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, std::vector< int > const &new_global_component_ids) const |
std::size_t | dofSizeWithGhosts () const |
The number of dofs including the those located in the ghost nodes. More... | |
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). More... | |
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 NUMLIB_EXPORT GlobalIndexType const | nop |
Private Member Functions | |
MeshComponentMap (detail::ComponentGlobalIndexDict &dict) | |
Private constructor used by internally created mesh component maps. More... | |
detail::Line | getLine (Location const &l, int const comp_id) const |
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. More... | |
std::vector< GlobalIndexType > | _ghosts_indices |
Global ID for ghost entries. More... | |
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 30 of file MeshComponentMap.cpp.
References MeshLib::NodePartitionedMesh::isForSingleThread().
|
inlineexplicitprivate |
Private constructor used by internally created mesh component maps.
Definition at line 159 of file MeshComponentMap.h.
|
private |
components | a vector of components |
order | type of ordering values in a vector |
Definition at line 325 of file MeshComponentMap.cpp.
References NumLib::BY_LOCATION, MaterialPropertyLib::c, MeshLib::NodePartitionedMesh::getGlobalNodeID(), MathLib::Point3dWithID::getID(), MeshLib::Mesh::getNode(), MeshLib::NodePartitionedMesh::getNumberOfGlobalNodes(), MeshLib::NodePartitionedMesh::isGhostNode(), MeshLib::Node, and OGS_FATAL.
|
private |
components | a vector of components |
order | type of ordering values in a vector |
Definition at line 298 of file MeshComponentMap.cpp.
References NumLib::BY_LOCATION, MaterialPropertyLib::c, and MeshLib::Node.
|
inline |
The number of dofs including the those located in the ghost nodes.
Definition at line 58 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 121 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 156 of file MeshComponentMap.cpp.
|
inline |
|
inline |
Get ghost indices (for DDC).
Definition at line 124 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 176 of file MeshComponentMap.cpp.
Referenced by NumLib::LocalToGlobalIndexMap::findGlobalIndices(), NumLib::LocalToGlobalIndexMap::findGlobalIndicesWithElementID(), and NumLib::LocalToGlobalIndexMap::getGlobalIndex().
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 184 of file MeshComponentMap.cpp.
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 219 of file MeshComponentMap.cpp.
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 197 of file MeshComponentMap.cpp.
Looks up if a line is already stored in the dictionary.
Definition at line 168 of file MeshComponentMap.cpp.
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 255 of file MeshComponentMap.cpp.
References 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, | ||
std::vector< int > const & | new_global_component_ids | ||
) | 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. |
new_global_component_ids | The components for which the bulk_mesh_subsets should be intersected with the new_mesh_subset. |
Definition at line 55 of file MeshComponentMap.cpp.
References MeshLib::Mesh::getElementsConnectedToNode(), MeshLib::MeshSubset::getMesh(), MeshLib::MeshSubset::getMeshID(), MeshLib::Mesh::getName(), MeshLib::MeshSubset::getNodes(), MeshLib::Mesh::getProperties(), MeshLib::isBaseNode(), MeshLib::Node, and OGS_FATAL.
Referenced by NumLib::LocalToGlobalIndexMap::deriveBoundaryConstrainedMap().
|
private |
|
friend |
Definition at line 148 of file MeshComponentMap.h.
|
private |
Definition at line 172 of file MeshComponentMap.h.
Referenced by dofSizeWithGhosts(), and getDictionary().
|
private |
Global ID for ghost entries.
Definition at line 184 of file MeshComponentMap.h.
Referenced by getGhostIndices().
|
private |
Number of global unknowns. Used internally only.
Definition at line 180 of file MeshComponentMap.h.
|
private |
Number of local unknowns excluding those associated with ghost nodes (for domain decomposition).
Definition at line 176 of file MeshComponentMap.h.
Referenced by dofSizeWithoutGhosts().
|
static |
A value returned if no global index was found for the requested location/component. The value is implementation dependent.
Definition at line 140 of file MeshComponentMap.h.
Referenced by ProcessLib::PythonBoundaryConditionLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::SourceTerms::Python::PythonSourceTermLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::assemble(), ProcessLib::ConstraintDirichletBoundaryCondition::getEssentialBCValues(), ProcessLib::PythonBoundaryCondition::getEssentialBCValues(), ProcessLib::PrimaryVariableConstraintDirichletBoundaryCondition::getEssentialBCValues(), ProcessLib::getEssentialBCValuesLocal(), NumLib::getNodalValue(), NumLib::getNonGhostNodalValue(), ProcessLib::NodalSourceTerm::integrate(), ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::operator()(), and ProcessLib::LIE::SmallDeformation::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, GlobalDim, ConstructorArgs >::operator()().