LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
Contains functionality for the implementation of DPG methods. More...
Namespaces | |
namespace | test |
Classes | |
class | ConvectionElementMatrixProvider |
Class for local quadrature based computations sub element matrices corresponding to convection-like element matrices. More... | |
class | DiffusionElementMatrixProvider |
Class for local quadrature based computations of sub element matrices corresponding to diffusion element matrices. More... | |
class | DiscontinuousScalarReferenceFiniteElement |
Decorator class around a ScalarReferenceFiniteElement to represent discontinuous shape functions. More... | |
class | DpgElementMatrixProvider |
Class to evaluate element matrices for DPG methods. More... | |
class | DpgElementVectorProvider |
Class to evaluate element vectors of DPG methods. More... | |
class | FeDiscontinuousO0Quad |
Discontinuous constant finite element on a quadrilateral reference element. More... | |
class | FeDiscontinuousO0Segment |
Discontinuous constant finite element on a line segment. More... | |
class | FeDiscontinuousO0Tria |
Discontinuous constant finite element on a triangular reference element. More... | |
class | FluxElementMatrixProvider |
class for local quadrature based computations of sub element matrices corresponding to element matrices associated to a flux variable in the trial space More... | |
class | LoadElementVectorProvider |
Class for local quadrature based computations of sub vectors corresponding to load vectors. More... | |
class | PrescribedSignProvider |
Class which allows evaluation of the \( \text{sgn}_K \) function. More... | |
class | ProductElementMatrixProvider |
Class providing element matrices associated with bilinear forms between cartesian/product spaces. More... | |
class | ProductElementMatrixProviderBuilder |
Builder class to build a ProductElementMatrixProvider. More... | |
class | ProductElementVectorProvider |
Class providing element vectors associated with linear forms on cartesian/product spaces. More... | |
class | ProductElementVectorProviderBuilder |
Builder class to build a ProductElementVectorProvider. More... | |
class | ProductUniformFEDofHandler |
Dofhandler for uniform finite element spaces that discretizes a cartesian/product space. More... | |
class | ProductUniformFESpace |
cartesian/prodcut space of finite element functions on a hybrid 2D mesh. More... | |
class | ProductUniformFESpaceFactory |
Factory class to build a ProductUniformFESpace. More... | |
class | ReactionElementMatrixProvider |
Class for local quadrature based computations of sub element matrices corresponding to reaction element matrices. More... | |
class | SubElementMatrixProvider |
Interface class providing sub element matrices associated with bilinear forms between components of Cartesian product spaces. More... | |
class | SubElementVectorProvider |
Interface class providing element vectors associated with linear forms of a component of a cartesian/product space. More... | |
class | TraceElementMatrixProvider |
Class for local quadrature based computations of sub element matrices corresponding to element matrices associated to a trace variable in the trial space. More... | |
class | TraceScalarReferenceFiniteElement |
Decorator class around a ScalarReferenceFiniteElement to represent traces on the cell boundary. More... | |
Typedefs | |
using | gdof_idx_t = lf::uscalfe::gdof_idx_t |
Type for indices into global matrices/vectors. More... | |
using | ldof_idx_t = lf::uscalfe::ldof_idx_t |
Type for indices referring to entity matrices/vectors. More... | |
using | size_type = lf::uscalfe::size_type |
Type for vector length/matrix sizes. More... | |
using | dim_t = lf::uscalfe::dim_t |
Tpe for (co)-dimensions. More... | |
using | glb_idx_t = lf::uscalfe::glb_idx_t |
Type for global index of entities. More... | |
using | sub_idx_t = lf::uscalfe::sub_idx_t |
Type for indexing of sub-entities. More... | |
using | quad_rule_collection_t = lf::uscalfe::quad_rule_collection_t |
data structure for passing collections of quadrature rules, see lf::uscalfe for more information. More... | |
using | dof_map_t = lf::assemble::UniformFEDofHandler::dof_map_t |
see lf::assemble More... | |
Functions | |
template<class PTR > | |
DpgElementMatrixProvider (PTR stiffness_provider, PTR gramianProvider) -> DpgElementMatrixProvider< typename PTR::element_type::SCALAR > | |
template<class PTR1 , class PTR2 > | |
DpgElementVectorProvider (PTR1 eLoadVectorProvider, PTR2 eStiffnessProvider, PTR2 gramianProvider) -> DpgElementVectorProvider< typename PTR1::element_type::SCALAR > | |
std::vector< lf::quad::QuadRule > | BoundaryQuadRule (lf::base::RefEl ref_el, const lf::quad::QuadRule &qr) |
Constructs a quadrature rule on the boundary of a reference element. More... | |
Eigen::MatrixXd | OuterNormals (const lf::geometry::Geometry &geometry) |
Compute the outer normals of a geometry object. More... | |
template<typename CONVECTION_COEFF > | |
lf::mesh::utils::CodimMeshDataSet< bool > | flagEntitiesOnInflowBoundary (const std::shared_ptr< const lf::mesh::Mesh > &mesh_p, CONVECTION_COEFF beta) |
flag all edges located on the inflow boundary More... | |
template<typename CONVECTION_COEFF > | |
lf::mesh::utils::CodimMeshDataSet< bool > | flagEntitiesOnOutflowBoundary (const std::shared_ptr< const lf::mesh::Mesh > &mesh_p, CONVECTION_COEFF beta) |
flag all edges located on the outflow boundary More... | |
template<typename SCALAR , typename EDGESELECTOR_DIRICHLET , typename EDGESELECTOR_NEUMANN , typename FUNCTION_G , typename FUNCTION_H > | |
std::vector< std::pair< bool, SCALAR > > | InitEssentialConditionsFromFunctions (const ProductUniformFESpace< SCALAR > &fes, size_type trace_component, size_type flux_component, EDGESELECTOR_DIRICHLET &&dirichletcondflag, EDGESELECTOR_NEUMANN &&neumanncondflag, FUNCTION_G &&g, FUNCTION_H &&h) |
Initialization of flags/values for dofs of fluxes and traces of a on a product finite element space whose values are imposed by two specified functions on two specified parts of the boundary. More... | |
template<typename SCALAR > | |
lf::mesh::utils::CodimMeshDataSet< SCALAR > | ElementErrorEstimators (const ProductUniformFEDofHandler &trial_dofh, std::shared_ptr< ProductElementMatrixProvider< SCALAR > > stiffness_provider, std::shared_ptr< ProductElementMatrixProvider< SCALAR > > gramian_provider, std::shared_ptr< ProductElementVectorProvider< SCALAR > > load_provider, const Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > &sol_vec) |
Evaluation of the local DPG error estimators on a mesh. More... | |
template<typename SCALAR > | |
SCALAR | EvalPosteriorError (const std::shared_ptr< const lf::mesh::Mesh > &mesh_p, const lf::mesh::utils::CodimMeshDataSet< SCALAR > &local_errors) |
Evaluation of the DPG error estimator. More... | |
template<class PTR , class DIFF_COEFF > | |
DiffusionElementMatrixProvider (PTR fe_space_trial, PTR fe_space_test, size_type trial_component, size_type test_component, DIFF_COEFF alpha) -> DiffusionElementMatrixProvider< typename PTR::element_type::SCALAR, DIFF_COEFF > | |
template<class PTR , class REACTION_COEFF > | |
ReactionElementMatrixProvider (PTR fe_trial, PTR fe_test, size_type trial_component, size_type test_component, REACTION_COEFF gamma) -> ReactionElementMatrixProvider< typename PTR::element_type::SCALAR, REACTION_COEFF > | |
template<class PTR , typename CONVECTION_COEFF_1 , typename CONVECTION_COEFF_2 > | |
ConvectionElementMatrixProvider (PTR fe_trial, PTR fe_test, size_type trial_component, size_type test_component, CONVECTION_COEFF_1 beta_1, CONVECTION_COEFF_2 beta_2) -> ConvectionElementMatrixProvider< typename PTR::element_type::SCALAR, CONVECTION_COEFF_1, CONVECTION_COEFF_2 > | |
template<class PTR , class DIFF_COEFF > | |
FluxElementMatrixProvider (PTR fe_space_trial, PTR fe_space_test, size_type trial_component, size_type test_component, DIFF_COEFF alpha) -> FluxElementMatrixProvider< typename PTR::element_type::SCALAR, DIFF_COEFF > | |
template<class PTR , class COEFF > | |
TraceElementMatrixProvider (PTR fe_space_trial, PTR fe_space_test, size_type trial_component, size_type test_component, COEFF alpha) -> TraceElementMatrixProvider< typename PTR::element_type::SCALAR, COEFF > | |
template<class PTR , class FUNCTOR > | |
LoadElementVectorProvider (PTR fe_space_test, size_type test_component, FUNCTOR f) -> LoadElementVectorProvider< typename PTR::element_type::SCALAR, FUNCTOR > | |
template<typename ptr , typename vector > | |
ProductElementMatrixProvider (ptr fe_space_tiral, ptr fe_space_test, vector subproviders) -> ProductElementMatrixProvider< typename ptr::element_type::SCALAR > | |
template<typename PTR , typename vector > | |
ProductElementVectorProvider (PTR fe_space_test, vector subproviders) -> ProductElementVectorProvider< typename PTR::element_type::SCALAR > | |
Contains functionality for the implementation of DPG methods.
using projects::dpg::dim_t = typedef lf::uscalfe::dim_t |
using projects::dpg::dof_map_t = typedef lf::assemble::UniformFEDofHandler::dof_map_t |
see lf::assemble
Definition at line 22 of file product_dofhandler.h.
using projects::dpg::gdof_idx_t = typedef lf::uscalfe::gdof_idx_t |
using projects::dpg::glb_idx_t = typedef lf::uscalfe::glb_idx_t |
using projects::dpg::ldof_idx_t = typedef lf::uscalfe::ldof_idx_t |
data structure for passing collections of quadrature rules, see lf::uscalfe for more information.
Definition at line 31 of file loc_comp_dpg.h.
using projects::dpg::sub_idx_t = typedef lf::uscalfe::sub_idx_t |
std::vector< lf::quad::QuadRule > projects::dpg::BoundaryQuadRule | ( | lf::base::RefEl | ref_el, |
const lf::quad::QuadRule & | qr | ||
) |
Constructs a quadrature rule on the boundary of a reference element.
ref_el | The reference element on whose boundary a quadrule should be constructed (triangle or quadrilateral). |
qr | a quadrule on the reference line segment. |
This function constructs a quadrature rule on the boundary of a reference element based on another quadrature rule on the reference line segment which is transformed to all edges of the reference element.
Definition at line 13 of file dpg_tools.cc.
References lf::base::RefEl::kQuad(), lf::base::RefEl::kTria(), lf::base::RefEl::NumSubEntities(), lf::quad::QuadRule::Points(), and lf::quad::QuadRule::Weights().
Referenced by projects::dpg::FluxElementMatrixProvider< SCALAR, DIFF_COEFF >::FluxElementMatrixProvider(), and projects::dpg::TraceElementMatrixProvider< SCALAR, COEFF >::TraceElementMatrixProvider().
projects::dpg::ConvectionElementMatrixProvider | ( | PTR | fe_trial, |
PTR | fe_test, | ||
size_type | trial_component, | ||
size_type | test_component, | ||
CONVECTION_COEFF_1 | beta_1, | ||
CONVECTION_COEFF_2 | beta_2 | ||
) | -> ConvectionElementMatrixProvider< typename PTR::element_type::SCALAR, CONVECTION_COEFF_1, CONVECTION_COEFF_2 > |
projects::dpg::DiffusionElementMatrixProvider | ( | PTR | fe_space_trial, |
PTR | fe_space_test, | ||
size_type | trial_component, | ||
size_type | test_component, | ||
DIFF_COEFF | alpha | ||
) | -> DiffusionElementMatrixProvider< typename PTR::element_type::SCALAR, DIFF_COEFF > |
projects::dpg::DpgElementMatrixProvider | ( | PTR | stiffness_provider, |
PTR | gramianProvider | ||
) | -> DpgElementMatrixProvider< typename PTR::element_type::SCALAR > |
projects::dpg::DpgElementVectorProvider | ( | PTR1 | eLoadVectorProvider, |
PTR2 | eStiffnessProvider, | ||
PTR2 | gramianProvider | ||
) | -> DpgElementVectorProvider< typename PTR1::element_type::SCALAR > |
lf::mesh::utils::CodimMeshDataSet< SCALAR > projects::dpg::ElementErrorEstimators | ( | const ProductUniformFEDofHandler & | trial_dofh, |
std::shared_ptr< ProductElementMatrixProvider< SCALAR > > | stiffness_provider, | ||
std::shared_ptr< ProductElementMatrixProvider< SCALAR > > | gramian_provider, | ||
std::shared_ptr< ProductElementVectorProvider< SCALAR > > | load_provider, | ||
const Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > & | sol_vec | ||
) |
Evaluation of the local DPG error estimators on a mesh.
trial_dofh | local-to-global index mapping for the trial space of the DPG method |
stiffness_provider | evaluates the extended element stiffness matrix \( B \) |
gramian_provider | evaluates the local Gramian matrix \( G \) |
load_provider | evaluates the extended element load vector \( l \) |
sol_vec | finite element vector of a function in the trial space |
SCALAR | a scalar type like 'double' |
Definition at line 327 of file dpg_tools.h.
References ElementErrorEstimators(), projects::dpg::ProductUniformFEDofHandler::GlobalDofIndices(), projects::dpg::ProductUniformFEDofHandler::Mesh(), and projects::dpg::ProductUniformFEDofHandler::NumLocalDofs().
Referenced by ElementErrorEstimators(), projects::dpg::test::TestConververgencePrimalDPGAdaptedNormConvectionDiffusionDirichletBVP(), and projects::dpg::test::TestConververgencePrimalDPGConvectionDiffusionDirichletBVP().
SCALAR projects::dpg::EvalPosteriorError | ( | const std::shared_ptr< const lf::mesh::Mesh > & | mesh_p, |
const lf::mesh::utils::CodimMeshDataSet< SCALAR > & | local_errors | ||
) |
Evaluation of the DPG error estimator.
mesh_p | the underlying mesh |
local_errors | data structure containing the local DPG error estimator for each cell of the mesh |
Scalar | a scalar type like 'double' |
Definition at line 374 of file dpg_tools.h.
References EvalPosteriorError().
Referenced by EvalPosteriorError(), projects::dpg::test::TestConververgencePrimalDPGAdaptedNormConvectionDiffusionDirichletBVP(), and projects::dpg::test::TestConververgencePrimalDPGConvectionDiffusionDirichletBVP().
lf::mesh::utils::CodimMeshDataSet< bool > projects::dpg::flagEntitiesOnInflowBoundary | ( | const std::shared_ptr< const lf::mesh::Mesh > & | mesh_p, |
CONVECTION_COEFF | beta | ||
) |
flag all edges located on the inflow boundary
mesh_p | the underlying mesh |
beta | the prescribed convection field \( \beta \) . |
An edge is located on the inflow boundary, if it is located on the boundary \( \partial \Omega \) and if it holds that \( \beta \cdot n_{\Omega} \) < 0 on that edge.
Definition at line 155 of file dpg_tools.h.
References lf::mesh::utils::flagEntitiesOnBoundary(), and OuterNormals().
Referenced by flagEntitiesOnOutflowBoundary().
lf::mesh::utils::CodimMeshDataSet< bool > projects::dpg::flagEntitiesOnOutflowBoundary | ( | const std::shared_ptr< const lf::mesh::Mesh > & | mesh_p, |
CONVECTION_COEFF | beta | ||
) |
flag all edges located on the outflow boundary
mesh_p | the underlying mesh |
beta | the prescribed convection field \( \beta \) |
An edge is located on the outflow boundary, if it is located on the boundary \( \partial \Omega \) and if it holds that \( \beta \cdot n_{\Omega} \geq 0 \) on that edge.
Definition at line 204 of file dpg_tools.h.
References lf::mesh::utils::flagEntitiesOnBoundary(), and flagEntitiesOnInflowBoundary().
projects::dpg::FluxElementMatrixProvider | ( | PTR | fe_space_trial, |
PTR | fe_space_test, | ||
size_type | trial_component, | ||
size_type | test_component, | ||
DIFF_COEFF | alpha | ||
) | -> FluxElementMatrixProvider< typename PTR::element_type::SCALAR, DIFF_COEFF > |
std::vector< std::pair< bool, SCALAR > > projects::dpg::InitEssentialConditionsFromFunctions | ( | const ProductUniformFESpace< SCALAR > & | fes, |
size_type | trace_component, | ||
size_type | flux_component, | ||
EDGESELECTOR_DIRICHLET && | dirichletcondflag, | ||
EDGESELECTOR_NEUMANN && | neumanncondflag, | ||
FUNCTION_G && | g, | ||
FUNCTION_H && | h | ||
) |
Initialization of flags/values for dofs of fluxes and traces of a on a product finite element space whose values are imposed by two specified functions on two specified parts of the boundary.
SCALAR | scalar type like 'double' |
EDGESELECTOR_DIRICHLET | and EDGESELECTOR_NEUMANN predicates returning true for edges with fixed dofs |
FUNCTION_G | and FUNCTION_H MeshFunction which define the imposed values on the edges |
InitEssentialConditionsFromFunctions
dofh | the local_to-global index mapping of the product space |
fe_spec_edge_trace | description of the local shape functions for a 'kSegment' type entity for the trace component |
fe_spec_edge_flux | description of the local shape functions for a 'kSegment' type entity for the flux component |
dirichletcondflag | predicate object whose evaluation operator returns true for all edges on which the degrees of freedom for the trace component should be set to a fixed value |
neumanncondflag | predicate object whose evaluation operator returns true for all edges on which the degrees of freedom for the flux component should be set to a fixed value. |
g | functor providing the evaluation of the essential conditions for the trace component (dirichlet data) |
h | functor providing the evalutation of the essential conditions for the flux component (neumann data) |
trace_component | the index of the trace component in the product space |
flux_component | the index of the flux component in the product space |
The dpg formulation usually involves variables, which represent fluxes or traces. This allows us to impose both Dirichlet and Neumann boundary conditions as essential boundary conditions on the corresponding components and is a generalization of the lehrfempp function lf::fe::InitEssentialConditionFromFunction to product spaces.
This function is meant to supply information for the elimination of essential dofs by means of the function lf::assembl::fix_flagged_solution_components().
Definition at line 272 of file dpg_tools.h.
References projects::dpg::ProductUniformFESpace< SCALAR >::ComponentFESpace(), lf::fe::InitEssentialConditionFromFunction(), projects::dpg::ProductUniformFESpace< SCALAR >::LocGlobMap(), projects::dpg::ProductUniformFEDofHandler::NumDofs(), and projects::dpg::ProductUniformFEDofHandler::Offset().
projects::dpg::LoadElementVectorProvider | ( | PTR | fe_space_test, |
size_type | test_component, | ||
FUNCTOR | f | ||
) | -> LoadElementVectorProvider< typename PTR::element_type::SCALAR, FUNCTOR > |
Eigen::MatrixXd projects::dpg::OuterNormals | ( | const lf::geometry::Geometry & | geometry | ) |
Compute the outer normals of a geometry object.
geometry | The geometry of the cell for which the outer normals are computed. Should be either a triangle or quadrilateral |
Definition at line 49 of file dpg_tools.cc.
References lf::geometry::Corners(), lf::geometry::Geometry::Jacobian(), lf::base::RefEl::kQuad(), lf::base::RefEl::kTria(), lf::base::RefEl::NodeCoords(), lf::geometry::Geometry::RefEl(), and lf::base::RefEl::SubSubEntity2SubEntity().
Referenced by projects::dpg::TraceElementMatrixProvider< SCALAR, COEFF >::Eval(), and flagEntitiesOnInflowBoundary().
projects::dpg::ProductElementMatrixProvider | ( | ptr | fe_space_tiral, |
ptr | fe_space_test, | ||
vector | subproviders | ||
) | -> ProductElementMatrixProvider< typename ptr::element_type::SCALAR > |
projects::dpg::ProductElementVectorProvider | ( | PTR | fe_space_test, |
vector | subproviders | ||
) | -> ProductElementVectorProvider< typename PTR::element_type::SCALAR > |
projects::dpg::ReactionElementMatrixProvider | ( | PTR | fe_trial, |
PTR | fe_test, | ||
size_type | trial_component, | ||
size_type | test_component, | ||
REACTION_COEFF | gamma | ||
) | -> ReactionElementMatrixProvider< typename PTR::element_type::SCALAR, REACTION_COEFF > |
projects::dpg::TraceElementMatrixProvider | ( | PTR | fe_space_trial, |
PTR | fe_space_test, | ||
size_type | trial_component, | ||
size_type | test_component, | ||
COEFF | alpha | ||
) | -> TraceElementMatrixProvider< typename PTR::element_type::SCALAR, COEFF > |