C++ mpi module for stochmagnet_main Package
SM_BCCStructuresBuilder.h
1 #ifndef SM_BCCStructuresBuilder_H
2 #define SM_BCCStructuresBuilder_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_BCCStructuresBuilder(void) {
29  }
30 
31 public :
32 
33  //Instance building
34  //=================
35 
39  inline static CORE_UniquePointer<SM_BCCStructuresBuilder> New() {
40  return CORE_UniquePointer<SM_BCCStructuresBuilder>(new SM_BCCStructuresBuilder(),
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 
91  virtual void computeParticlesWeight(const std::array<tInteger,SM_Constants::DIM>& Ns,
92  const std::array<tReal,SM_Constants::DIM>& Hs,
93  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
94  const std::valarray<tMask>& mask,
95  std::valarray<tReal>& vs) const;
96 
97 
105  virtual void getNetworkSliceMaxSizeOffset(const SM_CrystalStructure& cStructure,
106  const std::array<tInteger,SM_Constants::DIM>& Ns,
107  const std::array<tBoolean,SM_Constants::DIM>& periodicity,
108  std::valarray<tIndex>& sliceParticlesNumberOffset) const override;
109 
110 
126  virtual void buildNetworkSliceSet(const tInteger& slicesNumber,
127  const tInteger& sliceIndex,
128  const std::array<tReal,SM_Constants::DIM>& X0,
129  const std::array<tInteger,SM_Constants::DIM>& Ns,
130  const std::array<tReal,SM_Constants::DIM>& Hs,
131  const std::array<tBoolean,SM_Constants::DIM>& periodicity,
132  const std::valarray<tMask>& mask,
133  tIndex& nParticles,
134  tIndex *particles,
135  tReal *X,
136  tIndex *neighborsNumberPerParticle,
137  tIndex& nNeighboringParticles,
138  tIndex *neighboringParticlesList) const override;
139 
140 
141 
142 
150  virtual tIndex getNetworkGridMaxSize(const SM_CrystalStructure& cStructure,
151  const std::array<tInteger,SM_Constants::DIM>& Ns,
152  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
153  const std::array<tInteger,SM_Constants::DIM>& gridSize,
154  const std::array<tInteger,SM_Constants::DIM>& gridIndex) const override;
155 
156 
172  virtual void buildNetworkGridSet(const std::array<tInteger,SM_Constants::DIM>& gridsNumber,
173  const std::array<tInteger,SM_Constants::DIM>& gridIndex,
174  const std::array<tReal,SM_Constants::DIM>& X0,
175  const std::array<tInteger,SM_Constants::DIM>& Ns,
176  const std::array<tReal,SM_Constants::DIM>& Hs,
177  const std::array<tBoolean,SM_Constants::DIM>& periodicity,
178  const std::valarray<tMask>& mask,
179  tIndex& nParticles,
180  tIndex *particles,
181  tReal *X,
182  tIndex *neighborsNumberPerParticle,
183  tIndex& nNeighboringParticles,
184  tIndex *neighboringParticlesList) const override;
185 
186 
187 
188 public:
189 
201  static void CenterCellConnections( const std::array<tInteger,SM_Constants::DIM>& I,
202  const std::array<tInteger,SM_Constants::DIM>& nCs,
203  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
204  const tBoolean& incMask,const tMask* vMask,
205  const std::array<tUCInt,SM_Constants::DIM>& nDisplacements,
206  std::array<tUCInt,SM_Constants::DIM>& displacement,
207  std::array<tInteger,SM_Constants::DIM>& connectedCellIndices,
208  std::map<tIndex,tBoolean>& neighboringParticlesOrderedList);
209 
220  static void SummitConnections(const std::array<tInteger,SM_Constants::DIM>& I,
221  const std::array<tInteger,SM_Constants::DIM>& nPs,
222  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
223  const std::array<tUCInt,SM_Constants::DIM>& nDisplacements,
224  std::array<tUCInt,SM_Constants::DIM>& displacement,
225  std::array<tInteger,SM_Constants::DIM>& connectedPointIndices,
226  const tIndex& index0,
227  std::map<tIndex,tBoolean>& neighboringParticlesOrderedList);
228 
229 };
230 
231 #endif
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
This class generate a grid of bcc structures.
Definition: SM_BCCStructuresBuilder.h:13
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_BCCStructuresBuilder.h:60
static CORE_UniquePointer< SM_BCCStructuresBuilder > New()
build a new instance of a BCC structure
Definition: SM_BCCStructuresBuilder.h:39
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_BCCStructuresBuilder.cpp:306
static void SummitConnections(const std::array< tInteger, SM_Constants::DIM > &I, const std::array< tInteger, SM_Constants::DIM > &nPs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::array< tUCInt, SM_Constants::DIM > &nDisplacements, std::array< tUCInt, SM_Constants::DIM > &displacement, std::array< tInteger, SM_Constants::DIM > &connectedPointIndices, const tIndex &index0, std::map< tIndex, tBoolean > &neighboringParticlesOrderedList)
build the connections of the center of the cell at index I with all the summit of the cell I
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_BCCStructuresBuilder.h:72
SM_BCCStructuresBuilder(void)
create an instance class
Definition: SM_BCCStructuresBuilder.h:21
virtual void computeParticlesWeight(const std::array< tInteger, SM_Constants::DIM > &Ns, const std::array< tReal, SM_Constants::DIM > &Hs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::valarray< tMask > &mask, std::valarray< tReal > &vs) const
ocmpute the particles weight
Definition: SM_BCCStructuresBuilder.cpp:588
virtual ~SM_BCCStructuresBuilder(void)
destroy the instance of the class
Definition: SM_BCCStructuresBuilder.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_BCCStructuresBuilder.cpp:86
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_BCCStructuresBuilder.cpp:372
static void CenterCellConnections(const std::array< tInteger, SM_Constants::DIM > &I, const std::array< tInteger, SM_Constants::DIM > &nCs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const tBoolean &incMask, const tMask *vMask, const std::array< tUCInt, SM_Constants::DIM > &nDisplacements, std::array< tUCInt, SM_Constants::DIM > &displacement, std::array< tInteger, SM_Constants::DIM > &connectedCellIndices, std::map< tIndex, tBoolean > &neighboringParticlesOrderedList)
build the connections of the summit vertex at index I to the center of the connecetd cels to the vert...
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_BCCStructuresBuilder.cpp:14
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