Reduced Lagrange Multipliers
 
Loading...
Searching...
No Matches
TensorProductSpace< reduced_dim, dim, spacedim, n_components > Class Template Reference

#include <tensor_product_space.h>

Inheritance diagram for TensorProductSpace< reduced_dim, dim, spacedim, n_components >:
ReducedCoupling< 1, 2, dim, 1 >

Public Member Functions

 TensorProductSpace (const TensorProductSpaceParameters< reduced_dim, dim, spacedim, n_components > &par, MPI_Comm mpi_communicator=MPI_COMM_WORLD)
 
void initialize ()
 
const ReferenceCrossSection< dim - reduced_dim, spacedim, n_components > & get_reference_cross_section () const
 
void make_reduced_grid_and_properties ()
 
const DoFHandler< reduced_dim, spacedim > & get_dof_handler () const
 
const std::vector< Point< spacedim > > & get_locally_owned_qpoints () const
 
const std::vector< std::vector< double > > & get_locally_owned_weights () const
 
const std::vector< Point< spacedim > > & get_locally_owned_reduced_qpoints () const
 
const std::vector< std::vector< double > > & get_locally_owned_reduced_weights () const
 
const std::vector< std::vector< double > > & get_locally_owned_section_measure () const
 
void update_local_dof_indices (const std::map< unsigned int, IndexSet > &remote_q_point_indices)
 
const std::vector< types::global_dof_index > & get_dof_indices (const types::global_cell_index cell_index) const
 
std::tuple< unsigned int, unsigned int, unsigned int > particle_id_to_cell_and_qpoint_indices (const unsigned int qpoint_index) const
 
IndexSet locally_owned_qpoints () const
 
IndexSet locally_relevant_indices () const
 
auto get_quadrature () const -> const QGauss< reduced_dim > &
 
void compute_points_and_weights ()
 
const parallel::fullydistributed::Triangulation< reduced_dim, spacedim > & get_triangulation () const
 
double get_scaling (const unsigned int) const
 
const LinearAlgebra::distributed::Vector< double > & get_properties () const
 
const DoFHandler< reduced_dim, spacedim > & get_properties_dh () const
 
DoFHandler< reduced_dim, spacedim > & get_properties_dh ()
 
const std::vector< std::string > & get_properties_names () const
 
std::vector< std::string > & get_properties_names ()
 

Public Attributes

std::function< void(parallel::fullydistributed::Triangulation< reduced_dim, spacedim > &)> set_partitioner = [](auto &) {}
 

Static Public Attributes

static constexpr int cross_section_dim = dim - reduced_dim
 

Protected Member Functions

void setup_dofs ()
 
std::map< unsigned int, IndexSetlocal_q_point_indices_to_global_cell_indices (const std::map< unsigned int, IndexSet > &local_q_point_indices) const
 

Protected Attributes

MPI_Comm mpi_communicator
 
const TensorProductSpaceParameters< reduced_dim, dim, spacedim, n_components > & par
 
ReferenceCrossSection< cross_section_dim, spacedim, n_components > reference_cross_section
 
parallel::fullydistributed::Triangulation< reduced_dim, spacedim > triangulation
 
FESystem< reduced_dim, spacedim > fe
 
QGauss< reduced_dim > quadrature_formula
 
DoFHandler< reduced_dim, spacedim > dof_handler
 
std::map< types::global_cell_index, std::vector< types::global_dof_index > > global_cell_to_dof_indices
 
std::vector< Point< spacedim > > all_qpoints
 
std::vector< std::vector< double > > all_weights
 
std::vector< Point< spacedim > > reduced_qpoints
 
std::vector< std::vector< double > > reduced_weights
 
LinearAlgebra::distributed::Vector< double > properties
 
DoFHandler< reduced_dim, spacedim > properties_dh
 
std::vector< std::string > properties_names
 

Detailed Description

template<int reduced_dim, int dim, int spacedim, int n_components>
class TensorProductSpace< reduced_dim, dim, spacedim, n_components >

A class representing a tensor product space combining a lower-dimensional triangulation and a reference cross-section.

Template Parameters
reduced_dimThe dimension of the reduced triangulation.
dimThe dimension of the full-order object.
spacedimThe dimension of the ambient space
n_componentsThe number of components of the problem.

A class representing a tensor product space for reduced-dimensional problems.

This class provides functionality to work with tensor product spaces, including the initialization of reduced grids, handling degrees of freedom (DoFs), and managing reference cross-sections for reduced-dimensional domains.

Template Parameters
reduced_dimThe reduced dimension of the space.
dimThe full dimension of the space.
spacedimThe spatial dimension.
n_componentsThe number of components in the system.

Definition at line 147 of file tensor_product_space.h.

Constructor & Destructor Documentation

◆ TensorProductSpace()

template<int reduced_dim, int dim, int spacedim, int n_components>
TensorProductSpace< reduced_dim, dim, spacedim, n_components >::TensorProductSpace ( const TensorProductSpaceParameters< reduced_dim, dim, spacedim, n_components > & par,
MPI_Comm mpi_communicator = MPI_COMM_WORLD )

Constructor for the TensorProductSpace class.

Initializes the tensor product space using the provided parameters.

Parameters
parThe parameters defining the tensor product space.

Definition at line 46 of file tensor_product_space.cc.

References dof_handler, fe, mpi_communicator, par, properties_dh, quadrature_formula, reference_cross_section, and triangulation.

Member Function Documentation

◆ compute_points_and_weights()

◆ get_dof_handler()

template<int reduced_dim, int dim, int spacedim, int n_components>
const DoFHandler< reduced_dim, spacedim > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_dof_handler ( ) const

Retrieves the DoFHandler for the reduced domain.

Returns
A constant reference to the DoFHandler object.

Definition at line 156 of file tensor_product_space.cc.

◆ get_dof_indices()

template<int reduced_dim, int dim, int spacedim, int n_components>
const std::vector< types::global_dof_index > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_dof_indices ( const types::global_cell_index cell_index) const

Definition at line 260 of file tensor_product_space.cc.

◆ get_locally_owned_qpoints()

template<int reduced_dim, int dim, int spacedim, int n_components>
const std::vector< Point< spacedim > > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_locally_owned_qpoints ( ) const

Return a vector of all quadrature points in the tensor product space that are locally owned by the reduced domain.

Returns
std::vector<Point<spacedim>>

Definition at line 170 of file tensor_product_space.cc.

References all_qpoints, mpi_communicator, and Utilities::MPI::sum().

◆ get_locally_owned_reduced_qpoints()

template<int reduced_dim, int dim, int spacedim, int n_components>
const std::vector< Point< spacedim > > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_locally_owned_reduced_qpoints ( ) const

Definition at line 200 of file tensor_product_space.cc.

◆ get_locally_owned_reduced_weights()

template<int reduced_dim, int dim, int spacedim, int n_components>
const std::vector< std::vector< double > > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_locally_owned_reduced_weights ( ) const

Definition at line 216 of file tensor_product_space.cc.

◆ get_locally_owned_section_measure()

template<int reduced_dim, int dim, int spacedim, int n_components>
const std::vector< std::vector< double > > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_locally_owned_section_measure ( ) const

◆ get_locally_owned_weights()

template<int reduced_dim, int dim, int spacedim, int n_components>
const std::vector< std::vector< double > > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_locally_owned_weights ( ) const

Definition at line 186 of file tensor_product_space.cc.

References all_weights.

◆ get_properties()

template<int reduced_dim, int dim, int spacedim, int n_components>
const LinearAlgebra::distributed::Vector< double > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_properties ( ) const

Definition at line 505 of file tensor_product_space.cc.

References properties.

Referenced by get_locally_owned_section_measure().

◆ get_properties_dh() [1/2]

template<int reduced_dim, int dim, int spacedim, int n_components>
DoFHandler< reduced_dim, spacedim > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_properties_dh ( )

Definition at line 521 of file tensor_product_space.cc.

References properties_dh.

◆ get_properties_dh() [2/2]

template<int reduced_dim, int dim, int spacedim, int n_components>
const DoFHandler< reduced_dim, spacedim > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_properties_dh ( ) const

Definition at line 513 of file tensor_product_space.cc.

References properties_dh.

Referenced by get_locally_owned_section_measure().

◆ get_properties_names() [1/2]

template<int reduced_dim, int dim, int spacedim, int n_components>
std::vector< std::string > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_properties_names ( )

Definition at line 537 of file tensor_product_space.cc.

References properties_names.

◆ get_properties_names() [2/2]

template<int reduced_dim, int dim, int spacedim, int n_components>
const std::vector< std::string > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_properties_names ( ) const

Definition at line 529 of file tensor_product_space.cc.

References properties_names.

Referenced by get_locally_owned_section_measure().

◆ get_quadrature()

template<int reduced_dim, int dim, int spacedim, int n_components>
auto TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_quadrature ( ) const -> const QGauss<reduced_dim> &

Retrieve the quadrature formula used in the reduced domain.

Returns
A constant reference to the quadrature formula.

Definition at line 386 of file tensor_product_space.cc.

References quadrature_formula.

Referenced by compute_points_and_weights().

◆ get_reference_cross_section()

template<int reduced_dim, int dim, int spacedim, int n_components>
const ReferenceCrossSection< dim - reduced_dim, spacedim, n_components > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_reference_cross_section ( ) const

Retrieves the reference cross-section.

Returns
A constant reference to the reference cross-section object.

Definition at line 86 of file tensor_product_space.cc.

References reference_cross_section.

◆ get_scaling()

template<int reduced_dim, int dim, int spacedim, int n_components>
double TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_scaling ( const unsigned int ) const

Definition at line 497 of file tensor_product_space.cc.

References par, and std::pow().

Referenced by get_locally_owned_section_measure().

◆ get_triangulation()

template<int reduced_dim, int dim, int spacedim, int n_components>
const parallel::fullydistributed::Triangulation< reduced_dim, spacedim > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_triangulation ( ) const

Definition at line 489 of file tensor_product_space.cc.

References triangulation.

Referenced by get_locally_owned_section_measure().

◆ initialize()

template<int reduced_dim, int dim, int spacedim, int n_components>
void TensorProductSpace< reduced_dim, dim, spacedim, n_components >::initialize ( )

Initializes the tensor product space.

This function sets up the necessary components, such as the DoFHandler and finite element system.

Definition at line 66 of file tensor_product_space.cc.

References compute_points_and_weights(), make_reduced_grid_and_properties(), reference_cross_section, setup_dofs(), and triangulation.

◆ local_q_point_indices_to_global_cell_indices()

template<int reduced_dim, int dim, int spacedim, int n_components>
std::map< unsigned int, IndexSet > TensorProductSpace< reduced_dim, dim, spacedim, n_components >::local_q_point_indices_to_global_cell_indices ( const std::map< unsigned int, IndexSet > & local_q_point_indices) const
protected

Given a map of processor to local quadrature point indices, return a map of processor to the corresponding global cell indices.

Definition at line 301 of file tensor_product_space.cc.

Referenced by get_locally_owned_section_measure().

◆ locally_owned_qpoints()

template<int reduced_dim, int dim, int spacedim, int n_components>
IndexSet TensorProductSpace< reduced_dim, dim, spacedim, n_components >::locally_owned_qpoints ( ) const

Return the indices of the quadrature points that are locally owned by the reduced domain.

Returns
IndexSet

Definition at line 350 of file tensor_product_space.cc.

References quadrature_formula, reference_cross_section, IndexSet::tensor_product(), and triangulation.

◆ locally_relevant_indices()

template<int reduced_dim, int dim, int spacedim, int n_components>
IndexSet TensorProductSpace< reduced_dim, dim, spacedim, n_components >::locally_relevant_indices ( ) const

Return the indices of the cells that are required to assemble the coupling matrix.

Returns
IndexSet

Definition at line 372 of file tensor_product_space.cc.

References IndexSet::add_index(), IndexSet::compress(), global_cell_to_dof_indices, and triangulation.

◆ make_reduced_grid_and_properties()

template<int reduced_dim, int dim, int spacedim, int n_components>
void TensorProductSpace< reduced_dim, dim, spacedim, n_components >::make_reduced_grid_and_properties ( )

◆ particle_id_to_cell_and_qpoint_indices()

template<int reduced_dim, int dim, int spacedim, int n_components>
std::tuple< unsigned int, unsigned int, unsigned int > TensorProductSpace< reduced_dim, dim, spacedim, n_components >::particle_id_to_cell_and_qpoint_indices ( const unsigned int qpoint_index) const

Convert a global particle id to a global cell index, and the local quadrature indices on the reduce triangulation and on the cross-section.

Parameters
particle_idThe global particle id.
Returns
std::tuple<unsigned int, unsigned int, unsigned int> cell_index, q_index, qpoint_index_in_section

Definition at line 273 of file tensor_product_space.cc.

References quadrature_formula, and triangulation.

◆ setup_dofs()

template<int reduced_dim, int dim, int spacedim, int n_components>
void TensorProductSpace< reduced_dim, dim, spacedim, n_components >::setup_dofs ( )
protected

Sets up the degrees of freedom (DoFs) for the reduced domain.

This function initializes the DoFHandler and associates it with the finite element system.

Definition at line 334 of file tensor_product_space.cc.

References dof_handler, fe, and global_cell_to_dof_indices.

Referenced by get_locally_owned_section_measure(), and initialize().

◆ update_local_dof_indices()

template<int reduced_dim, int dim, int spacedim, int n_components>
void TensorProductSpace< reduced_dim, dim, spacedim, n_components >::update_local_dof_indices ( const std::map< unsigned int, IndexSet > & remote_q_point_indices)

Update the relevant local dof_indices.

After inserting global particles, this function updates the indices that are required to assemble the coupling matrix.

Definition at line 232 of file tensor_product_space.cc.

Member Data Documentation

◆ all_qpoints

template<int reduced_dim, int dim, int spacedim, int n_components>
std::vector<Point<spacedim> > TensorProductSpace< reduced_dim, dim, spacedim, n_components >::all_qpoints
protected

◆ all_weights

template<int reduced_dim, int dim, int spacedim, int n_components>
std::vector<std::vector<double> > TensorProductSpace< reduced_dim, dim, spacedim, n_components >::all_weights
protected

◆ cross_section_dim

template<int reduced_dim, int dim, int spacedim, int n_components>
int TensorProductSpace< reduced_dim, dim, spacedim, n_components >::cross_section_dim = dim - reduced_dim
staticconstexpr

The dimension of the cross-section of the reduced domain.

This is computed as the difference between the full dimension and the reduced dimension.

Definition at line 168 of file tensor_product_space.h.

◆ dof_handler

template<int reduced_dim, int dim, int spacedim, int n_components>
DoFHandler<reduced_dim, spacedim> TensorProductSpace< reduced_dim, dim, spacedim, n_components >::dof_handler
protected

The DoFHandler for the reduced domain.

This object manages the degrees of freedom for the reduced-dimensional domain.

Definition at line 375 of file tensor_product_space.h.

Referenced by setup_dofs(), and TensorProductSpace().

◆ fe

template<int reduced_dim, int dim, int spacedim, int n_components>
FESystem<reduced_dim, spacedim> TensorProductSpace< reduced_dim, dim, spacedim, n_components >::fe
protected

The finite element system used for the reduced domain.

This object defines the finite element basis functions for the reduced-dimensional domain.

Definition at line 362 of file tensor_product_space.h.

Referenced by compute_points_and_weights(), setup_dofs(), and TensorProductSpace().

◆ global_cell_to_dof_indices

template<int reduced_dim, int dim, int spacedim, int n_components>
std::map<types::global_cell_index, std::vector<types::global_dof_index> > TensorProductSpace< reduced_dim, dim, spacedim, n_components >::global_cell_to_dof_indices
protected

Mapping from global cell index to dof indices.

Definition at line 381 of file tensor_product_space.h.

Referenced by locally_relevant_indices(), and setup_dofs().

◆ mpi_communicator

template<int reduced_dim, int dim, int spacedim, int n_components>
MPI_Comm TensorProductSpace< reduced_dim, dim, spacedim, n_components >::mpi_communicator
protected

The MPI communicator for parallel processing.

This object is used to manage communication between different processes in a parallel environment.

Definition at line 329 of file tensor_product_space.h.

Referenced by get_locally_owned_qpoints(), make_reduced_grid_and_properties(), and TensorProductSpace().

◆ par

template<int reduced_dim, int dim, int spacedim, int n_components>
const TensorProductSpaceParameters<reduced_dim, dim, spacedim, n_components>& TensorProductSpace< reduced_dim, dim, spacedim, n_components >::par
protected

The parameters defining the tensor product space.

This object contains all the necessary configuration for the tensor product space.

Definition at line 338 of file tensor_product_space.h.

Referenced by compute_points_and_weights(), get_scaling(), make_reduced_grid_and_properties(), and TensorProductSpace().

◆ properties

template<int reduced_dim, int dim, int spacedim, int n_components>
LinearAlgebra::distributed::Vector<double> TensorProductSpace< reduced_dim, dim, spacedim, n_components >::properties
protected

The properties of the inclusion.

Definition at line 392 of file tensor_product_space.h.

Referenced by compute_points_and_weights(), get_properties(), and make_reduced_grid_and_properties().

◆ properties_dh

template<int reduced_dim, int dim, int spacedim, int n_components>
DoFHandler<reduced_dim, spacedim> TensorProductSpace< reduced_dim, dim, spacedim, n_components >::properties_dh
protected

The finite element system used for the properties of the inclusion.

Definition at line 397 of file tensor_product_space.h.

Referenced by compute_points_and_weights(), get_properties_dh(), get_properties_dh(), make_reduced_grid_and_properties(), and TensorProductSpace().

◆ properties_names

template<int reduced_dim, int dim, int spacedim, int n_components>
std::vector<std::string> TensorProductSpace< reduced_dim, dim, spacedim, n_components >::properties_names
protected

The names of the properties stored in the input file.

Definition at line 402 of file tensor_product_space.h.

Referenced by compute_points_and_weights(), get_properties_names(), get_properties_names(), and make_reduced_grid_and_properties().

◆ quadrature_formula

template<int reduced_dim, int dim, int spacedim, int n_components>
QGauss<reduced_dim> TensorProductSpace< reduced_dim, dim, spacedim, n_components >::quadrature_formula
protected

The quadrature formula used for integration in the reduced domain.

Definition at line 367 of file tensor_product_space.h.

Referenced by compute_points_and_weights(), get_quadrature(), locally_owned_qpoints(), particle_id_to_cell_and_qpoint_indices(), and TensorProductSpace().

◆ reduced_qpoints

template<int reduced_dim, int dim, int spacedim, int n_components>
std::vector<Point<spacedim> > TensorProductSpace< reduced_dim, dim, spacedim, n_components >::reduced_qpoints
protected

Definition at line 386 of file tensor_product_space.h.

Referenced by compute_points_and_weights().

◆ reduced_weights

template<int reduced_dim, int dim, int spacedim, int n_components>
std::vector<std::vector<double> > TensorProductSpace< reduced_dim, dim, spacedim, n_components >::reduced_weights
protected

Definition at line 387 of file tensor_product_space.h.

Referenced by compute_points_and_weights().

◆ reference_cross_section

template<int reduced_dim, int dim, int spacedim, int n_components>
ReferenceCrossSection<cross_section_dim, spacedim, n_components> TensorProductSpace< reduced_dim, dim, spacedim, n_components >::reference_cross_section
protected

The reference cross-section for the reduced domain.

This object represents the cross-section of the reduced-dimensional domain.

Definition at line 346 of file tensor_product_space.h.

Referenced by compute_points_and_weights(), get_reference_cross_section(), initialize(), locally_owned_qpoints(), and TensorProductSpace().

◆ set_partitioner

template<int reduced_dim, int dim, int spacedim, int n_components>
std::function<void( parallel::fullydistributed::Triangulation<reduced_dim, spacedim> &)> TensorProductSpace< reduced_dim, dim, spacedim, n_components >::set_partitioner = [](auto &) {}

Modify the partitioner for the triangulation.

This function is used to generate a fully distributed triangulation from a serial triangulation. The user can overload the default behavior to partition the grid differently. This function is called after the serial triangulation is generated, and before the triangulation is copied to the fully distributed triangulation.

Definition at line 181 of file tensor_product_space.h.

Referenced by make_reduced_grid_and_properties().

◆ triangulation

template<int reduced_dim, int dim, int spacedim, int n_components>
parallel::fullydistributed::Triangulation<reduced_dim, spacedim> TensorProductSpace< reduced_dim, dim, spacedim, n_components >::triangulation
protected

The triangulation representing the reduced domain.

This object holds the mesh for the reduced-dimensional domain.

Definition at line 354 of file tensor_product_space.h.

Referenced by compute_points_and_weights(), get_triangulation(), initialize(), locally_owned_qpoints(), locally_relevant_indices(), make_reduced_grid_and_properties(), particle_id_to_cell_and_qpoint_indices(), and TensorProductSpace().


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