C++ mpi module for stochmagnet_main Package
SMOMPI_OneMasterMacroCellsMagnetizationField.h
1 #ifndef SMOMPI_OneMasterMacroCellsMagnetizationField_H
2 #define SMOMPI_OneMasterMacroCellsMagnetizationField_H
3 
4 //base classes
5 #include "SM_MacroCellsMagnetizationField.h"
6 
7 //network header
8 #include "SMOMPI_OneMasterMacroCellsNetwork.h"
9 
10 
22 
23 private :
24 
27 
28  SM_RealField mDomainM;
29  //work array
30  std::valarray<tInteger> mCoreBBMacroCellsIndex;
31  std::valarray<tReal> mCorePM;
32 
33 protected:
34  // CONSTRUCTORS
38 
39  }
40 
41  // DESTRUCTORS
45  }
46 
47 
48 public :
49 
50  //Instance building
51  //=================
52 
53 
57  inline static CORE_UniquePointer<SelfClass> New() {
58  return CORE_UniquePointer<SelfClass>(new SelfClass(),
60  }
61 
65  virtual CORE_UniquePointer<SM_MacroCellsMagnetizationField> newInstance() const override {
66  return New();
67  }
68 
82  virtual tMemSize getMemorySize() const {
83  return sizeof(*this)+this->getContentsMemorySize();
84  }
85 
94  virtual tMemSize getContentsMemorySize() const {
95  tMemSize mem=SuperClass::getContentsMemorySize();
96  mem+=mDomainM.getSize()*sizeof(tReal);
97  mem+=mCoreBBMacroCellsIndex.size()*sizeof(tInteger);
98  mem+=mCorePM.size()*sizeof(tReal);
99  return mem;
100  }
101 
105  return mDomainM;
106  }
107 
108 public:
109 
114  virtual void discretize(const SM_Material& material,const SM_MacroCellsNetwork& network) final;
115 public:
124  virtual void computeField(const SM_Material& material,
125  const SM_MacroCellsNetwork& network,
126  const SM_RealField& S,
127  SM_RealField& M) final;
128 
129 
130 
131 };
132 
133 
134 #endif
tIndex getSize() const
return the number values of the container
Definition: CORE_Field.h:161
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
This class describes an MPI implementation of the magnetization field for one master core.
Definition: SMOMPI_OneMasterMacroCellsMagnetizationField.h:21
virtual void discretize(const SM_Material &material, const SM_MacroCellsNetwork &network) final
discretize the field It does :
Definition: SMOMPI_OneMasterMacroCellsMagnetizationField.cpp:10
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SMOMPI_OneMasterMacroCellsMagnetizationField.h:94
virtual ~SMOMPI_OneMasterMacroCellsMagnetizationField(void)
destroy
Definition: SMOMPI_OneMasterMacroCellsMagnetizationField.h:44
virtual CORE_UniquePointer< SM_MacroCellsMagnetizationField > newInstance() const override
create a New instance of this
Definition: SMOMPI_OneMasterMacroCellsMagnetizationField.h:65
const SM_RealField & getBoundingBoxMacroCellsMagnetizationField() const
get the magnetization field on all not empty macro cells of the bounding box of macro cells
Definition: SMOMPI_OneMasterMacroCellsMagnetizationField.h:104
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SMOMPI_OneMasterMacroCellsMagnetizationField.h:82
virtual void computeField(const SM_Material &material, const SM_MacroCellsNetwork &network, const SM_RealField &S, SM_RealField &M) final
compute the magnetization field from S
Definition: SMOMPI_OneMasterMacroCellsMagnetizationField.cpp:26
static CORE_UniquePointer< SelfClass > New()
build a new instance of the operator
Definition: SMOMPI_OneMasterMacroCellsMagnetizationField.h:57
SMOMPI_OneMasterMacroCellsMagnetizationField(void)
create a network class
Definition: SMOMPI_OneMasterMacroCellsMagnetizationField.h:37
This class is describes a Magnetization field.
Definition: SM_MacroCellsMagnetizationField.h:23
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_MacroCellsMagnetizationField.h:101
This class is describes a macro cell network.
Definition: SM_MacroCellsNetwork.h:25
This class describes a materials defined by state attributes:
Definition: SM_Material.h:61