v0.8.13
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...
 
auto getFTensor0IntegrationWeight ()
 Get integration weights. More...
 
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 ()
 
auto getFTenosr0HoMeasure ()
 
auto getFTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry. More...
 
DEPRECATED auto getTensor1CoordsAtGaussPts ()
 
auto getFTensor1HoCoordsAtGaussPts ()
 Get coordinates at integration points taking geometry from field. More...
 
DEPRECATED auto getTensor1HoCoordsAtGaussPts ()
 
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, SmallStrainPlasticity.hpp, and UnsaturatedFlow.hpp.

Definition at line 90 of file VolumeElementForcesAndSourcesCore.hpp.

Constructor & Destructor Documentation

◆ UserDataOperator() [1/3]

MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::UserDataOperator ( const FieldSpace  space)
Examples:
SmallStrainPlasticity.hpp.

Definition at line 92 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 95 of file VolumeElementForcesAndSourcesCore.hpp.

96  : 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 98 of file VolumeElementForcesAndSourcesCore.hpp.

101  : ForcesAndSourcesCore::UserDataOperator(row_field_name, col_field_name,
102  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.

Examples:
UnsaturatedFlow.hpp.

Definition at line 181 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
Examples:
MagneticElement.hpp.

Definition at line 766 of file VolumeElementForcesAndSourcesCore.cpp.

768  {
770 
771  int nb_dofs = data.getFieldData().size();
772  if (nb_dofs == 0)
774 
775  if (data.getSpace() != HDIV && data.getSpace() != HCURL) {
777  "This function should be used for primarily for HCURL"
778  " but will work with HDIV used but is used with %s",
779  FieldSpaceNames[data.getSpace()]);
780  }
781 
782  if ((unsigned int)nb_dofs != data.getDiffHcurlN().size2() / 9) {
784  "Data insistency, wrong number of dofs = %s "
785  "%d != %d/9",
786  FieldSpaceNames[data.getSpace()], nb_dofs,
787  data.getDiffHcurlN().size2());
788  }
789 
790  curl.resize(nb_dofs, 3, false);
792  &curl(0, 0), &curl(0, 1), &curl(0, 2));
793  const double *grad_ptr = &data.getDiffHcurlN()(gg, 0);
794 
796  grad_ptr, &grad_ptr[HCURL0_1], &grad_ptr[HCURL0_2], &grad_ptr[HCURL1_0],
797  &grad_ptr[HCURL1_1], &grad_ptr[HCURL1_2], &grad_ptr[HCURL2_0],
798  &grad_ptr[HCURL2_1], &grad_ptr[HCURL2_2]);
799  for (int dd = 0; dd != nb_dofs; ++dd) {
800  t_curl(0) = t_grad_base(2, 1) - t_grad_base(1, 2);
801  t_curl(1) = t_grad_base(0, 2) - t_grad_base(2, 0);
802  t_curl(2) = t_grad_base(1, 0) - t_grad_base(0, 1);
803  ++t_curl;
804  ++t_grad_base;
805  }
806 
808 }
field with continuous normal traction
Definition: definitions.h:181
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:495
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
static const char *const FieldSpaceNames[]
Definition: definitions.h:186
field with continuous tangents
Definition: definitions.h:180
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:439
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
Examples:
UnsaturatedFlow.hpp.

Definition at line 727 of file VolumeElementForcesAndSourcesCore.cpp.

729  {
731 
732  int nb_dofs = data.getFieldData().size();
733  if (nb_dofs == 0)
735 
736  if (data.getSpace() != HDIV && data.getSpace() != HCURL) {
738  "This function should be used for HDIV used but is used with %s",
739  FieldSpaceNames[data.getSpace()]);
740  }
741 
742  if ((unsigned int)nb_dofs != data.getDiffHdivN().size2() / 9) {
744  "Data inositency, wrong number of dofs = %s "
745  "%d != %d/9",
746  FieldSpaceNames[data.getSpace()], nb_dofs,
747  data.getDiffHdivN().size2());
748  }
749 
750  div.resize(nb_dofs, false);
751 
752  FTensor::Tensor0<double *> t_div(&*div.data().begin());
753  const double *grad_ptr = &data.getDiffHdivN()(gg, 0);
755  grad_ptr, &grad_ptr[HDIV1_1], &grad_ptr[HDIV2_2]);
756  for (int dd = 0; dd < nb_dofs; dd++) {
757  t_div = t_grad_base(0) + t_grad_base(1) + t_grad_base(2);
758  ++t_div;
759  ++t_grad_base;
760  }
761 
763 }
field with continuous normal traction
Definition: definitions.h:181
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:495
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:526
static const char *const FieldSpaceNames[]
Definition: definitions.h:186
field with continuous tangents
Definition: definitions.h:180
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:439
virtual MPI_Comm & get_comm() const =0

◆ getFTenosr0HoMeasure()

auto MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getFTenosr0HoMeasure ( )

◆ getFTensor0IntegrationWeight()

auto MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getFTensor0IntegrationWeight ( )

Get integration weights.

for(int gg = 0; gg!=getGaussPts.size2(); ++gg) {
// integrate something
++t_w;
}
Returns
FTensor::Tensor0<FTensor::PackPtr<double *, 1>>
Examples:
UnsaturatedFlow.hpp.

Definition at line 170 of file VolumeElementForcesAndSourcesCore.hpp.

170  {
172  &(getGaussPts()(3, 0)));
173  }
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

◆ getFTensor1CoordsAtGaussPts()

auto MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getFTensor1CoordsAtGaussPts ( )

Get coordinates at integration points assuming linear geometry.

auto t_coords = getFTensor1CoordsAtGaussPts();
for(int gg = 0;gg!=nb_int_ptrs;gg++) {
// do something
++t_coords;
}
Examples:
UnsaturatedFlow.hpp.

Definition at line 221 of file VolumeElementForcesAndSourcesCore.hpp.

221  {
223  &getCoordsAtGaussPts()(0, 0), &getCoordsAtGaussPts()(0, 1),
224  &getCoordsAtGaussPts()(0, 2));
225  }
MatrixDouble & getCoordsAtGaussPts()
Gauss points and weight, matrix (nb. of points x 3)

◆ getFTensor1HoCoordsAtGaussPts()

auto MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getFTensor1HoCoordsAtGaussPts ( )

Get coordinates at integration points taking geometry from field.

This is HO geometry given by arbitrary order polynomial

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

Definition at line 245 of file VolumeElementForcesAndSourcesCore.hpp.

245  {
247  &getHoCoordsAtGaussPts()(0, 0), &getHoCoordsAtGaussPts()(0, 1),
248  &getHoCoordsAtGaussPts()(0, 2));
249  }
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

Examples:
MagneticElement.hpp, and UnsaturatedFlow.hpp.

Definition at line 153 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getHoCoordsAtGaussPts()

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

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

Definition at line 189 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 132 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getJac()

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

get element Jacobian

Definition at line 125 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getMeasure()

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

get measure of element

Returns
area of face

Definition at line 140 of file VolumeElementForcesAndSourcesCore.hpp.

140 { return getVolume(); }

◆ getNumNodes()

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

◆ getTensor1CoordsAtGaussPts()

DEPRECATED auto MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getTensor1CoordsAtGaussPts ( )
Deprecated:
use getFTensor1CoordsAtGaussPts

Definition at line 228 of file VolumeElementForcesAndSourcesCore.hpp.

228  {
230  }
auto getFTensor1CoordsAtGaussPts()
Get coordinates at integration points assuming linear geometry.

◆ getTensor1HoCoordsAtGaussPts()

DEPRECATED auto MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getTensor1HoCoordsAtGaussPts ( )
Deprecated:
use getFTensor1HoCoordsAtGaussPts

Definition at line 252 of file VolumeElementForcesAndSourcesCore.hpp.

252  {
254  }
auto getFTensor1HoCoordsAtGaussPts()
Get coordinates at integration points taking geometry from field.

◆ getVolume()

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

◆ getVolumeFE()

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

return pointer to Generic Volume Finite Element object

Definition at line 258 of file VolumeElementForcesAndSourcesCore.hpp.


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