C++ mpi module for stochmagnet_main Package
SMOMPI_Operator.h
1 #ifndef SMOMPI_Operator_H
2 #define SMOMPI_Operator_H
3 
4 
5 //base class header
6 #include "SM_Operator.h"
7 
8 
19 class SMOMPI_Operator : public virtual SM_Operator {
20 
21  //attributes
22 private :
23 
24 
25 
26 protected:
27  // CONSTRUCTORS
31 
32  }
33 
34  // DESTRUCTORS
37  virtual ~SMOMPI_Operator(void) {
38  }
39 
40 public :
41 
42  //Instance building
43  //=================
44 
45 
46 
50  inline static CORE_UniquePointer<SMOMPI_Operator> New(CORE_UniquePointer<SM_SliceOperator> sliceOperator) {
51  CORE_UniquePointer<SMOMPI_Operator> p(new SMOMPI_Operator(),SMOMPI_Operator::Delete());
52  p->setSliceOperator(std::move(sliceOperator));
53  return p;
54  }
55 
58  virtual CORE_UniquePointer<SM_Operator> NewInstance() const {
59  return New(getSliceOperator().NewInstance());
60  }
61 
62 
63  //MEMORY
64 
78  virtual tMemSize getMemorySize() const {
79  return sizeof(*this)+getContentsMemorySize();
80  }
89  virtual tMemSize getContentsMemorySize() const {
90  tMemSize mem=SM_Object::getContentsMemorySize();
91  return mem;
92  }
93 
94 
95 
96  //SET & GET
97  //=========
98 
99 
100 public:
101 
102 
103 
104 
105  //Fields computation
106  //==================
107 
108 
119  virtual void computeMagneticField(const tIndex& timeIndex,
120  const SM_Network& network,
121  const SM_Material& material,
122  const SM_RealField& S,
123  const tBoolean& alpha,
124  SM_RealField& H) const final;
125 
126 
127  //Total energy computation
128  //========================
129 
130 
138  virtual tReal computeEnergy(const tIndex& timeIndex,
139  const SM_Network& network,
140  const SM_Material& material,
141  const SM_RealField& S) const final;
142 
143 
151  virtual tReal computeEnergy(const SM_Network& network,
152  const SM_Material& material,
153  const SM_RealField& S,
154  const SM_RealField& H) const final;
155 
156 
157 };
158 
159 
160 #endif
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
This class describes an OpenMP/MPI implementation of operator This package defined the following abst...
Definition: SMOMPI_Operator.h:19
virtual tReal computeEnergy(const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S) const final
compute the energy by virtual method
Definition: SMOMPI_Operator.cpp:48
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SMOMPI_Operator.h:78
SMOMPI_Operator(void)
create a network class
Definition: SMOMPI_Operator.h:30
virtual ~SMOMPI_Operator(void)
destroy
Definition: SMOMPI_Operator.h:37
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: SMOMPI_Operator.h:89
virtual CORE_UniquePointer< SM_Operator > NewInstance() const
create a new instance of this
Definition: SMOMPI_Operator.h:58
virtual void computeMagneticField(const tIndex &timeIndex, const SM_Network &network, const SM_Material &material, const SM_RealField &S, const tBoolean &alpha, SM_RealField &H) const final
compute the magnetic field by virtual method
Definition: SMOMPI_Operator.cpp:12
static CORE_UniquePointer< SMOMPI_Operator > New(CORE_UniquePointer< SM_SliceOperator > sliceOperator)
build a new instance of the operator
Definition: SMOMPI_Operator.h:50
This class describes a materials defined by state attributes:
Definition: SM_Material.h:61
This class is describes a network composed by.
Definition: SM_Network.h:66
This class is describes an operator.
Definition: SM_Operator.h:43
SM_SliceOperator & getSliceOperator()
get the slice operator for writing
Definition: SM_Operator.h:127