C++ main module for emicrom Package  1.0
EMMG_DisplacementFEMOperator.h
Go to the documentation of this file.
1 #ifndef EMMG_DisplacementFEMOperator_H
2 #define EMMG_DisplacementFEMOperator_H
3 
4 
6 
7 
8 
18 
20  // ATTRIBUTES
21 
22 
23 private:
24 
25 
26 public:
27 
28 
29  // ASSOCIATION
30 
31 private:
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_DisplacementFEMOperator New() {
57  SP::EMMG_DisplacementFEMOperator p(new EMMG_DisplacementFEMOperator(),
59  p->setThis(p);
60  return p;
61  };
62 
63 public:
64 
65 
74  virtual void computeElasticStress(const EMM_RealField& U, EMM_RealField& S) const {
75  tUIndex nCells=U.getSize();
76  const tDimension& dim=U.getDimension();
77 
78  //verify the type of U
79  const EMMG_RealField *gU=dynamic_cast<const EMMG_RealField *>(&U);
80  if (gU==null) throw EMM_Exception("generic","EMMG_DisplacementFEMOperator::computeElasticStress(..)",
81  "U is an incompatible real field");
82 
83  S.setDimension(dim);
84  S.setSize(nCells);
85  //verify the type of S
86  EMMG_RealField *gS=dynamic_cast<EMMG_RealField *>(&S);
87  if (gS==null) throw EMM_Exception("generic","EMMG_DisplacementFEMOperator::computeElasticStress(..)",
88  "S is an incompatible real field");
89 
90  EMM_DisplacementFEMOperator::computeElasticStress(true,1,nCells,dim,&(*gU)[0],&(*gS)[0]);
91  }
105  virtual void computeMagneticStress(const tReal& alpha,const tReal& beta,const EMM_RealArray& sigma,const EMM_RealField& M, EMM_RealField& S) const {
106  tUIndex nCells=M.getSize();
107  const tDimension& dim=M.getDimension();
108 
109  //verify the type of M
110  const EMMG_RealField *gM=dynamic_cast<const EMMG_RealField *>(&M);
111  if (gM==null) throw EMM_Exception("generic","EMMG_DisplacementFEMOperator::computeMagneticStress(..)",
112  "M is an incompatible real field");
113 
114 
115  //verify the type of S
116  EMMG_RealField *gS=dynamic_cast<EMMG_RealField *>(&S);
117  if (gS==null) throw EMM_Exception("generic","EMMG_DisplacementFEMOperator::computeMagneticStress(..)",
118  "S is an incompatible real field");
119 
120 
121  EMM_DisplacementFEMOperator::computeMagneticStress(alpha,beta,nCells,dim,sigma,&(*gM)[0],S.getSize(),&(*gS)[0]);
122 
123 
124  }
125 
126 };
127 
128 #endif
129 
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 the displacement operator based on Finite Elements Method EMM_DisplacementFEMOpe...
Definition: EMMG_DisplacementFEMOperator.h:17
virtual ~EMMG_DisplacementFEMOperator(void)
destroy
Definition: EMMG_DisplacementFEMOperator.h:48
virtual void computeMagneticStress(const tReal &alpha, const tReal &beta, const EMM_RealArray &sigma, const EMM_RealField &M, EMM_RealField &S) const
compute the magnetic stress for all cells
Definition: EMMG_DisplacementFEMOperator.h:105
#define null
Definition: types.h:144
DEFINE_SPTR(EMMG_DisplacementFEMOperator)
#define tDimension
Definition: EMM_Types.h:10
static SP::EMMG_DisplacementFEMOperator New()
create a cubic anisotropy operator
Definition: EMMG_DisplacementFEMOperator.h:56
SP_OBJECT(EMMG_DisplacementFEMOperator)
#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
EMMG_DisplacementFEMOperator(void)
create
Definition: EMMG_DisplacementFEMOperator.h:41
this class describes the exceptions raised for E-MicromM package
Definition: EMM_Exception.h:14
virtual void computeElasticStress(const tBoolean &withConstraints, const tReal &beta, const tUIndex &nData, const tDimension &dim, const tReal *U, tReal *D) const
compute the elastic stress
Definition: EMM_DisplacementFEMOperator.cpp:1353
void setDimension(const tDimension &d)
set the dimension
Definition: EMM_RealField.h:158
virtual void computeMagneticStress(const tReal &alpha, const tReal &beta, const tUIndex &nCells, const tDimension &dim, const EMM_RealArray &sigma, const tReal *M, const tUIndex &nData, tReal *D) const
compute the magnetic stress to elastic stress S
Definition: EMM_DisplacementFEMOperator.cpp:1865
This class describes the displacement operator defined on the points of the mesh. ...
Definition: EMM_DisplacementFEMOperator.h:345
virtual void computeElasticStress(const EMM_RealField &U, EMM_RealField &S) const
compute the elastic stress for all cells
Definition: EMMG_DisplacementFEMOperator.h:74
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
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141