OGS
|
Row and column indices in global linear algebra objects for each mesh item.
The row and column indices in global matrix and rhs vector for example, required for addition of local contributions from every mesh item (like node or cell) to global objects.
The number of rows should be equal to the number of mesh items and the number of columns should be equal to the number of the components on that mesh item.
Definition at line 40 of file LocalToGlobalIndexMap.h.
#include <LocalToGlobalIndexMap.h>
Classes | |
struct | ConstructorTag |
Public Types | |
using | RowColumnIndices = MathLib::RowColumnIndices<GlobalIndexType> |
using | LineIndex = RowColumnIndices::LineIndex |
Public Member Functions | |
LocalToGlobalIndexMap (std::vector< MeshLib::MeshSubset > &&mesh_subsets, NumLib::ComponentOrder const order) | |
LocalToGlobalIndexMap (std::vector< MeshLib::MeshSubset > &&mesh_subsets, std::vector< int > const &vec_var_n_components, NumLib::ComponentOrder const order) | |
LocalToGlobalIndexMap (std::vector< MeshLib::MeshSubset > &&mesh_subsets, std::vector< int > const &vec_var_n_components, std::vector< std::vector< MeshLib::Element * > const * > const &vec_var_elements, NumLib::ComponentOrder const order) | |
std::unique_ptr< LocalToGlobalIndexMap > | deriveBoundaryConstrainedMap (int const variable_id, std::vector< int > const &component_ids, MeshLib::MeshSubset &&new_mesh_subset) const |
std::unique_ptr< LocalToGlobalIndexMap > | deriveBoundaryConstrainedMap (MeshLib::MeshSubset &&new_mesh_subset) const |
std::size_t | dofSizeWithGhosts () const |
std::size_t | dofSizeWithoutGhosts () const |
std::size_t | size () const |
int | getNumberOfVariables () const |
int | getNumberOfVariableComponents (int variable_id) const |
int | getNumberOfGlobalComponents () const |
RowColumnIndices | operator() (std::size_t const mesh_item_id, const int global_component_id) const |
std::size_t | getNumberOfElementDOF (std::size_t const mesh_item_id) const |
std::size_t | getNumberOfElementComponents (std::size_t const mesh_item_id) const |
std::vector< int > | getElementVariableIDs (std::size_t const mesh_item_id) const |
GlobalIndexType | getGlobalIndex (MeshLib::Location const &l, int const variable_id, int const component_id) const |
GlobalIndexType | getGlobalIndex (MeshLib::Location const &l, int const global_component_id) const |
std::vector< GlobalIndexType > | getGlobalIndices (const MeshLib::Location &l) const |
Forwards the respective method from MeshComponentMap. | |
std::vector< GlobalIndexType > const & | getGhostIndices () const |
Get ghost indices, forwarded from MeshComponentMap. | |
GlobalIndexType | getLocalIndex (MeshLib::Location const &l, std::size_t const comp_id, std::size_t const range_begin, std::size_t const range_end) const |
MeshLib::MeshSubset const & | getMeshSubset (int const variable_id, int const component_id) const |
MeshLib::MeshSubset const & | getMeshSubset (int const global_component_id) const |
int | getGlobalComponent (int const variable_id, int const component_id) const |
LocalToGlobalIndexMap (std::vector< MeshLib::MeshSubset > &&mesh_subsets, std::vector< int > const &global_component_ids, std::vector< int > const &variable_component_offsets, std::vector< MeshLib::Element * > const &elements, NumLib::MeshComponentMap &&mesh_component_map, ConstructorTag) | |
Private Types | |
using | Table |
Private Member Functions | |
template<typename ElementIterator > | |
void | findGlobalIndices (ElementIterator first, ElementIterator last, std::vector< MeshLib::Node * > const &nodes, std::size_t const mesh_id, const int comp_id, const int comp_id_write) |
template<typename ElementIterator > | |
void | findGlobalIndicesWithElementID (ElementIterator first, ElementIterator last, std::vector< MeshLib::Node * > const &nodes, std::size_t const mesh_id, const int comp_id, const int comp_id_write) |
Private Attributes | |
std::vector< MeshLib::MeshSubset > | _mesh_subsets |
A vector of mesh subsets for each process variables' components. | |
NumLib::MeshComponentMap | _mesh_component_map |
Table | _rows |
Table const & | _columns = _rows |
std::vector< int > const | _variable_component_offsets |
Friends | |
std::ostream & | operator<< (std::ostream &os, LocalToGlobalIndexMap const &map) |
Prints first rows of the table, every line, and the mesh component map. | |
Definition at line 52 of file LocalToGlobalIndexMap.h.
Definition at line 51 of file LocalToGlobalIndexMap.h.
|
private |
Definition at line 197 of file LocalToGlobalIndexMap.h.
NumLib::LocalToGlobalIndexMap::LocalToGlobalIndexMap | ( | std::vector< MeshLib::MeshSubset > && | mesh_subsets, |
NumLib::ComponentOrder const | order ) |
Creates a MeshComponentMap internally and stores the global indices for each mesh element of the given mesh_subsets.
Definition at line 105 of file LocalToGlobalIndexMap.cpp.
NumLib::LocalToGlobalIndexMap::LocalToGlobalIndexMap | ( | std::vector< MeshLib::MeshSubset > && | mesh_subsets, |
std::vector< int > const & | vec_var_n_components, | ||
NumLib::ComponentOrder const | order ) |
Creates a MeshComponentMap internally and stores the global indices for each mesh element of the given mesh_subsets.
mesh_subsets | a vector of components |
vec_var_n_components | a vector of the number of variable components. The size of the vector should be equal to the number of variables. Sum of the entries should be equal to the size of the mesh_subsets. |
order | type of ordering values in a vector |
Definition at line 113 of file LocalToGlobalIndexMap.cpp.
References _mesh_subsets, findGlobalIndices(), and getGlobalComponent().
NumLib::LocalToGlobalIndexMap::LocalToGlobalIndexMap | ( | std::vector< MeshLib::MeshSubset > && | mesh_subsets, |
std::vector< int > const & | vec_var_n_components, | ||
std::vector< std::vector< MeshLib::Element * > const * > const & | vec_var_elements, | ||
NumLib::ComponentOrder const | order ) |
Creates a MeshComponentMap internally and stores the global indices for the given mesh elements
mesh_subsets | a vector of components |
vec_var_n_components | a vector of the number of variable components. The size of the vector should be equal to the number of variables. Sum of the entries should be equal to the size of the mesh_subsets. |
vec_var_elements | a vector of active mesh elements for each variable. |
order | type of ordering values in a vector |
Definition at line 143 of file LocalToGlobalIndexMap.cpp.
References _mesh_subsets, _rows, findGlobalIndicesWithElementID(), and getGlobalComponent().
|
explicit |
Private constructor (ensured by ConstructorTag) used by internally created local-to-global index maps. The mesh_component_map is passed as argument instead of being created by the constructor.
Definition at line 190 of file LocalToGlobalIndexMap.cpp.
References _mesh_subsets, findGlobalIndices(), and OGS_FATAL.
std::unique_ptr< LocalToGlobalIndexMap > NumLib::LocalToGlobalIndexMap::deriveBoundaryConstrainedMap | ( | int const | variable_id, |
std::vector< int > const & | component_ids, | ||
MeshLib::MeshSubset && | new_mesh_subset ) const |
Derive a LocalToGlobalIndexMap constrained to the mesh subset and mesh subset's elements. A new mesh component map will be constructed using the passed mesh_subset for the given variable and component ids.
Definition at line 224 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _mesh_subsets, _variable_component_offsets, DBUG(), getGlobalComponent(), NumLib::MeshComponentMap::getSubset(), and OGS_FATAL.
Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), ProcessLib::DirichletBoundaryCondition::DirichletBoundaryCondition(), ProcessLib::PrimaryVariableConstraintDirichletBoundaryCondition::PrimaryVariableConstraintDirichletBoundaryCondition(), ProcessLib::PythonBoundaryCondition::PythonBoundaryCondition(), ProcessLib::SolutionDependentDirichletBoundaryCondition::SolutionDependentDirichletBoundaryCondition(), anonymous_namespace{ProcessOutputData.cpp}::computeDofTablesForSubmesh(), ProcessLib::DeactivatedSubdomainDirichlet::config(), ProcessLib::DirichletBoundaryConditionWithinTimeInterval::config(), ProcessLib::createSourceTerm(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), and ProcessLib::createWellboreCompensateNeumannBoundaryCondition().
std::unique_ptr< LocalToGlobalIndexMap > NumLib::LocalToGlobalIndexMap::deriveBoundaryConstrainedMap | ( | MeshLib::MeshSubset && | new_mesh_subset | ) | const |
Derive a LocalToGlobalIndexMap constrained to the mesh subset and mesh subset's elements. A new mesh component map will be constructed using the passed mesh_subset for all variables and components of the current LocalToGlobalIndexMap.
Definition at line 267 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _mesh_subsets, _variable_component_offsets, DBUG(), getNumberOfGlobalComponents(), and NumLib::MeshComponentMap::getSubset().
std::size_t NumLib::LocalToGlobalIndexMap::dofSizeWithGhosts | ( | ) | const |
Returns total number of degrees of freedom including those located in the ghost nodes.
Definition at line 302 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, and NumLib::MeshComponentMap::dofSizeWithGhosts().
std::size_t NumLib::LocalToGlobalIndexMap::dofSizeWithoutGhosts | ( | ) | const |
Returns total number of local degrees of freedom of the present rank, which does not count the unknowns associated with ghost nodes (for DDC with node-wise mesh partitioning).
Definition at line 307 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, and NumLib::MeshComponentMap::dofSizeWithoutGhosts().
Referenced by NumLib::LocalLinearLeastSquaresExtrapolator::extrapolate().
|
private |
Definition at line 62 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _mesh_subsets, _rows, NumLib::MeshComponentMap::getGlobalIndex(), and MeshLib::Node.
Referenced by LocalToGlobalIndexMap(), and LocalToGlobalIndexMap().
|
private |
Definition at line 27 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _rows, NumLib::MeshComponentMap::getGlobalIndex(), and MeshLib::Node.
Referenced by LocalToGlobalIndexMap().
std::vector< int > NumLib::LocalToGlobalIndexMap::getElementVariableIDs | ( | std::size_t const | mesh_item_id | ) | const |
Definition at line 368 of file LocalToGlobalIndexMap.cpp.
References _rows, getGlobalComponent(), getNumberOfVariableComponents(), and getNumberOfVariables().
std::vector< GlobalIndexType > const & NumLib::LocalToGlobalIndexMap::getGhostIndices | ( | ) | const |
Get ghost indices, forwarded from MeshComponentMap.
Definition at line 412 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, and NumLib::MeshComponentMap::getGhostIndices().
Referenced by NumLib::LocalLinearLeastSquaresExtrapolator::extrapolate().
int NumLib::LocalToGlobalIndexMap::getGlobalComponent | ( | int const | variable_id, |
int const | component_id ) const |
The global component id for the specific variable (like velocity) and a component (like x, or y, or z).
Definition at line 20 of file LocalToGlobalIndexMap.cpp.
References _variable_component_offsets.
Referenced by LocalToGlobalIndexMap(), LocalToGlobalIndexMap(), ProcessLib::BoundaryConditionAndSourceTerm::Python::collectDofsToMatrix(), ProcessLib::createPythonBoundaryCondition(), deriveBoundaryConstrainedMap(), getElementVariableIDs(), getGlobalIndex(), and getMeshSubset().
GlobalIndexType NumLib::LocalToGlobalIndexMap::getGlobalIndex | ( | MeshLib::Location const & | l, |
int const | global_component_id ) const |
Definition at line 398 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, and NumLib::MeshComponentMap::getGlobalIndex().
GlobalIndexType NumLib::LocalToGlobalIndexMap::getGlobalIndex | ( | MeshLib::Location const & | l, |
int const | variable_id, | ||
int const | component_id ) const |
Definition at line 389 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, getGlobalComponent(), and NumLib::MeshComponentMap::getGlobalIndex().
Referenced by anonymous_namespace{CollectAndInterpolateNodalDof.cpp}::collectDofsToMatrixSingleComponentForSomeNodes(), ProcessLib::getEssentialBCValuesLocal(), NumLib::getNodalValue(), NumLib::getNonGhostNodalValue(), ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::operator()(), ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::preTimestep(), NumLib::transformVariableFromGlobalVector(), and NumLib::transformVariableFromGlobalVector().
std::vector< GlobalIndexType > NumLib::LocalToGlobalIndexMap::getGlobalIndices | ( | const MeshLib::Location & | l | ) | const |
Forwards the respective method from MeshComponentMap.
Definition at line 405 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, and NumLib::MeshComponentMap::getGlobalIndices().
GlobalIndexType NumLib::LocalToGlobalIndexMap::getLocalIndex | ( | MeshLib::Location const & | l, |
std::size_t const | comp_id, | ||
std::size_t const | range_begin, | ||
std::size_t const | range_end ) const |
Computes the index in a local (for DDC) vector for a given location and component; forwarded from MeshComponentMap.
Definition at line 420 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, and NumLib::MeshComponentMap::getLocalIndex().
Referenced by getIndexForComponentInSolutionVector().
MeshLib::MeshSubset const & NumLib::LocalToGlobalIndexMap::getMeshSubset | ( | int const | global_component_id | ) | const |
Definition at line 434 of file LocalToGlobalIndexMap.cpp.
References _mesh_subsets.
MeshLib::MeshSubset const & NumLib::LocalToGlobalIndexMap::getMeshSubset | ( | int const | variable_id, |
int const | component_id ) const |
Definition at line 428 of file LocalToGlobalIndexMap.cpp.
References getGlobalComponent(), and getMeshSubset().
Referenced by addPrimaryVariablesToMesh(), ProcessLib::createSourceTerm(), getMeshSubset(), NumLib::anonymous_namespace{DOFTableUtil.cpp}::norm(), ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::operator()(), NumLib::transformVariableFromGlobalVector(), and NumLib::transformVariableFromGlobalVector().
std::size_t NumLib::LocalToGlobalIndexMap::getNumberOfElementComponents | ( | std::size_t const | mesh_item_id | ) | const |
Definition at line 354 of file LocalToGlobalIndexMap.cpp.
References _rows.
std::size_t NumLib::LocalToGlobalIndexMap::getNumberOfElementDOF | ( | std::size_t const | mesh_item_id | ) | const |
Definition at line 341 of file LocalToGlobalIndexMap.cpp.
References _rows.
Referenced by ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >::operator()(), and ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::operator()().
int NumLib::LocalToGlobalIndexMap::getNumberOfGlobalComponents | ( | ) | const |
Definition at line 324 of file LocalToGlobalIndexMap.cpp.
References _mesh_subsets.
Referenced by NumLib::LocalLinearLeastSquaresExtrapolator::LocalLinearLeastSquaresExtrapolator(), addPrimaryVariablesToMesh(), ProcessLib::BoundaryConditionAndSourceTerm::Python::BcAndStLocalAssemblerImpl< BcOrStData, ShapeFunction, LowerOrderShapeFunction, GlobalDim >::assemble(), ProcessLib::BoundaryConditionAndSourceTerm::Python::collectDofsToMatrix(), computeSparsityPatternPETSc(), deriveBoundaryConstrainedMap(), NumLib::getIndices(), NumLib::getRowColumnIndices(), NumLib::ConvergenceCriterionPerComponentDeltaX::setDOFTable(), and NumLib::ConvergenceCriterionPerComponentResidual::setDOFTable().
int NumLib::LocalToGlobalIndexMap::getNumberOfVariableComponents | ( | int | variable_id | ) | const |
Definition at line 317 of file LocalToGlobalIndexMap.cpp.
References _variable_component_offsets, and getNumberOfVariables().
Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::PhaseFieldIrreversibleDamageOracleBoundaryCondition(), anonymous_namespace{PythonBoundaryCondition.cpp}::checkConsistency(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), ProcessLib::BoundaryConditionAndSourceTerm::Python::collectDofsToMatrix(), ProcessLib::ProcessVariable::createBoundaryConditionsForDeactivatedSubDomains(), ProcessLib::createPythonBoundaryCondition(), ProcessLib::createSourceTerm(), getElementVariableIDs(), ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::operator()(), NumLib::transformVariableFromGlobalVector(), and NumLib::transformVariableFromGlobalVector().
int NumLib::LocalToGlobalIndexMap::getNumberOfVariables | ( | ) | const |
Definition at line 312 of file LocalToGlobalIndexMap.cpp.
References _variable_component_offsets.
Referenced by ProcessLib::ConstraintDirichletBoundaryCondition::ConstraintDirichletBoundaryCondition(), ProcessLib::PhaseFieldIrreversibleDamageOracleBoundaryCondition::PhaseFieldIrreversibleDamageOracleBoundaryCondition(), addPrimaryVariablesToMesh(), anonymous_namespace{PythonBoundaryCondition.cpp}::checkConsistency(), ProcessLib::checkParametersOfDirichletBoundaryCondition(), ProcessLib::BoundaryConditionAndSourceTerm::Python::collectDofsToMatrix(), ProcessLib::createPythonBoundaryCondition(), ProcessLib::createSourceTerm(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), ProcessLib::createWellboreCompensateNeumannBoundaryCondition(), getElementVariableIDs(), and getNumberOfVariableComponents().
LocalToGlobalIndexMap::RowColumnIndices NumLib::LocalToGlobalIndexMap::operator() | ( | std::size_t const | mesh_item_id, |
const int | global_component_id ) const |
Definition at line 334 of file LocalToGlobalIndexMap.cpp.
std::size_t NumLib::LocalToGlobalIndexMap::size | ( | ) | const |
Definition at line 329 of file LocalToGlobalIndexMap.cpp.
References _rows.
Referenced by ProcessLib::BoundaryConditionAndSourceTerm::Python::BcAndStLocalAssemblerImpl< BcOrStData, ShapeFunction, LowerOrderShapeFunction, GlobalDim >::assemble(), NumLib::LocalLinearLeastSquaresExtrapolator::calculateResiduals(), NumLib::getIndices(), and NumLib::getRowColumnIndices().
|
friend |
Prints first rows of the table, every line, and the mesh component map.
Definition at line 441 of file LocalToGlobalIndexMap.cpp.
|
private |
Definition at line 195 of file LocalToGlobalIndexMap.h.
Referenced by deriveBoundaryConstrainedMap(), deriveBoundaryConstrainedMap(), dofSizeWithGhosts(), dofSizeWithoutGhosts(), findGlobalIndices(), findGlobalIndicesWithElementID(), getGhostIndices(), getGlobalIndex(), getGlobalIndex(), getGlobalIndices(), and getLocalIndex().
|
private |
A vector of mesh subsets for each process variables' components.
Definition at line 194 of file LocalToGlobalIndexMap.h.
Referenced by LocalToGlobalIndexMap(), LocalToGlobalIndexMap(), LocalToGlobalIndexMap(), deriveBoundaryConstrainedMap(), deriveBoundaryConstrainedMap(), findGlobalIndices(), getMeshSubset(), and getNumberOfGlobalComponents().
|
private |
Table contains for each element (first index) and each component (second index) a vector (LineIndex
) of indices in the global stiffness matrix or vector
Definition at line 203 of file LocalToGlobalIndexMap.h.
Referenced by LocalToGlobalIndexMap(), findGlobalIndices(), findGlobalIndicesWithElementID(), getElementVariableIDs(), getNumberOfElementComponents(), getNumberOfElementDOF(), operator()(), and size().
|
private |
Definition at line 208 of file LocalToGlobalIndexMap.h.
Referenced by deriveBoundaryConstrainedMap(), deriveBoundaryConstrainedMap(), getGlobalComponent(), getNumberOfVariableComponents(), and getNumberOfVariables().