C++ main module for emicrom Package  1.0
EMMG_DisplacementFVM_STEGROperator.h
Go to the documentation of this file.
1 #ifndef EMMG_DisplacementFVM_STEGROperator_H
2 #define EMMG_DisplacementFVM_STEGROperator_H
3 
4 
6 
7 
17 
19  // ATTRIBUTES
20 
21 
22 private:
23 
24 
25 public:
26 
27 
28  // ASSOCIATION
29 
30 private:
31 
32 protected:
33 
34  // METHODS
35 
36  // CONSTRUCTORS
37 
41  }
42 
43  // DESTRUCTORS
44 
48  }
49 
50 
51 public:
55  inline static SP::EMMG_DisplacementFVM_STEGROperator New() {
56  SP::EMMG_DisplacementFVM_STEGROperator p(new EMMG_DisplacementFVM_STEGROperator(),
58  p->setThis(p);
59  return p;
60  };
61 public:
62 
63 public:
64 
65 
66 
67 public:
68 
69 
70 
81  virtual void computeElasticStress(const EMM_RealField& U, EMM_RealField& S) const {
82  tUIndex nCells=U.getSize();
83  const tDimension& dim=U.getDimension();
84 
85  //verify the type of U
86  const EMMG_RealField *gU=dynamic_cast<const EMMG_RealField *>(&U);
87  if (gU==null) throw EMM_Exception("generic","EMMG_DisplacementFVM_STEGROperator::computeElasticStress(..)",
88  "U is an incompatible real field");
89 
90  S.setDimension(dim);
91  S.setSize(nCells);
92  //verify the type of S
93  EMMG_RealField *gS=dynamic_cast<EMMG_RealField *>(&S);
94  if (gS==null) throw EMM_Exception("generic","EMMG_DisplacementFVM_STEGROperator::computeElasticStress(..)",
95  "S is an incompatible real field");
96 
97  EMM_DisplacementFVM_STEGROperator::computeElasticStress(true,1,nCells,dim,&(*gU)[0],&(*gS)[0]);
98  }
99 
113  virtual void computeMagneticStress(const tReal& alpha,const tReal& beta,
114  const EMM_RealArray& sigma,const EMM_RealField& M, EMM_RealField& S) const {
115  tUIndex nCells=M.getSize();
116  const tDimension& dim=M.getDimension();
117 
118  //verify the type of M
119  const EMMG_RealField *gM=dynamic_cast<const EMMG_RealField *>(&M);
120  if (gM==null) throw EMM_Exception("generic","EMMG_DisplacementFVM_STEGROperator::computeMagneticStress(..)",
121  "M is an incompatible real field");
122 
123  //verify the type of S
124  EMMG_RealField *gS=dynamic_cast<EMMG_RealField *>(&S);
125 
126  if (gS==null) throw EMM_Exception("generic","EMMG_DisplacementFVM_STEGROperator::computeMagneticStress(..)",
127  "S is an incompatible real field");
128 
129  //verify the dimension
130  if (S.getSize()*S.getDimension()!=nCells*dim) {
131  throw EMM_Exception("generic","EMMG_DisplacementFVM_STEGROperator::computeMagneticStress(sigma,M,S)",
132  "M & S has incompatible size");
133  }
134  EMM_DisplacementFVM_STEGROperator::computeMagneticStress(alpha,beta,nCells,dim,sigma,&(*gM)[0],nCells,&(*gS)[0]);
135 
136 
137  }
138 
139 
140 };
141 
142 #endif
143 
static SP::EMMG_DisplacementFVM_STEGROperator New()
create a cubic anisotropy operator
Definition: EMMG_DisplacementFVM_STEGROperator.h:55
virtual tUIndex getSize() const =0
return the size of the field
This class describes the displacement operator defined on the cells of the mesh with Surface Gradient...
Definition: EMM_DisplacementFVM_STEGROperator.h:47
This class describes a generic real field.
Definition: EMMG_RealField.h:17
DEFINE_SPTR(EMMG_DisplacementFVM_STEGROperator)
#define null
Definition: types.h:144
#define tDimension
Definition: EMM_Types.h:10
This class describes the displacement operator based on Finite Differences Method EMM_DisplacementFVM...
Definition: EMMG_DisplacementFVM_STEGROperator.h:16
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_DisplacementFVMOperator.cpp:1427
virtual void computeElasticStress(const EMM_RealField &U, EMM_RealField &S) const
compute the elastic stress for all cells
Definition: EMMG_DisplacementFVM_STEGROperator.h:81
virtual void computeElasticStress(const tBoolean &withConstraints, const tReal &beta, const tUIndex &nData, const tDimension &dim, const tReal *U, tReal *S) const
compute the elastic stress
Definition: EMM_DisplacementFVMOperator.cpp:1067
#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_DisplacementFVM_STEGROperator)
this class describes the exceptions raised for E-MicromM package
Definition: EMM_Exception.h:14
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_DisplacementFVM_STEGROperator.h:113
void setDimension(const tDimension &d)
set the dimension
Definition: EMM_RealField.h:158
EMMG_DisplacementFVM_STEGROperator(void)
create
Definition: EMMG_DisplacementFVM_STEGROperator.h:40
This class describes a real field.
Definition: EMM_RealField.h:21
virtual ~EMMG_DisplacementFVM_STEGROperator(void)
destroy
Definition: EMMG_DisplacementFVM_STEGROperator.h:47
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