Commit f1706f0e by Santiago Ospina

### 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``. 1 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 @@ namespace Dune{ 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 * was adapted from Marian's code ... ... @@ -20,7 +39,7 @@ namespace Dorie{ * @tparam gt Geometry type of the grid. * @tparam order Order of the RT reconstruction. */ template template class RaviartThomasFluxReconstruction : public Dune::PDELab::GridFunctionBase< Dune::PDELab::GridFunctionTraits< ... ...
 ... ... @@ -13,8 +13,8 @@ namespace Dorie{ template class RaviartThomasSimplexLocalFiniteElementMap : public Dune::PDELab::SimpleLocalFiniteElementMap< Dune::Dorie::RaviartThomasSimplexLocalFiniteElement, GV::dimension> Dune::Dorie::RaviartThomasSimplexLocalFiniteElement, GV::dimension> { static constexpr unsigned int dim = GV::dimension; static constexpr unsigned int size_face = Dune::PB::PkSize::value; ... ... @@ -34,7 +34,8 @@ class RaviartThomasSimplexLocalFiniteElementMap static_assert(dim == 2 || dim == 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; public: RaviartThomasSimplexLocalFiniteElementMap(const GV& gv) : Base(_fe) {} ... ... @@ -80,14 +81,16 @@ RaviartThomasSimplexLocalFiniteElementMap::_fe = Dune::Dorie::RaviartThomasSimplexLocalFiniteElement (Dune::GeometryTypes::simplex(GV::dimension),k); template template struct RaviartThomasLocalFiniteElementMapBaseSelector { using type = Dune::PDELab::RaviartThomasLocalFiniteElementMap; }; template struct RaviartThomasLocalFiniteElementMapBaseSelector struct RaviartThomasLocalFiniteElementMapBaseSelector< GV,3,DF,RF,0,GeometryType::simplex> { using type = RaviartThomasSimplexLocalFiniteElementMap; }; ... ... @@ -107,8 +110,7 @@ struct RaviartThomasLocalFiniteElementMapBaseSelector 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: RaviartThomasLocalFiniteElementMap(const GV& gv) : Base(gv) {} }; ... ...
 ... ... @@ -37,8 +37,7 @@ public: /** * @brief Local key for a given index. * * @param[in] i The index that identifies a shape function (see * Dune::Dorie::VolumeRaviartThomasLocalBasis). * @param[in] i The index that identifies a shape function. * * @return The local key associated to the index i. (see Dune:.LocalKey in * dune-localfunctions) ... ... @@ -54,22 +53,6 @@ private: 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 RaviartThomasSimplexLocalFiniteElement ... ...
 ... ... @@ -157,12 +157,12 @@ int main(int argc, char** argv) sim.run(); break; } // case 3:{ * // Sim> sim(richards_config, grid_mapper, helper); // sim.set_policy(adapt_policy); // sim.run(); // break; // } case 3:{ // No flux reconstruction available Sim> sim(richards_config, grid_mapper, helper); sim.set_policy(adapt_policy); sim.run(); break; } default: DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); } ... ... @@ -228,24 +228,24 @@ int main(int argc, char** argv) Dune::Dorie::GridCreator> grid_creator(inifile, helper); auto grid_mapper = grid_creator.get_mapper(); switch(FEorder){ // case 1:{ * // Sim> sim(richards_config, grid_mapper, helper); // sim.set_policy(adapt_policy); // sim.run(); // break; // } // case 2:{ * // Sim> sim(richards_config, grid_mapper, helper); // sim.set_policy(adapt_policy); // sim.run(); // break; // } // case 3:{ * // Sim> sim(richards_config, grid_mapper, helper); // sim.set_policy(adapt_policy); // sim.run(); // break; // } case 1:{ // No flux reconstruction available Sim> sim(richards_config, grid_mapper, helper); sim.set_policy(adapt_policy); sim.run(); break; } case 2:{ // No flux reconstruction available Sim> sim(richards_config, grid_mapper, helper); sim.set_policy(adapt_policy); sim.run(); break; } case 3:{ // No flux reconstruction available Sim> sim(richards_config, grid_mapper, helper); sim.set_policy(adapt_policy); sim.run(); break; } default: DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); } ... ... @@ -267,12 +267,12 @@ int main(int argc, char** argv) sim.run(); break; } // case 3:{ * // Sim> sim(richards_config, grid_mapper, helper); // sim.set_policy(adapt_policy); // sim.run(); // break; // } case 3:{ // No flux reconstruction available Sim> sim(richards_config, grid_mapper, helper); sim.set_policy(adapt_policy); sim.run(); break; } default: DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); } ... ... @@ -291,11 +291,11 @@ int main(int argc, char** argv) sim.run(); break; } // case 3:{ * // Sim> sim(richards_config, grid_mapper, helper); // sim.run(); // break; // } case 3:{ // No flux reconstruction available Sim> sim(richards_config, grid_mapper, helper); sim.run(); break; } default: DUNE_THROW(Dune::NotImplemented,"Finite Element Order (grid.FEorder) not supported!"); } ... ...
 ... ... @@ -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 \ No newline at end of file
 ... ... @@ -9,7 +9,7 @@ namespace Dune{ namespace Dorie{ template class RichardsSimulation,Geo::cube>,3>>; // template class RichardsSimulation,Geo::simplex>,3>>; * template class RichardsSimulation,Geo::simplex>,3>>; // * } // namespace Dorie } // namespace Dune \ No newline at end of file
 #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include ... ... @@ -8,7 +9,7 @@ namespace Dune{ namespace Dorie{ template class RichardsSimulation,Geo::cube>,1>>; // template class RichardsSimulation,Geo::simplex>,1>>; * template class RichardsSimulation,Geo::simplex>,1>>; // * } // namespace Dorie } // namespace Dune \ No newline at end of file
 ... ... @@ -9,7 +9,7 @@ namespace Dune{ namespace Dorie{ template class RichardsSimulation,Geo::cube>,2>>; // template class RichardsSimulation,Geo::simplex>,2>>; * template class RichardsSimulation,Geo::simplex>,2>>; // * } // namespace Dorie } // namespace Dune
 ... ... @@ -8,8 +8,8 @@ namespace Dune{ namespace Dorie{ // template class RichardsSimulation,Geo::cube>,3>>; * // template class RichardsSimulation,Geo::simplex>,3>>; * template class RichardsSimulation,Geo::cube>,3>>; //* template class RichardsSimulation,Geo::simplex>,3>>; // * } // namespace Dorie } // namespace Dune \ No newline at end of file
 ... ... @@ -8,7 +8,7 @@ namespace Dune{ namespace Dorie{ // template class RichardsSimulation,Geo::cube>,3>>; * template class RichardsSimulation,Geo::cube>,3>>; // * } // namespace Dorie } // namespace Dune \ No newline at end of file