|
| | WeakFormIntegratorBase (const MeshType &mesh, CellManager< MeshType, FeType > &cell_manager, const FeExpressionTuple &fe_expression, const FeExpressionFaceTuple &fe_expression_face) |
| | Construct a new Weak Form Integrator Base object.
|
| virtual | ~WeakFormIntegratorBase ()=default |
| virtual void | integrate (index_t cell_id)=0 |
| | Integrate the weak form over a cell.
|
| void | computeUpdateFlags () |
| | Compute the update flags indicating the values to be updated for each cell in the FEValues.
|
| void | computeMaxOrder () |
| | Compute the maximum polynomial order among all finite element expressions.
|
| const CellType & | getCell (index_t cell_id, bool update_mapping=false) |
| | Get the cell object for a given cell id.
|
| void | preallocate (index_t cell_id) |
| | Resize the internal storage of local integrals (matrices) to fit the number of finite element expressions taking into account which expressions are computed on the faces and which in the volume, and which expressions are bilinear or linear.
|
| void | findCellNeigh () |
| | Find the neighboring cell across the current (local) face (m_face_id) and set up the ids for the neighbor FEValues if needed.
|
| void | applyBasisScaling () |
| | Apply the basis scaling to the integrals and right-hand side contributions if needed.
|
| Eigen::Map< Eigen::MatrixXd > | getCurrFaceIntegral (const auto &expr, Eigen::Index expr_id) |
| | Get a map to the data corresponding to the face integral for the current cell and face being integrated. The data is a raw buffer that points to the correct location in the internal storage.
|
| Eigen::Map< Eigen::VectorXd > | getCurrFaceRhs (const auto &expr, Eigen::Index expr_id) |
| | Get a map to the rhs vector for the current face and expression.
|
| void | buildWeakFormPointerTable () |
| | Build a lookup table that maps finite element expression pointers to their corresponding data storage locations for integrals and right-hand side contributions.
|
| const auto & | getIntegrals () const |
| | Get a const reference to the (bilinear) volume integrals buffer.
|
| const auto & | getRhsIntegrals () const |
| | Get a const reference to the (linear) volume right-hand side buffer.
|
| const auto & | getFaceIntegrals () const |
| | Get a const reference to the (bilinear) face integrals buffer where both basis functions belong to this cell.
|
| const auto & | getRhsFaceIntegrals () const |
| | Get a const reference to the (linear) face right-hand side buffer.
|
| const auto & | getFaceIntegralsNeigh () const |
| | Get a const reference to the (bilinear) face integrals buffer where one basis function belongs to the neighboring cell.
|
| const auto & | getRhsFaceIntegralsNeigh () const |
| | Get a const reference to the (linear) face rhs buffer where the test function belongs to the neighboring cell.
|
| auto | getIntegral (auto wf_ptr, index_t loc_neigh_id=-1) const |
| | Get the integral (matrix or vector) for the current cell.
|
|
| static constexpr index_t | s_n_expr |
| | total number of expression integrated inside the cell
|
| static constexpr index_t | s_n_face_expr |
| | total number of expression integrated on the boundary of the cell
|
| static constexpr index_t | s_n_expr_bilinear |
| | total number of bilinear expression integrated inside the cell
|
| static constexpr index_t | s_n_expr_linear |
| | total number of linear expression integrated inside the cell
|
| static constexpr index_t | s_n_face_expr_bilinear |
| | total number of bilinear expression integrated on the boundary of the cell
|
| static constexpr index_t | s_n_face_expr_linear |
| | total number of linear expression integrated on the boundary of the cell
|
| static constexpr std::size_t | dim = MeshType::self_dim |
| static constexpr uint32_t | nblocks |
| | Number of vector blocks in the system, e.g. for a scalar problem is 1, for an elasticity problem is dim (2 or 3).
|
|
| const MeshType & | m_mesh |
| | A reference to the underlying mesh.
|
| CellManager< MeshType, FeType > & | m_cell_manager |
| | The cell manager.
|
| FeExpressionTuple | m_fe_expression |
| | A tuple of pointers to the finite element expressions to compute the volume integrals.
|
| FeExpressionFaceTuple | m_fe_expression_face |
| | A tuple of pointers to the finite element expressions to compute the face integrals.
|
| const FeType & | m_fe_space |
| | A reference to the finite element space.
|
| std::size_t | m_order = -1 |
| | The maximum polynomial order of the finite element expressions integrated in the volume.
|
| std::size_t | m_order_face = -1 |
| | The maximum polynomial order of the finite element expressions integrated on the faces.
|
| std::unordered_map< void *, double * > | m_wf_ptr_table |
| | A map from finite element expression pointers to their corresponding data storage locations.
|
| std::unordered_map< void *, Eigen::MatrixXd > | m_neigh_sum_scratch |
| | Scratch buffers reused by getIntegral to accumulate the sum-over-neighbors case without a fresh heap allocation per call, keyed per weak-form pointer so two different neigh-summed forms queried on the same integrator cannot alias each other's result.
|
| fe::UpdateFlagsType | m_update_flags = 0 |
| | Update flags indicating which values to update in FEValues for the volume integrals.
|
| fe::UpdateFlagsType | m_update_flags_face = 0 |
| | Update flags indicating which values to update in FEValues for the face integrals.
|
| Eigen::Tensor< double, 3 > | m_integrals |
| | Tensor to store the bilinear volume integrals.
|
| Eigen::MatrixXd | m_rhs |
| | Matrix to store the linear volume right-hand side contributions.
|
| Eigen::Tensor< double, 3 > | m_face_integrals |
| | Tensor to store the bilinear face integrals where both basis functions belong to this cell.
|
| Eigen::MatrixXd | m_face_rhs |
| | Matrix to store the linear face right-hand side contributions.
|
| Eigen::Tensor< double, 4 > | m_face_integrals_neigh |
| | Tensor to store the bilinear face integrals where one basis function belongs to the neighboring cell.
|
| Eigen::Tensor< double, 3 > | m_face_rhs_neigh |
| | Tensor to store the linear face rhs contributions where the test function belongs to the neighboring cell; shape (nrows, s_n_face_expr, n_max_neigh) – dim1 uses s_n_face_expr (total) so getIntegral's slice_neigh_size = nrows * 1 * s_n_face_expr matches the tensor stride.
|
| fe::FeValues< dim > | m_fe_values |
| | The FEValues object to cache ids, normals and the evaluation of shape functions and their derivatives.
|
| bool | m_need_neigh_cell = -1 |
| | Flags indicating whether neighboring cell information is needed.
|
| bool | m_need_neigh_values = -1 |
| | Flags indicating whether neighboring cell values are needed, a subset of the above, so if this is true the above is true too.
|
| index_t | m_cell_id = -1 |
| | Current cell id being integrated, in mesh MPI local enumeration.
|
| index_t | m_face_id = -1 |
| | Current face id being integrated, local to the cell.
|
| CellNeighInfo | m_cell_neigh_info |
| | Information about the neighboring cell across the current face it might be empty if the neighbor is not needed or does not exist.
|
| const MappingType * | m_mapping = nullptr |
| | Pointer to the mapping of the current cell being integrated.
|
template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
class vulpes::assemble::WeakFormIntegratorBase< MeshType, FeExpressionTuple, FeExpressionFaceTuple >
Base class for weak form integrators.
- Template Parameters
-
| MeshType | Type of the mesh |
| FeExpressionTuple | Tuple of finite element expressions |
| FeExpressionFaceTuple | Tuple of finite element expressions on the faces |
The weak form integrator base class provides the common functionality for weak form integrators, such as managing the finite element expressions, computing update flags, and handling the integration process. It also manages the storage of integrals and right-hand side contributions.
template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
Apply the basis scaling to the integrals and right-hand side contributions if needed.
This method checks if the finite element type requires basis scaling. If so, it computes the scaling factors based on the Jacobian determinant of the mapping and applies them to the stored integrals and right-hand side contributions.
template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
Build a lookup table that maps finite element expression pointers to their corresponding data storage locations for integrals and right-hand side contributions.
This method populates an unordered map that associates each finite element expression pointer with a pointer to its corresponding data storage location in the internal tensors and matrices. It ensures that each expression is uniquely mapped and checks for duplicates, reporting an error if the same expression is used more than once.
template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
Get a map to the data corresponding to the face integral for the current cell and face being integrated. The data is a raw buffer that points to the correct location in the internal storage.
This method returns an Eigen::Map to the face integral matrix for the current cell and face being integrated. It takes into account whether the finite element expression requires neighbor values and whether a neighbor cell exists.
- Parameters
-
| expr | Pointer to the finite element expression for which to get the face integral. |
| expr_id | Index of the finite element expression in the tuple. |
- Returns
- Eigen::Map<Eigen::MatrixXd> Map to the face integral matrix. If there is no neighbor cell when needed, returns a null map.
- Warning
- The integral is not yet computed
template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
Get a map to the rhs vector for the current face and expression.
Returns a writable Eigen::Map into the correct per-neighbor slot of m_face_rhs_neigh (when the expression uses fe::neigh values) or into the flat m_face_rhs column (otherwise). Returns a null map (size 0) when a neighbor is required but absent, or when precompute() rejects this face.
- Parameters
-
| expr | Pointer to the linear face expression. |
| expr_id | Index of this expression in the linear face tuple. |
- Returns
- Eigen::Map<Eigen::VectorXd> into the appropriate storage.
template<typename MeshType, typename FeExpressionTuple, typename FeExpressionFaceTuple = std::tuple<>>
Tensor to store the linear face rhs contributions where the test function belongs to the neighboring cell; shape (nrows, s_n_face_expr, n_max_neigh) – dim1 uses s_n_face_expr (total) so getIntegral's slice_neigh_size = nrows * 1 * s_n_face_expr matches the tensor stride.