GEOSX
ParticleSubRegion.hpp
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 
15 
16 #ifndef GEOSX_MESH_PARTICLEELEMENTSUBREGION_HPP_
17 #define GEOSX_MESH_PARTICLEELEMENTSUBREGION_HPP_
18 
19 #include "mesh/generators/ParticleBlockABC.hpp"
22 
23 
24 namespace geos
25 {
26 
27 class MeshLevel;
28 
35 {
36 public:
37 
42  static string catalogName()
43  { return "ParticleSubRegion"; }
44 
48  virtual string getCatalogName() const override final
49  { return ParticleSubRegion::catalogName(); }
50 
55 
61  ParticleSubRegion( string const & name, Group * const parent );
62 
66  virtual ~ParticleSubRegion() override;
67 
69 
74 
79  void setParticleRank( int const rank );
80 
85  void copyFromParticleBlock( ParticleBlockABC & particleBlock );
86 
88 
93 
99  template< typename LAMBDA >
100  void forMaterials( LAMBDA lambda )
101  {
102  for( auto & constitutiveGroup : m_constitutiveGrouping )
103  {
104  lambda( constitutiveGroup );
105  }
106  }
107 
109 
115  {
117  static constexpr char const * constitutiveGroupingString() { return "ConstitutiveGrouping"; }
119  static constexpr char const * constitutiveMapString() { return "ConstitutiveMap"; }
120 
125  }
128 
129  virtual viewKeyStruct & viewKeys() override { return m_ParticleBlockSubRegionViewKeys; }
130  virtual viewKeyStruct const & viewKeys() const override { return m_ParticleBlockSubRegionViewKeys; }
131 
132 private:
133 
135  map< string, localIndex_array > m_constitutiveGrouping;
136 
138  string_array m_externalPropertyNames;
139 
140 };
141 
142 } /* namespace geos */
143 
144 #endif /* GEOSX_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:369
Group::wrapperMap::KeyIndex ViewKey
Type alias for KeyIndexT type used for wrapper lookups.
Definition: Group.hpp:1625
array1d< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:432
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.