Commit f1706f0e by Santiago Ospina De Los Ríos 🇨🇴

### Enable simulations with no flux reconstruction.

`Signed-off-by: Santiago Ospina <santiago.ospina@iup.uni-heidelberg.de>`
parent d84f7025
 ... @@ -215,6 +215,13 @@ adding an empty line, make text **bold** or ``monospaced``. ... @@ -215,6 +215,13 @@ adding an empty line, make text **bold** or ``monospaced``. 1 1 1, 2, 3 1, 2, 3 Apply the flux reconstruction method to the solved matric head to obtain conservative gradients for each element. true true, false ... ...
 ... @@ -12,6 +12,25 @@ ... @@ -12,6 +12,25 @@ namespace Dune{ namespace Dune{ namespace Dorie{ namespace Dorie{ template struct RaviartThomasFluxReconstructionHelper { private: using GV = typename GO::Traits::TrialGridFunctionSpace::Traits::GridViewType; static constexpr int dim = GV::dimension; static_assert(dim==2||dim==3); static_assert(gt==GeometryType::simplex||gt==GeometryType::cube); // hardcoded bool helpers static constexpr bool value_2d_simplex = (order <= 1); static constexpr bool value_3d_simplex = false; static constexpr bool value_2d_cube = (order <= 2); static constexpr bool value_3d_cube = (order <= 1); static constexpr bool value_simplex = (dim==2) ? value_2d_simplex : value_3d_simplex; static constexpr bool value_cube = (dim==2) ? value_2d_cube : value_3d_cube; public: static constexpr bool enable = (gt==GeometryType::simplex) ? value_simplex : value_cube; }; /*-------------------------------------------------------------------------*//** /*-------------------------------------------------------------------------*//** * @brief Provide RT flux vector field from DG discretization. This code * @brief Provide RT flux vector field from DG discretization. This code * was adapted from Marian's code * was adapted from Marian's code ... @@ -20,7 +39,7 @@ namespace Dorie{ ... @@ -20,7 +39,7 @@ namespace Dorie{ * @tparam gt Geometry type of the grid. * @tparam gt Geometry type of the grid. * @tparam order Order of the RT reconstruction. * @tparam order Order of the RT reconstruction. */ */ template template class RaviartThomasFluxReconstruction class RaviartThomasFluxReconstruction : public Dune::PDELab::GridFunctionBase< : public Dune::PDELab::GridFunctionBase< Dune::PDELab::GridFunctionTraits< Dune::PDELab::GridFunctionTraits< ... ...
 ... @@ -13,8 +13,8 @@ namespace Dorie{ ... @@ -13,8 +13,8 @@ namespace Dorie{ template template class RaviartThomasSimplexLocalFiniteElementMap class RaviartThomasSimplexLocalFiniteElementMap : public Dune::PDELab::SimpleLocalFiniteElementMap< : public Dune::PDELab::SimpleLocalFiniteElementMap< Dune::Dorie::RaviartThomasSimplexLocalFiniteElement, Dune::Dorie::RaviartThomasSimplexLocalFiniteElement, GV::dimension> GV::dimension> { { static constexpr unsigned int dim = GV::dimension; static constexpr unsigned int dim = GV::dimension; static constexpr unsigned int size_face = Dune::PB::PkSize::value; static constexpr unsigned int size_face = Dune::PB::PkSize::value; ... @@ -34,7 +34,8 @@ class RaviartThomasSimplexLocalFiniteElementMap ... @@ -34,7 +34,8 @@ class RaviartThomasSimplexLocalFiniteElementMap static_assert(dim == 2 || dim == 3, static_assert(dim == 2 || dim == 3, "Raviart Thomas for simplices are only implemented for dimension 2 and 3!"); "Raviart Thomas for simplices are only implemented for dimension 2 and 3!"); using FE = Dune::Dorie::RaviartThomasSimplexLocalFiniteElement; using FE = Dune::Dorie:: RaviartThomasSimplexLocalFiniteElement; using Base = Dune::PDELab::SimpleLocalFiniteElementMap; using Base = Dune::PDELab::SimpleLocalFiniteElementMap; public: public: RaviartThomasSimplexLocalFiniteElementMap(const GV& gv) : Base(_fe) {} RaviartThomasSimplexLocalFiniteElementMap(const GV& gv) : Base(_fe) {} ... @@ -80,14 +81,16 @@ RaviartThomasSimplexLocalFiniteElementMap::_fe ... @@ -80,14 +81,16 @@ RaviartThomasSimplexLocalFiniteElementMap::_fe = Dune::Dorie::RaviartThomasSimplexLocalFiniteElement = Dune::Dorie::RaviartThomasSimplexLocalFiniteElement (Dune::GeometryTypes::simplex(GV::dimension),k); (Dune::GeometryTypes::simplex(GV::dimension),k); template template struct RaviartThomasLocalFiniteElementMapBaseSelector struct RaviartThomasLocalFiniteElementMapBaseSelector { { using type = Dune::PDELab::RaviartThomasLocalFiniteElementMap; using type = Dune::PDELab::RaviartThomasLocalFiniteElementMap; }; }; template template struct RaviartThomasLocalFiniteElementMapBaseSelector struct RaviartThomasLocalFiniteElementMapBaseSelector< GV,3,DF,RF,0,GeometryType::simplex> { { using type = RaviartThomasSimplexLocalFiniteElementMap; using type = RaviartThomasSimplexLocalFiniteElementMap; }; }; ... @@ -107,8 +110,7 @@ struct RaviartThomasLocalFiniteElementMapBaseSelector template class RaviartThomasLocalFiniteElementMap class RaviartThomasLocalFiniteElementMap : public Dune::Dorie::RaviartThomasLocalFiniteElementMapBaseSelector::type : public Dune::Dorie::RaviartThomasLocalFiniteElementMapBaseSelector< GV,GV::dimension,DF,RF,k,Dune::GeometryType::simplex>::type { { using Base = typename Dune::Dorie::RaviartThomasLocalFiniteElementMapBaseSelector::type; using Base = typename Dune::Dorie:: RaviartThomasLocalFiniteElementMapBaseSelector< GV,GV::dimension,DF,RF,k,Dune::GeometryType::simplex >::type; public: public: RaviartThomasLocalFiniteElementMap(const GV& gv) : Base(gv) {} RaviartThomasLocalFiniteElementMap(const GV& gv) : Base(gv) {} }; }; ... ...
 ... @@ -37,8 +37,7 @@ public: ... @@ -37,8 +37,7 @@ public: /** /** * @brief Local key for a given index. * @brief Local key for a given index. * * * @param[in] i The index that identifies a shape function (see * @param[in] i The index that identifies a shape function. * Dune::Dorie::VolumeRaviartThomasLocalBasis). * * * @return The local key associated to the index i. (see Dune:.LocalKey in * @return The local key associated to the index i. (see Dune:.LocalKey in * dune-localfunctions) * dune-localfunctions) ... @@ -54,22 +53,6 @@ private: ... @@ -54,22 +53,6 @@ private: std::vector li; std::vector li; }; }; /** * \brief Raviart-Thomas local finite elements of arbitrary order * for simplices of arbitrary dimension. * * These generic local finite elements are only available for * simplex geometry types. The extension to cube and prism * elements could be added. * * \ingroup RaviartThomas * * \tparam dimDomain dimension of reference elements * \tparam D domain for basis functions * \tparam R range for basis functions * \tparam SF storage field for basis matrix * \tparam CF compute field for basis matrix */ template class SF=R, class CF=SF> class RaviartThomasSimplexLocalFiniteElement class RaviartThomasSimplexLocalFiniteElement ... ...
 ... @@ -157,12 +157,12 @@ int main(int argc, char** argv) ... @@ -157,12 +157,12 @@ int main(int argc, char** argv) sim.run(); sim.run(); break; break; } } // case 3:{ * case 3:{ // No flux reconstruction available // Sim> sim(richards_config, grid_mapper, helper); Sim> sim(richards_config, grid_mapper, helper); // sim.set_policy(adapt_policy); sim.set_policy(adapt_policy); // sim.run(); sim.run(); // break; break; // } } default: default: DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); } } ... @@ -228,24 +228,24 @@ int main(int argc, char** argv) ... @@ -228,24 +228,24 @@ int main(int argc, char** argv) Dune::Dorie::GridCreator> grid_creator(inifile, helper); Dune::Dorie::GridCreator> grid_creator(inifile, helper); auto grid_mapper = grid_creator.get_mapper(); auto grid_mapper = grid_creator.get_mapper(); switch(FEorder){ switch(FEorder){ // case 1:{ * case 1:{ // No flux reconstruction available // Sim> sim(richards_config, grid_mapper, helper); Sim> sim(richards_config, grid_mapper, helper); // sim.set_policy(adapt_policy); sim.set_policy(adapt_policy); // sim.run(); sim.run(); // break; break; // } } // case 2:{ * case 2:{ // No flux reconstruction available // Sim> sim(richards_config, grid_mapper, helper); Sim> sim(richards_config, grid_mapper, helper); // sim.set_policy(adapt_policy); sim.set_policy(adapt_policy); // sim.run(); sim.run(); // break; break; // } } // case 3:{ * case 3:{ // No flux reconstruction available // Sim> sim(richards_config, grid_mapper, helper); Sim> sim(richards_config, grid_mapper, helper); // sim.set_policy(adapt_policy); sim.set_policy(adapt_policy); // sim.run(); sim.run(); // break; break; // } } default: default: DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); } } ... @@ -267,12 +267,12 @@ int main(int argc, char** argv) ... @@ -267,12 +267,12 @@ int main(int argc, char** argv) sim.run(); sim.run(); break; break; } } // case 3:{ * case 3:{ // No flux reconstruction available // Sim> sim(richards_config, grid_mapper, helper); Sim> sim(richards_config, grid_mapper, helper); // sim.set_policy(adapt_policy); sim.set_policy(adapt_policy); // sim.run(); sim.run(); // break; break; // } } default: default: DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); } } ... @@ -291,11 +291,11 @@ int main(int argc, char** argv) ... @@ -291,11 +291,11 @@ int main(int argc, char** argv) sim.run(); sim.run(); break; break; } } // case 3:{ * case 3:{ // No flux reconstruction available // Sim> sim(richards_config, grid_mapper, helper); Sim> sim(richards_config, grid_mapper, helper); // sim.run(); sim.run(); // break; break; // } } default: default: DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); } } ... ...
 ... @@ -12,4 +12,6 @@ using Geo = Dune::GeometryType::BasicType; ... @@ -12,4 +12,6 @@ using Geo = Dune::GeometryType::BasicType; } } } } // A star "*" in the impl file is refers that it does not have flux reconstruction available. #endif // DUNE_DORIE_RICHARDS_IMPL_HH #endif // DUNE_DORIE_RICHARDS_IMPL_HH \ No newline at end of file
 ... @@ -9,7 +9,7 @@ namespace Dune{ ... @@ -9,7 +9,7 @@ namespace Dune{ namespace Dorie{ namespace Dorie{ template class RichardsSimulation,Geo::cube>,3>>; template class RichardsSimulation,Geo::cube>,3>>; // template class RichardsSimulation,Geo::simplex>,3>>; * template class RichardsSimulation,Geo::simplex>,3>>; // * } // namespace Dorie } // namespace Dorie } // namespace Dune } // namespace Dune \ No newline at end of file
 #ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H #include "config.h" #include "config.h" #endif #endif #include #include #include #include ... @@ -8,7 +9,7 @@ namespace Dune{ ... @@ -8,7 +9,7 @@ namespace Dune{ namespace Dorie{ namespace Dorie{ template class RichardsSimulation,Geo::cube>,1>>; template class RichardsSimulation,Geo::cube>,1>>; // template class RichardsSimulation,Geo::simplex>,1>>; * template class RichardsSimulation,Geo::simplex>,1>>; // * } // namespace Dorie } // namespace Dorie } // namespace Dune } // namespace Dune \ No newline at end of file
 ... @@ -9,7 +9,7 @@ namespace Dune{ ... @@ -9,7 +9,7 @@ namespace Dune{ namespace Dorie{ namespace Dorie{ template class RichardsSimulation,Geo::cube>,2>>; template class RichardsSimulation,Geo::cube>,2>>; // template class RichardsSimulation,Geo::simplex>,2>>; * template class RichardsSimulation,Geo::simplex>,2>>; // * } // namespace Dorie } // namespace Dorie } // namespace Dune } // namespace Dune
 ... @@ -8,8 +8,8 @@ ... @@ -8,8 +8,8 @@ namespace Dune{ namespace Dune{ namespace Dorie{ namespace Dorie{ // template class RichardsSimulation,Geo::cube>,3>>; * template class RichardsSimulation,Geo::cube>,3>>; //* // template class RichardsSimulation,Geo::simplex>,3>>; * template class RichardsSimulation,Geo::simplex>,3>>; // * } // namespace Dorie } // namespace Dorie } // namespace Dune } // namespace Dune \ No newline at end of file
 ... @@ -8,7 +8,7 @@ ... @@ -8,7 +8,7 @@ namespace Dune{ namespace Dune{ namespace Dorie{ namespace Dorie{ // template class RichardsSimulation,Geo::cube>,3>>; * template class RichardsSimulation,Geo::cube>,3>>; // * } // namespace Dorie } // namespace Dorie } // namespace Dune } // namespace Dune \ No newline at end of file