GEOS
ParticleBlockABC.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 #ifndef GEOS_PARTICLEBLOCKABC_HPP
17 #define GEOS_PARTICLEBLOCKABC_HPP
18 
19 #include "mesh/ParticleType.hpp"
20 
21 #include "dataRepository/Group.hpp"
22 #include "common/DataTypes.hpp"
23 
24 #include <vector>
25 
26 namespace geos
27 {
28 
40 {
41 public:
42 
48  ParticleBlockABC( string const & name,
49  Group * const parent )
50  :
51  Group( name, parent )
52  { }
53 
58  virtual ParticleType getParticleType() const = 0;
59 
65 
70  virtual array1d< int > getParticleGroup() const = 0;
71 
77 
82  virtual array1d< real64 > getParticleDamage() const = 0;
83 
89 
94  virtual array2d< real64 > getParticleCenter() const = 0;
95 
101 
107 
113 
119 
124  virtual bool hasRVectors() const = 0;
125 
130  virtual localIndex numParticles() const = 0;
131 
137 
148  template< typename LAMBDA >
149  void forExternalProperties( LAMBDA && lambda )
150  {
151  for( auto * wrapperBase: this->getExternalProperties() )
152  {
153  lambda( *wrapperBase );
154  }
155  }
156 
157 private:
168  virtual std::list< dataRepository::WrapperBase * > getExternalProperties() = 0;
169 };
170 
171 }
172 
173 #endif //GEOS_CELLBLOCKABC_HPP
virtual array1d< real64 > getParticleDamage() const =0
Get the list of particle damage values in this subregion.
ParticleBlockABC(string const &name, Group *const parent)
Constructor.
virtual array1d< int > getParticleSurfaceFlag() const =0
Get the list of particle surface flag values in this subregion.
virtual array2d< real64 > getParticleVelocity() const =0
Get the list of particle velocities in this subregion.
virtual array1d< real64 > getParticleVolume() const =0
Get the list of particle volumes in this subregion.
virtual array1d< real64 > getParticleStrengthScale() const =0
Get the list of particle strength scale values in this subregion.
void forExternalProperties(LAMBDA &&lambda)
Helper function to apply a lambda function over all the external properties of the subregion.
virtual localIndex numParticles() const =0
Get the number of particles.
virtual array1d< globalIndex > localToGlobalMap() const =0
Get local to global map.
virtual bool hasRVectors() const =0
Query whether this subregion has particles of a type that have r-vectors that depend on the deformati...
virtual array1d< globalIndex > getParticleID() const =0
Get the list of particle global IDs in this subregion.
virtual array2d< real64 > getParticleMaterialDirection() const =0
Get the list of particle material directions in this subregion.
virtual array2d< real64 > getParticleCenter() const =0
Get the list of particle center locations in this subregion.
virtual array3d< real64 > getParticleRVectors() const =0
Get the list of particle r-vectors in this subregion.
virtual array1d< int > getParticleGroup() const =0
Get the list of particle group numbers (for contact) in this subregion.
virtual ParticleType getParticleType() const =0
Get the type of particle in this subregion.
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:192
Array< T, 3, PERMUTATION > array3d
Alias for 3D array.
Definition: DataTypes.hpp:208
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
ParticleType
Denotes type of particle shape/interpolation scheme.
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:176