C++ mpi module for stochmagnet_main Package
SM_NetworkBuilder.h
1 #ifndef SM_NetworkBuilder_H
2 #define SM_NetworkBuilder_H
3 
4 //define the std::array object
5 #include <array>
6 
7 //super class header
8 #include "SM_Object.h"
9 
10 
11 //network header
12 #include "SM_Network.h"
13 
14 //crystal structure header
15 #include "SM_CrystalStructure.h"
16 
28 class SM_NetworkBuilder : public SM_Object {
29 
30  //attributes
31 private :
32 
33 
34 
35 protected:
36 
37  // CONSTRUCTORS
41 
42 
43  }
44 
45  // DESTRUCTORS
48  virtual ~SM_NetworkBuilder(void) {
49  }
50 
51 public :
52 
53  //Instance building
54  //=================
55 
56 
57 
58 
59  //MEMORY
60 
74  virtual tMemSize getMemorySize() const {
75  return sizeof(*this)+getContentsMemorySize();
76  }
77 
86  virtual tMemSize getContentsMemorySize() const {
87  tMemSize mem=SM_Object::getContentsMemorySize();
88 
89  return mem;
90  }
91 
92  //SET & GET methods
93 
94 
95 
96 
97 public:
98 
99 
108  virtual void buildNetwork(const SM_CrystalStructure& cStructure,
109  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
110  const std::array<tReal,SM_Constants::DIM>& X0,
111  const std::array<tInteger,SM_Constants::DIM>& Ns,
112  const std::valarray<tMask>& mask,
113  SM_Network& network)=0;
114 
115 
122  virtual tBoolean buildDomainNetwork(const SM_CrystalStructure& cStructure,
123  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
124  const tString& domainExpression,
125  SM_Network& network)=0;
126 
127 
134  inline void buildPaverNetwork(const SM_CrystalStructure& cStructure,
135  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
136  const std::array<tInteger,SM_Constants::DIM>& Ns,
137  SM_Network& network) {
138  buildPaverNetwork(cStructure,isPeriodic,
139  {0.,0.,0.},Ns,
140  network);
141  }
142 
149  inline void buildPaverNetwork(const SM_CrystalStructure& cStructure,
150  const std::array<tReal,SM_Constants::DIM>& X0,
151  const std::array<tInteger,SM_Constants::DIM>& Ns,
152  SM_Network& network) {
153  buildPaverNetwork(cStructure,{false,false,false},
154  X0,Ns,
155  network);
156  }
157 
163  inline void buildPaverNetwork(const SM_CrystalStructure& cStructure,
164  const std::array<tInteger,SM_Constants::DIM>& Ns,
165  SM_Network& network) {
166  buildPaverNetwork(cStructure,
167  {false,false,false},
168  {0,0,0},Ns,
169  network);
170  }
171 
179  inline void buildPaverNetwork(const SM_CrystalStructure& cStructure,
180  const std::array<tBoolean,SM_Constants::DIM>& isPeriodic,
181  const std::array<tReal,SM_Constants::DIM>& X0,
182  const std::array<tInteger,SM_Constants::DIM>& Ns,
183  SM_Network& network){
184 
185 
186  std::valarray<tMask> mask(1);
187  mask[0]=1;
188  buildNetwork(cStructure,isPeriodic,X0,Ns,mask,network);
189 
190  }
191 
192 
193 
194 
195 
196 };
197 
198 #endif
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
This class decribe a crystal structure.
Definition: SM_CrystalStructure.h:30
This class is dedicated to build a network.
Definition: SM_NetworkBuilder.h:28
void buildPaverNetwork(const SM_CrystalStructure &cStructure, const std::array< tInteger, SM_Constants::DIM > &Ns, SM_Network &network)
build the network from a grid paver
Definition: SM_NetworkBuilder.h:163
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_NetworkBuilder.h:86
void buildPaverNetwork(const SM_CrystalStructure &cStructure, const std::array< tReal, SM_Constants::DIM > &X0, const std::array< tInteger, SM_Constants::DIM > &Ns, SM_Network &network)
build the network from a grid paver
Definition: SM_NetworkBuilder.h:149
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_NetworkBuilder.h:74
virtual tBoolean buildDomainNetwork(const SM_CrystalStructure &cStructure, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const tString &domainExpression, SM_Network &network)=0
build the network from domain expression
virtual void buildNetwork(const SM_CrystalStructure &cStructure, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::array< tReal, SM_Constants::DIM > &X0, const std::array< tInteger, SM_Constants::DIM > &Ns, const std::valarray< tMask > &mask, SM_Network &network)=0
build the network from a grid paver and a mask on crystal structure on grid
void buildPaverNetwork(const SM_CrystalStructure &cStructure, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::array< tReal, SM_Constants::DIM > &X0, const std::array< tInteger, SM_Constants::DIM > &Ns, SM_Network &network)
build the network from a grid paver
Definition: SM_NetworkBuilder.h:179
void buildPaverNetwork(const SM_CrystalStructure &cStructure, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::array< tInteger, SM_Constants::DIM > &Ns, SM_Network &network)
build the network from a grid paver
Definition: SM_NetworkBuilder.h:134
SM_NetworkBuilder(void)
create a network class
Definition: SM_NetworkBuilder.h:40
virtual ~SM_NetworkBuilder(void)
destroy
Definition: SM_NetworkBuilder.h:48
This class is describes a network composed by.
Definition: SM_Network.h:66
This class is a base class for Stoch Microm package.
Definition: SM_Object.h:36