![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
Classes | |
| class | FeExpressionUpwindFromFunctionWrapper |
| Q-point based upwind flux expression built from a velocity callable. More... | |
Functions | |
| double | sqrtNonNegative (double x, double tol=1e-12) |
| Square root of a quantity that is non-negative in exact arithmetic (squared norms, quadratic forms). | |
| double | computeDGError (double errH1int, double errJump) |
| compute the total DG error by combining the H1 semi-norm error and the jump error. | |
| template<typename MeshType, typename FeSpaceType, typename ExprType> | |
| double | integrateFeExpression (const MeshType &mesh, assemble::CellManager< MeshType, FeSpaceType > &cell_manager, const ExprType &expression, std::optional< uint32_t > quad_degree=std::nullopt) |
| Integrate a scalar finite element expression over the entire domain. | |
| template<typename MeshType, typename FeSpaceType, typename DofHandlerType, typename ExprType> | |
| double | computeL2Error (const MeshType &mesh, assemble::CellManager< MeshType, FeSpaceType > &cell_manager, const DofHandlerType &dof_handler, const la::Vector &u_h, const ExprType &u_exact_expr, std::optional< uint32_t > quad_degree=std::nullopt) |
| Compute the L2 error integral between a numerical solution and an exact expression. | |
| template<typename MeshType, typename FeSpaceType, typename DofHandlerType, typename ExprType> | |
| double | computeH1SemiError (const MeshType &mesh, assemble::CellManager< MeshType, FeSpaceType > &cell_manager, const DofHandlerType &dof_handler, const la::Vector &u_h, const ExprType &grad_u_exact_expr, std::optional< uint32_t > quad_degree=std::nullopt) |
| Compute the H1 semi-norm error integral between a numerical solution and an exact gradient. | |
| template<typename MeshType> | |
| double | computeJumpError (const dofs::DofHandler< MeshType > &dof_handler, const la::Vector &u_h, const la::SparseMatrix &matrix) |
| Compute the total Jump error that is: sqrt(u_h^T matrix u_h). This is used only when the provided problem has homogeneous Dirichlet boundary conditions. | |
| template<std::size_t Dim> | |
| auto | createPenaltyExpression (std::size_t order, double gamma) |
| Create a penalty expression for DG methods. | |
| template<std::size_t Dim, typename CellType> | |
| double | faceMeasureForPenalty (const CellType &cell, std::size_t face_id) |
| Measure |F| of a face of a cell, as used by the Kb penalties: the face diameter in 2D (equal to its length) and the face area in 3D. | |
| template<std::size_t Dim> | |
| auto | createPenaltyExpressionKb (std::size_t order, double gamma) |
| Create a penalty expression for DG methods using the face's Kb. | |
| template<std::size_t Dim> | |
| auto | createPenaltyExpressionHarmonic (std::size_t order, double gamma) |
| Create a penalty expression for DG methods using the harmonic mean between the two cells. | |
| template<std::size_t Dim, typename VelocityFunc> | |
| auto | createUpwindFlux (VelocityFunc velocity_func) |
| Create an upwind flux expression from a velocity callable. | |
| template<typename MeshType> | |
| double | computeError (const dofs::DofHandler< MeshType > &dof_handler, const la::Vector &u_h, const la::Vector &u_exact, const la::SparseMatrix &matrix) |
| Compute the error between a discrete solution and an exact one. | |
| double | computeAverage (const la::Vector &u, const la::Vector &rhs_const, double domain_measure) |
| Compute the spatial average of a function in modal/DG space. | |
| template<typename MeshType> | |
| la::Vector | projectConstantOntoModalSpace (const dofs::DofHandler< MeshType > &dof_handler, double constant_value, const la::SparseMatrix &mass_matrix, const la::Vector &rhs_const) |
| Project a constant value onto modal DG space using L2 projection. | |
| template<typename MeshType> | |
| double | forceEqualMean (const dofs::DofHandler< MeshType > &dof_handler, la::Vector &u, const la::Vector &u_reference, const la::SparseMatrix &mass_matrix, const la::Vector &rhs_const, double domain_measure) |
| Adjust a solution to match the average of a reference solution. | |
| template<typename MeshType, typename CellManagerType, typename DofHandlerType, typename FeSpaceType, typename Expression> | |
| la::Vector | l2ProjectExpressionScalar (const MeshType &mesh, CellManagerType &cell_manager, const DofHandlerType &dof_handler, const FeSpaceType &fe_space, const Expression &expr, const la::SparseMatrix &mass_scalar) |
| L2-project a scalar expression using a precomputed scalar mass matrix. | |
| template<typename MeshType, typename CellManagerType, typename DofHandlerType, typename FeSpaceType, typename Expression> | |
| la::Vector | l2ProjectExpressionScalar (const MeshType &mesh, CellManagerType &cell_manager, const DofHandlerType &dof_handler, const FeSpaceType &fe_space, const Expression &expr, const la::SparseMatrix &mass_blocked, std::size_t component) |
| L2-project a scalar expression using one component extracted from a blocked mass matrix. | |
| template<std::size_t VecSize, std::size_t NFields, typename MeshType, typename CellManagerType, typename DofHandlerType, typename FeSpaceType, typename Expression> | |
| la::Vector | l2ProjectExpressionBlockedSubset (const MeshType &mesh, CellManagerType &cell_manager, const DofHandlerType &dof_handler, const FeSpaceType &fe_space, const Expression &expr, std::size_t component_offset, const la::SparseMatrix &mass_blocked) |
| L2-project a vector expression into a subset of components of a blocked vector. | |
|
inline |
Compute the spatial average of a function in modal/DG space.
| u | The solution vector in modal coefficients |
| rhs_const | The RHS vector from assembling constant*v dx |
| domain_measure | The measure (volume/area) of the domain |
|
inline |
compute the total DG error by combining the H1 semi-norm error and the jump error.
| errH1int | the H1 semi-norm error |
| errJump | the jump error |
| double vulpes::assemble::dg::computeError | ( | const dofs::DofHandler< MeshType > & | dof_handler, |
| const la::Vector & | u_h, | ||
| const la::Vector & | u_exact, | ||
| const la::SparseMatrix & | matrix ) |
Compute the error between a discrete solution and an exact one.
| MeshType | Type of the mesh |
| dof_handler | The dof handler associated to the discrete solution |
| u_h | The discrete solution vector |
| u_exact | The exact solution vector |
| matrix | The matrix used to compute the error norm, if the provided matrix is the mass matrix the computed error is the L2 error, if it is the stiffness matrix the computed error is the H1 error |
| double vulpes::assemble::dg::computeH1SemiError | ( | const MeshType & | mesh, |
| assemble::CellManager< MeshType, FeSpaceType > & | cell_manager, | ||
| const DofHandlerType & | dof_handler, | ||
| const la::Vector & | u_h, | ||
| const ExprType & | grad_u_exact_expr, | ||
| std::optional< uint32_t > | quad_degree = std::nullopt ) |
Compute the H1 semi-norm error integral between a numerical solution and an exact gradient.
| MeshType | Type of the mesh |
| FeSpaceType | Type of the finite element space |
| DofHandlerType | Type of the DOF handler |
| ExprType | Type of the FE expression (exact gradient solution) |
| mesh | The computational mesh |
| cell_manager | The cell manager |
| dof_handler | The DOF handler for the numerical solution |
| u_h | The numerical solution vector (DOF coefficients) |
| grad_u_exact_expr | The exact solution gradient as an FE expression |
| quad_degree | Polynomial degree integrated exactly by the simplex rule; defaults to 1 + the order of the integrand, at least 2p + 7 (exact solution declared of order p + 3) |
| double vulpes::assemble::dg::computeJumpError | ( | const dofs::DofHandler< MeshType > & | dof_handler, |
| const la::Vector & | u_h, | ||
| const la::SparseMatrix & | matrix ) |
Compute the total Jump error that is: sqrt(u_h^T matrix u_h). This is used only when the provided problem has homogeneous Dirichlet boundary conditions.
| MeshType | Type of the mesh |
| dof_handler | The dof handler associated to the discrete solution |
| u_h | The discrete solution vector |
| matrix | The matrix used to compute the error norm |
| double vulpes::assemble::dg::computeL2Error | ( | const MeshType & | mesh, |
| assemble::CellManager< MeshType, FeSpaceType > & | cell_manager, | ||
| const DofHandlerType & | dof_handler, | ||
| const la::Vector & | u_h, | ||
| const ExprType & | u_exact_expr, | ||
| std::optional< uint32_t > | quad_degree = std::nullopt ) |
Compute the L2 error integral between a numerical solution and an exact expression.
| MeshType | Type of the mesh |
| FeSpaceType | Type of the finite element space |
| DofHandlerType | Type of the DOF handler |
| ExprType | Type of the FE expression (exact solution) |
| mesh | The computational mesh |
| cell_manager | The cell manager |
| dof_handler | The DOF handler for the numerical solution |
| u_h | The numerical solution vector (DOF coefficients) |
| u_exact_expr | The exact solution as an FE expression |
| quad_degree | Polynomial degree integrated exactly by the simplex rule; defaults to 1 + the order of the integrand, at least 2p + 7 (exact solution declared of order p + 3) |
| auto vulpes::assemble::dg::createPenaltyExpression | ( | std::size_t | order, |
| double | gamma ) |
Create a penalty expression for DG methods.
| Dim | Dimension of the problem |
| order | Order of the polynomial basis |
| gamma | Penalty parameter |
| auto vulpes::assemble::dg::createPenaltyExpressionHarmonic | ( | std::size_t | order, |
| double | gamma ) |
Create a penalty expression for DG methods using the harmonic mean between the two cells.
| Dim | Dimension of the problem |
| order | Order of the polynomial basis |
| gamma | Penalty parameter |
| auto vulpes::assemble::dg::createPenaltyExpressionKb | ( | std::size_t | order, |
| double | gamma ) |
Create a penalty expression for DG methods using the face's Kb.
| Dim | Dimension of the problem |
| order | Order of the polynomial basis |
| gamma | Penalty parameter |
| auto vulpes::assemble::dg::createUpwindFlux | ( | VelocityFunc | velocity_func | ) |
Create an upwind flux expression from a velocity callable.
| Dim | Dimension of the problem |
| VelocityFunc | Callable returning Eigen::Vector<double,Dim> given a physical point Eigen::Vector<double,Dim>. |
| velocity_func | Callable that takes a physical point and returns velocity vector. |
| double vulpes::assemble::dg::faceMeasureForPenalty | ( | const CellType & | cell, |
| std::size_t | face_id ) |
Measure |F| of a face of a cell, as used by the Kb penalties: the face diameter in 2D (equal to its length) and the face area in 3D.
| double vulpes::assemble::dg::forceEqualMean | ( | const dofs::DofHandler< MeshType > & | dof_handler, |
| la::Vector & | u, | ||
| const la::Vector & | u_reference, | ||
| const la::SparseMatrix & | mass_matrix, | ||
| const la::Vector & | rhs_const, | ||
| double | domain_measure ) |
Adjust a solution to match the average of a reference solution.
| MeshType | Type of the mesh |
| dof_handler | The DOF handler |
| u | The solution vector to modify (modified in place) |
| u_reference | The reference solution |
| mass_matrix | The L2 mass matrix |
| rhs_const | The RHS from assembling constant*v dx |
| domain_measure | The measure (volume/area) of the domain |
| double vulpes::assemble::dg::integrateFeExpression | ( | const MeshType & | mesh, |
| assemble::CellManager< MeshType, FeSpaceType > & | cell_manager, | ||
| const ExprType & | expression, | ||
| std::optional< uint32_t > | quad_degree = std::nullopt ) |
Integrate a scalar finite element expression over the entire domain.
| MeshType | Type of the mesh |
| FeSpaceType | Type of the finite element space |
| ExprType | Type of the FE expression to integrate |
| mesh | The computational mesh |
| cell_manager | The cell manager containing mesh and FE space information |
| expression | The scalar FE expression to integrate (e.g., f(x), (u_h - u_exact)^2) |
| quad_degree | Polynomial degree integrated exactly by the simplex rule; defaults to 1 + expression.computeOrder(). Warns above the tabled rules, where Grundmann-Moeller rules amplify roundoff. |
| la::Vector vulpes::assemble::dg::l2ProjectExpressionBlockedSubset | ( | const MeshType & | mesh, |
| CellManagerType & | cell_manager, | ||
| const DofHandlerType & | dof_handler, | ||
| const FeSpaceType & | fe_space, | ||
| const Expression & | expr, | ||
| std::size_t | component_offset, | ||
| const la::SparseMatrix & | mass_blocked ) |
L2-project a vector expression into a subset of components of a blocked vector.
| VecSize | Number of projected components in the expression |
| NFields | Total number of fields in the blocked vector |
| MeshType | Type of the mesh |
| CellManagerType | Type of the cell manager |
| DofHandlerType | Type of the DOF handler |
| FeSpaceType | Type of the FE space |
| Expression | Type of the vector FE expression |
| mesh | The computational mesh |
| cell_manager | Cell manager used by the integrator |
| dof_handler | DOF handler for assembly and output vector |
| fe_space | FE space used to build test functions |
| expr | Vector expression to project |
| component_offset | Start component in the blocked vector where projected values are inserted |
| mass_blocked | Blocked mass matrix used in the L2 solve |
| la::Vector vulpes::assemble::dg::l2ProjectExpressionScalar | ( | const MeshType & | mesh, |
| CellManagerType & | cell_manager, | ||
| const DofHandlerType & | dof_handler, | ||
| const FeSpaceType & | fe_space, | ||
| const Expression & | expr, | ||
| const la::SparseMatrix & | mass_blocked, | ||
| std::size_t | component ) |
L2-project a scalar expression using one component extracted from a blocked mass matrix.
| MeshType | Type of the mesh |
| CellManagerType | Type of the cell manager |
| DofHandlerType | Type of the DOF handler |
| FeSpaceType | Type of the FE space |
| Expression | Type of the scalar FE expression |
| mesh | The computational mesh |
| cell_manager | Cell manager used by the integrator |
| dof_handler | DOF handler for assembly and output vector |
| fe_space | FE space used to build test functions |
| expr | Expression to project |
| mass_blocked | Blocked mass matrix containing all components |
| component | Component index to extract from the blocked mass matrix |
| la::Vector vulpes::assemble::dg::l2ProjectExpressionScalar | ( | const MeshType & | mesh, |
| CellManagerType & | cell_manager, | ||
| const DofHandlerType & | dof_handler, | ||
| const FeSpaceType & | fe_space, | ||
| const Expression & | expr, | ||
| const la::SparseMatrix & | mass_scalar ) |
L2-project a scalar expression using a precomputed scalar mass matrix.
| MeshType | Type of the mesh |
| CellManagerType | Type of the cell manager |
| DofHandlerType | Type of the DOF handler |
| FeSpaceType | Type of the FE space |
| Expression | Type of the scalar FE expression |
| mesh | The computational mesh |
| cell_manager | Cell manager used by the integrator |
| dof_handler | DOF handler for assembly and output vector |
| fe_space | FE space used to build test functions |
| expr | Expression to project |
| mass_scalar | Scalar mass matrix used in the L2 solve |
| la::Vector vulpes::assemble::dg::projectConstantOntoModalSpace | ( | const dofs::DofHandler< MeshType > & | dof_handler, |
| double | constant_value, | ||
| const la::SparseMatrix & | mass_matrix, | ||
| const la::Vector & | rhs_const ) |
Project a constant value onto modal DG space using L2 projection.
| MeshType | Type of the mesh |
| dof_handler | The DOF handler |
| constant_value | The constant value to project |
| mass_matrix | The L2 mass matrix |
| rhs_const | The RHS from assembling constant*v dx |
|
inline |
Square root of a quantity that is non-negative in exact arithmetic (squared norms, quadratic forms).
| x | The value whose square root is taken |
| tol | Negative values above -tol are treated as roundoff and clamped to zero; below -tol a warning is printed |