C++ mpi module for stochmagnet_main Package
SMOMPI_OneMasterMacroCellsDemagnetizedField.h
1 #ifndef SMOMPI_OneMasterMacroCellsDemagnetizedField_H
2 #define SMOMPI_OneMasterMacroCellsDemagnetizedField_H
3 
4 //base classes
5 #include "SM_MacroCellsDemagnetizedField.h"
6 
7 //mpi header
8 #include "MPI_Run.h"
9 
10 //network header
11 #include "SMOMPI_OneMasterMacroCellsNetwork.h"
12 
24 
25 private :
26 
29 
30  SM_RealField mDomainH;
31  //work array
32  std::valarray<tInteger> mCoreBBMacroCellIndices;
33  std::valarray<tReal> mCorePHdem;
34 protected:
35  // CONSTRUCTORS
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_MacroCellsDemagnetizedField> newInstance() const override {
66  CORE_UniquePointer<SelfClass> p=New();
67  p->setStorage(getStorage());
68  return std::move(p);
69  }
83  virtual tMemSize getMemorySize() const {
84  return sizeof(*this)+this->getContentsMemorySize();
85  }
86 
95  virtual tMemSize getContentsMemorySize() const {
96  tMemSize mem=SuperClass::getContentsMemorySize();
97  mem+=mDomainH.getSize()*sizeof(tReal);
98  //work array
99  mem+=sizeof(tInteger)*mCoreBBMacroCellIndices.size();
100  mem+=sizeof(tReal)*mCorePHdem.size();
101  return mem;
102  }
103 public:
104 
105 
109  return mDomainH;
110  }
114  return mDomainH;
115  }
116 
129  virtual void discretize(const SM_Material& material,const SM_MacroCellsNetwork& network) final;
130 
131 
137  virtual void computeMatrix(const SM_Material& material,
138  const SM_MacroCellsNetwork& network) override;
139 
140 public:
141 
142 
149  virtual void computeField(const SM_MacroCellsNetwork& network,
150  const SM_MacroCellsMagnetizationField& M) override;
151 
152 
153 
154 };
155 
156 
157 #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 demagnetized field for one master core.
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.h:23
virtual void discretize(const SM_Material &material, const SM_MacroCellsNetwork &network) final
discretize the field
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.cpp:20
virtual ~SMOMPI_OneMasterMacroCellsDemagnetizedField(void)
destroy
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.h:44
virtual void computeField(const SM_MacroCellsNetwork &network, const SM_MacroCellsMagnetizationField &M) override
compute the demagnetized field on macro cells network
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.cpp:104
virtual void computeMatrix(const SM_Material &material, const SM_MacroCellsNetwork &network) override
compute the matrix
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.cpp:39
static CORE_UniquePointer< SelfClass > New()
build a new instance of the operator
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.h:57
SMOMPI_OneMasterMacroCellsDemagnetizedField(void)
create a network class
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.h:38
const SM_RealField & getBoundingBoxMacroCellsDemagnetizedField() const
get the magnetization field on all not empty macro cells of the bounding box of macro cells
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.h:108
virtual CORE_UniquePointer< SM_MacroCellsDemagnetizedField > newInstance() const override
create a New instance of this
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.h:65
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.h:95
SM_RealField & getBoundingBoxMacroCellsDemagnetizedField()
get the magnetization field on all not empty macro cells of the bounding box of macro cells
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.h:113
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SMOMPI_OneMasterMacroCellsDemagnetizedField.h:83
This class is describes a demagnetized operator.
Definition: SM_MacroCellsDemagnetizedField.h:50
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_MacroCellsDemagnetizedField.h:141
const tFlag & getStorage() const
yet storage type in {NO_STORAGE,PACKED_STORAGE}
Definition: SM_MacroCellsDemagnetizedField.h:162
This class is describes a Magnetization field.
Definition: SM_MacroCellsMagnetizationField.h:23
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