C++ main module for emicrom Package  1.0
EMM_DisplacementFEMOperator.h
Go to the documentation of this file.
1 #ifndef EMM_DisplacementFEMOperator_H
2 #define EMM_DisplacementFEMOperator_H
3 
5 
6 #include "EMM_MassMatrix.h"
7 
8 #include "MATH_Solver.h"
9 #include "MATH_Vector.h"
10 
346 
348  // ATTRIBUTES
349 public:
350 
353  static const tFlag CANONICAL_MASS_MATRIX=0;
356  static const tFlag BLOCK_MASS_MATRIX=1;
359  static const tFlag CONDENSED_MASS_MATRIX=2;
360 
361 private:
362 
363 
364  /* \brief compute \f$ \int_{\hat \omega} \frac{\partial \hat \Phi_i}{\partial r_j} d{\hat \omega}=|\hat \omega| . INT_GRAD_PHI[i*3+j]/ (H_j . INT_GRAD_PHI_FACTOR)\f$
365  */
366  static const tCInt INT_GRAD_PHI[];
368 
369  // ASSOCIATION
370 
371 private:
372 
374 
375  //accelerator matrix
376  SP::EMM_MassMatrix mMassMatrix;
377 
378 
379 
380 protected:
381 
382  // METHODS
383 
384  // CONSTRUCTORS
385 
389 
390  // DESTRUCTORS
391 
394  virtual ~EMM_DisplacementFEMOperator(void);
395 
396 
397 public:
398 
399  //limit conditions input data
400  //===========================
401 
402 
403 protected:
404 
415  virtual void buildDataOnBoundaryFaces(const EMM_Grid3D& mesh,
416  const EMM_LimitConditionArray& limitConditionOnPoints,
417  const EMM_RealField& U0,
418  EMM_RealField& DnU0) {
419 
420  //temporaray vector to compute \f$ \int_{\partial \omega_1} C. d\sigma \f$
421  SP::EMM_RealField C=DnU0.NewInstance();
422  if (buildDataOnNeumannBoundaryFaces(mesh, limitConditionOnPoints,DnU0,*C.get())) {
423  //not null constraint
424  DnU0.copy(*C.get());
425  } else {
426  //null constraint
427  DnU0.setSize(0);
428  }
429 
430  }
431 
432 private:
445  const EMM_LimitConditionArray& limitConditionOnPoints,
446  const EMM_RealField& DnU0,
447  EMM_RealField& C) const;
448 
449  //discretization mehods
450  //======================
451 public:
460  virtual tBoolean discretize(const EMM_LandauLifschitzSystem& system);
461 
469 
470 
474  inline void setMassMatrixType(const tFlag& t) {
475  mMassMatrixType=t;
476  }
480  inline const tFlag& getMassMatrixType() const {
481  return mMassMatrixType;
482  }
483 
487  virtual SP::EMM_MassMatrix NewMassMatrix() const;
488 
489 
493  inline const tUIndex* getPointsNumber() const {
494  return mMassMatrix->getPointsNumber();
495  }
496 
501  inline const tCellFlag& getPeriodicIndicator() const {
502  return mMassMatrix->getPeriodicIndicator();
503  }
504 
507  inline const EMM_CellFlagArray& getNeighborsIndicator() const {
508  return mMassMatrix->getNeighborsIndicator();
509  }
510 
519  virtual tULLInt getMemorySize() const {
521  mMassMatrix->getMemorySize();
522  }
523 
524  //output data
525  //=============
526 
536  virtual tBoolean getDataFieldSpace(const tUSInt& index,tString& dataName,tFlag& supportType,tString& dFieldType,tUIndex& n,tDimension& dim) const {
537  supportType=EMM_Grid3D::POINT;
538  dFieldType=CORE_Object::getTypeName<tReal>();
539  switch(index) {
540  case 0:
542  dataName="U";
543  n=getDisplacement().getSize();
544  return true;
545  break;
546  case 1:
547  dataName="dU_dt";
548  dim=getVelocity().getDimension();
549  n=getVelocity().getSize();
550  return true;
551  break;
552  case 2:
553  dataName="acc";
555  n=getAccelerator().getSize();
556  return true;
557  break;
558  }
559  return false;
560  }
561 
562 
563 
564 
565 
566 
567  //time evolutions of fields for unsteady state
568  //=============================================
569 
570 protected:
571 
572 
582 
589  virtual void spaceProjection(EMM_RealField& V) const;
590 
597  virtual void spaceProjection(const EMM_RealField& V0, EMM_RealField& V) const;
598 
599 protected:
606  virtual void spaceRelevant(EMM_RealField& V) const;
607 
608  //steady state method
609  //===================
610 
611 
612 public:
613 
619 
620 
621 
622 
623 
624  //elastic tensor methods
625  //======================
626 
627 protected:
628 
650  virtual void computeElasticTensor(const tUIndex& nData,
651  const tDimension& dim,
652  const tReal* U,
653  EMM_2PackedSymmetricTensors& eTensor) const;
654 
655 
656  //stress methods
657  //==============
658 protected:
677  virtual void computeElasticStress(const tBoolean& withConstraints,
678  const tReal& beta,
679  const tUIndex& nData,const tDimension& dim, const tReal* U,tReal* D) const;
680 
681 
682 private:
691  void addBoundaryElasticStress(const tReal& beta,const tUIndex& nPoints,const tDimension& dim,tReal* D) const;
692 
693 protected:
721  virtual void computeMagneticStress(const tReal& alpha,const tReal& beta,
722  const tUIndex& nCells,const tDimension& dim, const EMM_RealArray& sigma,
723  const tReal* M,
724  const tUIndex& nData,tReal* D) const;
725 
726 
727 
728 
729  //energy methods
730  //===============
731 public:
737  virtual tReal computeCineticEnergy(const EMM_RealField& V) const;
738 
739  /* ! \brief compute the potential energy to the space variation of the displacement
740  * @param U: displacement field
741  * @return potential energy value \f$ \int_\omega (\lambda^e:\varepsilon(u)):\varepsilon(u) d\omega \f$
742  *
743  */
744  virtual tReal computePotentialEnergy(const EMM_RealField& U) const;
745 
751 
752 
753  //STRING representation
754  //======================
755 public:
758  virtual tString toString() const {
760  }
761 
762 
763 
764 };
765 
766 #endif
767 
static const tFlag POINT
Definition: EMM_Grid3D.h:66
virtual void computeEquilibriumMatrixDiagonalConditioner(MATH_Vector &D) const
compute the diagonal conditioner
Definition: EMM_DisplacementFEMOperator.cpp:595
This class describes a grid3d mesh.
Definition: EMM_Grid3D.h:48
virtual tUIndex getSize() const =0
return the size of the field
SP::EMM_MassMatrix mMassMatrix
Definition: EMM_DisplacementFEMOperator.h:376
const tFlag & getMassMatrixType() const
get the mass matrix type
Definition: EMM_DisplacementFEMOperator.h:480
tReal computeStressConstraintEnergy(const EMM_RealField &Uf) const
compute the stress constraint energy on boundary
Definition: EMM_DisplacementFEMOperator.cpp:2176
static const tFlag CANONICAL_MASS_MATRIX
mass matrix whose each element is real
Definition: EMM_DisplacementFEMOperator.h:353
EMM_RealField & getAccelerator()
get the accelerator for writing
Definition: EMM_DisplacementOperator.h:970
tBoolean buildDataOnNeumannBoundaryFaces(const EMM_Grid3D &mesh, const EMM_LimitConditionArray &limitConditionOnPoints, const EMM_RealField &DnU0, EMM_RealField &C) const
build the data on boundary faces
Definition: EMM_DisplacementFEMOperator.cpp:50
virtual tBoolean resetToInitialState(const EMM_LandauLifschitzSystem &system)
reset the operator to initial state the operator
Definition: EMM_DisplacementFEMOperator.cpp:536
EMM_RealField & getDisplacement()
get the displacement for writing
Definition: EMM_DisplacementOperator.h:911
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: EMM_DisplacementOperator.cpp:854
SP_OBJECT(EMM_DisplacementFEMOperator)
#define tUCInt
Definition: types.h:21
#define tUSInt
Definition: types.h:28
#define tBoolean
Definition: types.h:139
static const tFlag CONDENSED_MASS_MATRIX
mass matrix is diagonal
Definition: EMM_DisplacementFEMOperator.h:359
void addBoundaryElasticStress(const tReal &beta, const tUIndex &nPoints, const tDimension &dim, tReal *D) const
add the elastic stress from boundary
Definition: EMM_DisplacementFEMOperator.cpp:1301
static const tUCInt INT_GRAD_PHI_FACTOR
Definition: EMM_DisplacementFEMOperator.h:367
#define tDimension
Definition: EMM_Types.h:10
static const tCInt INT_GRAD_PHI[]
Definition: EMM_DisplacementFEMOperator.h:366
virtual void computeElasticTensor(const tUIndex &nData, const tDimension &dim, const tReal *U, EMM_2PackedSymmetricTensors &eTensor) const
compute the elastic tensor for all cells
Definition: EMM_DisplacementFEMOperator.cpp:1088
virtual void spaceRelevant(EMM_RealField &V) const
make the rebuild of the vector V from the solving space.
Definition: EMM_DisplacementFEMOperator.cpp:563
virtual void spaceProjection(EMM_RealField &V) const
make the projection of the vector B into the solving linear space
Definition: EMM_DisplacementFEMOperator.cpp:555
virtual void buildDataOnBoundaryFaces(const EMM_Grid3D &mesh, const EMM_LimitConditionArray &limitConditionOnPoints, const EMM_RealField &U0, EMM_RealField &DnU0)
build the data on boundary faces
Definition: EMM_DisplacementFEMOperator.h:415
virtual SP::EMM_RealField NewInstance() const =0
create a new instance of real field with the same dimension and size
This class describes a morse array of symmetric tensors of 2 order in packed form.
Definition: EMM_2PackedSymmetricTensors.h:20
tFlag mMassMatrixType
Definition: EMM_DisplacementFEMOperator.h:373
#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
virtual tBoolean solveAcceleratorSystem(EMM_RealField &V)
solve the velocity form the accelerator matrix : M.X=V V:=X
Definition: EMM_DisplacementFEMOperator.cpp:567
virtual tBoolean getDataFieldSpace(const tUSInt &index, tString &dataName, tFlag &supportType, tString &dFieldType, tUIndex &n, tDimension &dim) const
get the data field at index for saving data in vtk,txt,... files.
Definition: EMM_DisplacementFEMOperator.h:536
const tCellFlag & getPeriodicIndicator() const
get the periodicity indication
Definition: EMM_DisplacementFEMOperator.h:501
This class describes a resolution of landau-lifschitz system of the Core Package for E-MicroM...
Definition: EMM_LandauLifschitzSystem.h:88
#define tCInt
Definition: types.h:24
This class describes a masked vector.
Definition: MATH_Vector.h:16
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: EMM_DisplacementFEMOperator.h:519
virtual ~EMM_DisplacementFEMOperator(void)
destroy
Definition: EMM_DisplacementFEMOperator.cpp:43
#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
DEFINE_SPTR(EMM_DisplacementFEMOperator)
virtual void copy(const EMM_RealField &f)=0
copy the real vector
#define tString
Definition: types.h:135
virtual tReal computePotentialEnergy(const EMM_RealField &U) const
compute the potential energy to the space variation of the displacement
Definition: EMM_DisplacementFEMOperator.cpp:2170
void setMassMatrixType(const tFlag &t)
set the mass matrix type
Definition: EMM_DisplacementFEMOperator.h:474
virtual tReal computeCineticEnergy(const EMM_RealField &V) const
compute the energy of the magnetostriction operator at current displacement and velocity ...
Definition: EMM_DisplacementFEMOperator.cpp:2159
EMM_RealField & getVelocity()
get the velocity for writing
Definition: EMM_DisplacementOperator.h:949
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
const EMM_CellFlagArray & getNeighborsIndicator() const
return the neighbors indicator in bits where F is the number of faces per element and is 1 if there...
Definition: EMM_DisplacementFEMOperator.h:507
static const tFlag BLOCK_MASS_MATRIX
mass matrix whose each element is a digonal matrixof size 3
Definition: EMM_DisplacementFEMOperator.h:356
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
#define tULLInt
Definition: types.h:45
virtual tString toString() const
turn the martix into string
Definition: EMM_DisplacementFEMOperator.h:758
This class describes a real field.
Definition: EMM_RealField.h:21
virtual void setSize(const tUIndex &n)=0
set the size
virtual SP::EMM_MassMatrix NewMassMatrix() const
create the accelerator matrix
Definition: EMM_DisplacementFEMOperator.cpp:480
#define tReal
Definition: types.h:118
virtual tBoolean discretize(const EMM_LandauLifschitzSystem &system)
discretize the operator
Definition: EMM_DisplacementFEMOperator.cpp:500
EMM_DisplacementFEMOperator(void)
create
Definition: EMM_DisplacementFEMOperator.cpp:36
const tUIndex * getPointsNumber() const
get the points number in each direction
Definition: EMM_DisplacementFEMOperator.h:493
#define tFlag
Definition: types.h:74