GEOSX
ParticleBlockABC.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) 2020- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
15 #ifndef GEOSX_PARTICLEBLOCKABC_HPP
16 #define GEOSX_PARTICLEBLOCKABC_HPP
17 
18 #include "mesh/ParticleType.hpp"
19 
20 #include "dataRepository/Group.hpp"
21 #include "common/DataTypes.hpp"
22 
23 #include <vector>
24 
25 namespace geos
26 {
27 
39 {
40 public:
41 
47  ParticleBlockABC( string const & name,
48  Group * const parent )
49  :
50  Group( name, parent )
51  { }
52 
57  virtual ParticleType getParticleType() const = 0;
58 
64 
69  virtual array1d< int > getParticleGroup() const = 0;
70 
76 
81  virtual array1d< real64 > getParticleDamage() const = 0;
82 
88 
93  virtual array2d< real64 > getParticleCenter() const = 0;
94 
100 
106 
112 
118 
123  virtual bool hasRVectors() const = 0;
124 
129  virtual localIndex numParticles() const = 0;
130 
136 
147  template< typename LAMBDA >
148  void forExternalProperties( LAMBDA && lambda )
149  {
150  for( auto * wrapperBase: this->getExternalProperties() )
151  {
152  lambda( *wrapperBase );
153  }
154  }
155 
156 private:
167  virtual std::list< dataRepository::WrapperBase * > getExternalProperties() = 0;
168 };
169 
170 }
171 
172 #endif //GEOSX_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:232
Array< T, 3, PERMUTATION > array3d
Alias for 3D array.
Definition: DataTypes.hpp:248
ParticleType
Denotes type of particle shape/interpolation scheme.
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:216