GEOSX
ToElementRelation.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_MESH_TOELEMENTRELATION_HPP_
20 #define GEOS_MESH_TOELEMENTRELATION_HPP_
21 
22 #include "InterObjectRelation.hpp"
23 
24 namespace geos
25 {
26 
27 class ElementRegionManager;
28 
34 template< typename BASETYPE >
36 {
37 public:
38 
40  using base_type = BASETYPE;
41 
48  template< typename ... DIMS >
49  void resize( DIMS... newdims )
50  {
51  m_toElementRegion.resize( newdims ... );
52  m_toElementSubRegion.resize( newdims ... );
53  m_toElementIndex.resize( newdims ... );
54  }
55 
60  localIndex size() const
61  {
62  return m_toElementRegion.size();
63  }
64 
70  localIndex size( int const dim ) const
71  {
72  return m_toElementRegion.size( dim );
73  }
74 
80  {
81  m_elemRegionManager = &input;
82  }
83 
89  {
90  return m_elemRegionManager;
91  }
92 
98  BASETYPE m_toElementIndex;
99 
102 };
103 
106 
109 
120  localIndex const firstIndex,
121  localIndex const er,
122  localIndex const esr,
123  localIndex const ei );
124 
135  localIndex const firstIndex,
136  localIndex const er,
137  localIndex const esr,
138  localIndex const ei );
139 
140 
141 
142 } /* namespace geos */
143 
144 #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.
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.
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125