C++ main module for emicrom Package  1.0
EMMG_FullExchangeOperator.h
Go to the documentation of this file.
1 #ifndef EMMG_FullExchangeOperator_H
2 #define EMMG_FullExchangeOperator_H
3 
5 
6 
17 
19  // ATTRIBUTES
20 
21 
22 private:
23 
24 
25 
26 public:
27 
28 
29  // ASSOCIATION
30 
31 private:
32 
33 
34 
35 
36 
37 protected:
38 
39  // METHODS
40 
41  // CONSTRUCTORS
42 
46  }
47 
48  // DESTRUCTORS
49 
53  }
54 
55 
56 public:
60  inline static SP::EMMG_FullExchangeOperator New() {
61  SP::EMMG_FullExchangeOperator p(new EMMG_FullExchangeOperator(),
63  p->setThis(p);
64  return p;
65  };
66 
67 
68 
69 public:
70 
77  virtual void computeMagneticExcitationField(const EMM_RealArray& sigma,
78  const EMM_RealField& M,
79  EMM_RealField& H) const {
80  // size of the operator
81  tUIndex nCells=M.getSize();
82  //dimension
83  const tDimension &dim=M.getDimension();
84 
85  //set the size of the magnetic excitation field
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","EMMG_FullExchangeOperator:: computeMagneticExcitationField(..)",
95  "M is an incompatible real field");
96 
97  //verify the type of H
98  EMMG_RealField *gH=dynamic_cast<EMMG_RealField *>(&H);
99  if (gH==null) throw EMM_Exception("generic","EMMG_FullExchangeOperator:: computeMagneticExcitationField(..)",
100  "H is an incompatible real field");
101 
102  EMM_FullExchangeOperator::computeMagneticExcitationField(nCells,dim,&(*gM)[0],&(*gH)[0]);
103 
104  };
105 
106 
107 };
108 
109 #endif
110 
virtual tUIndex getSize() const =0
return the size of the field
This class describes a generic real field.
Definition: EMMG_RealField.h:17
static SP::EMMG_FullExchangeOperator New()
create shared pointer to an exchange operator class
Definition: EMMG_FullExchangeOperator.h:60
virtual void computeMagneticExcitationField(const tUIndex &nCells, const tDimension &dim, const tReal *M, tReal *H) const
compute the excitation magnetic field at M
Definition: EMM_FullExchangeOperator.cpp:294
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_FullExchangeOperator.h:77
#define null
Definition: types.h:144
#define tDimension
Definition: EMM_Types.h:10
EMMG_FullExchangeOperator(void)
create th eexchange operator
Definition: EMMG_FullExchangeOperator.h:45
This class describes an implementation of the exchange operator EMM_FullExchangeOperator using an EMM...
Definition: EMMG_FullExchangeOperator.h:16
DEFINE_SPTR(EMMG_FullExchangeOperator)
#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
SP_OBJECT(EMMG_FullExchangeOperator)
this class describes the exceptions raised for E-MicromM package
Definition: EMM_Exception.h:14
virtual ~EMMG_FullExchangeOperator(void)
destroy the exchange operator
Definition: EMMG_FullExchangeOperator.h:52
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
This class describes an implementation of the exchange operator EMM_MinimalExchangeOperator.
Definition: EMM_FullExchangeOperator.h:29
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141