GEOS
ParticleSubRegion.hpp
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 
16 
17 #ifndef GEOS_MESH_PARTICLEELEMENTSUBREGION_HPP_
18 #define GEOS_MESH_PARTICLEELEMENTSUBREGION_HPP_
19 
20 #include "mesh/generators/ParticleBlockABC.hpp"
23 
24 
25 namespace geos
26 {
27 
28 class MeshLevel;
29 
36 {
37 public:
38 
43  static string catalogName()
44  { return "ParticleSubRegion"; }
45 
49  virtual string getCatalogName() const override final
50  { return ParticleSubRegion::catalogName(); }
51 
56 
62  ParticleSubRegion( string const & name, Group * const parent );
63 
67  virtual ~ParticleSubRegion() override;
68 
70 
75 
80  void setParticleRank( int const rank );
81 
86  void copyFromParticleBlock( ParticleBlockABC & particleBlock );
87 
89 
94 
100  template< typename LAMBDA >
101  void forMaterials( LAMBDA lambda )
102  {
103  for( auto & constitutiveGroup : m_constitutiveGrouping )
104  {
105  lambda( constitutiveGroup );
106  }
107  }
108 
110 
116  {
118  static constexpr char const * constitutiveGroupingString() { return "ConstitutiveGrouping"; }
120  static constexpr char const * constitutiveMapString() { return "ConstitutiveMap"; }
121 
126  }
129 
130  virtual viewKeyStruct & viewKeys() override { return m_ParticleBlockSubRegionViewKeys; }
131  virtual viewKeyStruct const & viewKeys() const override { return m_ParticleBlockSubRegionViewKeys; }
132 
133 private:
134 
136  map< string, localIndex_array > m_constitutiveGrouping;
137 
139  string_array m_externalPropertyNames;
140 
141 };
142 
143 } /* namespace geos */
144 
145 #endif /* GEOS_MESH_CELLELEMENTSUBREGION_HPP_ */
virtual viewKeyStruct const & viewKeys() const override
Get the view keys for Group access, const version.
virtual viewKeyStruct & viewKeys() override
Get the view keys for Group access.
virtual string getCatalogName() const override final
Const getter for the catalog name.
void forMaterials(LAMBDA lambda)
Helper function to apply a lambda function over all constructive groups.
static string catalogName()
Const getter for the catalog name.
void copyFromParticleBlock(ParticleBlockABC &particleBlock)
Fill the ParticleSubRegion by copying those of the source ParticleBlock.
virtual ~ParticleSubRegion() override
Destructor.
geos::ParticleSubRegion::viewKeyStruct m_ParticleBlockSubRegionViewKeys
viewKey struct for the ParticleSubRegion class
void setParticleRank(int const rank)
Set the ghost rank of particles in this subregion.
ParticleSubRegion(string const &name, Group *const parent)
Constructor for this class.
Base template for ordered and unordered maps.
Definition: DataTypes.hpp:329
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
Definition: Group.hpp:1662
array1d< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:392
struct to serve as a container for variable strings and keys
static constexpr char const * constitutiveGroupingString()
static constexpr char const * constitutiveMapString()
dataRepository::ViewKey constitutiveMap
ViewKey for the constitutive map.
dataRepository::ViewKey constitutiveGrouping
ViewKey for the constitutive grouping.
A struct to serve as a container for variable strings and keys.