GEOS
ToElementRelation.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_MESH_TOELEMENTRELATION_HPP_
21 #define GEOS_MESH_TOELEMENTRELATION_HPP_
22 
23 #include "InterObjectRelation.hpp"
24 
25 namespace geos
26 {
27 
28 class ElementRegionManager;
29 
35 template< typename BASETYPE >
37 {
38 public:
39 
41  using base_type = BASETYPE;
42 
49  template< typename ... DIMS >
50  void resize( DIMS... newdims )
51  {
52  m_toElementRegion.resize( newdims ... );
53  m_toElementSubRegion.resize( newdims ... );
54  m_toElementIndex.resize( newdims ... );
55  }
56 
61  localIndex size() const
62  {
63  return m_toElementRegion.size();
64  }
65 
71  localIndex size( int const dim ) const
72  {
73  return m_toElementRegion.size( dim );
74  }
75 
81  {
82  m_elemRegionManager = &input;
83  }
84 
90  {
91  return m_elemRegionManager;
92  }
93 
99  BASETYPE m_toElementIndex;
100 
103 };
104 
107 
110 
121  localIndex const firstIndex,
122  localIndex const er,
123  localIndex const esr,
124  localIndex const ei );
125 
136  localIndex const firstIndex,
137  localIndex const er,
138  localIndex const esr,
139  localIndex const ei );
140 
141 
142 
143 } /* namespace geos */
144 
145 #endif /* GEOS_MESH_TOELEMENTRELATION_HPP_ */
The ElementRegionManager class provides an interface to ObjectManagerBase in order to manage ElementR...
A relationship to an element.
ElementRegionManager const * getElementRegionManager() const
Get the ElementRegionManager.
localIndex size() const
Get the current size of the relationship storage.
localIndex size(int const dim) const
Get the size of a specific dimension of the relationship storage.
BASETYPE base_type
The type of the underlying relationship storage object.
void setElementRegionManager(ElementRegionManager const &input)
Set the ElementRegionManager.
void resize(DIMS... newdims)
Resize the underlying relationship storage.
BASETYPE m_toElementIndex
The relationship between object indices and element indices.
ElementRegionManager const * m_elemRegionManager
The current ElementRegionManager.
BASETYPE m_toElementSubRegion
The relationship between object indices and element subregions.
BASETYPE m_toElementRegion
The relationship between object indices and element regions.
ToElementRelation< ArrayOfArrays< localIndex > > OrderedVariableToManyElementRelation
A ToElementRelation where each object is related to an arbitrary number of elements.
ToElementRelation< array2d< localIndex > > FixedToManyElementRelation
A ToElementRelation where each object is related to the same number of elements.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
void insert(OrderedVariableToManyElementRelation &relation, localIndex const firstIndex, localIndex const er, localIndex const esr, localIndex const ei)
Insert an element relation for an object in the relation.
void erase(OrderedVariableToManyElementRelation &relation, localIndex const firstIndex, localIndex const er, localIndex const esr, localIndex const ei)
Remove an element relation from an object in the relation.