ScratchData< dim, spacedim, number > Class Template Reference
|
Developer Documentation
|
Container for shared scratch data between operations/operators. More...
#include <scratch_data.hpp>
Public Member Functions | |
| ScratchData (const MPI_Comm mpi_communicator, const unsigned int verbosity_level_in, const bool do_matrix_free) | |
| Construct a scratch data container. | |
| void | reinit (const dealii::Mapping< dim, spacedim > &mapping, const std::vector< const dealii::DoFHandler< dim, spacedim > * > &dof_handler, const std::vector< const dealii::AffineConstraints< number > * > &constraint, const std::vector< dealii::Quadrature< dim > > &quad, const bool enable_boundary_face_loops, const bool enable_inner_face_loops, const bool enable_normal_vector_update=false) |
| Set up mapping, DoFHandlers, constraints, quadrature rules and matrix-free data in a single call. | |
| void | set_mapping (const dealii::Mapping< dim, spacedim > &mapping) |
| Set the mapping by value. | |
| void | set_mapping (const std::shared_ptr< dealii::Mapping< dim, spacedim > > mapping) |
| Set the mapping from a shared pointer. | |
| unsigned int | attach_dof_handler (const dealii::DoFHandler< dim, spacedim > &dof_handler) |
| Attach a DoFHandler and return its index. | |
| unsigned int | attach_constraint_matrix (const dealii::AffineConstraints< number > &constraint) |
| Attach a constraint matrix and return its index. | |
| unsigned int | attach_dof_handler_and_constraint (const dealii::DoFHandler< dim, spacedim > &dof_handler, const dealii::AffineConstraints< number > &constraint) |
| Attach a DoFHandler and its corresponding constraint matrix. | |
| unsigned int | attach_quadrature (const dealii::Quadrature< dim > &quadrature) |
| Attach a cell quadrature rule and create a corresponding face rule. | |
| void | create_partitioning () |
| Build partitioning and cell-size information for all attached DoFHandlers. | |
| void | build (const bool enable_boundary_face_loops, const bool enable_inner_face_loops, const bool enable_normal_vector_update=false, const bool enable_inner_face_hessians_update=false) |
| Build matrix-free and mapping-related data structures. | |
| void | initialize_dof_vector (VectorType &vec, const unsigned int dof_idx) const |
| Initialize a distributed vector for a given DoF index. | |
| void | initialize_dof_vector (BlockVectorType &vec, const unsigned int dof_idx) const |
Initialize a block vector with dim components for a given DoF index. | |
| void | initialize_dof_vector (BlockVectorType &vec, const std::array< unsigned int, dim > &dof_indices_per_block) const |
| Initialize DoFs vectors with a per block DoF index. | |
| void | initialize_bc_vector (VectorType &vec, const unsigned int dof_idx) const |
| Initialize a vector and distribute constraints for a given DoF index. | |
| void | initialize_bc_vector (BlockVectorType &vec, const unsigned int dof_idx) const |
| Initialize all blocks of a block vector and distribute constraints. | |
| void | clear () |
| Clear all attached data and reset to the default-constructed state. | |
| void | create_remote_point_evaluation (const unsigned int dof_idx, const std::function< std::vector< bool >()> &marked_vertices={}) |
| Create a dealii::Utilities::MPI::RemotePointEvaluation object for a given DoF index, if it does not already exist. | |
| const dealii::Mapping< dim, spacedim > & | get_mapping () const |
| Access the stored mapping. | |
| const dealii::FiniteElement< dim, spacedim > & | get_fe (const unsigned int fe_index) const |
| Get the finite element associated with a given DoF index. | |
| const dealii::AffineConstraints< number > & | get_constraint (const unsigned int constraint_index) const |
| Get a constraint object by index (const overload). | |
| dealii::AffineConstraints< number > & | get_constraint (const unsigned int constraint_index) |
| Get a constraint object by index (non-const overload). | |
| const std::vector< const dealii::AffineConstraints< number > * > & | get_constraints () const |
| Get the list of all attached constraint matrices. | |
| const dealii::Quadrature< dim > & | get_quadrature (const unsigned int quad_index) const |
| Get a cell quadrature rule by index. | |
| const std::vector< dealii::Quadrature< dim > > & | get_quadratures () const |
| Get all stored cell quadrature rules. | |
| const dealii::Quadrature< dim - 1 > & | get_face_quadrature (const unsigned int quad_index) const |
| Get a face quadrature rule corresponding to a given cell rule. | |
| const std::vector< dealii::Quadrature< dim - 1 > > & | get_face_quadratures () const |
| Get all stored face quadrature rules. | |
| dealii::MatrixFree< dim, number, VectorizedArrayType > & | get_matrix_free () |
| Access the internal MatrixFree object (non-const). | |
| const dealii::MatrixFree< dim, number, VectorizedArrayType > & | get_matrix_free () const |
| Access the internal MatrixFree object (const). | |
| const dealii::DoFHandler< dim, spacedim > & | get_dof_handler (const unsigned int dof_idx) const |
| Get a DoFHandler by index (const overload). | |
| dealii::DoFHandler< dim, spacedim > & | get_dof_handler (const unsigned int dof_idx) |
| Get a DoFHandler by index (non-const overload). | |
| const std::vector< const dealii::DoFHandler< dim, spacedim > * > & | get_dof_handlers () const |
| Get the vector of all attached DoFHandlers. | |
| const dealii::Triangulation< dim > & | get_triangulation (const unsigned int dof_idx=0) const |
| Get the triangulation associated with a given DoFHandler index. | |
| unsigned int | get_n_dofs_per_cell (const unsigned int dof_idx) const |
| Get the number of DoFs per cell for a given DoFHandler index. | |
| unsigned int | get_degree (const unsigned int dof_idx) const |
| Get the polynomial degree of the finite element at a given DoF index. | |
| unsigned int | get_n_q_points (const unsigned int dof_idx) const |
| Get the number of quadrature points for a given quadrature index. | |
| const number & | get_min_cell_size () const |
| Get the global minimum cell size. | |
| number | get_min_cell_size (const unsigned int dof_idx) const |
| Get a suitable minimum cell size for a given finite element. | |
| const number & | get_max_cell_size () const |
| Get the global maximum cell size. | |
| const number & | get_min_diameter () const |
| Get the minimal cell diameter over the triangulation. | |
| const dealii::AlignedVector< dealii::VectorizedArray< number > > & | get_cell_sizes () const |
| Get the vector of cell sizes used by the MatrixFree object. | |
| MPI_Comm | get_mpi_comm (const unsigned int dof_idx=0) const |
| Get the MPI communicator for a given DoFHandler. | |
| const dealii::IndexSet & | get_locally_owned_dofs (const unsigned int dof_idx) const |
| Get the set of locally owned DoFs for a given DoFHandler index. | |
| const dealii::IndexSet & | get_locally_relevant_dofs (const unsigned int dof_idx) const |
| Get the set of locally relevant DoFs for a given DoFHandler index. | |
| const std::shared_ptr< dealii::Utilities::MPI::Partitioner > & | get_partitioner (const unsigned int dof_idx) const |
| Get the partitioner object for a given DoFHandler index. | |
| const ConditionalOStream | get_pcout (const unsigned int level=1) const |
| Get a ConditionalOStream associated with a given verbosity level. | |
| unsigned int | get_cell_range_category (const std::pair< unsigned, unsigned > &cell_range) const |
| Get the cell range category for a given cell range. | |
| std::pair< unsigned int, unsigned int > | get_face_range_category (const std::pair< unsigned, unsigned > &face_range) const |
| Get the face range category for a given face range. | |
| bool | is_hex_mesh (const unsigned int dof_idx=0) const |
| Check whether the underlying mesh is a pure hypercube mesh. | |
| bool | is_FE_Q_iso_Q_1 (const unsigned int dof_idx, const unsigned int component=0) const |
| Check whether a given component uses FE_Q_iso_Q1. | |
| bool | is_FE_DGQ (const unsigned int dof_idx, const unsigned int component=0) const |
| Check whether a given component uses FE_DGQ. | |
| CutUtil::CutPhaseType | get_cut_type (const unsigned int dof_idx) const |
| Get the cut-cell phase type for a given DoFHandler. | |
| dealii::TimerOutput & | get_timer () const |
| Access the timer associated with this scratch data object. | |
| dealii::Utilities::MPI::RemotePointEvaluation< dim, dim > & | get_remote_point_evaluation (const unsigned int dof_idx) const |
| Access the RemotePointEvaluation object for a given DoF index. | |
Public Attributes | |
| bool | enable_boundary_faces |
| Flag indicating whether boundary-face matrix-free loops are enabled. | |
| bool | enable_inner_faces |
| Flag indicating whether interior-face matrix-free loops are enabled. | |
Private Types | |
| using | VectorizedArrayType = dealii::VectorizedArray< number > |
| using | VectorType = dealii::LinearAlgebra::distributed::Vector< number > |
| using | BlockVectorType = dealii::LinearAlgebra::distributed::BlockVector< number > |
Private Member Functions | |
| void | create_pcout (MPI_Comm mpi_communicator) |
| Helper function that (re)creates the internal ConditionalOStreams. | |
Private Attributes | |
| bool | do_matrix_free |
| std::vector< dealii::ConditionalOStream > | pcout |
| std::shared_ptr< dealii::Mapping< dim, spacedim > > | mapping |
| std::vector< const dealii::DoFHandler< dim, spacedim > * > | dof_handler |
| std::vector< const dealii::AffineConstraints< number > * > | constraint |
| std::vector< dealii::Quadrature< dim > > | quad |
| std::vector< dealii::Quadrature< dim - 1 > > | face_quad |
| number | min_cell_size |
| number | max_cell_size |
| number | min_diameter |
| dealii::AlignedVector< dealii::VectorizedArray< number > > | cell_sizes |
| std::vector< dealii::IndexSet > | locally_owned_dofs |
| std::vector< dealii::IndexSet > | locally_relevant_dofs |
| std::vector< std::shared_ptr< dealii::Utilities::MPI::Partitioner > > | partitioner |
| std::map< unsigned int, std::shared_ptr< dealii::Utilities::MPI::RemotePointEvaluation< dim, dim > > > | rpe |
| const unsigned int | verbosity_level |
| std::shared_ptr< dealii::TimerOutput > | timer |
| dealii::MatrixFree< dim, number, VectorizedArrayType > | matrix_free |
Detailed Description
class MeltPoolDG::ScratchData< dim, spacedim, number >
Container for shared scratch data between operations/operators.
This class centralizes all data that is commonly needed by different operations/operators working on the same mesh:
- The dealii::Mapping used to transfer between reference and real cells.
- One or more dealii::DoFHandler objects and their associated dealii::AffineConstraints.
- Cell and face quadrature rules.
- MPI-related data such as locally owned / relevant DoFs and dealii::Utilities::MPI::Partitioner objects.
- A dealii::MatrixFree object for matrix-free operator evaluations, plus per-cell size information.
- Optional utilities such as remote point evaluation and timing output.
The class can be used both in matrix-free and matrix-based workflows, controlled by the do_matrix_free flag passed to the constructor. It is intended to be initialized once per mesh / discretization and then reused by multiple operators to avoid duplicated setup work.
- Template Parameters
-
dim Topological dimension of the problem. spacedim Dimension of the embedding physical space. number Scalar number type used for matrix-free data structures.
Member Typedef Documentation
◆ BlockVectorType
|
private |
◆ VectorizedArrayType
|
private |
◆ VectorType
|
private |
Constructor & Destructor Documentation
◆ ScratchData()
| MeltPoolDG::ScratchData< dim, spacedim, number >::ScratchData | ( | const MPI_Comm | mpi_communicator, |
| const unsigned int | verbosity_level_in, | ||
| const bool | do_matrix_free | ||
| ) |
Construct a scratch data container.
Initializes the internal output streams and creates an associated dealii::TimerOutput object.
- Parameters
-
mpi_communicator MPI communicator used for all distributed data. verbosity_level_in Verbosity level for dealii::ConditionalOStream output (0–3, where 0 effectively disables output). do_matrix_free If true, build() will set up the internal dealii::MatrixFree object. If false, only partitioning and related data are created.
Member Function Documentation
◆ attach_constraint_matrix()
| unsigned int MeltPoolDG::ScratchData< dim, spacedim, number >::attach_constraint_matrix | ( | const dealii::AffineConstraints< number > & | constraint | ) |
Attach a constraint matrix and return its index.
The constraint pointer is stored internally; the referenced object must outlive this ScratchData instance.
- Parameters
-
constraint Constraint matrix to attach.
- Returns
- Index of the newly attached constraint matrix (0-based).
◆ attach_dof_handler()
| unsigned int MeltPoolDG::ScratchData< dim, spacedim, number >::attach_dof_handler | ( | const dealii::DoFHandler< dim, spacedim > & | dof_handler | ) |
Attach a DoFHandler and return its index.
The DoFHandler pointer is stored internally; the referenced object must outlive this ScratchData instance.
- Parameters
-
dof_handler DoFHandler to attach.
- Returns
- Index of the newly attached DoFHandler (0-based).
◆ attach_dof_handler_and_constraint()
| unsigned int MeltPoolDG::ScratchData< dim, spacedim, number >::attach_dof_handler_and_constraint | ( | const dealii::DoFHandler< dim, spacedim > & | dof_handler, |
| const dealii::AffineConstraints< number > & | constraint | ||
| ) |
Attach a DoFHandler and its corresponding constraint matrix.
This is a convenience wrapper combining attach_dof_handler() and attach_constraint_matrix(), and asserts that the numbers of attached DoFHandlers and constraints remain consistent.
- Parameters
-
dof_handler DoFHandler to attach. constraint Constraint matrix corresponding to dof_handler.
- Returns
- Index of the newly attached constraint / DoFHandler pair.
◆ attach_quadrature()
| unsigned int MeltPoolDG::ScratchData< dim, spacedim, number >::attach_quadrature | ( | const dealii::Quadrature< dim > & | quadrature | ) |
Attach a cell quadrature rule and create a corresponding face rule.
The provided cell quadrature is stored internally. A matching face quadrature is constructed using deal.II's internal utilities, supporting both tensor-product and simplex elements.
- Parameters
-
quadrature Cell quadrature rule to attach.
- Returns
- Index of the newly attached quadrature rule (0-based).
◆ build()
| void MeltPoolDG::ScratchData< dim, spacedim, number >::build | ( | const bool | enable_boundary_face_loops, |
| const bool | enable_inner_face_loops, | ||
| const bool | enable_normal_vector_update = false, |
||
| const bool | enable_inner_face_hessians_update = false |
||
| ) |
Build matrix-free and mapping-related data structures.
If the class has been constructed with do_matrix_free = true, this function sets up the internal dealii::MatrixFree object from the stored mapping, DoFHandlers, constraints and quadrature rules. It also fills the vector of per-cell sizes.
The enable_* flags control which mapping update flags are set for cell, boundary-face and inner-face integrals.
- Parameters
-
enable_boundary_face_loops Enable setup of boundary face data. enable_inner_face_loops Enable setup of interior face data. enable_normal_vector_update Include normal vectors in mapping updates. enable_inner_face_hessians_update Include Hessians in mapping updates for inner face loops.
◆ clear()
| void MeltPoolDG::ScratchData< dim, spacedim, number >::clear | ( | ) |
Clear all attached data and reset to the default-constructed state.
This removes attached DoFHandlers, constraints, quadrature rules, partitioning information, mapping and matrix-free data. It does not modify the verbosity level or the do_matrix_free flag.
◆ create_partitioning()
| void MeltPoolDG::ScratchData< dim, spacedim, number >::create_partitioning | ( | ) |
Build partitioning and cell-size information for all attached DoFHandlers.
This function (re-)computes:
- locally_owned_dofs and locally_relevant_dofs for each DoFHandler.
- MPI dealii::Utilities::MPI::Partitioner objects.
- Minimum and maximum cell diameters and corresponding cell sizes.
It assumes that at least one DoFHandler has been attached.
◆ create_pcout()
|
private |
Helper function that (re)creates the internal ConditionalOStreams.
One ConditionalOStream is created for each verbosity level between 0 and 3.
- Parameters
-
mpi_communicator MPI communicator used to decide which rank prints.
◆ create_remote_point_evaluation()
| void MeltPoolDG::ScratchData< dim, spacedim, number >::create_remote_point_evaluation | ( | const unsigned int | dof_idx, |
| const std::function< std::vector< bool >()> & | marked_vertices = {} |
||
| ) |
Create a dealii::Utilities::MPI::RemotePointEvaluation object for a given DoF index, if it does not already exist.
The marked_vertices callback allows to mark the vertices at which remote point evaluation will be performed.
- Parameters
-
dof_idx Index of the DoFHandler for which the object is created. marked_vertices Callback returning a boolean mask of marked vertices.
◆ get_cell_range_category()
| unsigned int MeltPoolDG::ScratchData< dim, spacedim, number >::get_cell_range_category | ( | const std::pair< unsigned, unsigned > & | cell_range | ) | const |
Get the cell range category for a given cell range.
This is a direct wrapper around dealii::MatrixFree::get_cell_range_category().
- Parameters
-
cell_range Pair of indices denoting the cell range.
- Returns
- Category index of the cell range.
◆ get_cell_sizes()
| const dealii::AlignedVector< dealii::VectorizedArray< number > > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_cell_sizes | ( | ) | const |
Get the vector of cell sizes used by the MatrixFree object.
Each entry corresponds to a cell batch and stores the cell size in a dealii::VectorizedArray.
- Returns
- Constant reference to the cell size vector.
◆ get_constraint() [1/2]
| dealii::AffineConstraints< number > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_constraint | ( | const unsigned int | constraint_index | ) |
Get a constraint object by index (non-const overload).
- Parameters
-
constraint_index Index of the requested constraint matrix.
- Returns
- Reference to the constraint matrix.
◆ get_constraint() [2/2]
| const dealii::AffineConstraints< number > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_constraint | ( | const unsigned int | constraint_index | ) | const |
Get a constraint object by index (const overload).
- Parameters
-
constraint_index Index of the requested constraint matrix.
- Returns
- Constant reference to the constraint matrix.
◆ get_constraints()
| const std::vector< const dealii::AffineConstraints< number > * > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_constraints | ( | ) | const |
Get the list of all attached constraint matrices.
- Returns
- Vector of pointers to all attached constraint matrices.
◆ get_cut_type()
| CutUtil::CutPhaseType MeltPoolDG::ScratchData< dim, spacedim, number >::get_cut_type | ( | const unsigned int | dof_idx | ) | const |
Get the cut-cell phase type for a given DoFHandler.
Delegates to CutUtil::get_cut_type() for the attached DoFHandler.
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- Cut-phase type associated with the DoFHandler.
◆ get_degree()
| unsigned int MeltPoolDG::ScratchData< dim, spacedim, number >::get_degree | ( | const unsigned int | dof_idx | ) | const |
Get the polynomial degree of the finite element at a given DoF index.
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- Polynomial degree of the associated finite element.
◆ get_dof_handler() [1/2]
| dealii::DoFHandler< dim, spacedim > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_dof_handler | ( | const unsigned int | dof_idx | ) |
Get a DoFHandler by index (non-const overload).
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- Reference to the DoFHandler.
◆ get_dof_handler() [2/2]
| const dealii::DoFHandler< dim, spacedim > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_dof_handler | ( | const unsigned int | dof_idx | ) | const |
Get a DoFHandler by index (const overload).
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- Constant reference to the DoFHandler.
◆ get_dof_handlers()
| const std::vector< const dealii::DoFHandler< dim, spacedim > * > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_dof_handlers | ( | ) | const |
Get the vector of all attached DoFHandlers.
- Returns
- Vector of pointers to all DoFHandlers.
◆ get_face_quadrature()
| const dealii::Quadrature< dim - 1 > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_face_quadrature | ( | const unsigned int | quad_index | ) | const |
Get a face quadrature rule corresponding to a given cell rule.
- Parameters
-
quad_index Index of the associated cell quadrature rule.
- Returns
- Constant reference to the face quadrature rule.
◆ get_face_quadratures()
| const std::vector< dealii::Quadrature< dim - 1 > > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_face_quadratures | ( | ) | const |
Get all stored face quadrature rules.
- Returns
- Vector of face quadrature rules.
◆ get_face_range_category()
| std::pair< unsigned int, unsigned int > MeltPoolDG::ScratchData< dim, spacedim, number >::get_face_range_category | ( | const std::pair< unsigned, unsigned > & | face_range | ) | const |
Get the face range category for a given face range.
This is a direct wrapper around dealii::MatrixFree::get_face_range_category().
- Parameters
-
face_range Pair of indices denoting the face range.
- Returns
- Pair of category indices for the two sides of the face range.
◆ get_fe()
| const dealii::FiniteElement< dim, spacedim > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_fe | ( | const unsigned int | fe_index | ) | const |
Get the finite element associated with a given DoF index.
- Parameters
-
fe_index Index of the DoFHandler / finite element.
- Returns
- Constant reference to the corresponding finite element.
◆ get_locally_owned_dofs()
| const dealii::IndexSet & MeltPoolDG::ScratchData< dim, spacedim, number >::get_locally_owned_dofs | ( | const unsigned int | dof_idx | ) | const |
Get the set of locally owned DoFs for a given DoFHandler index.
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- IndexSet of locally owned DoFs.
◆ get_locally_relevant_dofs()
| const dealii::IndexSet & MeltPoolDG::ScratchData< dim, spacedim, number >::get_locally_relevant_dofs | ( | const unsigned int | dof_idx | ) | const |
Get the set of locally relevant DoFs for a given DoFHandler index.
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- IndexSet of locally relevant DoFs.
◆ get_mapping()
| const dealii::Mapping< dim, spacedim > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_mapping | ( | ) | const |
Access the stored mapping.
- Returns
- Constant reference to the stored mapping.
◆ get_matrix_free() [1/2]
| dealii::MatrixFree< dim, number, dealii::VectorizedArray< number > > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_matrix_free | ( | ) |
Access the internal MatrixFree object (non-const).
- Returns
- Reference to the MatrixFree object.
◆ get_matrix_free() [2/2]
| const dealii::MatrixFree< dim, number, dealii::VectorizedArray< number > > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_matrix_free | ( | ) | const |
Access the internal MatrixFree object (const).
- Returns
- Constant reference to the MatrixFree object.
◆ get_max_cell_size()
| const number & MeltPoolDG::ScratchData< dim, spacedim, number >::get_max_cell_size | ( | ) | const |
Get the global maximum cell size.
- Returns
- Reference to the maximal cell size.
◆ get_min_cell_size() [1/2]
| const number & MeltPoolDG::ScratchData< dim, spacedim, number >::get_min_cell_size | ( | ) | const |
Get the global minimum cell size.
This is derived from the minimal cell diameter divided by sqrt(dim).
- Returns
- Reference to the minimal cell size.
◆ get_min_cell_size() [2/2]
| number MeltPoolDG::ScratchData< dim, spacedim, number >::get_min_cell_size | ( | const unsigned int | dof_idx | ) | const |
Get a suitable minimum cell size for a given finite element.
For FE_Q_iso_Q1 elements, this is identical to get_min_cell_size(). For higher-order elements, the minimum cell size is scaled by the polynomial degree.
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- Minimum cell size corresponding to the finite element at
dof_idx.
◆ get_min_diameter()
| const number & MeltPoolDG::ScratchData< dim, spacedim, number >::get_min_diameter | ( | ) | const |
Get the minimal cell diameter over the triangulation.
- Returns
- Reference to the minimal cell diameter.
◆ get_mpi_comm()
| MPI_Comm MeltPoolDG::ScratchData< dim, spacedim, number >::get_mpi_comm | ( | const unsigned int | dof_idx = 0 | ) | const |
Get the MPI communicator for a given DoFHandler.
- Parameters
-
dof_idx Index of the DoFHandler (defaults to 0).
- Returns
- MPI communicator associated with the DoFHandler.
◆ get_n_dofs_per_cell()
| unsigned int MeltPoolDG::ScratchData< dim, spacedim, number >::get_n_dofs_per_cell | ( | const unsigned int | dof_idx | ) | const |
Get the number of DoFs per cell for a given DoFHandler index.
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- Number of DoFs per cell.
◆ get_n_q_points()
| unsigned int MeltPoolDG::ScratchData< dim, spacedim, number >::get_n_q_points | ( | const unsigned int | dof_idx | ) | const |
Get the number of quadrature points for a given quadrature index.
- Parameters
-
quad_idx Index of the quadrature rule.
- Returns
- Number of quadrature points.
◆ get_partitioner()
| const std::shared_ptr< dealii::Utilities::MPI::Partitioner > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_partitioner | ( | const unsigned int | dof_idx | ) | const |
Get the partitioner object for a given DoFHandler index.
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- Shared pointer to the corresponding MPI partitioner.
◆ get_pcout()
| const ConditionalOStream MeltPoolDG::ScratchData< dim, spacedim, number >::get_pcout | ( | const unsigned int | level = 1 | ) | const |
Get a ConditionalOStream associated with a given verbosity level.
Level 0 is always inactive, higher levels are active depending on the verbosity level passed to the constructor.
- Parameters
-
level Verbosity level (0–3).
- Returns
- ConditionalOStream for the requested level.
◆ get_quadrature()
| const dealii::Quadrature< dim > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_quadrature | ( | const unsigned int | quad_index | ) | const |
Get a cell quadrature rule by index.
- Parameters
-
quad_index Index of the quadrature rule.
- Returns
- Constant reference to the quadrature rule.
◆ get_quadratures()
| const std::vector< dealii::Quadrature< dim > > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_quadratures | ( | ) | const |
Get all stored cell quadrature rules.
- Returns
- Vector of cell quadrature rules.
◆ get_remote_point_evaluation()
| dealii::Utilities::MPI::RemotePointEvaluation< dim, dim > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_remote_point_evaluation | ( | const unsigned int | dof_idx | ) | const |
Access the RemotePointEvaluation object for a given DoF index.
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- Reference to the corresponding RemotePointEvaluation object.
- Exceptions
-
dealii::ExcMessage if no RemotePointEvaluation object was created yet for the given dof_idx.
◆ get_timer()
| dealii::TimerOutput & MeltPoolDG::ScratchData< dim, spacedim, number >::get_timer | ( | ) | const |
Access the timer associated with this scratch data object.
- Returns
- Reference to the internal dealii::TimerOutput.
◆ get_triangulation()
| const dealii::Triangulation< dim > & MeltPoolDG::ScratchData< dim, spacedim, number >::get_triangulation | ( | const unsigned int | dof_idx = 0 | ) | const |
Get the triangulation associated with a given DoFHandler index.
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- Constant reference to the associated triangulation.
◆ initialize_bc_vector() [1/2]
| void MeltPoolDG::ScratchData< dim, spacedim, number >::initialize_bc_vector | ( | BlockVectorType & | vec, |
| const unsigned int | dof_idx | ||
| ) | const |
Initialize all blocks of a block vector and distribute constraints.
All blocks are initialized using initialize_bc_vector() with the same dof_idx.
- Parameters
-
[out] vec Block vector to be initialized and constrained. [in] dof_idx Index of the DoFHandler / constraints pair to use.
◆ initialize_bc_vector() [2/2]
| void MeltPoolDG::ScratchData< dim, spacedim, number >::initialize_bc_vector | ( | VectorType & | vec, |
| const unsigned int | dof_idx | ||
| ) | const |
Initialize a vector and distribute constraints for a given DoF index.
This is a convenience wrapper around initialize_dof_vector() which additionally applies the corresponding dealii::AffineConstraints via dealii::AffineConstraints::distribute().
- Parameters
-
[out] vec Vector to be initialized and constrained. [in] dof_idx Index of the DoFHandler / constraints pair to use.
◆ initialize_dof_vector() [1/3]
| void MeltPoolDG::ScratchData< dim, spacedim, number >::initialize_dof_vector | ( | BlockVectorType & | vec, |
| const std::array< unsigned int, dim > & | dof_indices_per_block | ||
| ) | const |
Initialize DoFs vectors with a per block DoF index.
- Parameters
-
[out] vec BlockVector initialized with the DoF indices. [in] dof_indices_per_block Array of DoF indices associated with the different blocks of the BlockVector.
◆ initialize_dof_vector() [2/3]
| void MeltPoolDG::ScratchData< dim, spacedim, number >::initialize_dof_vector | ( | BlockVectorType & | vec, |
| const unsigned int | dof_idx | ||
| ) | const |
Initialize a block vector with dim components for a given DoF index.
All blocks are initialized consistently with the same DoFHandler index.
- Parameters
-
[out] vec Block vector to be initialized (resized to dimblocks).[in] dof_idx Index of the DoFHandler / partitioning to use.
◆ initialize_dof_vector() [3/3]
| void MeltPoolDG::ScratchData< dim, spacedim, number >::initialize_dof_vector | ( | VectorType & | vec, |
| const unsigned int | dof_idx | ||
| ) | const |
Initialize a distributed vector for a given DoF index.
Either delegates to dealii::MatrixFree::initialize_dof_vector() (matrix-free mode) or reinitializes the vector using locally owned / relevant DoFs and the associated MPI communicator.
- Parameters
-
[out] vec Vector to be initialized. [in] dof_idx Index of the DoFHandler / partitioning to use.
◆ is_FE_DGQ()
| bool MeltPoolDG::ScratchData< dim, spacedim, number >::is_FE_DGQ | ( | const unsigned int | dof_idx, |
| const unsigned int | component = 0 |
||
| ) | const |
Check whether a given component uses FE_DGQ.
This is implemented via string matching on the finite element name.
- Parameters
-
dof_idx Index of the DoFHandler. component Component index within the finite element.
- Returns
- True if the sub-element is FE_DGQ, false otherwise.
◆ is_FE_Q_iso_Q_1()
| bool MeltPoolDG::ScratchData< dim, spacedim, number >::is_FE_Q_iso_Q_1 | ( | const unsigned int | dof_idx, |
| const unsigned int | component = 0 |
||
| ) | const |
Check whether a given component uses FE_Q_iso_Q1.
This is implemented via string matching on the finite element name.
- Parameters
-
dof_idx Index of the DoFHandler. component Component index within the finite element.
- Returns
- True if the sub-element is FE_Q_iso_Q1, false otherwise.
◆ is_hex_mesh()
| bool MeltPoolDG::ScratchData< dim, spacedim, number >::is_hex_mesh | ( | const unsigned int | dof_idx = 0 | ) | const |
Check whether the underlying mesh is a pure hypercube mesh.
- Parameters
-
dof_idx Index of the DoFHandler.
- Returns
- True if all reference cells are hypercubes, false otherwise.
◆ reinit()
| void MeltPoolDG::ScratchData< dim, spacedim, number >::reinit | ( | const dealii::Mapping< dim, spacedim > & | mapping, |
| const std::vector< const dealii::DoFHandler< dim, spacedim > * > & | dof_handler, | ||
| const std::vector< const dealii::AffineConstraints< number > * > & | constraint, | ||
| const std::vector< dealii::Quadrature< dim > > & | quad, | ||
| const bool | enable_boundary_face_loops, | ||
| const bool | enable_inner_face_loops, | ||
| const bool | enable_normal_vector_update = false |
||
| ) |
Set up mapping, DoFHandlers, constraints, quadrature rules and matrix-free data in a single call.
This is the high-level convenience entry point that clears any existing state, attaches all provided DoFHandlers, constraint matrices and quadrature rules, (re-)creates partitioning information and then calls build() to initialize matrix-free data if requested.
- Parameters
-
mapping Mapping used for all attached DoFHandlers. dof_handler Vector of DoFHandlers to attach. constraint Vector of constraint matrices corresponding one-to-one to dof_handler.quad Vector of cell quadrature rules to attach. enable_boundary_face_loops If true, face data for boundary loops are set up in build(). enable_inner_face_loops If true, face data for interior faces are set up in build(). enable_normal_vector_update If true, normal vectors are included in the mapping update flags.
◆ set_mapping() [1/2]
| void MeltPoolDG::ScratchData< dim, spacedim, number >::set_mapping | ( | const dealii::Mapping< dim, spacedim > & | mapping | ) |
Set the mapping by value.
Stores a clone of the given mapping object internally.
- Parameters
-
mapping Mapping object to be cloned and stored.
◆ set_mapping() [2/2]
| void MeltPoolDG::ScratchData< dim, spacedim, number >::set_mapping | ( | const std::shared_ptr< dealii::Mapping< dim, spacedim > > | mapping | ) |
Set the mapping from a shared pointer.
The shared pointer is stored internally and may be shared with other parts of the code.
- Parameters
-
mapping Shared pointer to the mapping object to use.
Member Data Documentation
◆ cell_sizes
|
private |
◆ constraint
|
private |
◆ do_matrix_free
|
private |
◆ dof_handler
|
private |
◆ enable_boundary_faces
| bool MeltPoolDG::ScratchData< dim, spacedim, number >::enable_boundary_faces |
◆ enable_inner_faces
| bool MeltPoolDG::ScratchData< dim, spacedim, number >::enable_inner_faces |
◆ face_quad
|
private |
◆ locally_owned_dofs
|
private |
◆ locally_relevant_dofs
|
private |
◆ mapping
|
private |
◆ matrix_free
|
private |
◆ max_cell_size
|
private |
◆ min_cell_size
|
private |
◆ min_diameter
|
private |
◆ partitioner
|
private |
◆ pcout
|
private |
◆ quad
|
private |
◆ rpe
|
private |
◆ timer
|
mutableprivate |
◆ verbosity_level
|
private |
The documentation for this class was generated from the following files:
- include/meltpooldg/core/scratch_data.hpp
- source/core/scratch_data.cpp
Generated by