C++ mpi module for stochmagnet_main Package
SM_FCCStructuresBuilder.h
1 #ifndef SM_FCCStructuresBuilder_H
2 #define SM_FCCStructuresBuilder_H
3 
4 //super class header
5 #include "SM_CrystalStructuresBuilder.h"
6 
14 
15 
16 
17 protected:
18  // CONSTRUCTORS
22  }
23 
24 
25  // DESTRUCTORS
28  virtual ~SM_FCCStructuresBuilder(void) {
29  }
30 
31 public :
32 
33  //Instance building
34  //=================
35 
39  inline static CORE_UniquePointer<SM_FCCStructuresBuilder> New() {
40  return CORE_UniquePointer<SM_FCCStructuresBuilder>(new SM_FCCStructuresBuilder(),
42  }
43 
44 
45  //MEMORY
46 
60  virtual tMemSize getMemorySize() const {
61  return sizeof(*this)+getContentsMemorySize();
62  }
63 
72  virtual tMemSize getContentsMemorySize() const {
74  return mem;
75  }
76 
77  //SET & GET methods
78 
79 
80 public:
81 
82 
83 
84 
92  virtual void getNetworkSliceMaxSizeOffset(const SM_CrystalStructure& cStructure,
93  const std::array<tInteger,SM_Constants::DIM>& Ns,
94  const std::array<tBoolean,SM_Constants::DIM>& periodicity,
95  std::valarray<tIndex>& sliceParticlesNumberOffset) const override;
96 
97 
113  virtual void buildNetworkSliceSet(const tInteger& slicesNumber,
114  const tInteger& sliceIndex,
115  const std::array<tReal,SM_Constants::DIM>& X0,
116  const std::array<tInteger,SM_Constants::DIM>& Ns,
117  const std::array<tReal,SM_Constants::DIM>& Hs,
118  const std::array<tBoolean,SM_Constants::DIM>& periodicity,
119  const std::valarray<tMask>& mask,
120  tIndex& nParticles,
121  tIndex *particles,
122  tReal *X,
123  tIndex *neighborsNumberPerParticle,
124  tIndex& nNeighboringParticles,
125  tIndex *neighboringParticlesList) const override;
126 
127 
128 
129 
137  virtual tIndex getNetworkGridMaxSize(const SM_CrystalStructure& cStructure,
138  const std::array<tInteger,SM_Constants::DIM>& Ns,
139  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
140  const std::array<tInteger,SM_Constants::DIM>& gridSize,
141  const std::array<tInteger,SM_Constants::DIM>& gridIndex) const override;
142 
143 
159  virtual void buildNetworkGridSet(const std::array<tInteger,SM_Constants::DIM>& gridsNumber,
160  const std::array<tInteger,SM_Constants::DIM>& gridIndex,
161  const std::array<tReal,SM_Constants::DIM>& X0,
162  const std::array<tInteger,SM_Constants::DIM>& Ns,
163  const std::array<tReal,SM_Constants::DIM>& Hs,
164  const std::array<tBoolean,SM_Constants::DIM>& periodicity,
165  const std::valarray<tMask>& mask,
166  tIndex& nParticles,
167  tIndex *particles,
168  tReal *X,
169  tIndex *neighborsNumberPerParticle,
170  tIndex& nNeighboringParticles,
171  tIndex *neighboringParticlesList) const override;
172 
173 
174 
175 
176  // virtual void computeParticlesWeight(const std::array<tInteger,SM_Constants::DIM>& Ns,
177  // const std::array<tReal,SM_Constants::DIM>& Hs,
178  // const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
179  // const std::valarray<tMask>& mask,
180  // std::valarray<tReal>& vs) const;
181 
182 private:
183 
184 
202  static void FaceToFaceConnections(const tDimension& d,
203  const std::array<std::array<tDimension,SM_Constants::HDIM>,SM_Constants::DIM>& hyperplanBasis,
204  const tInteger* iFaceElementIndices,
205  const std::array<std::array<tInteger,SM_Constants::DIM>,SM_Constants::DIM>& faceElementsNumbers,
206  const std::array<tIndex,SM_Constants::DIM+1>& hyperplanFaceElementsNumberOffset,
207  const std::array<tInteger,SM_Constants::DIM>& nCs,const std::array<tInteger,SM_Constants::DIM>& nPs,
208  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
209  const tBoolean& incMask,const tMask* vMask,
210  std::array<tInteger,SM_Constants::DIM>& connectedFaceElementIndices,
211  std::array<tInteger,SM_Constants::DIM>& cellIndices,tIndex& cellIndex,
212  std::map<tIndex,tIndex>& connectedFaces,
213  std::map<tIndex,tIndex>& neighboringParticlesOrderedList);
214 
215 
234  static void VertexToFaceConnections(const std::array<tInteger,SM_Constants::DIM>& vertexIndices,
235  const std::array<std::array<tDimension,SM_Constants::HDIM>,SM_Constants::DIM>& hyperplanBases,
236  const std::array<std::array<tInteger,SM_Constants::DIM>,SM_Constants::DIM>& faceElementsNumbers,
237  const std::array<tIndex,SM_Constants::DIM+1>& hyperplanFaceElementsNumberOffset,
238  const std::array<tInteger,SM_Constants::DIM>& nCs,
239  const std::array<tInteger,SM_Constants::DIM>& nPs,
240  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
241  const tBoolean& incMask,const tMask* vMask,
242  std::array<tUCInt,SM_Constants::HDIM>& moveIndices,
243  std::array<tInteger,SM_Constants::DIM>& cellIndices,
244  tIndex& cellIndex,
245  std::array<tInteger,SM_Constants::DIM>& connectedFaceElementIndices,
246  std::map<tIndex,tIndex>& connectedFaces,
247  std::map<tIndex,tIndex>& neighboringParticlesOrderedList);
248 
249 
250 
251 };
252 
253 #endif
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
static constexpr tDimension DIM
space dimension
Definition: SM_Constants.h:80
This class decribe a crystal structure.
Definition: SM_CrystalStructure.h:30
This class is an interface class for method for building a grid of crystal structure.
Definition: SM_CrystalStructuresBuilder.h:17
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_CrystalStructuresBuilder.h:72
This class generate a grid of fcc structures.
Definition: SM_FCCStructuresBuilder.h:13
virtual void buildNetworkGridSet(const std::array< tInteger, SM_Constants::DIM > &gridsNumber, const std::array< tInteger, SM_Constants::DIM > &gridIndex, const std::array< tReal, SM_Constants::DIM > &X0, const std::array< tInteger, SM_Constants::DIM > &Ns, const std::array< tReal, SM_Constants::DIM > &Hs, const std::array< tBoolean, SM_Constants::DIM > &periodicity, const std::valarray< tMask > &mask, tIndex &nParticles, tIndex *particles, tReal *X, tIndex *neighborsNumberPerParticle, tIndex &nNeighboringParticles, tIndex *neighboringParticlesList) const override
build a network based on a nD paver grid decomposed in grid sets
Definition: SM_FCCStructuresBuilder.cpp:709
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_FCCStructuresBuilder.h:72
virtual tIndex getNetworkGridMaxSize(const SM_CrystalStructure &cStructure, const std::array< tInteger, SM_Constants::DIM > &Ns, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::array< tInteger, SM_Constants::DIM > &gridSize, const std::array< tInteger, SM_Constants::DIM > &gridIndex) const override
get the max size of the network
Definition: SM_FCCStructuresBuilder.cpp:647
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_FCCStructuresBuilder.h:60
SM_FCCStructuresBuilder(void)
create an instance class
Definition: SM_FCCStructuresBuilder.h:21
static CORE_UniquePointer< SM_FCCStructuresBuilder > New()
build a new instance of a FCC structure
Definition: SM_FCCStructuresBuilder.h:39
virtual ~SM_FCCStructuresBuilder(void)
destroy the instance of the class
Definition: SM_FCCStructuresBuilder.h:28
virtual void buildNetworkSliceSet(const tInteger &slicesNumber, const tInteger &sliceIndex, const std::array< tReal, SM_Constants::DIM > &X0, const std::array< tInteger, SM_Constants::DIM > &Ns, const std::array< tReal, SM_Constants::DIM > &Hs, const std::array< tBoolean, SM_Constants::DIM > &periodicity, const std::valarray< tMask > &mask, tIndex &nParticles, tIndex *particles, tReal *X, tIndex *neighborsNumberPerParticle, tIndex &nNeighboringParticles, tIndex *neighboringParticlesList) const override
build a network based on a decomposed in slice sets
Definition: SM_FCCStructuresBuilder.cpp:154
virtual void getNetworkSliceMaxSizeOffset(const SM_CrystalStructure &cStructure, const std::array< tInteger, SM_Constants::DIM > &Ns, const std::array< tBoolean, SM_Constants::DIM > &periodicity, std::valarray< tIndex > &sliceParticlesNumberOffset) const override
get the max size of the network
Definition: SM_FCCStructuresBuilder.cpp:18