C++ mpi module for stochmagnet_main Package
SMOMPI_AllMasterMacroCellsDemagnetizedField.h
1 #ifndef SMOMPI_AllMasterMacroCellsDemagnetizedField_H
2 #define SMOMPI_AllMasterMacroCellsDemagnetizedField_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_AllMasterMacroCellsNetwork.h"
12 
24 
25 private :
26 
29 
30  std::valarray<tMPICount> mSliceFieldLength;
31  std::valarray<tMPICount> mSliceFieldDisplacement;
32 
33 protected:
34  // CONSTRUCTORS
38  }
39 
40  // DESTRUCTORS
44  }
45 
46 
47 public :
48 
49  //Instance building
50  //=================
51 
52 
56  inline static CORE_UniquePointer<SelfClass> New() {
57  return CORE_UniquePointer<SelfClass>(new SelfClass(),
59  }
60 
64  virtual CORE_UniquePointer<SM_MacroCellsDemagnetizedField> newInstance() const override {
65  CORE_UniquePointer<SelfClass> p=New();
66  p->setStorage(getStorage());
67  return std::move(p);
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+=mSliceFieldLength.size()*sizeof(tMPICount);
97  mem+=mSliceFieldDisplacement.size()*sizeof(tMPICount);
98  return mem;
99  }
100 public:
101 
102 
103 
116  virtual void discretize(const SM_Material& material,const SM_MacroCellsNetwork& network) final;
117 
118 
124  virtual void computeMatrix(const SM_Material& material,
125  const SM_MacroCellsNetwork& network) override;
126 
127 public:
128 
129 
136  virtual void computeField(const SM_MacroCellsNetwork& network,
137  const SM_MacroCellsMagnetizationField& M) override;
138 
139 
140 
141 };
142 
143 
144 #endif
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
This class describes an OpenMP/MPI implementation of the demagnetized field for all core considered a...
Definition: SMOMPI_AllMasterMacroCellsDemagnetizedField.h:23
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SMOMPI_AllMasterMacroCellsDemagnetizedField.h:94
static CORE_UniquePointer< SelfClass > New()
build a new instance of the operator
Definition: SMOMPI_AllMasterMacroCellsDemagnetizedField.h:56
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SMOMPI_AllMasterMacroCellsDemagnetizedField.h:82
virtual void discretize(const SM_Material &material, const SM_MacroCellsNetwork &network) final
discretize the field
Definition: SMOMPI_AllMasterMacroCellsDemagnetizedField.cpp:19
virtual ~SMOMPI_AllMasterMacroCellsDemagnetizedField(void)
destroy
Definition: SMOMPI_AllMasterMacroCellsDemagnetizedField.h:43
SMOMPI_AllMasterMacroCellsDemagnetizedField(void)
create a network class
Definition: SMOMPI_AllMasterMacroCellsDemagnetizedField.h:37
virtual CORE_UniquePointer< SM_MacroCellsDemagnetizedField > newInstance() const override
create a New instance of this
Definition: SMOMPI_AllMasterMacroCellsDemagnetizedField.h:64
virtual void computeField(const SM_MacroCellsNetwork &network, const SM_MacroCellsMagnetizationField &M) override
compute the demagnetized field on macro cells network
Definition: SMOMPI_AllMasterMacroCellsDemagnetizedField.cpp:123
virtual void computeMatrix(const SM_Material &material, const SM_MacroCellsNetwork &network) override
compute the matrix
Definition: SMOMPI_AllMasterMacroCellsDemagnetizedField.cpp:51
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