C++ main module for emicrom Package  1.0
EMMG_MagnetostrictionOperator.h
Go to the documentation of this file.
1 #ifndef EMMG_MagnetostrictionOperator_H
2 #define EMMG_MagnetostrictionOperator_H
3 
4 
6 
16 
18  // ATTRIBUTES
19 
20 
21 private:
22 
23 
24 public:
25 
26 
27  // ASSOCIATION
28 
29 private:
30 
31 protected:
32 
33  // METHODS
34 
35  // CONSTRUCTORS
36 
40  }
41 
42  // DESTRUCTORS
43 
47  }
48 
49 
50 public:
54  inline static SP::EMMG_MagnetostrictionOperator New() {
55  SP::EMMG_MagnetostrictionOperator p(new EMMG_MagnetostrictionOperator(),
57  p->setThis(p);
58  return p;
59  };
60 
61 
62 public:
69  virtual void computeMagneticExcitationField(const EMM_RealArray& sigma,
70  const EMM_RealField& M,
71  EMM_RealField& H) const {
72  tUIndex nCells=M.getSize();
73  const tDimension& dim=M.getDimension();
74 
75  //set the size of the magnetic excitation field
76  H.setSize(nCells);
77 
78  //no computation
79  if (nCells==0) return;
80 
81  //verify the type of M
82  const EMMG_RealField *gM=dynamic_cast<const EMMG_RealField *>(&M);
83  if (gM==null) throw EMM_Exception("generic","EMMG_MagnetostrictionOperator::computeMagneticExcitationField(..)",
84  "M is an incompatible real field");
85 
86 
87  //verify the type of H
88  EMMG_RealField *gH=dynamic_cast<EMMG_RealField *>(&H);
89  if (gH==null) throw EMM_Exception("generic","EMMG_MagnetostrictionOperator:: computeMagneticExcitationField(..)",
90  "H is an incompatible real field");
91 
92  EMM_MagnetostrictionOperator::computeMagneticExcitationField(nCells,dim,sigma,&(*gM)[0],&(*gH)[0]);
93  }
94 
103  const EMM_RealField& M,
104  const EMM_RealField& D,
105  EMM_RealField& gradH) const {
106 
107  throw EMM_Exception("emicrom/generic",
108  "EMMG_MagnetostrictionOperator::computeMagneticExcitationFieldGradient()",
109  "gradient of operator is not computationable");
110  return true;
111  }
112 
113 
114 public:
133  const EMM_RealArray& sigma,const EMM_RealField& M,const EMM_RealField& H) const {
134  // size of the operator
135  tUIndex nCells=M.getSize();
136  const tDimension& dim=M.getDimension();
137 
138  //no computation
139  if (nCells==0) return 0;
140 
141  //verify the type of M
142  const EMMG_RealField *gM=dynamic_cast<const EMMG_RealField *>(&M);
143  if (gM==null) throw EMM_Exception("generic","EMMG_MagnetostrictionOperator::computeMagneticExcitationField(..)",
144  "M is an incompatible real field");
145 
146  const EMMG_RealField *gH=dynamic_cast<const EMMG_RealField *>(&H);
147  if (gH==null) throw EMM_Exception("generic","EMMG_MagnetostrictionOperator::computeMagneticExcitationField(..)",
148  "H is an incompatible real field");
149 
150 
151  return EMM_MagnetostrictionOperator::computeEnergy(t,nCells,dim,sigma,&(*gM)[0]);
152  }
167  virtual tReal computeEnergy(const tReal& t, const EMM_RealArray& sigma,const EMM_RealField& M,EMM_RealField& W) const {
168  // size of the operator
169  tUIndex nCells=M.getSize();
170  const tDimension& dim=M.getDimension();
171 
172 
173  //no computation
174  if (nCells==0) return 0;
175 
176  //verify the type of M
177  const EMMG_RealField *gM=dynamic_cast<const EMMG_RealField *>(&M);
178  if (gM==null) throw EMM_Exception("generic","EMMG_MagnetostrictionOperator:: computeEnergy(..)",
179  "M is an incompatible real field");
180 
181 
182  return EMM_MagnetostrictionOperator::computeEnergy(t,nCells,dim,sigma,&(*gM)[0]);
183  }
184 
185 
186 };
187 
188 #endif
189 
virtual ~EMMG_MagnetostrictionOperator(void)
destroy
Definition: EMMG_MagnetostrictionOperator.h:46
virtual tUIndex getSize() const =0
return the size of the field
virtual tBoolean computeMagneticExcitationFieldGradient(const EMM_RealArray &sigma, const EMM_RealField &M, const EMM_RealField &D, EMM_RealField &gradH) const
compute the gradient of the magnetic excitation field at M in the direction D
Definition: EMMG_MagnetostrictionOperator.h:102
This class describes a generic real field.
Definition: EMMG_RealField.h:17
static SP::EMMG_MagnetostrictionOperator New()
create a cubic anisotropy operator
Definition: EMMG_MagnetostrictionOperator.h:54
virtual tReal computeEnergy(const tReal &t, const EMM_RealArray &sigma, const EMM_RealField &M, EMM_RealField &W) const
compute the energy of the operator
Definition: EMMG_MagnetostrictionOperator.h:167
#define tBoolean
Definition: types.h:139
virtual void computeMagneticExcitationField(const EMM_RealArray &sigma, const EMM_RealField &M, EMM_RealField &H) const
compute the normalized excitation magnetic field at M
Definition: EMMG_MagnetostrictionOperator.h:69
SP_OBJECT(EMMG_MagnetostrictionOperator)
This class describes the magnetostriction operator EMM_MagnetostrictionOperator of the landau lifschi...
Definition: EMMG_MagnetostrictionOperator.h:15
#define null
Definition: types.h:144
#define tDimension
Definition: EMM_Types.h:10
virtual void computeMagneticExcitationField(const tUIndex &nCells, const tDimension &dim, const EMM_RealArray &sigma, const tReal *M, tReal *H) const
compute the normalized excitation magnetic field at M
Definition: EMM_MagnetostrictionOperator.cpp:124
tReal computeEnergy(const tReal &t, const tUIndex &nCells, const tDimension &dim, const EMM_RealArray &sigma, const tReal *M) const
compute the energy of the magnetostriction operator at current displacement and velocity ...
Definition: EMM_MagnetostrictionOperator.cpp:203
#define tUIndex
Definition: types.h:126
This class describes a real array.
Definition: EMM_RealArray.h:16
const tDimension & getDimension() const
get the dimension
Definition: EMM_RealField.h:553
DEFINE_SPTR(EMMG_MagnetostrictionOperator)
this class describes the exceptions raised for E-MicromM package
Definition: EMM_Exception.h:14
EMMG_MagnetostrictionOperator(void)
create
Definition: EMMG_MagnetostrictionOperator.h:39
This class describes a real field.
Definition: EMM_RealField.h:21
virtual void setSize(const tUIndex &n)=0
set the size
#define tReal
Definition: types.h:118
This class describes the magnetostriction operator of the landau lifshcitz system EMM_LandauLifschitz...
Definition: EMM_MagnetostrictionOperator.h:207
virtual tReal computeEnergyWithMagneticExcitation(const tReal &t, const EMM_RealArray &sigma, const EMM_RealField &M, const EMM_RealField &H) const
compute the energy of the operator
Definition: EMMG_MagnetostrictionOperator.h:132
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141