C++ main module for emicrom Package  1.0
EMMG_DisplacementFVM_VOGGROperator.h
Go to the documentation of this file.
1 #ifndef EMMG_DisplacementFVM_VOGGROperator_H
2 #define EMMG_DisplacementFVM_VOGGROperator_H
3 
4 
6 
7 
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_DisplacementFVM_VOGGROperator New() {
57  SP::EMMG_DisplacementFVM_VOGGROperator p(new EMMG_DisplacementFVM_VOGGROperator(),
59  p->setThis(p);
60  return p;
61  };
62 public:
63 
64 public:
65 
66 
67 
68 public:
69 
70 
71 
82  virtual void computeElasticStress(const EMM_RealField& U, EMM_RealField& S) const {
83  tUIndex nCells=U.getSize();
84  const tDimension& dim=U.getDimension();
85 
86  //verify the type of U
87  const EMMG_RealField *gU=dynamic_cast<const EMMG_RealField *>(&U);
88  if (gU==null) throw EMM_Exception("generic","EMMG_DisplacementFVM_VOGGROperator::computeElasticStress(..)",
89  "U is an incompatible real field");
90 
91  S.setDimension(dim);
92  S.setSize(nCells);
93  //verify the type of S
94  EMMG_RealField *gS=dynamic_cast<EMMG_RealField *>(&S);
95  if (gS==null) throw EMM_Exception("generic","EMMG_DisplacementFVM_VOGGROperator::computeElasticStress(..)",
96  "S is an incompatible real field");
97 
98  EMM_DisplacementFVM_VOGGROperator::computeElasticStress(true,1,nCells,dim,&(*gU)[0],&(*gS)[0]);
99  }
100 
115  virtual void computeMagneticStress(const tReal& alpha,const tReal& beta,const EMM_RealArray& sigma,const EMM_RealField& M, EMM_RealField& S) const {
116  tUIndex nCells=M.getSize();
117  const tDimension& dim=M.getDimension();
118 
119  //verify the type of M
120  const EMMG_RealField *gM=dynamic_cast<const EMMG_RealField *>(&M);
121  if (gM==null) throw EMM_Exception("generic","EMMG_DisplacementFVM_VOGGROperator::computeMagneticStress(..)",
122  "M is an incompatible real field");
123 
124  //verify the type of S
125  EMMG_RealField *gS=dynamic_cast<EMMG_RealField *>(&S);
126 
127  if (gS==null) throw EMM_Exception("generic","EMMG_DisplacementFVM_VOGGROperator::computeMagneticStress(..)",
128  "S is an incompatible real field");
129 
130  //verify the dimension
131  if (S.getSize()*S.getDimension()!=nCells*dim) {
132  throw EMM_Exception("generic","EMMG_DisplacementFVM_VOGGROperator::computeMagneticStress(sigma,M,S)",
133  "M & S has incompatible size");
134  }
135  EMM_DisplacementFVM_VOGGROperator::computeMagneticStress(alpha,beta,nCells,dim,sigma,&(*gM)[0],nCells,&(*gS)[0]);
136 
137 
138  }
139 
140 };
141 
142 #endif
143 
virtual tUIndex getSize() const =0
return the size of the field
This class describes a generic real field.
Definition: EMMG_RealField.h:17
EMMG_DisplacementFVM_VOGGROperator(void)
create
Definition: EMMG_DisplacementFVM_VOGGROperator.h:41
This class describes the displacement operator based on Finite Volumes Method for the EMMG_Magnetostr...
Definition: EMMG_DisplacementFVM_VOGGROperator.h:17
#define null
Definition: types.h:144
#define tDimension
Definition: EMM_Types.h:10
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 ~EMMG_DisplacementFVM_VOGGROperator(void)
destroy
Definition: EMMG_DisplacementFVM_VOGGROperator.h:48
DEFINE_SPTR(EMMG_DisplacementFVM_VOGGROperator)
This class describes the method to interpolate U on points, faces and cells.
Definition: EMM_DisplacementFVM_VOGGROperator.h:48
SP_OBJECT(EMMG_DisplacementFVM_VOGGROperator)
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
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 computeElasticStress(const EMM_RealField &U, EMM_RealField &S) const
compute the elastic stress for all cells
Definition: EMMG_DisplacementFVM_VOGGROperator.h:82
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_VOGGROperator.h:115
This class describes a real field.
Definition: EMM_RealField.h:21
static SP::EMMG_DisplacementFVM_VOGGROperator New()
create a cubic anisotropy operator
Definition: EMMG_DisplacementFVM_VOGGROperator.h:56
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