C++ main module for emicrom Package  1.0
EMMG_LinearAnisotropyOperator.h
Go to the documentation of this file.
1 #ifndef EMMG_LinearAnisotropyOperator_H
2 #define EMMG_LinearAnisotropyOperator_H
3 
4 
5 
7 
18 
20  // ATTRIBUTES
21 
22 
23 private:
24 
25 
26 public:
27 
28 
29  // ASSOCIATION
30 
31 private:
32 
33 
34 
35 
36 protected:
37 
38  // METHODS
39 
40  // CONSTRUCTORS
41 
45 
46  }
47 
48  // DESTRUCTORS
49 
53  }
54 
55 
56 public:
60  inline static SP::EMMG_LinearAnisotropyOperator New() {
61  SP::EMMG_LinearAnisotropyOperator p(new EMMG_LinearAnisotropyOperator(),
63  p->setThis(p);
64  return p;
65  };
66 
67  // SET methods
68  // ===========
69 
70  // GET methods
71  // ===========
72 
73 
80  virtual void computeMagneticExcitationField(const EMM_RealArray& sigma,
81  const EMM_RealField& M,
82  EMM_RealField& H) const {
83  tUIndex nCells=M.getSize();
84  const tDimension& dim=M.getDimension();
85 
86  H.setDimension(dim);
87  H.setSize(nCells);
88 
89  //no computation
90  if (nCells==0) return;
91 
92  //verify the type of M
93  const EMMG_RealField *gM=dynamic_cast<const EMMG_RealField *>(&M);
94  if (gM==null) throw EMM_Exception("generic","EMM_LinearAnisotropyOperator::computeMagneticExcitationField(..)",
95  "M is an incompatible real field");
96 
97 
98  //verify the type of H
99  EMMG_RealField *gH=dynamic_cast<EMMG_RealField *>(&H);
100  if (gH==null) throw EMM_Exception("generic","EMM_LinearAnisotropyOperator:: computeMagneticExcitationField(..)",
101  "H is an incompatible real field");
102 
103 
104  EMM_LinearAnisotropyOperator::computeMagneticExcitationField(nCells,dim,sigma,&(*gM)[0],&(*gH)[0]);
105  }
106 
107 
108 };
109 
110 #endif
111 
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_LinearAnisotropyOperator.h:80
virtual tUIndex getSize() const =0
return the size of the field
EMMG_LinearAnisotropyOperator(void)
create
Definition: EMMG_LinearAnisotropyOperator.h:44
This class describes a generic real field.
Definition: EMMG_RealField.h:17
SP_OBJECT(EMMG_LinearAnisotropyOperator)
DEFINE_SPTR(EMMG_LinearAnisotropyOperator)
static SP::EMMG_LinearAnisotropyOperator New()
create a cubic anisotropy operator
Definition: EMMG_LinearAnisotropyOperator.h:60
This class describes the linear anistropy operator of the landau lifschitz system EMM_LandauLifschitz...
Definition: EMM_LinearAnisotropyOperator.h:52
#define null
Definition: types.h:144
#define tDimension
Definition: EMM_Types.h:10
virtual ~EMMG_LinearAnisotropyOperator(void)
destroy
Definition: EMMG_LinearAnisotropyOperator.h:52
#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
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 when anisotropy directions is uniform ...
Definition: EMM_LinearAnisotropyOperator.cpp:202
This class describes an implementation of the mixed of linear anistropy operators EMM_LinearAnisotrop...
Definition: EMMG_LinearAnisotropyOperator.h:17
this class describes the exceptions raised for E-MicromM package
Definition: EMM_Exception.h:14
void setDimension(const tDimension &d)
set the dimension
Definition: EMM_RealField.h:158
This class describes a real field.
Definition: EMM_RealField.h:21
virtual void setSize(const tUIndex &n)=0
set the size
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141