Commit 5ce550bc authored by Santiago Ospina's avatar Santiago Ospina

fixbug about bindings in volume terms

parent 10312ce4
......@@ -136,19 +136,19 @@ int main(int argc, char** argv)
if (gtype == "gmsh"){
auto grid = Dune::Dorie::build_grid_gmsh<Dune::UGGrid<2>>(inifile,helper);
switch(FEorder){
case 1:{
Sim<Simplex<2,1>> sim(helper,grid,inifile);
sim.set_policy(adapt_policy);
sim.run();
break;
}
case 2:{
Sim<Simplex<2,2>> sim(helper,grid,inifile);
sim.set_policy(adapt_policy);
sim.run();
break;
}
// case 3:{
// case 1:{
// Sim<Simplex<2,1>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
// break;
// }
// case 2:{
// Sim<Simplex<2,2>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
// break;
// }
// case 3:{ *
// Sim<Simplex<2,3>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
......@@ -162,24 +162,24 @@ int main(int argc, char** argv)
if(adaptivity){
auto grid = Dune::Dorie::build_grid_cube<Dune::UGGrid<2>>(inifile,helper);
switch(FEorder){
case 1:{
Sim<CubeAdaptive<2,1>> sim(helper,grid,inifile);
sim.set_policy(adapt_policy);
sim.run();
break;
}
case 2:{
Sim<CubeAdaptive<2,2>> sim(helper,grid,inifile);
sim.set_policy(adapt_policy);
sim.run();
break;
}
case 3:{
Sim<CubeAdaptive<2,3>> sim(helper,grid,inifile);
sim.set_policy(adapt_policy);
sim.run();
break;
}
// case 1:{
// Sim<CubeAdaptive<2,1>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
// break;
// }
// case 2:{
// Sim<CubeAdaptive<2,2>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
// break;
// }
// case 3:{
// Sim<CubeAdaptive<2,3>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
// break;
// }
default:
DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!");
}
......@@ -192,16 +192,16 @@ int main(int argc, char** argv)
sim.run();
break;
}
case 2:{
Sim<Cube<2,2>> sim(helper,grid,inifile);
sim.run();
break;
}
case 3:{
Sim<Cube<2,3>> sim(helper,grid,inifile);
sim.run();
break;
}
// case 2:{
// Sim<Cube<2,2>> sim(helper,grid,inifile);
// sim.run();
// break;
// }
// case 3:{
// Sim<Cube<2,3>> sim(helper,grid,inifile);
// sim.run();
// break;
// }
default:
DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!");
}
......@@ -216,19 +216,19 @@ int main(int argc, char** argv)
if (gtype == "gmsh"){
auto grid = Dune::Dorie::build_grid_gmsh<Dune::UGGrid<3>>(inifile,helper);
switch(FEorder){
// case 1:{
// case 1:{ *
// Sim<Simplex<3,1>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
// break;
// }
// case 2:{
// case 2:{ *
// Sim<Simplex<3,2>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
// break;
// }
// case 3:{
// case 3:{ *
// Sim<Simplex<3,3>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
......@@ -242,19 +242,19 @@ int main(int argc, char** argv)
if(adaptivity){
auto grid = Dune::Dorie::build_grid_cube<Dune::UGGrid<3>>(inifile,helper);
switch(FEorder){
case 1:{
Sim<CubeAdaptive<3,1>> sim(helper,grid,inifile);
sim.set_policy(adapt_policy);
sim.run();
break;
}
case 2:{
Sim<CubeAdaptive<3,2>> sim(helper,grid,inifile);
sim.set_policy(adapt_policy);
sim.run();
break;
}
// case 3:{
// case 1:{
// Sim<CubeAdaptive<3,1>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
// break;
// }
// case 2:{
// Sim<CubeAdaptive<3,2>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
// break;
// }
// case 3:{ *
// Sim<CubeAdaptive<3,3>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
// sim.run();
......@@ -267,17 +267,17 @@ int main(int argc, char** argv)
else{ // no adaptivity
auto grid = Dune::Dorie::build_grid_cube<Dune::YaspGrid<3>>(inifile,helper);
switch(FEorder){
case 1:{
Sim<Cube<3,1>> sim(helper,grid,inifile);
sim.run();
break;
}
case 2:{
Sim<Cube<3,2>> sim(helper,grid,inifile);
sim.run();
break;
}
// case 3:{
// case 1:{
// Sim<Cube<3,1>> sim(helper,grid,inifile);
// sim.run();
// break;
// }
// case 2:{
// Sim<Cube<3,2>> sim(helper,grid,inifile);
// sim.run();
// break;
// }
// case 3:{ *
// Sim<Cube<3,3>> sim(helper,grid,inifile);
// sim.run();
// break;
......
......@@ -8,8 +8,8 @@
namespace Dune{
namespace Dorie{
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,1>>;
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,1>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,1>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,1>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -8,8 +8,8 @@
namespace Dune{
namespace Dorie{
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,2>>;
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,2>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,2>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,2>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -8,8 +8,8 @@
namespace Dune{
namespace Dorie{
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,3>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,3>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,3>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,3>>; *
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -8,8 +8,8 @@
namespace Dune{
namespace Dorie{
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,1>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,1>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,1>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,1>>; *
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -8,8 +8,8 @@
namespace Dune{
namespace Dorie{
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,2>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,2>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,2>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,2>>; *
} // namespace Dorie
} // namespace Dune
......@@ -8,8 +8,8 @@
namespace Dune{
namespace Dorie{
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,3>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,3>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,3>>; *
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,3>>; *
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -8,7 +8,7 @@
namespace Dune{
namespace Dorie{
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,2>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,2>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -8,7 +8,7 @@
namespace Dune{
namespace Dorie{
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,3>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,3>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -8,7 +8,7 @@
namespace Dune{
namespace Dorie{
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,1>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,1>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -8,7 +8,7 @@
namespace Dune{
namespace Dorie{
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,2>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,2>>;
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -8,7 +8,7 @@
namespace Dune{
namespace Dorie{
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,3>>;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,3>>; *
} // namespace Dorie
} // namespace Dune
\ No newline at end of file
......@@ -165,11 +165,6 @@ public:
template<typename EG, typename LFSUC, typename LFSWC>
void onBindLFSUV(const EG & eg, const LFSUC & lfsu_cache, const LFSWC & lfsw_cache)
{
// Check that local matrix will be conforming
assert(lfsu_cache.size() == lfsw_cache.size());
assert(lfsu_cache.size() == (lfsv_volume.size() + lfsv_skeleton.size() * eg.entity().subEntities(1)));
assert(lfsv_skeleton.size() == lfsv_skeleton_n.size());
global_sl_view.bind(lfsu_cache);
xl.resize(lfsu_cache.size());
}
......@@ -200,7 +195,18 @@ public:
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);
......@@ -214,6 +220,9 @@ public:
const LFSUC & lfsu_n_cache, const LFSWC & lfsw_n_cache)
{
lfsv_skeleton_n.bind( ig.outside() );
assert(lfsv_skeleton.size() == lfsv_skeleton_n.size());
global_sn_view.bind(lfsu_n_cache);
xn.assign(lfsu_n_cache.size(),0.0);
......
......@@ -54,7 +54,7 @@ public:
VolumeRaviartThomasLocalCoefficients()
{
for (int i = 0; i < size(); ++i)
for (unsigned int i = 0; i < size(); ++i)
li[i] = LocalKey(0,0,i);
}
......
......@@ -53,7 +53,7 @@ class RaviartThomasFluxReconstruction
using LOP = typename GO::Traits::LocalAssembler::LocalOperator;
using MBE = typename GO::Traits::MatrixBackend;
using GOP = Dune::PDELab::GridOperator<GFSU,GFSW,LOP,MBE,DF,RF,JF>;
using Range = typename GOP::Traits::Domain;
using Range = Dune::PDELab::Backend::Vector<GFSU, RF>;
using LA = typename GOP::Traits::LocalAssembler;
using VolumeFEM = Dune::Dorie::VolumeRaviartThomasLocalFiniteElementMap<DF,RF,order,dim,gt>;
......@@ -75,10 +75,11 @@ public:
RaviartThomasFluxReconstruction(GO& go, int intorderadd_=2)
: _go(go)
, gv(go.trialGridFunctionSpace().gridView())
, _gfsu(_go.trialGridFunctionSpace().entitySet(),gv)
, _gv(go.trialGridFunctionSpace().gridView())
, _femu(_gv)
, _gfsu(_go.trialGridFunctionSpace().entitySet(),_femu)
, _x(_gfsu,0.0)
, dgfp(_gfsu,_x)
, _dgfp(_gfsu,_x)
{}
void update (const Domain& p)
......@@ -114,7 +115,7 @@ public:
const typename Traits::DomainType& x,
typename Traits::RangeType& y) const
{
dgfp.evaluate(e,x,y);
_dgfp.evaluate(e,x,y);
}
template<class Time>
......@@ -124,15 +125,16 @@ public:
//! get a reference to the GridView
inline const typename Traits::GridViewType& getGridView () const
{
return gv;
return _gv;
}
private:
GO& _go;
GV gv;
GV _gv;
FEMU _femu;
GFSU _gfsu;
Range _x;
Dune::PDELab::DiscreteGridFunctionPiola<GFSU,Range> dgfp;
Dune::PDELab::DiscreteGridFunctionPiola<GFSU,Range> _dgfp;
};
} // namespace Dorie
......
......@@ -29,7 +29,7 @@ public:
static constexpr std::size_t size(GeometryType gt)
{
return (gt.dim() == dim-1) ? Dune::PB::PkSize<k,dim-1>::value : 0;
return Dune::PB::PkSize<k,dim-1>::value;
}
static constexpr std::size_t maxLocalSize()
......@@ -57,7 +57,7 @@ public:
static constexpr std::size_t size(GeometryType gt)
{
return (gt.dim() == dim-1) ? Dune::StaticPower<k+1,dim-1>::power : 0;
return Dune::StaticPower<k+1,dim-1>::power;
}
static constexpr std::size_t maxLocalSize()
......
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