ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
ryujin::OfflineData< dim, Number > Class Template Referencefinal

#include <source/offline_data.h>

Inheritance diagram for ryujin::OfflineData< dim, Number >:
Inheritance graph
[legend]
Collaboration diagram for ryujin::OfflineData< dim, Number >:
Collaboration graph
[legend]

Classes

struct  CouplingDescription
 

Public Types

Typedefs and constexpr constants
using BoundaryDescription = std::tuple< unsigned int, dealii::Tensor< 1, dim, Number >, Number, Number, dealii::types::boundary_id, dealii::Point< dim > >
 

Public Member Functions

template<typename ITERATOR1 , typename ITERATOR2 >
auto construct_boundary_map (const ITERATOR1 &begin, const ITERATOR2 &end, const Utilities::MPI::Partitioner &partitioner) const -> BoundaryMap
 
template<typename ITERATOR1 , typename ITERATOR2 >
auto collect_coupling_boundary_pairs (const ITERATOR1 &begin, const ITERATOR2 &end, const Utilities::MPI::Partitioner &partitioner) const -> CouplingBoundaryPairs
 
Constructor and setup
 OfflineData (const MPIEnsemble &mpi_ensemble, const Discretization< dim > &discretization, const std::string &subsection="/OfflineData")
 
void prepare (const unsigned int problem_dimension, const unsigned int n_precomputed_values)
 
Information and statistics
const auto & dof_handler_cg () const
 
const auto & dof_handler_dg () const
 
const dealii::DoFHandler< dim > & dof_handler () const
 
dealii::DoFHandler< dim > & dof_handler ()
 
const auto & affine_constraints_cg () const
 
const auto & affine_constraints_dg () const
 
const dealii::AffineConstraints< Number > & affine_constraints () const
 
const auto & scalar_partitioner () const
 
const auto & hyperbolic_vector_partitioner () const
 
const auto & precomputed_vector_partitioner () const
 
const auto & n_export_indices () const
 
const auto & n_locally_internal () const
 
const auto & n_locally_owned () const
 
const auto & n_locally_relevant () const
 
const auto & boundary_map () const
 
const auto & boundary_indices () const
 
const auto & boundary_slots () const
 
const auto & coupling_boundary_pairs () const
 
const auto & level_boundary_map () const
 
const auto & sparsity_pattern () const
 
const auto & sparsity_pattern_simd () const
 
const auto & mass_matrix () const
 
const auto & mass_matrix_inverse () const
 
const auto & lumped_mass_matrix () const
 
const auto & lumped_mass_matrix_inverse () const
 
const auto & level_lumped_mass_matrix () const
 
const auto & betaij_matrix () const
 
const auto & cij_matrix () const
 
const auto & incidence_matrix () const
 
const auto & measure_of_omega () const
 
const auto & discretization () const
 

Detailed Description

template<int dim, typename Number = double>
class ryujin::OfflineData< dim, Number >

A class to store all data that can be precomputed offline.

This class takes a reference to a Discretization object (that itself holds a Triangulation, FiniteElement, Mapping, and Quadrature object).

Most notably this class sets up a DoFHandler, the SparsityPattern, various IndexSet objects to hold locally owned and locally relevant indices, and precomputes all matrices (mass matrix, lumped mass matrix, $c_{ij}$ matrices, and $n_{ij}$ matrices).

After prepare() is called, all getter functions return valid references.

Note
The offline data precomputed in this class is problem independent, it only depends on the chosen geometry and ansatz stored in the Discretization class.
Data structures in OfflineData are initialized with the ensemble subrange communicator stored in MPIEnsemble.

Definition at line 53 of file offline_data.h.

Member Typedef Documentation

◆ BoundaryDescription

template<int dim, typename Number = double>
using ryujin::OfflineData< dim, Number >::BoundaryDescription = std::tuple<unsigned int , dealii::Tensor<1, dim, Number> , Number , Number , dealii::types::boundary_id , dealii::Point<dim> >

A tuple describing (local) dof index, boundary normal, normal mass, boundary mass, boundary id, and position of the boundary degree of freedom.

Definition at line 66 of file offline_data.h.

Constructor & Destructor Documentation

◆ OfflineData()

template<int dim, typename Number >
ryujin::OfflineData< dim, Number >::OfflineData ( const MPIEnsemble mpi_ensemble,
const Discretization< dim > &  discretization,
const std::string &  subsection = "/OfflineData< dim, Number >" 
)

Constructor

Definition at line 33 of file offline_data.template.h.

Member Function Documentation

◆ prepare()

template<int dim, typename Number >
void ryujin::OfflineData< dim, Number >::prepare ( const unsigned int  problem_dimension,
const unsigned int  n_precomputed_values 
)

Prepare offline data. A call to prepare() sets up storage, dof handlers, sparsity patterns, and assembles all matrices.

The problem_dimension and n_precomputed_values parameters is used to set up appropriately sized vector partitioners for the state and precomputed MultiComponentVector.

Definition at line 69 of file offline_data.template.h.

◆ dof_handler_cg()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::dof_handler_cg ( ) const
inline

Return a read-only const reference to the DoFHandler for the continuous ("cG") variant of the selected finite element space.

Note
If the selected finite element space is continuous then this method simply returns the same object as dof_handler().

Definition at line 124 of file offline_data.h.

Referenced by ryujin::MGSmoother< dim, Number >::initialize().

◆ dof_handler_dg()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::dof_handler_dg ( ) const
inline

Return a read-only const reference to the DoFHandler for the discontinuous ("dG") variant of the selected finite element space.

Note
If the selected finite element space is discontinuous then this method simply returns the same object as dof_handler().

Definition at line 133 of file offline_data.h.

◆ dof_handler() [1/2]

template<int dim, typename Number = double>
const dealii::DoFHandler< dim > & ryujin::OfflineData< dim, Number >::dof_handler ( ) const
inline

Return a read-only const reference to the dof handler.

Definition at line 138 of file offline_data.h.

Referenced by ryujin::MGSmoother< dim, Number >::initialize().

◆ dof_handler() [2/2]

template<int dim, typename Number = double>
dealii::DoFHandler< dim > & ryujin::OfflineData< dim, Number >::dof_handler ( )
inline

Return a writable reference to the dof handler.

Definition at line 152 of file offline_data.h.

◆ affine_constraints_cg()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::affine_constraints_cg ( ) const
inline

An AffineConstraints object storing constraints for the continuous ("cG") variant of the selected finite element space in (deal.II typical) global numbering.

Note
The affine constraints object is populated with (a) hanging node constraints, and (b) periodicity constraints, that directly affect the chosen ansatz space.
If the selected finite element space is continuous then this method simply returns the same object as affine_constraints().

Definition at line 175 of file offline_data.h.

◆ affine_constraints_dg()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::affine_constraints_dg ( ) const
inline

An AffineConstraints object storing constraints for the discontinuous ("dG") variant of the selected finite element space in (deal.II typical) global numbering.

Note
The affine constraints object is populated with (a) hanging node constraints, and (b) periodicity constraints, that directly affect the chosen ansatz space.
If the selected finite element space is discontinuous then this method simply returns the same object as affine_constraints().

Definition at line 189 of file offline_data.h.

◆ affine_constraints()

template<int dim, typename Number = double>
const dealii::AffineConstraints< Number > & ryujin::OfflineData< dim, Number >::affine_constraints ( ) const
inline

An AffineConstraints object storing constraints in (deal.II typical) global numbering.

Note
The affine constraints object is populated with (a) hanging node constraints, and (b) periodicity constraints, that directly affect the chosen ansatz space.

Definition at line 199 of file offline_data.h.

◆ scalar_partitioner()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::scalar_partitioner ( ) const
inline

An MPI partitioner for the (scalar) Vector storing a scalar-valued quantity.

Definition at line 212 of file offline_data.h.

Referenced by ryujin::SelectedComponentsExtractor< Description, dim, Number >::extract().

◆ hyperbolic_vector_partitioner()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::hyperbolic_vector_partitioner ( ) const
inline

An MPI partitioner for the MultiComponentVector storing a vector-valued quantity of size HyperbolicSystem::problem_dimension.

Definition at line 218 of file offline_data.h.

◆ precomputed_vector_partitioner()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::precomputed_vector_partitioner ( ) const
inline

An MPI partitioner for the MultiComponentVector storing a vector-valued quantity of size HyperbolicSystem::problem_dimension.

Definition at line 224 of file offline_data.h.

◆ n_export_indices()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::n_export_indices ( ) const
inline

The subinterval \([0,\texttt{n_export_indices()})\) contains all (SIMD-vectorized) indices of the interval \([0,\texttt{n_locally_internal()})\) that are exported to neighboring MPI ranks.

Note
The interval \([\texttt{n_locally_internal()}, \texttt{n_locally_relevant()})\) (consisting of non-SIMD-vectorized indices) contains additional degrees of freedom that might have to be exported to neighboring MPI ranks.

Definition at line 237 of file offline_data.h.

◆ n_locally_internal()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::n_locally_internal ( ) const
inline

Number of locally owned internal degrees of freedom: In (MPI rank) local numbering all indices in the half open interval [0, n_locally_internal_) are owned by this processor, have standard connectivity, and are not situated at a boundary.

Definition at line 245 of file offline_data.h.

Referenced by ryujin::Euler::HyperbolicSystem::fill_precomputed_values(), ryujin::EulerAEOS::HyperbolicSystem::fill_precomputed_values(), ryujin::EulerBarotropic::HyperbolicSystem::fill_precomputed_values(), ryujin::ScalarConservation::HyperbolicSystem::fill_precomputed_values(), and ryujin::ShallowWater::HyperbolicSystem::fill_precomputed_values().

◆ n_locally_owned()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::n_locally_owned ( ) const
inline

◆ n_locally_relevant()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::n_locally_relevant ( ) const
inline

Number of locally relevant degrees of freedom: This number is the total number of degrees of freedom we store locally on this MPI rank. I.e., we can access the half open interval [0, n_locally_relevant_) on this machine.

Definition at line 260 of file offline_data.h.

◆ boundary_map()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::boundary_map ( ) const
inline

The boundary map. Local numbering.

For every degree of freedom that has nonzero support at the boundary we record the global degree of freedom index along with a weighted boundary normal, the associated boundary id, and position.

This map is later used in OfflineData to handle boundary degrees of freedom after every time step (for example to implement reflective boundary conditions).

Definition at line 273 of file offline_data.h.

Referenced by ryujin::NavierStokes::VelocityMatrix< dim, Number, Number2 >::vmult(), and ryujin::NavierStokes::EnergyMatrix< dim, Number, Number2 >::vmult().

◆ boundary_indices()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::boundary_indices ( ) const
inline

A compacted, strictly increasing list of all locally owned degrees of freedom that appear in the boundary_map(). The function returns a reference to a Mirrored object that can be accessed on both memory spaces with view() and size().

Definition at line 281 of file offline_data.h.

◆ boundary_slots()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::boundary_slots ( ) const
inline

For every entry of the boundary_map() the position of its degree of freedom in boundary_indices(). Local numbering.

Note
The boundary map can contain more than one entry for the same degree of freedom (for example a corner that is simultaneously located on a slip and a dirichlet boundary). All such entries share the same position.

Definition at line 292 of file offline_data.h.

◆ coupling_boundary_pairs()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::coupling_boundary_pairs ( ) const
inline

An array of CouplingDescription structures describing coupling degrees of freedom i and j where both degrees of freedom are collocated at the boundary (and hence the d_ij matrix has to be symmetrized). The function returns a reference to a Mirrored object holding (i, col_idx, j) triples that can be accessed on both memory spaces with view() and size().

Definition at line 302 of file offline_data.h.

◆ level_boundary_map()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::level_boundary_map ( ) const
inline

◆ sparsity_pattern()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::sparsity_pattern ( ) const
inline

A sparsity pattern for (standard deal.II) matrices storing indices in (deal.II typical) global numbering.

Definition at line 314 of file offline_data.h.

◆ sparsity_pattern_simd()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::sparsity_pattern_simd ( ) const
inline

◆ mass_matrix()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::mass_matrix ( ) const
inline

The mass matrix. (SIMD storage, local numbering)

Definition at line 325 of file offline_data.h.

◆ mass_matrix_inverse()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::mass_matrix_inverse ( ) const
inline

The inverse mass matrix. (SIMD storage, local numbering)

This matrix is only available for a discontinuous finite Element ansatz.

Definition at line 333 of file offline_data.h.

◆ lumped_mass_matrix()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::lumped_mass_matrix ( ) const
inline

The lumped mass matrix. (stored as vector, local numbering)

Definition at line 338 of file offline_data.h.

Referenced by ryujin::NavierStokes::VelocityMatrix< dim, Number, Number2 >::vmult(), and ryujin::NavierStokes::EnergyMatrix< dim, Number, Number2 >::vmult().

◆ lumped_mass_matrix_inverse()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::lumped_mass_matrix_inverse ( ) const
inline

The inverse of the lumped mass matrix. (stored as vector, local numbering)

Definition at line 344 of file offline_data.h.

◆ level_lumped_mass_matrix()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::level_lumped_mass_matrix ( ) const
inline

◆ betaij_matrix()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::betaij_matrix ( ) const
inline

The stiffness matrix \((beta_{ij})\): \(\beta_{ij} = \nabla\varphi_{j}\cdot\nabla\varphi_{i}\) (SIMD storage, local numbering)

Definition at line 357 of file offline_data.h.

◆ cij_matrix()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::cij_matrix ( ) const
inline

The \((c_{ij})\) matrix. (SIMD storage, local numbering)

Definition at line 362 of file offline_data.h.

◆ incidence_matrix()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::incidence_matrix ( ) const
inline

The incidence matrix \((beta_{ij})\): 1 for coupling face degrees of freedom that share the same support point coordinate, 0 otherwise.

(SIMD storage, local numbering)

This matrix is only available for a discontinuous finite Element ansatz.

Definition at line 373 of file offline_data.h.

◆ measure_of_omega()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::measure_of_omega ( ) const
inline

Size of computational domain.

Definition at line 378 of file offline_data.h.

◆ discretization()

template<int dim, typename Number = double>
const auto & ryujin::OfflineData< dim, Number >::discretization ( ) const
inline

Returns a reference of the underlying Discretization object.

Definition at line 383 of file offline_data.h.

Referenced by ryujin::MGSmoother< dim, Number >::initialize().

◆ construct_boundary_map()

template<int dim, typename Number = double>
template<typename ITERATOR1 , typename ITERATOR2 >
auto ryujin::OfflineData< dim, Number >::construct_boundary_map ( const ITERATOR1 &  begin,
const ITERATOR2 &  end,
const Utilities::MPI::Partitioner &  partitioner 
) const -> BoundaryMap

Definition at line 1235 of file offline_data.template.h.

References ryujin::no_slip, ryujin::periodic, and ryujin::slip.

◆ collect_coupling_boundary_pairs()

template<int dim, typename Number = double>
template<typename ITERATOR1 , typename ITERATOR2 >
auto ryujin::OfflineData< dim, Number >::collect_coupling_boundary_pairs ( const ITERATOR1 &  begin,
const ITERATOR2 &  end,
const Utilities::MPI::Partitioner &  partitioner 
) const -> CouplingBoundaryPairs

Definition at line 1460 of file offline_data.template.h.

References ryujin::periodic.


The documentation for this class was generated from the following files: