GEOS
CellElementRegion.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_CELLELEMENTREGION_HPP_
21 #define GEOS_MESH_CELLELEMENTREGION_HPP_
22 
23 #include "ElementRegionBase.hpp"
24 
25 namespace geos
26 {
27 
35 {
36 public:
37 
42 
43 
49  CellElementRegion( string const & name, Group * const parent );
50 
54  CellElementRegion() = delete;
55 
59  virtual ~CellElementRegion() override;
60 
65 
70  static string catalogName()
71  { return "CellElementRegion"; }
72 
76  virtual string getCatalogName() const override final
77  { return catalogName(); }
78 
80 
85 
86 
93  { return m_cellBlockNames.toViewConst(); }
94 
99  void addCellBlockName( string const & cellBlockName )
100  {
101  m_cellBlockNames.emplace_back( cellBlockName );
102  }
103 
108  template< typename StringContainerType >
109  void setCellBlockNames( StringContainerType const & cellBlockNames )
110  {
111  m_cellBlockNames.clear();
112  for( auto const & name: cellBlockNames )
113  {
114  m_cellBlockNames.emplace_back( name );
115  }
116  }
117 
124  virtual void generateMesh( Group const & cellBlocks ) override;
125 
127 
133  {
135  static constexpr char const * coarseningRatioString() {return "coarseningRatio"; }
136 
138  static constexpr char const * sourceCellBlockNamesString() {return "cellBlocks"; }
139  };
140 
141 private:
142 
144  string_array m_cellBlockNames;
145 
147  real64 m_coarseningRatio;
148 
149 
155  std::set< string > computeSelectedCellBlocks( std::set< string > const & cellBlocksNames ) const;
156 
157 };
158 
159 } /* namespace geos */
160 
161 #endif /* GEOS_MESH_CELLELEMENTREGION_HPP_ */
void addCellBlockName(string const &cellBlockName)
Select a cellBlock by its name for generateMesh().
arrayView1d< string const > getCellBlockNames() const
void setCellBlockNames(StringContainerType const &cellBlockNames)
Select cellBlocks by their names for generateMesh().
static string catalogName()
The key name for the FaceElementRegion in the object catalog.
virtual string getCatalogName() const override final
The key name for the FaceElementRegion in the object catalog.
virtual void generateMesh(Group const &cellBlocks) override
register every cellBlocks that is requested in the cellBlockNames list.
CellElementRegion(string const &name, Group *const parent)
Constructor.
CellElementRegion()=delete
Deleted default constructor.
virtual ~CellElementRegion() override
Destructor.
The ElementRegionBase is the base class to manage the data stored at the element level.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:180
array1d< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:392
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
A struct to serve as a container for variable strings and keys.
static constexpr char const * sourceCellBlockNamesString()
static constexpr char const * coarseningRatioString()
Struct to serve as a container for variable strings and keys.