19 #ifndef GEOS_MESH_EDGEMANAGER_HPP_
20 #define GEOS_MESH_EDGEMANAGER_HPP_
23 #include "mesh/generators/CellBlockManagerABC.hpp"
26 #include "LvArray/src/tensorOps.hpp"
60 {
return "EdgeManager"; }
92 Group *
const parent );
189 bool const overwriteUpMaps,
190 bool const overwriteDownMaps )
override;
227 template<
typename OUT_VECTOR >
230 OUT_VECTOR && edgeCenter )
const;
239 template<
typename OUT_VECTOR >
242 OUT_VECTOR && edgeVector )
const;
256 static constexpr
char const * nodeListString() {
return "nodeList"; }
257 static constexpr
char const * faceListString() {
return "faceList"; }
258 static constexpr
char const * elementRegionListString() {
return "elemRegionList"; }
259 static constexpr
char const * elementSubRegionListString() {
return "elemSubRegionList"; }
260 static constexpr
char const * elementListString() {
return "elemList"; }
298 {
return m_toNodesRelation( edgeIndex, nodeIndex ); }
307 {
return m_toNodesRelation( edgeIndex, nodeIndex ); }
345 template<
bool DO_PACKING >
351 template<
typename OUT_VECTOR >
354 OUT_VECTOR && edgeCenter )
const
356 LvArray::tensorOps::copy< 3 >( edgeCenter, X[m_toNodesRelation[edgeIndex][0]] );
357 LvArray::tensorOps::add< 3 >( edgeCenter, X[m_toNodesRelation[edgeIndex][1]] );
358 LvArray::tensorOps::scale< 3 >( edgeCenter, 0.5 );
361 template<
typename OUT_VECTOR >
364 OUT_VECTOR && edgeSegment )
const
366 LvArray::tensorOps::copy< 3 >( edgeSegment, X[m_toNodesRelation[edgeIndex][1]] );
367 LvArray::tensorOps::subtract< 3 >( edgeSegment, X[m_toNodesRelation[edgeIndex][0]] );
Abstract base class for CellBlockManager.
static constexpr localIndex faceMapExtraSpacePerEdge()
Extra space for extra edges.
This class provides an interface to ObjectManagerBase in order to manage edge data.
void setupRelatedObjectsInRelations(NodeManager const &nodeManager, FaceManager const &faceManager)
Link the current manager to other managers.
NodeMapType const & nodeList() const
Provide an accessor to an immutable node list.
static constexpr localIndex faceMapOverallocation()
Oversize the Face mapping by this amount for each edge (hardcoded)
FixedOneToManyRelation NodeMapType
EdgeToNode map type.
void setIsExternal(FaceManager const &faceManager)
Set external edges.
static string catalogName()
void depopulateUpMaps(std::set< localIndex > const &receivedEdges, ArrayOfArraysView< localIndex const > const &facesToEdges)
Clean up the edges-to-faces mapping with respect to a new list of edges.
localIndex & nodeList(localIndex const edgeIndex, localIndex const nodeIndex)
Get a reference to a node list.
void buildEdges(localIndex const numNodes, ArrayOfArraysView< localIndex const > const &faceToNodeMap, ArrayOfArrays< localIndex > &faceToEdgeMap)
Build faces-to-edges and nodes-to-edges relation maps.
virtual localIndex packUpDownMapsSize(arrayView1d< localIndex const > const &packList) const override
Compute the future size of a packed list.
virtual ArrayOfSets< globalIndex > extractMapFromObjectForAssignGlobalIndexNumbers(ObjectManagerBase const &nodeManager) override
Build a vector containing all the global indices of each nodes of each edges.
void calculateLength(localIndex const edgeIndex, arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const &X, OUT_VECTOR &&edgeVector) const
Calculate the edge segment.
bool hasNode(const localIndex edgeIndex, const localIndex nodeIndex) const
Check if edge edgeIndex contains node nodeIndex.
InterObjectRelation< ArrayOfSets< localIndex > > FaceMapType
EdgeToFace map type.
virtual void resize(localIndex const newSize) override
Resize the EdgeManager object and all it members.
virtual localIndex unpackUpDownMaps(buffer_unit_type const *&buffer, localIndex_array &packList, bool const overwriteUpMaps, bool const overwriteDownMaps) override
Unpack a buffer to an array of indices that has been packed.
virtual localIndex packUpDownMaps(buffer_unit_type *&buffer, arrayView1d< localIndex const > const &packList) const override
Pack an array of edge indices in a buffer.
geos::EdgeManager::viewKeyStruct viewKeys
viewKeys
virtual string getCatalogName() const override
Getter used to access the edge manager catalog name.
EdgeManager(string const &name, Group *const parent)
main constructor for EdgeManager Objects
void buildSets(NodeManager const &nodeManager)
Build sets from the node sets.
FaceMapType const & faceList() const
Get an immutable accessor to the edge-to-face relation.
NodeMapType & nodeList()
Get a node list.
void calculateCenter(localIndex const edgeIndex, arrayView2d< real64 const, nodes::REFERENCE_POSITION_USD > const &X, OUT_VECTOR &&edgeCenter) const
Calculate the center of an edge given its index.
void fixUpDownMaps(bool const clearIfUnmapped)
Call fixUpDownMaps of the class ObjectManagerBase for nodes-to-edges and nodes-to-faces relation maps...
localIndex nodeList(localIndex const edgeIndex, localIndex const nodeIndex) const
Get a node list.
void setGeometricalRelations(CellBlockManagerABC const &cellBlockManager, bool isBaseMeshLevel)
Copies the edges to (nodes|faces) mappings from cellBlockManager.
FaceMapType & faceList()
Get the edge-to-face relation.
void setDomainBoundaryObjects(FaceManager const &faceManager)
Set the node of the domain boundary object.
void compressRelationMaps()
Compress all nodes-to-faces relation maps so that the values of each array are contiguous with no ext...
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
The NodeManager class provides an interface to ObjectManagerBase in order to manage node data.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
Base template for ordered and unordered maps.
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
array1d< localIndex > localIndex_array
A 1-dimensional array of geos::localIndex types.
LvArray::ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, LvArray::ChaiBuffer > ArrayOfArraysView
View of array of variable-sized arrays. See LvArray::ArrayOfArraysView for details.
InterObjectRelation< array2d< localIndex > > FixedOneToManyRelation
A relationship from single objects to many other objects, where each object is related to the same nu...
LvArray::ArrayOfSets< T, INDEX_TYPE, LvArray::ChaiBuffer > ArrayOfSets
Array of variable-sized sets. See LvArray::ArrayOfSets for details.
signed char buffer_unit_type
Type stored in communication buffers.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
LvArray::ArrayOfArrays< T, INDEX_TYPE, LvArray::ChaiBuffer > ArrayOfArrays
Array of variable-sized arrays. See LvArray::ArrayOfArrays for details.
Container of keys needed to access the data of the class member.
struct to serve as a container for variable strings and keys