v0.8.4
Public Member Functions | List of all members
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator Struct Reference

default operator for TET element More...

#include <src/finite_elements/VolumeElementForcesAndSourcesCore.hpp>

Inheritance diagram for MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator:
[legend]
Collaboration diagram for MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator:
[legend]

Public Member Functions

 UserDataOperator (const FieldSpace space)
 
 UserDataOperator (const std::string &field_name, const char type)
 
 UserDataOperator (const std::string &row_field_name, const std::string &col_field_name, const char type, const bool symm=true)
 
int getNumNodes ()
 get element number of nodes More...
 
const EntityHandlegetConn ()
 get element connectivity More...
 
double getVolume ()
 element volume (linear geometry) More...
 
FTensor::Tensor2< double *, 3, 3 > & getJac ()
 get element Jacobian More...
 
FTensor::Tensor2< double *, 3, 3 > & getInvJac ()
 get element inverse Jacobian More...
 
double getMeasure ()
 get measure of element More...
 
VectorDoublegetCoords ()
 nodal coordinates More...
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element where columns 0,1,2 are x,y,z coordinates respectively and column 3 is a weight value for example getGaussPts()(1,13) returns y coordinate of 13th Gauss point on particular volume element More...
 
FTensor::Tensor0< double * > getFTensor0IntegrationWeight ()
 
MatrixDoublegetCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3) More...
 
MatrixDoublegetHoCoordsAtGaussPts ()
 coordinate at Gauss points (if hierarchical approximation of element geometry) More...
 
MatrixDoublegetHoGaussPtsInvJac ()
 
VectorDoublegetHoGaussPtsDetJac ()
 
FTensor::Tensor0< double * > getFTenosr0HoMeasure ()
 
FTensor::Tensor1< double *, 3 > getTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry. More...
 
FTensor::Tensor1< double *, 3 > getFTensor1HoCoordsAtGaussPts ()
 Get coordinates at integration points taking geometry from field. More...
 
const VolumeElementForcesAndSourcesCoregetVolumeFE ()
 return pointer to Generic Volume Finite Element object More...
 
MoFEMErrorCode getDivergenceOfHDivBaseFunctions (int side, EntityType type, DataForcesAndSourcesCore::EntData &data, int gg, VectorDouble &div)
 Get divergence of base functions at integration point. More...
 
MoFEMErrorCode getCurlOfHCurlBaseFunctions (int side, EntityType type, DataForcesAndSourcesCore::EntData &data, int gg, MatrixDouble &curl)
 Get curl of base functions at integration point. More...
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPLAST, const bool symm=true)
 
 UserDataOperator (const std::string &field_name, const char type, const bool symm=true)
 
 UserDataOperator (const std::string &row_field_name, const std::string &col_field_name, const char type, const bool symm=true)
 
virtual ~UserDataOperator ()
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement. More...
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle. More...
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices. More...
 
DEPRECATED MoFEMErrorCode getPorblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices. More...
 
virtual MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
DEPRECATED MoFEMErrorCode getPorblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 
const FEMethodgetFEMethod () const
 Return raw pointer to Finite Element Method object. More...
 
int getOpType () const
 Get operator types. More...
 
void setOpType (const OpType type)
 Set operator type. More...
 
void addOpType (const OpType type)
 Add operator type. More...
 
int getNinTheLoop () const
 get number of finite element in the loop More...
 
int getLoopSize () const
 get size of elements in the loop More...
 
const std::string & getFEName () const
 Get name of the element. More...
 
Vec getSnesF () const
 
Vec getSnesX () const
 
Mat getSnesA () const
 
Mat getSnesB () const
 
Vec getTSu () const
 
Vec getTSu_t () const
 
Vec getTSf () const
 
Mat getTSA () const
 
Mat getTSB () const
 
int getTSstep () const
 
double getTStime () const
 
double getTSa () const
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true, const bool do_vertices=true, const bool do_edges=true, const bool do_quads=true, const bool do_tris=true, const bool do_tets=true, const bool do_prisms=true)
 
virtual ~DataOperator ()
 
virtual MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
 Operator for bi-linear form, usually to calculate values on right hand side. More...
 
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data, bool symm=true)
 
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data)
 
virtual MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 Operator for linear form, usually to calculate values on left hand side. More...
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool do_vertices, const bool do_edges, const bool do_quads, const bool do_tris, const bool do_tets, const bool do_prisms, const bool error_if_no_base=true)
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=true)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not. More...
 
void setSymm ()
 set if operator is executed taking in account symmetry More...
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem More...
 

Additional Inherited Members

- Public Types inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
enum  OpType { OPROW = 1<<0, OPCOL = 1<<1, OPROWCOL = 1<<2, OPLAST = 1<<3 }
 Controls loop over entities on element. More...
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
char opType
 
std::string rowFieldName
 
std::string colFieldName
 
FieldSpace sPace
 
- Public Attributes inherited from MoFEM::DataOperator
bool sYmm
 If true assume that matrix is symmetric structure. More...
 
bool doVertices
 If false skip vertices. More...
 
bool doEdges
 If false skip edges. More...
 
bool doQuads
 
bool doTris
 
bool doTets
 
bool doPrisms
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Detailed Description

default operator for TET element

Examples:
hello_world.cpp, MagneticElement.hpp, Remodeling.hpp, simple_elasticity.cpp, simple_interface.cpp, and UnsaturatedFlow.hpp.

Definition at line 91 of file VolumeElementForcesAndSourcesCore.hpp.

Constructor & Destructor Documentation

◆ UserDataOperator() [1/3]

MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::UserDataOperator ( const FieldSpace  space)

Definition at line 93 of file VolumeElementForcesAndSourcesCore.hpp.

ForcesAndSourcesCore::UserDataOperator UserDataOperator

◆ UserDataOperator() [2/3]

MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::UserDataOperator ( const std::string &  field_name,
const char  type 
)

Definition at line 96 of file VolumeElementForcesAndSourcesCore.hpp.

97  : ForcesAndSourcesCore::UserDataOperator(field_name, type) {}
ForcesAndSourcesCore::UserDataOperator UserDataOperator

◆ UserDataOperator() [3/3]

MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::UserDataOperator ( const std::string &  row_field_name,
const std::string &  col_field_name,
const char  type,
const bool  symm = true 
)

Definition at line 99 of file VolumeElementForcesAndSourcesCore.hpp.

102  : ForcesAndSourcesCore::UserDataOperator(row_field_name, col_field_name,
103  type, symm) {}
ForcesAndSourcesCore::UserDataOperator UserDataOperator

Member Function Documentation

◆ getConn()

const EntityHandle* MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getConn ( )

◆ getCoords()

VectorDouble& MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getCoords ( )

◆ getCoordsAtGaussPts()

MatrixDouble& MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getCoordsAtGaussPts ( )

Gauss points and weight, matrix (nb. of points x 3)

Column 0-2 integration points coordinate x, y and z, respectively. At rows are integration points.

Definition at line 168 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getCurlOfHCurlBaseFunctions()

MoFEMErrorCode UserDataOperator::getCurlOfHCurlBaseFunctions ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data,
int  gg,
MatrixDouble curl 
)

Get curl of base functions at integration point.

\[ \nabla \times \mathbf{\phi} \]

Works only for H-curl and H-div space.

How to use it:

MatrixDouble curl_mat(data.getFieldData().size(),3);
for(int gg = 0;gg<nb_gauss_pts;gg++) {
CHKERR getCurlOfHCurlBaseFunctions(side,type,data,gg,curl_mat);
&curl_mat(0,0), &curl_mat(0,1), &curl_mat(0,2)
);
// do something with curl
}

where curl_mat is matrix which number of rows is equal to nb. of base functions. Number of columns is 3, since we work in 3d here. Rows represents curl of base functions.

Parameters
sideside (local) number of entity on element
typetype of entity
datadata structure
gggauss pts
curlcurl matrix, nb. of rows is equal to number of base functions, columns are curl of base vector
Returns
error code

Definition at line 747 of file VolumeElementForcesAndSourcesCore.cpp.

749  {
751 
752  int nb_dofs = data.getFieldData().size();
753  if (nb_dofs == 0)
755 
756  if (data.getSpace() != HDIV && data.getSpace() != HCURL) {
758  "This function should be used for primarily for HCURL"
759  " but will work with HDIV used but is used with %s",
760  FieldSpaceNames[data.getSpace()]);
761  }
762 
763  if ((unsigned int)nb_dofs != data.getDiffHcurlN().size2() / 9) {
765  "Data insistency, wrong number of dofs = %s "
766  "%d != %d/9",
767  FieldSpaceNames[data.getSpace()], nb_dofs,
768  data.getDiffHcurlN().size2());
769  }
770 
771  curl.resize(nb_dofs, 3, false);
773  &curl(0, 0), &curl(0, 1), &curl(0, 2));
774  const double *grad_ptr = &data.getDiffHcurlN()(gg, 0);
775 
777  grad_ptr, &grad_ptr[HCURL0_1], &grad_ptr[HCURL0_2], &grad_ptr[HCURL1_0],
778  &grad_ptr[HCURL1_1], &grad_ptr[HCURL1_2], &grad_ptr[HCURL2_0],
779  &grad_ptr[HCURL2_1], &grad_ptr[HCURL2_2]);
780  for (int dd = 0; dd != nb_dofs; ++dd) {
781  t_curl(0) = t_grad_base(2, 1) - t_grad_base(1, 2);
782  t_curl(1) = t_grad_base(0, 2) - t_grad_base(2, 0);
783  t_curl(2) = t_grad_base(1, 0) - t_grad_base(0, 1);
784  ++t_curl;
785  ++t_grad_base;
786  }
787 
789 }
field with continuous normal traction
Definition: definitions.h:179
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T *> &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
static const char *const FieldSpaceNames[]
Definition: definitions.h:184
field with continuous tangents
Definition: definitions.h:178
const VolumeElementForcesAndSourcesCore * getVolumeFE()
return pointer to Generic Volume Finite Element object
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:443
virtual MPI_Comm & get_comm() const =0

◆ getDivergenceOfHDivBaseFunctions()

MoFEMErrorCode UserDataOperator::getDivergenceOfHDivBaseFunctions ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data,
int  gg,
VectorDouble div 
)

Get divergence of base functions at integration point.

Works only for H-div space.

How to use it:

VectorDouble div_vec(data.getFieldData().size());
for(int gg = 0;gg<nb_gauss_pts;gg++) {
CHKERR getDivergenceOfHDivBaseFunctions(side,type,data,gg,div_vec);
// do something with vec_div
}

where vec_div has size of nb. of dofs, at each element represents divergence of base functions.

Parameters
sideside (local) number of entity on element
typetype of entity
datadata structure
gggauss pts
divdivergence vector, size of vector is equal to number of base functions
Returns
error code

Definition at line 708 of file VolumeElementForcesAndSourcesCore.cpp.

710  {
712 
713  int nb_dofs = data.getFieldData().size();
714  if (nb_dofs == 0)
716 
717  if (data.getSpace() != HDIV && data.getSpace() != HCURL) {
719  "This function should be used for HDIV used but is used with %s",
720  FieldSpaceNames[data.getSpace()]);
721  }
722 
723  if ((unsigned int)nb_dofs != data.getDiffHdivN().size2() / 9) {
725  "Data inositency, wrong number of dofs = %s "
726  "%d != %d/9",
727  FieldSpaceNames[data.getSpace()], nb_dofs,
728  data.getDiffHdivN().size2());
729  }
730 
731  div.resize(nb_dofs, false);
732 
733  FTensor::Tensor0<double *> t_div(&*div.data().begin());
734  const double *grad_ptr = &data.getDiffHdivN()(gg, 0);
736  grad_ptr, &grad_ptr[HDIV1_1], &grad_ptr[HDIV2_2]);
737  for (int dd = 0; dd < nb_dofs; dd++) {
738  t_div = t_grad_base(0) + t_grad_base(1) + t_grad_base(2);
739  ++t_div;
740  ++t_grad_base;
741  }
742 
744 }
field with continuous normal traction
Definition: definitions.h:179
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T *> &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:528
static const char *const FieldSpaceNames[]
Definition: definitions.h:184
field with continuous tangents
Definition: definitions.h:178
const VolumeElementForcesAndSourcesCore * getVolumeFE()
return pointer to Generic Volume Finite Element object
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:443
virtual MPI_Comm & get_comm() const =0

◆ getFTenosr0HoMeasure()

FTensor::Tensor0<double *> MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getFTenosr0HoMeasure ( )

◆ getFTensor0IntegrationWeight()

FTensor::Tensor0<double *> MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getFTensor0IntegrationWeight ( )

Definition at line 158 of file VolumeElementForcesAndSourcesCore.hpp.

158  {
159  return FTensor::Tensor0<double *>(&(getGaussPts()(3, 0)), 1);
160  }
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element where columns 0,1,2 are x,y,z coordinates respectively and column 3 is a weight value for example getGaussPts()(1,13) returns y coordinate of 13th Gauss point on particular volume element

◆ getFTensor1HoCoordsAtGaussPts()

FTensor::Tensor1<double *, 3> MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getFTensor1HoCoordsAtGaussPts ( )

Get coordinates at integration points taking geometry from field.

This is HO geometry given by arbitrary order polynomial

FTensor::Tensor1<double*> t_coords = getTensor1HoCoordsAtGaussPts();
for(int gg = 0;gg!=nb_int_ptrs;gg++) {
// do something
++t_coords;
}

Definition at line 226 of file VolumeElementForcesAndSourcesCore.hpp.

226  {
228  &getHoCoordsAtGaussPts()(0, 1),
229  &getHoCoordsAtGaussPts()(0, 2), 3);
230  }
MatrixDouble & getHoCoordsAtGaussPts()
coordinate at Gauss points (if hierarchical approximation of element geometry)

◆ getGaussPts()

MatrixDouble& MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getGaussPts ( )

matrix of integration (Gauss) points for Volume Element where columns 0,1,2 are x,y,z coordinates respectively and column 3 is a weight value for example getGaussPts()(1,13) returns y coordinate of 13th Gauss point on particular volume element

Definition at line 154 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getHoCoordsAtGaussPts()

MatrixDouble& MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getHoCoordsAtGaussPts ( )

coordinate at Gauss points (if hierarchical approximation of element geometry)

Definition at line 176 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getHoGaussPtsDetJac()

VectorDouble& MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getHoGaussPtsDetJac ( )

◆ getHoGaussPtsInvJac()

MatrixDouble& MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getHoGaussPtsInvJac ( )

◆ getInvJac()

FTensor::Tensor2<double *, 3, 3>& MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getInvJac ( )

get element inverse Jacobian

Definition at line 133 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getJac()

FTensor::Tensor2<double *, 3, 3>& MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getJac ( )

get element Jacobian

Definition at line 126 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getMeasure()

double MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getMeasure ( )

get measure of element

Returns
area of face

Definition at line 141 of file VolumeElementForcesAndSourcesCore.hpp.

141 { return getVolume(); }

◆ getNumNodes()

int MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getNumNodes ( )

◆ getTensor1CoordsAtGaussPts()

FTensor::Tensor1<double *, 3> MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getTensor1CoordsAtGaussPts ( )

Get coordinates at integration points assuming linear geometry.

for(int gg = 0;gg!=nb_int_ptrs;gg++) {
// do something
++t_coords;
}

Definition at line 207 of file VolumeElementForcesAndSourcesCore.hpp.

207  {
209  &getCoordsAtGaussPts()(0, 1),
210  &getCoordsAtGaussPts()(0, 2), 3);
211  }
MatrixDouble & getCoordsAtGaussPts()
Gauss points and weight, matrix (nb. of points x 3)

◆ getVolume()

double MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getVolume ( )

◆ getVolumeFE()

const VolumeElementForcesAndSourcesCore* MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getVolumeFE ( )

return pointer to Generic Volume Finite Element object

Definition at line 234 of file VolumeElementForcesAndSourcesCore.hpp.


The documentation for this struct was generated from the following files: