C++ main module for emicrom Package  1.0
EMMG_MinimalExchangeOperator.h
Go to the documentation of this file.
1 #ifndef EMMG_MinimalExchangeOperator_H
2 #define EMMG_MinimalExchangeOperator_H
3 
5 
6 
16 
18  // ATTRIBUTES
19 
20 
21 private:
22 
23 
24 
25 public:
26 
27 
28  // ASSOCIATION
29 
30 private:
31 
32 
33 protected:
34 
35  // METHODS
36 
37  // CONSTRUCTORS
38 
42  }
43 
44  // DESTRUCTORS
45 
49  }
50 
51 
52 public:
56  inline static SP::EMMG_MinimalExchangeOperator New() {
57  SP::EMMG_MinimalExchangeOperator p(new EMMG_MinimalExchangeOperator(),
59  p->setThis(p);
60  return p;
61  };
62 
63 
64 
71  virtual void computeMagneticExcitationField(const EMM_RealArray& sigma,
72  const EMM_RealField& M,
73  EMM_RealField& H) const {
74 
75  //get the exchange factor at each cell;
76  tUIndex nCells=M.getSize();
77  const tDimension& dim=M.getDimension();
78 
79  //set the size of the magnetic excitation field
80  H.setSize(nCells);
81  H.setDimension(dim);
82 
83  //no computation
84  if (nCells==0) return;
85 
86  //verify the type of M
87  const EMMG_RealField *gM=dynamic_cast<const EMMG_RealField *>(&M);
88  if (gM==null) throw EMM_Exception("generic","EMMG_MinimalExchangeOperator:: computeMagneticExcitationField(..)",
89  "M is an incompatible real field");
90 
91  //verify the type of H
92  EMMG_RealField *gH=dynamic_cast<EMMG_RealField *>(&H);
93  if (gH==null) throw EMM_Exception("generic","EMMG_MinimalExchangeOperator:: computeMagneticExcitationField(..)",
94  "H is an incompatible real field");
95 
96 
97  EMM_MinimalExchangeOperator::computeMagneticExcitationField(nCells,dim,sigma,&(*gM)[0],&(*gH)[0]);
98 
99  };
100 
101 
102 };
103 
104 #endif
105 
virtual void computeMagneticExcitationField(const EMM_RealArray &sigma, const EMM_RealField &M, EMM_RealField &H) const
compute the normalized excitation magnetic field at M for reading
Definition: EMMG_MinimalExchangeOperator.h:71
virtual tUIndex getSize() const =0
return the size of the field
This class describes a generic real field.
Definition: EMMG_RealField.h:17
This class describes an implementation of the exchange operator EMM_MinimalExchangeOperator using an ...
Definition: EMMG_MinimalExchangeOperator.h:15
virtual ~EMMG_MinimalExchangeOperator(void)
destroy the exchange operator
Definition: EMMG_MinimalExchangeOperator.h:48
SP_OBJECT(EMMG_MinimalExchangeOperator)
#define null
Definition: types.h:144
#define tDimension
Definition: EMM_Types.h:10
DEFINE_SPTR(EMMG_MinimalExchangeOperator)
#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
This class describes an implementation of the exchange operator EMM_ExchangeOperator.
Definition: EMM_MinimalExchangeOperator.h:34
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
virtual void computeMagneticExcitationField(const tUIndex &nCells, const tDimension &dim, const EMM_RealArray &sigma, const tReal *M, tReal *H) const
compute the excitation magnetic field at M
Definition: EMM_MinimalExchangeOperator.cpp:81
This class describes a real field.
Definition: EMM_RealField.h:21
static SP::EMMG_MinimalExchangeOperator New()
create shared pointer to an exchange operator class
Definition: EMMG_MinimalExchangeOperator.h:56
virtual void setSize(const tUIndex &n)=0
set the size
EMMG_MinimalExchangeOperator(void)
create th eexchange operator
Definition: EMMG_MinimalExchangeOperator.h:41
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141