Commit 12d40e0d authored by Santiago Ospina's avatar Santiago Ospina

fixed some bugs in the raviart thomas engeine (it needs a modification on...

fixed some bugs in the raviart thomas engeine (it needs a modification on PDELab, therefore, from now, it will always fail in the pipeline)
parent 5ce550bc
......@@ -167,6 +167,15 @@ public:
{
global_sl_view.bind(lfsu_cache);
xl.resize(lfsu_cache.size());
// local system to be solved on each element. Matrix has block form:
// A_{eleme,eleme} A_{eleme,face1} A_{eleme,face2} ... A_{eleme,facen}
// A_{face1,eleme} A_{face1,face1} A_{face1,face2} ... A_{face1,facen}
// : :
// A_{facen,eleme} A_{facen,face1} A_{facen,face2} ... A_{facen,facen}
r_vec = LocalResidualVector(lfsu_cache.size(),0.0);
m_matrix = LocalMassMatrix(lfsu_cache.size(),lfsu_cache.size(),0.0);
}
template<typename EG, typename LFSWC>
......@@ -178,40 +187,12 @@ public:
lfsv_volume.bind( eg.entity() );
rl.assign(lfsv_volume.size(),0.0);
// variables for the local problem
auto n = lfsv_volume.size() + lfsv_skeleton.size() * eg.entity().subEntities(1);
// local system to be solved on each element. Matrix has block form:
// A_{eleme,eleme} A_{eleme,face1} A_{eleme,face2} ... A_{eleme,facen}
// A_{face1,eleme} A_{face1,face1} A_{face1,face2} ... A_{face1,facen}
// : :
// A_{facen,eleme} A_{facen,face1} A_{facen,face2} ... A_{facen,facen}
r_vec.resize(n,0.0);
m_matrix.resize(n,n,0.0);
}
template<typename IG, typename LFSUC, typename LFSWC>
void onBindLFSUVInside(const IG & ig, const LFSUC & lfsu_cache, const LFSWC & lfsw_cache)
{
std::cout << "lfsu_cache.size(): " << lfsu_cache.size() << std::endl;
std::cout << "lfsw_cache.size(): " << lfsw_cache.size() << std::endl;
std::cout << "lfsv_volume.size(): " << lfsv_volume.size() << std::endl;
std::cout << "lfsv_skeleton.size(): " << lfsv_skeleton.size() << std::endl;
std::cout << "eg.entity().subEntities(1): " << ig.inside().subEntities(1) << std::endl;
// Check that local matrix will be conforming
assert(lfsu_cache.size() == lfsw_cache.size());
assert(lfsu_cache.size() == (lfsv_volume.size() + lfsv_skeleton.size() * ig.inside().subEntities(1)));
lfsv_skeleton.bind( ig.inside() );
global_sl_view.bind(lfsu_cache);
xl.assign(lfsu_cache.size(),0.0);
global_pl_view.bind(lfsw_cache);
pl.resize(lfsw_cache.size());
// This is never called
}
template<typename IG, typename LFSUC, typename LFSWC>
......@@ -219,8 +200,35 @@ public:
const LFSUC & lfsu_s_cache, const LFSWC & lfsw_s_cache,
const LFSUC & lfsu_n_cache, const LFSWC & lfsw_n_cache)
{
lfsv_skeleton_n.bind( ig.outside() );
lfsv_skeleton.bind( ig.intersection() );
lfsv_skeleton_n.bind( ig.intersection() );
// inside part
std::cout << "lfsu_s_cache.size(): " << lfsu_s_cache.size() << std::endl;
std::cout << "lfsu_s.debug():" << std::endl; lfsu_s_cache.localFunctionSpace().debug();
std::cout << "lfsw_s_cache.size(): " << lfsw_s_cache.size() << std::endl;
std::cout << "lfsw_s.debug():" << std::endl; lfsw_s_cache.localFunctionSpace().debug();
std::cout << "lfsv_volume.size(): " << lfsv_volume.size() << std::endl;
std::cout << "lfsv_volume.debug():" << std::endl; lfsv_volume.debug();
std::cout << "lfsv_skeleton.size(): " << lfsv_skeleton.size() << std::endl;
std::cout << "lfsv_skeleton.debug():" << std::endl; lfsv_skeleton.debug();
std::cout << "ig.entity().subEntities(1): " << ig.inside().subEntities(1) << std::endl;
// Check that local matrix will be conforming
assert(lfsu_s_cache.size() == lfsw_s_cache.size());
assert(lfsu_s_cache.size() == (lfsv_volume.size() + lfsv_skeleton.size() * ig.inside().subEntities(1)));
global_sl_view.bind(lfsu_s_cache);
xl.assign(lfsu_s_cache.size(),0.0);
global_pl_view.bind(lfsw_s_cache);
pl.resize(lfsw_s_cache.size());
// outside part
assert(lfsv_skeleton.size() == lfsv_skeleton_n.size());
global_sn_view.bind(lfsu_n_cache);
......@@ -233,8 +241,7 @@ public:
template<typename IG, typename LFSWC>
void onBindLFSVInside(const IG & ig, const LFSWC & lfsw_cache)
{
// global_rl_view.bind(lfsw_cache);
rl.assign(lfsw_cache.size(),0.0);
// This is never called
}
template<typename IG, typename LFSWC>
......@@ -242,6 +249,8 @@ public:
const LFSWC & lfsw_s_cache,
const LFSWC & lfsw_n_cache)
{
// global_rl_view.bind(lfsw_s_cache);
rl.assign(lfsw_s_cache.size(),0.0);
// global_rn_view.bind(lfsw_n_cache);
rn.assign(lfsw_n_cache.size(),0.0);
}
......@@ -255,9 +264,9 @@ public:
{
auto& lfsu = lfsu_cache.localFunctionSpace();
for (unsigned int i = 0; i < lfsu.size(); ++i)
xl(lfsu,i) = x_vec[i];
global_sl_view.add(xl);
// for (unsigned int i = 0; i < lfsu.size(); ++i)
// xl(lfsu,i) = x_vec[i];
// global_sl_view.add(xl);
}
//! @}
......@@ -371,7 +380,7 @@ public:
auto factor = it.weight() * gt.integrationElement(p_local);
for (unsigned int i = 0; i<lfsv_volume.size(); i++)
for (unsigned int j = 0; i<lfsu.size(); j++)
for (unsigned int j = 0; j<lfsu.size(); j++)
m_matrix[i][j] = (phiu[j]*phiv[i])/detB * factor/detB;
}
}
......@@ -396,7 +405,7 @@ public:
// Load residual view into the local residual vector
for (unsigned int i = 0; i < lfsv_skeleton.size(); ++i)
r_vec[i+offset] = rl(lfsv_skeleton,i) + rn(lfsv_skeleton_n,i);
r_vec[i+offset] += rl(lfsv_skeleton,i) + rn(lfsv_skeleton_n,i);
auto& lfsu_s = lfsu_s_cache.localFunctionSpace();
......@@ -441,8 +450,10 @@ public:
const auto factor = it.weight() * ig.geometry().integrationElement(it.position());
for (unsigned int i = 0; i<lfsv_skeleton.size(); i++)
for (unsigned int j = 0; i<lfsu_s.size(); j++)
m_matrix[i+offset][j] = (y*phiu_s[j])/detB * phiv_s[i+offset] * factor;
for (unsigned int j = 0; j<lfsu_s.size(); j++){
auto xx = y*phiu_s[j]/detB * phiv_s[i+offset] * factor;
m_matrix[i+offset][j] += xx;
}
}
}
......@@ -460,7 +471,7 @@ public:
unsigned int offset = lfsv_volume.size() + lfsv_skeleton.size()*ig.intersectionIndex();
// Load residual view into the local residual vector
for (unsigned int i = 0; i < lfsv_skeleton.size(); ++i)
r_vec[i+offset] = rl(lfsv_skeleton,i);
r_vec[i+offset] += rl(lfsv_skeleton,i);
auto& lfsu_s = lfsu_s_cache.localFunctionSpace();
......@@ -505,8 +516,8 @@ public:
const auto factor = it.weight() * ig.geometry().integrationElement(it.position());
for (unsigned int i = 0; i<lfsv_skeleton.size(); i++)
for (unsigned int j = 0; i<lfsu_s.size(); j++)
m_matrix[i+offset][j] = (y*phiu_s[j])/detB * phiv_s[i+offset] * factor;
for (unsigned int j = 0; j<lfsu_s.size(); j++)
m_matrix[i+offset][j] += (y*phiu_s[j])/detB * phiv_s[i+offset] * factor;
}
}
......@@ -620,4 +631,4 @@ private:
} // namespace Dorie
} // namespace Dune
#endif // DUNE_DORIE_RAVIART_THOMAS_RESIDUALENGINE_HH
#endif // DUNE_DORIE_RAVIART_THOMAS_RESIDUALENGINE_HH
\ No newline at end of file
......@@ -28,7 +28,7 @@ public:
VolumeRaviartThomasLocalCoefficients()
{
for (int i = 0; i < size(); ++i)
for (unsigned int i = 0; i < size(); ++i)
li[i] = LocalKey(0,0,i);
}
......
......@@ -9,8 +9,8 @@ except NameError:
pass
# paths set by cmake
DORIEDIR = "/Users/soilros/Codes/DORIE_INSTALL/Debug/dorie"
MPIEXEC = "/usr/local/bin/mpiexec"
DORIEDIR = "/home/saospina/Codes/DUNE_INSTALL/Debug/dorie"
MPIEXEC = "/usr/bin/mpiexec"
MPIEXEC_NUMPROC_FLAG = "-n"
MPIEXEC_PREFLAG = ""
MPIEXEC_POSTFLAGS = ""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment