![]() |
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 33 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 45 of file LocalToGlobalIndexMap.h.
Definition at line 44 of file LocalToGlobalIndexMap.h.
|
private |
Definition at line 190 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 98 of file LocalToGlobalIndexMap.cpp.
References LocalToGlobalIndexMap(), and size().
Referenced by LocalToGlobalIndexMap(), and operator<<.
| 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 106 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _mesh_subsets, _variable_component_offsets, 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 136 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _mesh_subsets, _rows, _variable_component_offsets, 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 183 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _mesh_subsets, _variable_component_offsets, and findGlobalIndices().
| 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 217 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _mesh_subsets, _variable_component_offsets, DBUG(), getGlobalComponent(), 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::createBoundaryDOFTable(), ProcessLib::createReleaseNodalForce(), 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 260 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _mesh_subsets, _variable_component_offsets, DBUG(), and getNumberOfGlobalComponents().
| std::size_t NumLib::LocalToGlobalIndexMap::dofSizeWithGhosts | ( | ) | const |
Returns total number of degrees of freedom including those located in the ghost nodes.
Definition at line 295 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map.
| 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 300 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map.
|
private |
Definition at line 55 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _mesh_subsets, _rows, and MeshLib::Node.
Referenced by LocalToGlobalIndexMap(), and LocalToGlobalIndexMap().
|
private |
Definition at line 20 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, _rows, and MeshLib::Node.
Referenced by LocalToGlobalIndexMap().
| std::vector< int > NumLib::LocalToGlobalIndexMap::getElementVariableIDs | ( | std::size_t const | mesh_item_id | ) | const |
Definition at line 361 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 405 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map.
| 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 13 of file LocalToGlobalIndexMap.cpp.
References _variable_component_offsets.
Referenced by LocalToGlobalIndexMap(), LocalToGlobalIndexMap(), ProcessLib::BoundaryConditionAndSourceTerm::Python::collectDofsToMatrix(), ProcessLib::createPythonBoundaryCondition(), deriveBoundaryConstrainedMap(), getElementVariableIDs(), getGlobalIndex(), NumLib::getIndices(), and getMeshSubset().
| GlobalIndexType NumLib::LocalToGlobalIndexMap::getGlobalIndex | ( | MeshLib::Location const & | l, |
| int const | global_component_id ) const |
Definition at line 391 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map.
| GlobalIndexType NumLib::LocalToGlobalIndexMap::getGlobalIndex | ( | MeshLib::Location const & | l, |
| int const | variable_id, | ||
| int const | component_id ) const |
Definition at line 382 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map, and getGlobalComponent().
Referenced by anonymous_namespace{CollectAndInterpolateNodalDof.cpp}::collectDofsToMatrixSingleComponentForSomeNodes(), ProcessLib::getEssentialBCValuesLocal(), NumLib::getIndices(), NumLib::getNodalValue(), NumLib::getNonGhostNodalValue(), 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 398 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map.
| 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 413 of file LocalToGlobalIndexMap.cpp.
References _mesh_component_map.
Referenced by getIndexForComponentInSolutionVector().
| MeshLib::MeshSubset const & NumLib::LocalToGlobalIndexMap::getMeshSubset | ( | int const | global_component_id | ) | const |
Definition at line 427 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 421 of file LocalToGlobalIndexMap.cpp.
References getGlobalComponent(), and getMeshSubset().
Referenced by addPrimaryVariablesToMesh(), ProcessLib::createSourceTerm(), NumLib::getIndices(), getMeshSubset(), NumLib::anonymous_namespace{DOFTableUtil.cpp}::norm(), NumLib::transformVariableFromGlobalVector(), and NumLib::transformVariableFromGlobalVector().
| std::size_t NumLib::LocalToGlobalIndexMap::getNumberOfElementComponents | ( | std::size_t const | mesh_item_id | ) | const |
| std::size_t NumLib::LocalToGlobalIndexMap::getNumberOfElementDOF | ( | std::size_t const | mesh_item_id | ) | const |
| int NumLib::LocalToGlobalIndexMap::getNumberOfGlobalComponents | ( | ) | const |
Definition at line 317 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(), and operator<<.
| int NumLib::LocalToGlobalIndexMap::getNumberOfVariableComponents | ( | int | variable_id | ) | const |
Definition at line 310 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::createReleaseNodalForce(), ProcessLib::createSourceTerm(), getElementVariableIDs(), NumLib::transformVariableFromGlobalVector(), and NumLib::transformVariableFromGlobalVector().
| int NumLib::LocalToGlobalIndexMap::getNumberOfVariables | ( | ) | const |
Definition at line 305 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 327 of file LocalToGlobalIndexMap.cpp.
| std::size_t NumLib::LocalToGlobalIndexMap::size | ( | ) | const |
Definition at line 322 of file LocalToGlobalIndexMap.cpp.
References _rows.
Referenced by LocalToGlobalIndexMap(), ProcessLib::BoundaryConditionAndSourceTerm::Python::BcAndStLocalAssemblerImpl< BcOrStData, ShapeFunction, LowerOrderShapeFunction, GlobalDim >::assemble(), NumLib::getIndices(), NumLib::getRowColumnIndices(), and operator<<.
|
friend |
Prints first rows of the table, every line, and the mesh component map.
Definition at line 434 of file LocalToGlobalIndexMap.cpp.
References LocalToGlobalIndexMap(), _mesh_component_map, _rows, getNumberOfGlobalComponents(), and size().
|
private |
Definition at line 188 of file LocalToGlobalIndexMap.h.
Referenced by LocalToGlobalIndexMap(), LocalToGlobalIndexMap(), LocalToGlobalIndexMap(), deriveBoundaryConstrainedMap(), deriveBoundaryConstrainedMap(), dofSizeWithGhosts(), dofSizeWithoutGhosts(), findGlobalIndices(), findGlobalIndicesWithElementID(), getGhostIndices(), getGlobalIndex(), getGlobalIndex(), getGlobalIndices(), getLocalIndex(), and operator<<.
|
private |
A vector of mesh subsets for each process variables' components.
Definition at line 187 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 196 of file LocalToGlobalIndexMap.h.
Referenced by LocalToGlobalIndexMap(), findGlobalIndices(), findGlobalIndicesWithElementID(), getElementVariableIDs(), getNumberOfElementComponents(), getNumberOfElementDOF(), operator()(), operator<<, and size().
|
private |
Definition at line 201 of file LocalToGlobalIndexMap.h.
Referenced by LocalToGlobalIndexMap(), LocalToGlobalIndexMap(), LocalToGlobalIndexMap(), deriveBoundaryConstrainedMap(), deriveBoundaryConstrainedMap(), getGlobalComponent(), getNumberOfVariableComponents(), and getNumberOfVariables().