#include <tensor_product_space.h>
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, IndexSet > | local_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 |
A class representing a tensor product space combining a lower-dimensional triangulation and a reference cross-section.
reduced_dim | The dimension of the reduced triangulation. |
dim | The dimension of the full-order object. |
spacedim | The dimension of the ambient space |
n_components | The 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.
reduced_dim | The reduced dimension of the space. |
dim | The full dimension of the space. |
spacedim | The spatial dimension. |
n_components | The number of components in the system. |
Definition at line 147 of file tensor_product_space.h.
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.
par | The 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.
void TensorProductSpace< reduced_dim, dim, spacedim, n_components >::compute_points_and_weights | ( | ) |
Definition at line 394 of file tensor_product_space.cc.
References all_qpoints, all_weights, fe, FEValues< int dim, int spacedim >::get_function_values(), FEValues< int dim, int spacedim >::get_JxW_values(), get_quadrature(), FEValues< int dim, int spacedim >::get_quadrature_points(), numbers::invalid_unsigned_int, FEValues< int dim, int spacedim >::JxW(), FEValues< int dim, int spacedim >::normal_vector(), par, properties, properties_dh, properties_names, quadrature_formula, FEValues< int dim, int spacedim >::quadrature_point_indices(), reduced_qpoints, reduced_weights, reference_cross_section, FEValues< int dim, int spacedim >::reinit(), and triangulation.
Referenced by get_locally_owned_section_measure(), and initialize().
const DoFHandler< reduced_dim, spacedim > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_dof_handler | ( | ) | const |
Retrieves the DoFHandler for the reduced domain.
Definition at line 156 of file tensor_product_space.cc.
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.
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.
Definition at line 170 of file tensor_product_space.cc.
References all_qpoints, mpi_communicator, and Utilities::MPI::sum().
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.
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.
const std::vector< std::vector< double > > & TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_locally_owned_section_measure | ( | ) | const |
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.
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().
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.
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().
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.
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().
auto TensorProductSpace< reduced_dim, dim, spacedim, n_components >::get_quadrature | ( | ) | const -> const QGauss<reduced_dim> & |
Retrieve the quadrature formula used in the reduced domain.
Definition at line 386 of file tensor_product_space.cc.
References quadrature_formula.
Referenced by compute_points_and_weights().
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.
Definition at line 86 of file tensor_product_space.cc.
References reference_cross_section.
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().
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().
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.
|
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().
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.
Definition at line 350 of file tensor_product_space.cc.
References quadrature_formula, reference_cross_section, IndexSet::tensor_product(), and triangulation.
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.
Definition at line 372 of file tensor_product_space.cc.
References IndexSet::add_index(), IndexSet::compress(), global_cell_to_dof_indices, and triangulation.
void TensorProductSpace< reduced_dim, dim, spacedim, n_components >::make_reduced_grid_and_properties | ( | ) |
Definition at line 94 of file tensor_product_space.cc.
References DoFTools::extract_locally_relevant_dofs(), DoFHandler< int dim, int spacedim >::get_fe(), Vector< typename Number >::l2_norm(), mpi_communicator, DoFHandler< int dim, int spacedim >::n_dofs(), par, properties, properties_dh, properties_names, set_partitioner, Utilities::MPI::this_mpi_process(), and triangulation.
Referenced by initialize().
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.
particle_id | The global particle id. |
Definition at line 273 of file tensor_product_space.cc.
References quadrature_formula, and triangulation.
|
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().
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.
|
protected |
Definition at line 383 of file tensor_product_space.h.
Referenced by compute_points_and_weights(), and get_locally_owned_qpoints().
|
protected |
Definition at line 384 of file tensor_product_space.h.
Referenced by compute_points_and_weights(), and get_locally_owned_weights().
|
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.
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
protected |
Definition at line 386 of file tensor_product_space.h.
Referenced by compute_points_and_weights().
|
protected |
Definition at line 387 of file tensor_product_space.h.
Referenced by compute_points_and_weights().
|
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().
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().
|
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().