C++ main module for stochmagnet Package  1.0
SM_TemplatedOperator.h
Go to the documentation of this file.
1 #ifndef SM_TemplatedOperator_H
2 #define SM_TemplatedOperator_H
3 
4 //base class header
5 #include "SM_Operator.h"
6 
7 //network class header
8 #include "SM_Network.h"
9 
17 template<class I>
19 
20  //attributes
21 private :
22 
23 
24  //association
25 
26 
27 
28 protected:
29  // CONSTRUCTORS
33 
34  }
35 
36  // DESTRUCTORS
39  virtual ~SM_TemplatedOperator(void) {
40  }
41 
42 public :
43 
44  //Instance building
45  //=================
46 
47 
48 
62  virtual tMemSize getMemorySize() const {
63  return sizeof(*this)+getContentsMemorySize();
64  }
65 
66 
67 public:
74  inline void computeTemplatedMagneticField(const tIndex& t,
75  const SM_Network& network,
76  const tReal *mu,
77  tReal *B) const {
78  static_cast<const I*>(this)->computeTemplatedMagneticField(t,network,mu,B);
79  }
88  const SM_Network& network,
89  const tReal *mu,
90  tReal *H,
91  tReal& E) {
92  static_cast<const I*>(this)->computeTemplatedMagneticFieldAndEnergy(t,network,mu,H,E);
93  }
101  const SM_Network& network,
102  const tReal *mu) const {
103  return static_cast<const I*>(this)->omputeTemplatedEnergy(t,network,mu);
104  }
105 };
106 
107 
108 #endif
This class is describes a a network.
Definition: SM_Network.h:18
This class is describes an operator.
Definition: SM_Operator.h:18
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: SM_Operator.h:80
This class is describes an implmentation of operator with the class I.
Definition: SM_TemplatedOperator.h:18
SM_TemplatedOperator(void)
create a network class
Definition: SM_TemplatedOperator.h:32
void computeTemplatedMagneticField(const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B) const
compute the magnetic field by templated method at time t
Definition: SM_TemplatedOperator.h:74
virtual ~SM_TemplatedOperator(void)
destroy
Definition: SM_TemplatedOperator.h:39
void computeTemplatedMagneticFieldAndEnergy(const tIndex &t, const SM_Network &network, const tReal *mu, tReal *H, tReal &E)
compute the magnetic field and energy at time t
Definition: SM_TemplatedOperator.h:87
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_TemplatedOperator.h:62
tReal computeTemplatedEnergy(const tIndex &t, const SM_Network &network, const tReal *mu) const
compute the energy
Definition: SM_TemplatedOperator.h:100
#define tIndex
Definition: types.h:157
#define tMemSize
Definition: types.h:166
#define tReal
Definition: types.h:137