C++ main module for emicrom Package  1.0
EMM_DisplacementOperator.h
Go to the documentation of this file.
1 #ifndef EMM_DisplacementOperator_H
2 #define EMM_DisplacementOperator_H
3 
4 #include "EMM_Operator.h"
5 
8 
9 #include "CORE_MorseArray.h"
10 
12 
14 
15 #include "MATH_Solver.h"
16 
193 class EMM_DisplacementOperator : public virtual EMM_Operator {
194 
196  // ATTRIBUTES
197 
198 public:
199  //limit condition types
200  //time integation methods
201  static const tFlag P1;
202  static const tFlag TE;
203 
204  //is steady state : mElasticityState & 1 = 1 true :
205  // - FROZEN
206  // - EQUILIBRIUM_STATE
207  //is equilibrium :
208  // - EQUILIBRIUM_STATE
209  static const tFlag FROZEN_STATE;//10
210  static const tFlag EQUILIBRIUM_STATE;//11
211  static const tFlag UNSTEADY_STATE;//00
212 private:
213 
214  //elastic constraint tensor
215  SP::EMM_4SymmetricTensors mLe;
216 
217 
218  //elastic constraints tensor of the magnetic excitation : \f$ L^{me}= \lambda^m : \lambda^e \f$
219  SP::EMM_4Tensors mLme;
220 
221  //elastic constraints tensor of the magnetic excitation : \f$ L^{em}= \lambda^e : \lambda^m \f$
222  SP::EMM_4Tensors mLem;
223 
224 
225  //magnetic constraint tensor of the magnetic excitation \f$ L^{mem} = (\lambda^m : (\lambda^e:\lambda^m)) \f$
226  SP::EMM_4SymmetricTensors mLmem;
227 
228 
229 
230  //indicates the elasticity state
232 
233 
234  //integration time method P1|TE
236 
237  //integration time order 1|2
239 
240  //adimensionized size of a cell
241  tReal mL[3];
242 
243  //time step between \f$ t_{n-1} \f$ and \f$ t_n\f$
246 
247  //normalized volumic mass distribution per cell
249 
250  //limit condition on point i in[0,nPoints[
251  // - dirichlet point 1
252  // - neumann points 0
254 
255 
256  //elastic tensor for each cell : \f$ \varepsilon(u)_{ij}=\displaystyle \frac{1}{2} \left ( \frac{\partial u_i}{\partial x_j} + \frac{\partial u_j}{\partial x_i} \right ) \f$
258 
259  //displacement field at time \f$ t_{n-1} \f$ (for TE)
260  SP::EMM_RealField mUnm1;
261 
262  //displacement field at \f$ t_n \f$
263  SP::EMM_RealField mUn;
264 
265  //displacement field at \f$ t > t_n \f$
266  SP::EMM_RealField mUt;
267 
268  //displacement velocity at time (for GLi)
269  SP::EMM_RealField mVt;
270 
271  //displacement velocity at time \f$ t_n \f$
272  SP::EMM_RealField mVn;
273 
274  //the stress of size n x mDimension \f$ \displaystyle \frac{\partial^2 u}{\partial t^2} = div(sigma) \f$ at time \f$ t_n \f$
275  SP::EMM_RealField mAccelerator;
276 
277  //the stress of size n x mDimension at time t (for GL4)
278  SP::EMM_RealField mAccelerator_t;
279 
280 
281  //init data file for displacement
283  //scale factor for file
285  //init uniform data for displacement
286  SP::EMM_RealField mInitU;
287  //init data file for velocity
289  //scale factor for file
291  //init uniform data for velocity
292  SP::EMM_RealField mInitV;
293 
294  //constraint face indicator
296 
297  //constraints defined on points
298  SP::EMM_RealField mConstraints;
299 
300  //adimensionized parameters
301  tReal mElasticTensorAdimensionizedParameter;//parameter of adimensioning the constraint
302  tReal mTc;//caracteristic time
303  tReal mLc;//caracteristic length
304  tReal mMsat;//magnetization at saturation
305 
306  //ASSOCIATIONS:
307 
308  //gauss lagrange integration for next time step fields computing (for GL4)
309  SP::MATH_GaussLegendreIntegration mIntegrator;
310 
311  //for gauss legendre integration (for GL4)
312  SP::EMM_RealField mUs;
313  SP::EMM_RealField mMs;
314 
315  //solver
316  SP::MATH_Solver mSolver;
317 
318  //equilibrium matrix
320  SP::EMM_BlockEquilibriumMatrix mEquilibriumMatrix;
321 
322 protected:
323 
324  // METHODS
325 
326  // CONSTRUCTORS
327 
331 
332  // DESTRUCTORS
333 
336  virtual ~EMM_DisplacementOperator(void);
337 
338 
339 public:
340  //NEW constructor
341 protected:
345  virtual void toDoAfterThisSetting() {
347  };
348 
349 
350 public:
351 
352  //physical data input
353  //====================
362  virtual void adimensionize(const tReal& Le,const tReal& Ms,const tReal& T,const tReal& L) {
363  mElasticTensorAdimensionizedParameter=Le;
364  mTc=T;
365  mLc=L;
366  mMsat=Ms;
367  }
371  inline const tReal* getAdimensionizedSegmentsSize() const {
372  return mL;
373  }
374 
375 
380  return mKappa;
381  }
382 
386  inline const EMM_4SymmetricTensors & getLambdaE() const {
387  return *mLe.get();
388  }
389 
393  inline const EMM_4Tensors& getLambdaEDoubleDotLambdaM() const {
394  return *mLem.get();
395  }
396 
400  inline const EMM_4Tensors& getLambdaMDoubleDotLambdaE() const {
401  return *mLme.get();
402  }
407  return *mLmem.get();
408  }
409 
410  //initial data
411  //=============
412 
417  inline void setInitialDisplacement(const tReal& scale,const tString& dataFile) {
418  mInitUFile=dataFile;
419  mInitUFileScale=scale;
420  }
424  inline void setInitialDisplacement(const tReal data[3]) {
425  mInitU->setSize(1);
426  EMM_RealField &U=*mInitU.get();
427  U.setValue(0,data);
428  mInitUFile="";
429  }
435  inline void setInitialDisplacement(const tReal U0,const tReal& U1,const tReal& U2) {
436  mInitU->setSize(1);
437  EMM_RealField &U=*mInitU.get();
438  U.initField(U0,U1,U2);
439  mInitUFile="";
440  }
444  inline void setInitialDisplacement(const EMM_RealField& data) {
445  mInitU->copy(data);
446  mInitUFile="";
447  }
452  inline void setInitialVelocity(const tReal& scale,const tString& dataFile) {
453  mInitVFile=dataFile;
454  mInitVFileScale=scale;
455  }
459  inline void setInitialVelocity(const EMM_RealField& data) {
460  mInitV->copy(data);
461  mInitVFile="";
462  }
463 
467  inline void setInitialVelocity(const tReal data[3]) {
468  mInitV->setSize(1);
469  EMM_RealField &V=*mInitV.get();
470  V.setValue(0,data);
471  mInitVFile="";
472  }
478  inline void setInitialVelocity(const tReal& V0,const tReal& V1,const tReal& V2) {
479  mInitV->setSize(1);
480  EMM_RealField &V=*mInitV.get();
481  V.initField(V0,V1,V2);
482  mInitVFile="";
483  }
484 
485 
486 
487  //limit conditions input data
488  //===========================
489 
497  inline void setLimitConditionOnPoints(const EMM_IntArray& lc) {
498  mLimitConditionOnPoints->copy(lc);
499  }
500 
508  mLimitConditionOnPoints->setSize(1);
509  (*mLimitConditionOnPoints.get())[0]=lc;
510  }
511 
516  inline void setConstraints(const tFlag& C,const tString& dataFile) {
517  mConstraintFaces=C;
518  if (!mConstraints->loadFromFile(dataFile))
519  throw EMM_Exception("emicrom/operator/magnetostriction",
520  "EMM_DisplacementOperator::setConstraints(fileName)",
521  "error in reading the file "+dataFile);
522 
523  }
528  inline void setConstraints(const tFlag& C,const tReal data[3]) {
529  mConstraintFaces=C;
530  mConstraints->setSize(1);
531  EMM_RealField &V=*mConstraints.get();
532  V.setValue(0,data);
533  }
540  inline void setConstraints(const tFlag& C,
541  const tReal& C0,const tReal& C1,const tReal& C2) {
542  mConstraintFaces=C;
543  mConstraints->setSize(1);
544  EMM_RealField &V=*mConstraints.get();
545  V.initField(C0,C1,C2);
546  }
551  inline void setConstraints(const tFlag& C,const EMM_RealField& data) {
552  mConstraintFaces=C;
553  mConstraints->copy(data);
554  }
555 
559  inline const tFlag& getConstraintFaces() const {
560  return mConstraintFaces;
561  }
562 
566  inline const EMM_RealField& getConstraints() const {
567  return *mConstraints.get();
568  }
573  return *mConstraints.get();
574  }
575 
576 public:
577  /* get the limit condition value for all points of the mesh.
578  * @return the array at all points:
579  * - NO_LIMIT_CONDITION for all interior points or not magnetized point
580  * - DIRICHLET_LIMIT_CONDITION for all points on Dirichlet boundary
581  * - NEUMANN_LIMIT_CONDITION for all points on Neumann boundary
582  */
584  return *mLimitConditionOnPoints.get();
585  }
586  /* get the limit condition value for all points of the mesh.
587  * @return the array at all points:
588  * - NO_LIMIT_CONDITION for all interior points or not magnetized point
589  * - DIRICHLET_LIMIT_CONDITION for all points on Dirichlet boundary
590  * - NEUMANN_LIMIT_CONDITION for all points on Neumann boundary
591  */
594  }
595 
596 
606  virtual void buildDataOnBoundaryFaces(const EMM_Grid3D& mesh,
607  const EMM_LimitConditionArray& limitConditionOnPoints,
608  const EMM_RealField& U0,
609  EMM_RealField& DnU0) = 0;
610 
611 
618 
626  void nullProjectionOnDirichletBoundary(const tUIndex& nPoints,const tDimension& dim,tReal* V) const;
627 
635 
636 
646  void projectionOnDirichletBoundary(const tUIndex& nPoints,const tDimension& dim,const tBoolean& incV0,const tReal* V0, tReal* V) const;
647 
648 
656  void periodicProjection(const tCellFlag& periodicity,const tUInteger nPoints[3],EMM_RealField& V) const;
657 
658 
659  //discretization methods
660  //======================
661 
662 
671  virtual tULLInt getMemorySize() const;
672 
673 
687  virtual tBoolean discretize(const EMM_LandauLifschitzSystem& system);
688 
697 
698  //backup & restore methods
699  //========================
700 
701 public:
717  virtual tBoolean backup(const tString& prefix,const tString& suffix,const tString& ext) const;
718 
733  virtual tBoolean restore(const EMM_LandauLifschitzSystem& system,
734  const tString& prefix,const tString& suffix,const tString& ext);
735 
736  //output data
737  //=============
738 
743  return mEpsilonUt;
744  }
745  //Data fields methods
746  //===================
747 
751  virtual tUSInt getDataFieldsNumber() const {
752  return (isSteadyState())?1:3;
753  }
754 
755 
768  virtual tBoolean getDataField(const tUSInt& index,tString& dataName,tUIndex& n,tDimension& dim,const float *& values) const {
769  tBoolean succeeds=false;
770  switch(index) {
771  case 0:
772  dataName="U";
773  dim=mUn->getDimension();
774  succeeds=mUn->getValues(n,values);
775  n/=dim;
776  break;
777  case 1:
778  dataName="dU_dt";
779  dim=mVn->getDimension();
780  succeeds=mVn->getValues(n,values);
781  n/=dim;
782  break;
783 
784  case 2:
785  dataName="d2U_dt2";
786  dim=mAccelerator->getDimension();
787  succeeds=mAccelerator->getValues(n,values);
788  n/=dim;
789  break;
790  }
791  return succeeds;
792  }
804  virtual tBoolean getDataField(const tUSInt& index,tString& dataName,tUIndex& n,tDimension& dim,const double *& values) const {
805  tBoolean succeeds=false;
806  switch(index) {
807  case 0:
808  dataName="U";
809  dim=mUn->getDimension();
810  succeeds=mUn->getValues(n,values);
811  n/=dim;
812  break;
813  case 1:
814  dataName="dU_dt";
815  dim=mVn->getDimension();
816  succeeds=mVn->getValues(n,values);
817  n/=dim;
818  break;
819  case 2:
820  dataName="d2U_dt2";
821  dim=mAccelerator->getDimension();
822  succeeds=mAccelerator->getValues(n,values);
823  n/=dim;
824  break;
825 
826 
827  }
828  return succeeds;
829  }
841  virtual tBoolean getDataField(const tUSInt& index,tString& dataName,tUIndex& n,tDimension& dim,const long double *& values) const {
842  tBoolean succeeds=false;
843  switch(index) {
844  case 0:
845  dataName="U";
846  dim=mUn->getDimension();
847  succeeds=mUn->getValues(n,values);
848  n/=dim;
849  break;
850  case 1:
851  dataName="dU_dt";
852  dim=mVn->getDimension();
853  succeeds=mVn->getValues(n,values);
854  n/=dim;
855  break;
856 
857  case 2:
858  dataName="d2U_dt2";
859  dim=mAccelerator->getDimension();
860  succeeds=mAccelerator->getValues(n,values);
861  n/=dim;
862  break;
863 
864  }
865  return succeeds;
866 
867 
868  }
869 
870 
871 public:
872 
873  //operator attributes
874  //=================
875 
879  virtual tBoolean isAffine() const {
880  return false;
881  }
886  return false;
887  }
888 
889 
890 
891  //Displacement fields Methods at 2 times
892  //======================================
893 public:
897  inline void setDisplacement(const EMM_RealField& u) {
898  mUn->copy(u);
899  }
905  inline void setDisplacement(const tReal& Ux,const tReal& Uy,const tReal& Uz) {
906  mUn->initField(Ux,Uy,Uz);
907  }
912  return *mUn.get();
913  }
917  inline const EMM_RealField& getDisplacement() const {
918  return *mUn.get();
919  }
923  inline const EMM_RealField& getDisplacement(const tReal& t) const {
924  if ((t==0) || (isSteadyState())) return *mUn.get();
925  else if (t<0) return *mUnm1.get();
926  else return *mUt.get();
927  }
928 
929 
930 
934  void setVelocity(const EMM_RealField& v) {
935  mVn->copy(v);
936 
937  }
943  void setVelocity(const tReal& Vx,const tReal& Vy,const tReal& Vz) {
944  mVn->initField(Vx,Vy,Vz);
945  }
950  return *mVn.get();
951  }
955  inline const EMM_RealField& getVelocity(const tReal& t) const {
956  if ((t==0)||(isSteadyState())) return *mVn.get();
957  else return *mVt.get();
958  }
959 
963  inline const EMM_RealField& getVelocity() const {
964  return *mVn.get();
965  }
966 public:
971  return *mAccelerator.get();
972  }
976  inline const EMM_RealField& getAccelerator() const {
977  return *mAccelerator.get();
978  }
979 
980 
981  //linear system solver
982  //=====================
983 
992  virtual void setSolver(const tString& solverName);
993 
997  void setSolver(SP::MATH_Solver solver) {
998  mSolver=solver;
999  }
1000 
1006  return mSolver.get();
1007  }
1008  //Time integration methods
1009  //=========================
1010 
1014  inline void setElasticityState(const tFlag& v) {
1015  mElasticityState=v;
1016  }
1017  /* \brief @return true if the elastity is steady
1018  *
1019  */
1020  inline tBoolean isSteadyState() const {
1021  return ((mElasticityState & 1)==1);
1022  }
1023  /* \brief @return true if the elastity is at equilibrium
1024  */
1025  inline tBoolean isEquilibriumState() const {
1026  return (mElasticityState==EQUILIBRIUM_STATE);
1027  }
1028  /* \brief @return true if the elastity is frozen
1029  */
1030  inline tBoolean isFrozenState() const {
1031  return (mElasticityState==FROZEN_STATE);
1032  }
1033 
1034 
1038  inline void setTimeIntegrationMethod(const tFlag& m) {
1039  mTimeIntegrationMethod=m;
1040  }
1044  inline const tFlag& getTimeIntegrationMethod() const {
1045  return mTimeIntegrationMethod;
1046  }
1050  inline void setTimeIntegrationOrder(const tInt& o) {
1051  mTimeIntegrationOrder=o;
1052  }
1056  inline const tUCInt& getTimeIntegrationOrder() const {
1057  return mTimeIntegrationOrder;
1058  }
1059 
1063  inline const tReal& getTimeStep() const {
1064  return mDt;
1065  }
1066 
1067  //time evolutions of fields for unsteady state
1068  //=============================================
1069 public:
1073  inline void setCFL(const tReal& cfl) {
1074  mCFL=cfl;
1075  }
1076 
1087  virtual tBoolean computeFieldsAtTime(const tReal& t,
1088  const tFlag& order,
1089  const EMM_RealArray& sigma,
1090  const EMM_RealField& dM_dt0,
1091  const EMM_RealField& M0);
1092 
1093 
1101  virtual tBoolean updateAtNextTimeStep(const tReal& dt,
1102  const EMM_RealArray& sigma,
1103  const EMM_RealField& Mt);
1104 
1105 
1106 private:
1118  const EMM_RealField& accelerator,
1119  const EMM_RealField& U0,
1120  const EMM_RealField& V0,
1121  EMM_RealField& U) const;
1122 
1123 
1140  const tReal& dt,
1141  const EMM_RealField& accelerator,
1142  const EMM_RealField& U0,
1143  const EMM_RealField& U1,
1144  EMM_RealField& U2,
1145  EMM_RealField& V2) const;
1146 
1147 
1162  const EMM_RealField& accelerator,
1163  const EMM_RealField& U0,
1164  const EMM_RealField& V0,
1165  EMM_RealField& U1,
1166  EMM_RealField& V1) const;
1167 
1168 
1169 
1186  const EMM_RealArray& sigma,
1187  const EMM_RealField& dM_dt0,
1188  const EMM_RealField& M0,
1189  const EMM_RealField& U0,
1190  const EMM_RealField& V0,
1191  EMM_RealField& Ut,
1192  EMM_RealField& Vt) const;
1193 
1225  const EMM_RealArray& sigma,
1226  const EMM_RealField& dM_dt0,
1227  const EMM_RealField& M0,
1228  const EMM_RealField& U0,
1229  const EMM_RealField& V0,
1230  EMM_RealField& Ut,
1231  EMM_RealField& Vt,
1232  EMM_RealField& Us,
1233  EMM_RealField& Ms);
1234 
1235 private:
1236 
1247 
1255 
1261  virtual void spaceProjection(EMM_RealField& V) const=0;
1262 
1269  virtual void spaceProjection(const EMM_RealField& V0, EMM_RealField& V) const=0;
1270 
1271 protected:
1277  virtual void spaceRelevant(EMM_RealField& V) const=0;
1278 
1279  //steady state methods
1280  //===================
1281 
1282 public:
1283 
1287  virtual SP::EMM_BlockEquilibriumMatrix NewEquilibriumMatrix() const;
1288 
1289 
1294  mIsEquilibriumMatrixConditioned=c;
1295  }
1301  }
1302 
1308  D.setSize(0);
1309  }
1310 protected:
1319  virtual void initializeEquilibriumSolver( const EMM_RealField& U0);
1320 
1321 public:
1322 
1335  const EMM_RealField& M,
1336  const EMM_RealField& U0,
1337  EMM_RealField& U);
1338 
1339 
1340 public:
1349  virtual void computeElasticStressMatrixProduct(const tUIndex& nData,const tDimension& dim, const tReal* U,tReal* D) const {
1350  computeElasticStress(false,-1,nData,dim,U,D);
1351  }
1352 
1353 
1354 
1355 
1356  //elastic tensor methods
1357  //==========================
1358 public:
1359 
1368  virtual void computeElasticTensor(const EMM_RealField& U, EMM_2PackedSymmetricTensors& eTensor);
1369 
1370 
1371 
1372 protected:
1373 
1374 
1385  virtual void computeElasticTensor(const tUIndex& nData,
1386  const tDimension& dim,
1387  const tReal* U,
1388  EMM_2PackedSymmetricTensors& eTensor) const=0;
1389 
1390 
1391  //stress methods
1392  //==============
1393 public:
1405  inline void computeStress(const EMM_RealArray& sigma,const EMM_RealField&U,const EMM_RealField& M,EMM_RealField& stress) const {
1406  computeElasticStress(U,stress);
1407  computeMagneticStress(1,-1,sigma,M,stress);
1408  }
1409 
1410 
1411  //elastic stress
1412  //==============
1413 
1424  virtual void computeElasticStress(const EMM_RealField& U, EMM_RealField& S) const {
1425  tUIndex nU,nS;
1426  const tDimension &dim=U.getDimension();
1427  const tReal *Us;
1428  tReal *Ss;
1429  if (!U.getValues(nU,Us)) {
1430  throw EMM_Exception("emicrom/operators/magnetistriction",
1431  "EMM_DisplacementOperator::computeElasticStress(U,S)",
1432  "displacement field has incompatible real type");
1433  }
1434  if (!S.getValues(nS,Ss)) {
1435  throw EMM_Exception("emicrom/operators/magnetistriction",
1436  "EMM_DisplacementOperator::computeElasticStress(U,S)",
1437  "stress field has incompatible real type");
1438  }
1439  if (nU!=nS) {
1440  throw EMM_Exception("emicrom/operators/magnetistriction",
1441  "EMM_DisplacementOperator::computeElasticStress(U,S)",
1442  "stress field & displacement field has incompatible size");
1443 
1444  }
1445  nU/=dim;
1446 
1447  computeElasticStress(nU,dim,Us,Ss);
1448  }
1449 
1450 public:
1451 
1481  inline void computeElasticStress(const tUIndex& nData,const tDimension& dim, const tReal* U,tReal* D) const {
1482  computeElasticStress(true,1,nData,dim,U,D);
1483  }
1484 
1485 protected:
1499  virtual void computeElasticStress(const tBoolean& withConstraints,
1500  const tReal& beta,
1501  const tUIndex& nData,const tDimension& dim,
1502  const tReal* U,
1503  tReal* D) const=0;
1504 
1505 
1506 
1507 public:
1519  inline void computeMagneticStress(const EMM_RealArray& sigma,const EMM_RealField& M, EMM_RealField& S) const {
1520  //get the dimensipon of the discrete space
1521  tUIndex nData=mUn->getSize();
1522  const tDimension& dim=mUn->getDimension();
1523  //update the size of the discrete magnetic stress field
1524  S.setDimension(dim);
1525  S.setSize(nData);
1526  //compute the magnetic stress field
1527  computeMagneticStress(0.,1.,sigma,M,S);
1528  }
1529 
1543  virtual void computeMagneticStress(const tReal& alpha,const tReal& beta,
1544  const EMM_RealArray& sigma,const EMM_RealField& M,
1545  EMM_RealField& S) const=0;
1546 
1547 
1548 
1549 
1550 protected:
1551 
1563  virtual void computeMagneticStress(const tReal& alpha,const tReal& beta,
1564  const tUIndex& nCells,const tDimension& dim, const EMM_RealArray& sigma,
1565  const tReal* M,
1566  const tUIndex& nS,tReal* S) const=0;
1567 
1568 
1569 public:
1570 
1571 
1572 
1573 
1574 
1575 
1576  //energy methods
1577  //===================
1578 public:
1592  tReal computeEnergy(const tReal& t,
1593  const tUIndex& nCells,const tDimension& dim,
1594  const EMM_RealArray& sigma,
1595  const tReal* M) const;
1596 
1597 
1603  inline tReal computeCineticEnergyAtTime(const tReal& t) const {
1604  return computeCineticEnergy(getVelocity(t));
1605  }
1611  virtual tReal computeCineticEnergy(const EMM_RealField& V) const=0;
1612 
1613 
1614 
1620  inline tReal computePotentialEnergyAtTime(const tReal& t) const {
1622  }
1623 
1629  virtual tReal computePotentialEnergy(const EMM_RealField& U) const;
1630 
1635  inline tReal computeStressConstraintEnergy(const tReal& t) const {
1637  }
1638 
1639 
1640 
1641 
1647  virtual tReal computeStressConstraintEnergy(const EMM_RealField& U) const=0;
1648 
1649 
1650 
1651 
1652 public:
1655  virtual tString toString() const {
1656  return EMM_Operator::toString();
1657  }
1658 
1659 
1660 
1661 };
1662 
1663 #endif
1664 
tBoolean computeFieldsAtTimeWithGL1Interpolation(const tReal &dt, const EMM_RealArray &sigma, const EMM_RealField &dM_dt0, const EMM_RealField &M0, const EMM_RealField &U0, const EMM_RealField &V0, EMM_RealField &Ut, EMM_RealField &Vt) const
compute the new U & V at by gauss legendre interpolation of degre N (N=1)
Definition: EMM_DisplacementOperator.cpp:1243
const EMM_RealField & getVelocity(const tReal &t) const
get the velocity at time
Definition: EMM_DisplacementOperator.h:955
tString mInitVFile
Definition: EMM_DisplacementOperator.h:288
void periodicProjection(const tCellFlag &periodicity, const tUInteger nPoints[3], EMM_RealField &V) const
make the periodic projection of the field V
Definition: EMM_DisplacementOperator.cpp:336
This class describes a morse array of symmetric tensors of 4 order.
Definition: EMM_4SymmetricTensors.h:17
const EMM_RealField & getAccelerator() const
get the accelerator for reading
Definition: EMM_DisplacementOperator.h:976
This class describes a grid3d mesh.
Definition: EMM_Grid3D.h:48
tReal mInitVFileScale
Definition: EMM_DisplacementOperator.h:290
void setInitialDisplacement(const tReal U0, const tReal &U1, const tReal &U2)
set initial displacement field
Definition: EMM_DisplacementOperator.h:435
SP::EMM_RealField mAccelerator_t
Definition: EMM_DisplacementOperator.h:278
virtual tBoolean restore(const EMM_LandauLifschitzSystem &system, const tString &prefix, const tString &suffix, const tString &ext)
restore the operator data from file(s)
Definition: EMM_DisplacementOperator.cpp:936
virtual SP::EMM_BlockEquilibriumMatrix NewEquilibriumMatrix() const
create the equilibrium matrix
Definition: EMM_DisplacementOperator.cpp:1420
tReal mMsat
Definition: EMM_DisplacementOperator.h:304
virtual void computeElasticStress(const EMM_RealField &U, EMM_RealField &S) const
compute the elastic stress for all cells
Definition: EMM_DisplacementOperator.h:1424
void setSolver(SP::MATH_Solver solver)
set the solver
Definition: EMM_DisplacementOperator.h:997
#define tLimitCondition
Definition: EMM_Types.h:19
tReal mElasticTensorAdimensionizedParameter
Definition: EMM_DisplacementOperator.h:301
virtual void initializeEquilibriumSolver(const EMM_RealField &U0)
initialize the equilibrium solver
Definition: EMM_DisplacementOperator.cpp:1423
const EMM_4Tensors & getLambdaMDoubleDotLambdaE() const
return the adimensionized magnetic tensor distribution
Definition: EMM_DisplacementOperator.h:400
tReal computeEnergy(const tReal &t, const tUIndex &nCells, const tDimension &dim, const EMM_RealArray &sigma, const tReal *M) const
compute the energy of the magnetostriction operator at current displacement and velocity ...
Definition: EMM_DisplacementOperator.cpp:1651
EMM_2PackedSymmetricTensors mEpsilonUt
Definition: EMM_DisplacementOperator.h:257
static const tFlag UNSTEADY_STATE
Definition: EMM_DisplacementOperator.h:211
#define tUInteger
Definition: types.h:91
SP::MATH_GaussLegendreIntegration mIntegrator
Definition: EMM_DisplacementOperator.h:309
SPC::EMM_LimitConditionArray getLimitConditionOnPointsByReference() const
Definition: EMM_DisplacementOperator.h:592
tReal computeCineticEnergyAtTime(const tReal &t) const
compute the energy due to velocity
Definition: EMM_DisplacementOperator.h:1603
const EMM_4SymmetricTensors & getLambdaMDoubleDotLambdaEDoubleDotLambdaM() const
return the adimensionized magnetic tensor distribution
Definition: EMM_DisplacementOperator.h:406
const EMM_2PackedSymmetricTensors & getElasticTensor() const
return the elastic tensor
Definition: EMM_DisplacementOperator.h:742
tUCInt mTimeIntegrationOrder
Definition: EMM_DisplacementOperator.h:238
virtual tBoolean isGradientComputationable() const
return true if the gradient of the magnetic excitation is computationable
Definition: EMM_DisplacementOperator.h:885
const tFlag & getConstraintFaces() const
get the constraint faces if face f is constrainted
Definition: EMM_DisplacementOperator.h:559
EMM_RealField & getAccelerator()
get the accelerator for writing
Definition: EMM_DisplacementOperator.h:970
void setIsEquilibriumMatrixReconditioned(const tBoolean &c)
set to true if the equilibrium matrix is conditioned
Definition: EMM_DisplacementOperator.h:1293
virtual void buildDataOnBoundaryFaces(const EMM_Grid3D &mesh, const EMM_LimitConditionArray &limitConditionOnPoints, const EMM_RealField &U0, EMM_RealField &DnU0)=0
build the data on boundary faces
SP::EMM_4Tensors mLme
Definition: EMM_DisplacementOperator.h:219
EMM_RealField & getDisplacement()
get the displacement for writing
Definition: EMM_DisplacementOperator.h:911
tBoolean computeEquilibriumState(const EMM_RealArray &sigma, const EMM_RealField &M, const EMM_RealField &U0, EMM_RealField &U)
compute the equilibirum state
Definition: EMM_DisplacementOperator.cpp:1478
void nullProjectionOnDirichletBoundary(EMM_RealField &V) const
project the velocity to 0 on dirichlet boundary points
Definition: EMM_DisplacementOperator.cpp:124
virtual ~EMM_DisplacementOperator(void)
destroy
Definition: EMM_DisplacementOperator.cpp:118
tBoolean isEquilibriumState() const
Definition: EMM_DisplacementOperator.h:1025
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: EMM_DisplacementOperator.cpp:854
T & get(const tUIndex &i)
get the value of the array at index i
Definition: CORE_Array.h:555
virtual void spaceProjection(EMM_RealField &V) const =0
make the projection of the vector B into the solving linear space
const EMM_RealField & getVelocity() const
get the velocity at t for reading
Definition: EMM_DisplacementOperator.h:963
#define tUCInt
Definition: types.h:21
virtual tBoolean computeFieldsAtTime(const tReal &t, const tFlag &order, const EMM_RealArray &sigma, const EMM_RealField &dM_dt0, const EMM_RealField &M0)
compute the fields of operator at time
Definition: EMM_DisplacementOperator.cpp:996
#define tUSInt
Definition: types.h:28
const tBoolean & isEquilibriumMatrixReconditioned() const
get if the equilibrium matrix is conditioned
Definition: EMM_DisplacementOperator.h:1299
virtual tReal computeCineticEnergy(const EMM_RealField &V) const =0
compute the energy due to velocity
void computeElasticStress(const tUIndex &nData, const tDimension &dim, const tReal *U, tReal *D) const
compute the elastic stress
Definition: EMM_DisplacementOperator.h:1481
void setConstraints(const tFlag &C, const tString &dataFile)
set constraints from file defined on points
Definition: EMM_DisplacementOperator.h:516
SP::EMM_4SymmetricTensors mLmem
Definition: EMM_DisplacementOperator.h:226
#define tBoolean
Definition: types.h:139
SP::EMM_4SymmetricTensors mLe
Definition: EMM_DisplacementOperator.h:215
static const tFlag P1
Definition: EMM_DisplacementOperator.h:201
SP::EMM_RealField mInitV
Definition: EMM_DisplacementOperator.h:292
void computeStress(const EMM_RealArray &sigma, const EMM_RealField &U, const EMM_RealField &M, EMM_RealField &stress) const
compute the stress
Definition: EMM_DisplacementOperator.h:1405
tBoolean computeFieldsAtTimeWithTE2(const tReal &dtau, const tReal &dt, const EMM_RealField &accelerator, const EMM_RealField &U0, const EMM_RealField &U1, EMM_RealField &U2, EMM_RealField &V2) const
compute the new U & V at by taylor extension of order 2
Definition: EMM_DisplacementOperator.cpp:1194
virtual tBoolean getDataField(const tUSInt &index, tString &dataName, tUIndex &n, tDimension &dim, const double *&values) const
get the data field at index for saving data in vtk,txt,... files.
Definition: EMM_DisplacementOperator.h:804
const EMM_LimitConditionArray & getLimitConditionOnPoints() const
Definition: EMM_DisplacementOperator.h:583
virtual void computeElasticTensor(const EMM_RealField &U, EMM_2PackedSymmetricTensors &eTensor)
compute the elastic tensor for all cells
Definition: EMM_DisplacementOperator.cpp:1623
const EMM_RealField & getConstraints() const
get the constraints field for reading
Definition: EMM_DisplacementOperator.h:566
static const tFlag TE
Definition: EMM_DisplacementOperator.h:202
virtual tBoolean resetToInitialState(const EMM_LandauLifschitzSystem &system)
reset the opertaro to initial state
Definition: EMM_DisplacementOperator.cpp:771
tReal computePotentialEnergyAtTime(const tReal &t) const
compute the potential energy to the space variation of the displacement
Definition: EMM_DisplacementOperator.h:1620
virtual tString toString() const
turn the martix into string
Definition: EMM_DisplacementOperator.h:1655
void computeMagneticStress(const EMM_RealArray &sigma, const EMM_RealField &M, EMM_RealField &S) const
compute the magnetic stress for all cells
Definition: EMM_DisplacementOperator.h:1519
#define tDimension
Definition: EMM_Types.h:10
tReal mL[3]
Definition: EMM_DisplacementOperator.h:241
void setInitialVelocity(const tReal data[3])
set initial velocity field
Definition: EMM_DisplacementOperator.h:467
void projectionOnDirichletBoundary(const EMM_RealField &V0, EMM_RealField &V) const
project the velocity to 0 on dirichlet boundary points
Definition: EMM_DisplacementOperator.cpp:156
SP::EMM_RealField mMs
Definition: EMM_DisplacementOperator.h:313
static const tFlag FROZEN_STATE
Definition: EMM_DisplacementOperator.h:209
void setTimeIntegrationOrder(const tInt &o)
set the time integration order for new field
Definition: EMM_DisplacementOperator.h:1050
EMM_DisplacementOperator(void)
create
Definition: EMM_DisplacementOperator.cpp:26
SP::MATH_Solver mSolver
Definition: EMM_DisplacementOperator.h:316
SP::EMM_RealField mUt
Definition: EMM_DisplacementOperator.h:266
tReal mCFL
Definition: EMM_DisplacementOperator.h:244
void setInitialDisplacement(const tReal &scale, const tString &dataFile)
set initial displacement field.
Definition: EMM_DisplacementOperator.h:417
void setLimitConditionOnPoints(const tLimitCondition &lc)
set the limit condition to all points
Definition: EMM_DisplacementOperator.h:507
const EMM_RealField & getDisplacement() const
get the displacement for reading
Definition: EMM_DisplacementOperator.h:917
const EMM_RealField & getDisplacement(const tReal &t) const
get the veolicty at time
Definition: EMM_DisplacementOperator.h:923
This class describes a morse array of symmetric tensors of 2 order in packed form.
Definition: EMM_2PackedSymmetricTensors.h:20
const EMM_4SymmetricTensors & getLambdaE() const
return the adimensionized elastic tensor distribution
Definition: EMM_DisplacementOperator.h:386
const tReal * getAdimensionizedSegmentsSize() const
get the segments size in all directions
Definition: EMM_DisplacementOperator.h:371
tFlag mConstraintFaces
Definition: EMM_DisplacementOperator.h:295
virtual void computeEquilibriumMatrixDiagonalConditioner(MATH_Vector &D) const
compute the diagonal conditioner
Definition: EMM_DisplacementOperator.h:1307
#define tCellFlag
Definition: EMM_Types.h:16
This class describes the displacement operator defined on the data of the mesh.
Definition: EMM_DisplacementOperator.h:193
tReal mTc
Definition: EMM_DisplacementOperator.h:302
SP::EMM_BlockEquilibriumMatrix mEquilibriumMatrix
Definition: EMM_DisplacementOperator.h:320
virtual void spaceRelevant(EMM_RealField &V) const =0
make the relevment of the vector B from the solving linear space.
virtual tReal computePotentialEnergy(const EMM_RealField &U) const
compute the potential energy to the space variation of the displacement
Definition: EMM_DisplacementOperator.cpp:1644
static const tFlag EQUILIBRIUM_STATE
Definition: EMM_DisplacementOperator.h:210
SP::EMM_4Tensors mLem
Definition: EMM_DisplacementOperator.h:222
tReal computeStressConstraintEnergy(const tReal &t) const
compute the energy of the boundary stress constraint
Definition: EMM_DisplacementOperator.h:1635
This class is an operator of a E-MicromM package which computes the field of the operator with respec...
Definition: EMM_Operator.h:24
This class describes a resolution of landau-lifschitz system of the Core Package for E-MicroM...
Definition: EMM_LandauLifschitzSystem.h:88
const tFlag & getTimeIntegrationMethod() const
get the time integration method for next time step
Definition: EMM_DisplacementOperator.h:1044
tReal mLc
Definition: EMM_DisplacementOperator.h:303
virtual void initField(const tReal &f)=0
init the field to uniform value in each direction
SP::EMM_RealField mConstraints
Definition: EMM_DisplacementOperator.h:298
virtual tBoolean getDataField(const tUSInt &index, tString &dataName, tUIndex &n, tDimension &dim, const long double *&values) const
get the data field at index for saving data in vtk,txt,... files.
Definition: EMM_DisplacementOperator.h:841
void setCFL(const tReal &cfl)
set the cfl for computing the initial time step
Definition: EMM_DisplacementOperator.h:1073
virtual void toDoAfterThisSetting()
method called after the setting of the shared pointer this method can only be called once...
Definition: EMM_Object.h:71
SP::EMM_RealField mInitU
Definition: EMM_DisplacementOperator.h:286
This class describes a masked vector.
Definition: MATH_Vector.h:16
virtual tBoolean backup(const tString &prefix, const tString &suffix, const tString &ext) const
backup of the operator data into file(s) used for restoring
Definition: EMM_DisplacementOperator.cpp:891
virtual void adimensionize(const tReal &Le, const tReal &Ms, const tReal &T, const tReal &L)
adimensionize the operator
Definition: EMM_DisplacementOperator.h:362
virtual tBoolean getValues(tUIndex &size, const float *&values) const
get the values
Definition: EMM_RealField.h:585
void setInitialVelocity(const tReal &V0, const tReal &V1, const tReal &V2)
set initial velocity field
Definition: EMM_DisplacementOperator.h:478
EMM_Array< tLimitCondition > EMM_LimitConditionArray
Definition: EMM_Array.h:279
tFlag mTimeIntegrationMethod
Definition: EMM_DisplacementOperator.h:235
tBoolean isSteadyState() const
Definition: EMM_DisplacementOperator.h:1020
tReal mDt
Definition: EMM_DisplacementOperator.h:245
virtual tBoolean getDataField(const tUSInt &index, tString &dataName, tUIndex &n, tDimension &dim, const float *&values) const
get the data field at index for saving data in vtk,txt,... files.
Definition: EMM_DisplacementOperator.h:768
tReal mInitUFileScale
Definition: EMM_DisplacementOperator.h:284
SP::EMM_RealField mVn
Definition: EMM_DisplacementOperator.h:272
const tUCInt & getTimeIntegrationOrder() const
get the time integration order for new field
Definition: EMM_DisplacementOperator.h:1056
#define tUIndex
Definition: types.h:126
const tReal & getTimeStep() const
get the time step for elasticty
Definition: EMM_DisplacementOperator.h:1063
This class describes a real array.
Definition: EMM_RealArray.h:16
const tDimension & getDimension() const
get the dimension
Definition: EMM_RealField.h:553
tBoolean isFrozenState() const
Definition: EMM_DisplacementOperator.h:1030
SP::EMM_RealField mVt
Definition: EMM_DisplacementOperator.h:269
virtual void setSize(const tUIndex &n)=0
set the size of the vector
virtual tBoolean discretize(const EMM_LandauLifschitzSystem &system)
discretize and initialize the operator
Definition: EMM_DisplacementOperator.cpp:475
virtual void setSolver(const tString &solverName)
set the solver
Definition: EMM_DisplacementOperator.cpp:1402
void setDisplacement(const tReal &Ux, const tReal &Uy, const tReal &Uz)
set the displacement field to an uniform vector defied on points
Definition: EMM_DisplacementOperator.h:905
DEFINE_SPTR(EMM_DisplacementOperator)
This class describes a solver of Ax=b.
Definition: MATH_Solver.h:18
MATH_Solver * getSolver()
get the solver of the system
Definition: EMM_DisplacementOperator.h:1005
#define tString
Definition: types.h:135
tFlag mElasticityState
Definition: EMM_DisplacementOperator.h:231
virtual tString toString() const
return the string representation of the object node
Definition: CORE_Object.h:326
const EMM_RealArray & getAdimensionizedVolumicMass() const
get the adimensionized volumic mass per cell
Definition: EMM_DisplacementOperator.h:379
SP::EMM_LimitConditionArray mLimitConditionOnPoints
Definition: EMM_DisplacementOperator.h:253
void setValue(const tUIndex &i, const tDimension &k, const tReal &v)
set the value at point i and for coordinate k
Definition: EMM_RealField.h:253
tBoolean computeFieldsAtTimeWithTE1(const tReal &dt, const EMM_RealField &accelerator, const EMM_RealField &U0, const EMM_RealField &V0, EMM_RealField &U1, EMM_RealField &V1) const
compute the new U & V at by taylor extension of order 2
Definition: EMM_DisplacementOperator.cpp:1163
tBoolean computeAccelerator(EMM_RealField &V)
compute the accelerator from the mass matrix : M.X=V V:=X
Definition: EMM_DisplacementOperator.cpp:1382
SP::EMM_RealField mUnm1
Definition: EMM_DisplacementOperator.h:260
virtual void toDoAfterThisSetting()
method called after the setting of the shared pointer this method can only be called once...
Definition: EMM_DisplacementOperator.h:345
SP::EMM_RealField mUs
Definition: EMM_DisplacementOperator.h:312
tString mInitUFile
Definition: EMM_DisplacementOperator.h:282
this class describes the exceptions raised for E-MicromM package
Definition: EMM_Exception.h:14
EMM_RealField & getVelocity()
get the velocity for writing
Definition: EMM_DisplacementOperator.h:949
tBoolean computeFieldsAtTimeWithGLnInterpolation(const tReal &dt, const EMM_RealArray &sigma, const EMM_RealField &dM_dt0, const EMM_RealField &M0, const EMM_RealField &U0, const EMM_RealField &V0, EMM_RealField &Ut, EMM_RealField &Vt, EMM_RealField &Us, EMM_RealField &Ms)
compute the new U & V at by gauss legendre interpolation of degre N (N=4)
Definition: EMM_DisplacementOperator.cpp:1286
This class describes a morse array of tensors of 4 order.
Definition: EMM_4Tensors.h:19
EMM_RealArray mKappa
Definition: EMM_DisplacementOperator.h:248
void setTimeIntegrationMethod(const tFlag &m)
set the time integration method for new field
Definition: EMM_DisplacementOperator.h:1038
void setDimension(const tDimension &d)
set the dimension
Definition: EMM_RealField.h:158
tBoolean mIsEquilibriumMatrixConditioned
Definition: EMM_DisplacementOperator.h:319
void setInitialDisplacement(const tReal data[3])
set initial displacement field
Definition: EMM_DisplacementOperator.h:424
void setDisplacement(const EMM_RealField &u)
set the displacement field
Definition: EMM_DisplacementOperator.h:897
SP_OBJECT(EMM_DisplacementOperator)
void setVelocity(const EMM_RealField &v)
set the velocity of dicplacement defined on points
Definition: EMM_DisplacementOperator.h:934
const EMM_4Tensors & getLambdaEDoubleDotLambdaM() const
return the adimensionized magnetic tensor distribution
Definition: EMM_DisplacementOperator.h:393
void setInitialDisplacement(const EMM_RealField &data)
set initial displacement field
Definition: EMM_DisplacementOperator.h:444
#define tULLInt
Definition: types.h:45
void setConstraints(const tFlag &C, const tReal &C0, const tReal &C1, const tReal &C2)
set initial constriants field
Definition: EMM_DisplacementOperator.h:540
void setInitialVelocity(const tReal &scale, const tString &dataFile)
set initial velocity field
Definition: EMM_DisplacementOperator.h:452
This class describes a real field.
Definition: EMM_RealField.h:21
SP::EMM_RealField mAccelerator
Definition: EMM_DisplacementOperator.h:275
virtual tBoolean solveAcceleratorSystem(EMM_RealField &V)=0
solve the accelerator system : M.X=V V:=X
void setVelocity(const tReal &Vx, const tReal &Vy, const tReal &Vz)
set the displacement velocity field to an uniform vector defined on points
Definition: EMM_DisplacementOperator.h:943
#define tInt
Definition: types.h:35
void setInitialVelocity(const EMM_RealField &data)
set initial velocity field
Definition: EMM_DisplacementOperator.h:459
virtual tBoolean updateAtNextTimeStep(const tReal &dt, const EMM_RealArray &sigma, const EMM_RealField &Mt)
update the data of operator at next time step
Definition: EMM_DisplacementOperator.cpp:1074
This class describes a general array.
Definition: EMM_Array.h:18
SP::EMM_RealField mUn
Definition: EMM_DisplacementOperator.h:263
virtual void setSize(const tUIndex &n)=0
set the size
virtual tUSInt getDataFieldsNumber() const
get the number of field used in the operator
Definition: EMM_DisplacementOperator.h:751
tBoolean computePastDisplacement(const tReal &dt, const EMM_RealField &accelerator, const EMM_RealField &U0, const EMM_RealField &V0, EMM_RealField &U) const
compute from and with time step dt
Definition: EMM_DisplacementOperator.cpp:1147
void setLimitConditionOnPoints(const EMM_IntArray &lc)
set the limit condition each point is set to
Definition: EMM_DisplacementOperator.h:497
EMM_RealField & getConstraints()
get the constraints field for writing
Definition: EMM_DisplacementOperator.h:572
void setElasticityState(const tFlag &v)
set the elasticity state
Definition: EMM_DisplacementOperator.h:1014
#define tReal
Definition: types.h:118
virtual void computeElasticStressMatrixProduct(const tUIndex &nData, const tDimension &dim, const tReal *U, tReal *D) const
compute the elastic stress Matrix product
Definition: EMM_DisplacementOperator.h:1349
void setConstraints(const tFlag &C, const tReal data[3])
set constraints field
Definition: EMM_DisplacementOperator.h:528
void setConstraints(const tFlag &C, const EMM_RealField &data)
set constraints
Definition: EMM_DisplacementOperator.h:551
virtual tBoolean isAffine() const
return true if the operator is either constant or linear
Definition: EMM_DisplacementOperator.h:879
#define tFlag
Definition: types.h:74