OGS
|
Multidirectional mapping between mesh entities and degrees of freedom.
Definition at line 29 of file MeshComponentMap.h.
#include <MeshComponentMap.h>
Public Types | |
using | Location = MeshLib::Location |
Public Member Functions | |
MeshComponentMap (std::vector< MeshLib::MeshSubset > const &components, ComponentOrder order) | |
MeshComponentMap | getSubset (std::vector< MeshLib::MeshSubset > const &bulk_mesh_subsets, MeshLib::MeshSubset const &new_mesh_subset) const |
std::size_t | dofSizeWithGhosts () const |
The number of dofs including the those located in the ghost nodes. | |
std::vector< int > | getComponentIDs (const Location &l) const |
GlobalIndexType | getGlobalIndex (Location const &l, int const comp_id) const |
std::vector< GlobalIndexType > | getGlobalIndices (const Location &l) const |
std::vector< GlobalIndexType > | getGlobalIndicesByLocation (const std::vector< Location > &ls) const |
std::vector< GlobalIndexType > | getGlobalIndicesByComponent (const std::vector< Location > &ls) const |
std::size_t | dofSizeWithoutGhosts () const |
std::vector< GlobalIndexType > const & | getGhostIndices () const |
Get ghost indices (for DDC). | |
GlobalIndexType | getLocalIndex (Location const &l, int const comp_id, std::size_t const range_begin, std::size_t const range_end) const |
const detail::ComponentGlobalIndexDict & | getDictionary () const |
Static Public Attributes | |
static constexpr NUMLIB_EXPORT GlobalIndexType const | nop |
Private Member Functions | |
MeshComponentMap (detail::ComponentGlobalIndexDict &dict) | |
Private constructor used by internally created mesh component maps. | |
void | renumberByLocation (GlobalIndexType offset=0) |
void | createSerialMeshComponentMap (std::vector< MeshLib::MeshSubset > const &components, ComponentOrder order) |
void | createParallelMeshComponentMap (std::vector< MeshLib::MeshSubset > const &components, ComponentOrder order) |
Private Attributes | |
detail::ComponentGlobalIndexDict | _dict |
std::size_t | _num_local_dof = 0 |
std::size_t | _num_global_dof = 0 |
Number of global unknowns. Used internally only. | |
std::vector< GlobalIndexType > | _ghosts_indices |
Global ID for ghost entries. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, MeshComponentMap const &m) |
Definition at line 32 of file MeshComponentMap.h.
NumLib::MeshComponentMap::MeshComponentMap | ( | std::vector< MeshLib::MeshSubset > const & | components, |
ComponentOrder | order ) |
components | a vector of components |
order | type of ordering values in a vector |
Definition at line 28 of file MeshComponentMap.cpp.
References createParallelMeshComponentMap(), createSerialMeshComponentMap(), and MeshLib::NodePartitionedMesh::isForSingleThread().
Referenced by getSubset().
|
inlineexplicitprivate |
Private constructor used by internally created mesh component maps.
Definition at line 157 of file MeshComponentMap.h.
|
private |
components | a vector of components |
order | type of ordering values in a vector |
Definition at line 384 of file MeshComponentMap.cpp.
References _dict, _ghosts_indices, _num_global_dof, _num_local_dof, NumLib::BY_LOCATION, MeshLib::Mesh::getElementsConnectedToNode(), NumLib::getGlobalIndexWithTaylorHoodElement(), MeshLib::NodePartitionedMesh::getGlobalNodeID(), MeshLib::NodePartitionedMesh::getNumberOfGlobalBaseNodes(), MeshLib::NodePartitionedMesh::getNumberOfGlobalNodes(), MeshLib::Mesh::getNumberOfNodes(), MeshLib::isBaseNode(), MeshLib::NodePartitionedMesh::isGhostNode(), MeshLib::Node, and OGS_FATAL.
Referenced by MeshComponentMap().
|
private |
components | a vector of components |
order | type of ordering values in a vector |
Definition at line 295 of file MeshComponentMap.cpp.
References _dict, _num_local_dof, NumLib::BY_LOCATION, MeshLib::views::ids, MeshLib::Node, and renumberByLocation().
Referenced by MeshComponentMap().
|
inline |
The number of dofs including the those located in the ghost nodes.
Definition at line 55 of file MeshComponentMap.h.
References _dict.
Referenced by NumLib::LocalToGlobalIndexMap::dofSizeWithGhosts().
|
inline |
Get the number of local unknowns excluding those associated with ghost nodes (for DDC with node-wise mesh partitioning).
Definition at line 118 of file MeshComponentMap.h.
References _num_local_dof.
Referenced by NumLib::LocalToGlobalIndexMap::dofSizeWithoutGhosts().
std::vector< int > NumLib::MeshComponentMap::getComponentIDs | ( | const Location & | l | ) | const |
Component ids at given location l
.
Location | ComponentID |
---|---|
l | comp_id_1 |
l | ... |
l | comp_id_n |
Definition at line 154 of file MeshComponentMap.cpp.
References _dict.
Referenced by getSubset().
|
inline |
|
inline |
Get ghost indices (for DDC).
Definition at line 121 of file MeshComponentMap.h.
References _ghosts_indices.
Referenced by NumLib::LocalToGlobalIndexMap::getGhostIndices().
GlobalIndexType NumLib::MeshComponentMap::getGlobalIndex | ( | Location const & | l, |
int const | comp_id ) const |
Global index of the given component id at given location l
.
Location | ComponentID | GlobalIndex |
---|---|---|
l | comp_id | gi |
Definition at line 166 of file MeshComponentMap.cpp.
Referenced by NumLib::LocalToGlobalIndexMap::findGlobalIndices(), NumLib::LocalToGlobalIndexMap::findGlobalIndicesWithElementID(), NumLib::LocalToGlobalIndexMap::getGlobalIndex(), NumLib::LocalToGlobalIndexMap::getGlobalIndex(), getLocalIndex(), and getSubset().
std::vector< GlobalIndexType > NumLib::MeshComponentMap::getGlobalIndices | ( | const Location & | l | ) | const |
Global indices for all components at the given location l
.
If there is more than one component at the given location, the function returns a vector containing global indices for each component.
Location | ComponentID | GlobalIndex |
---|---|---|
l | comp_id_1 | gi23 |
... | ... | ... |
l | comp_id_k | gi45 |
Definition at line 174 of file MeshComponentMap.cpp.
References _dict.
Referenced by NumLib::LocalToGlobalIndexMap::getGlobalIndices().
std::vector< GlobalIndexType > NumLib::MeshComponentMap::getGlobalIndicesByComponent | ( | const std::vector< Location > & | ls | ) | const |
Global indices for all components at all given locations ls
ordered by component ids. The return list is sorted first by component ids.
Location | ComponentID | GlobalIndex |
---|---|---|
l_1 | comp_id_1 | gi23 |
... | ... | ... |
l_k | comp_id_1 | gi45 |
l_1 | comp_id_2 | gi46 |
... | ... | ... |
l_m | comp_id_2 | gi78 |
... | ... | ... |
l_n | comp_id_n | gi89 |
Definition at line 209 of file MeshComponentMap.cpp.
References _dict.
std::vector< GlobalIndexType > NumLib::MeshComponentMap::getGlobalIndicesByLocation | ( | const std::vector< Location > & | ls | ) | const |
Global indices for all components at all given locations ls
ordered by location. The return list is sorted first by location.
Location | ComponentID | GlobalIndex |
---|---|---|
l_1 | comp_id_1 | gi23 |
... | ... | ... |
l_1 | comp_id_k | gi45 |
l_2 | comp_id_1 | gi46 |
... | ... | ... |
l_2 | comp_id_m | gi67 |
... | ... | ... |
l_n | comp_id_n | gi78 |
Definition at line 187 of file MeshComponentMap.cpp.
References _dict.
GlobalIndexType NumLib::MeshComponentMap::getLocalIndex | ( | Location const & | l, |
int 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. When domain decomposition is not used, it is equal to getGlobalIndex(). The range is needed to compute the offset for non-ghost locations and also to map ghost locations.
Definition at line 245 of file MeshComponentMap.cpp.
References _ghosts_indices, _num_global_dof, getGlobalIndex(), nop, and OGS_FATAL.
Referenced by NumLib::LocalToGlobalIndexMap::getLocalIndex().
MeshComponentMap NumLib::MeshComponentMap::getSubset | ( | std::vector< MeshLib::MeshSubset > const & | bulk_mesh_subsets, |
MeshLib::MeshSubset const & | new_mesh_subset ) const |
Creates a multi-component subset of the current mesh component map. The order (BY_LOCATION/BY_COMPONENT) of components is the same as of the current map.
bulk_mesh_subsets | components that should remain in the created subset, one for each global component. |
new_mesh_subset | The constraining mesh subset with a mapping of node ids to the bulk mesh nodes. |
Definition at line 53 of file MeshComponentMap.cpp.
References MeshComponentMap(), MeshLib::bulkNodeIDs(), getComponentIDs(), MeshLib::Mesh::getElementsConnectedToNode(), getGlobalIndex(), MeshLib::MeshSubset::getMesh(), MeshLib::MeshSubset::getMeshID(), MeshLib::Mesh::getName(), MeshLib::MeshSubset::getNodes(), MeshLib::isBaseNode(), MeshLib::Node, nop, and OGS_FATAL.
Referenced by NumLib::LocalToGlobalIndexMap::deriveBoundaryConstrainedMap(), and NumLib::LocalToGlobalIndexMap::deriveBoundaryConstrainedMap().
|
private |
Definition at line 140 of file MeshComponentMap.cpp.
References _dict, and NumLib::detail::Line::global_index.
Referenced by createSerialMeshComponentMap().
|
friend |
Definition at line 146 of file MeshComponentMap.h.
|
private |
Definition at line 164 of file MeshComponentMap.h.
Referenced by createParallelMeshComponentMap(), createSerialMeshComponentMap(), dofSizeWithGhosts(), getComponentIDs(), getDictionary(), getGlobalIndex(), getGlobalIndices(), getGlobalIndicesByComponent(), getGlobalIndicesByLocation(), and renumberByLocation().
|
private |
Global ID for ghost entries.
Definition at line 176 of file MeshComponentMap.h.
Referenced by createParallelMeshComponentMap(), getGhostIndices(), and getLocalIndex().
|
private |
Number of global unknowns. Used internally only.
Definition at line 172 of file MeshComponentMap.h.
Referenced by createParallelMeshComponentMap(), and getLocalIndex().
|
private |
Number of local unknowns excluding those associated with ghost nodes (for domain decomposition).
Definition at line 168 of file MeshComponentMap.h.
Referenced by createParallelMeshComponentMap(), createSerialMeshComponentMap(), and dofSizeWithoutGhosts().
|
staticconstexpr |
A value returned if no global index was found for the requested location/component. The value is implementation dependent.
Definition at line 137 of file MeshComponentMap.h.
Referenced by addPrimaryVariablesToMesh(), anonymous_namespace{CollectAndInterpolateNodalDof.cpp}::collectDofsToMatrixSingleComponentForSomeNodes(), ProcessLib::PythonBoundaryCondition::collectPrimaryVariables(), ProcessLib::ConstraintDirichletBoundaryCondition::getEssentialBCValues(), ProcessLib::PrimaryVariableConstraintDirichletBoundaryCondition::getEssentialBCValues(), ProcessLib::PythonBoundaryCondition::getEssentialBCValues(), ProcessLib::getEssentialBCValuesLocal(), getGlobalIndex(), getLocalIndex(), NumLib::getNodalValue(), NumLib::getNonGhostNodalValue(), getSubset(), ProcessLib::NodalSourceTerm::integrate(), ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::operator()(), ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::operator()(), and NumLib::transformVariableFromGlobalVector().