v0.8.15
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...
 
MatrixDoublegetCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3) More...
 
MatrixDoublegetHoCoordsAtGaussPts ()
 coordinate at Gauss points (if hierarchical approximation of element geometry) More...
 
MatrixDoublegetHoGaussPtsJac ()
 
MatrixDoublegetHoGaussPtsInvJac ()
 
VectorDoublegetHoGaussPtsDetJac ()
 
auto getFTenosr0HoMeasure ()
 
auto getFTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry. More...
 
auto getFTensor1HoCoordsAtGaussPts ()
 Get coordinates at integration points taking geometry from field. More...
 
auto getFTensor2HoGaussPtsJac ()
 
auto getFTensor2HoGaussPtsInvJac ()
 
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...
 
DEPRECATED auto getTensor1CoordsAtGaussPts ()
 
DEPRECATED auto getTensor1HoCoordsAtGaussPts ()
 
- 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
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element More...
 
auto getFTensor0IntegrationWeight ()
 Get integration weights. More...
 
- 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:
elasticity.cpp, forces_and_sources_testing_users_base.cpp, hello_world.cpp, HookeElement.cpp, HookeElement.hpp, MagneticElement.hpp, Remodeling.hpp, simple_elasticity.cpp, simple_interface.cpp, SmallStrainPlasticity.hpp, and UnsaturatedFlow.hpp.

Definition at line 78 of file VolumeElementForcesAndSourcesCore.hpp.

Constructor & Destructor Documentation

◆ UserDataOperator() [1/3]

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

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

84  : 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 86 of file VolumeElementForcesAndSourcesCore.hpp.

89  : ForcesAndSourcesCore::UserDataOperator(row_field_name, col_field_name,
90  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 142 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 448 of file VolumeElementForcesAndSourcesCore.cpp.

450  {
452 
453  int nb_dofs = data.getFieldData().size();
454  if (nb_dofs == 0)
456 
457  if (data.getSpace() != HDIV && data.getSpace() != HCURL) {
459  "This function should be used for primarily for HCURL"
460  " but will work with HDIV used but is used with %s",
461  FieldSpaceNames[data.getSpace()]);
462  }
463 
464  if ((unsigned int)nb_dofs != data.getDiffN().size2() / 9) {
466  "Data insistency, wrong number of dofs = %s "
467  "%d != %d/9",
468  FieldSpaceNames[data.getSpace()], nb_dofs,
469  data.getDiffN().size2());
470  }
471 
472  curl.resize(nb_dofs, 3, false);
474  &curl(0, 0), &curl(0, 1), &curl(0, 2));
475  const double *grad_ptr = &data.getDiffN()(gg, 0);
476 
478  grad_ptr, &grad_ptr[HVEC0_1], &grad_ptr[HVEC0_2], &grad_ptr[HVEC1_0],
479  &grad_ptr[HVEC1_1], &grad_ptr[HVEC1_2], &grad_ptr[HVEC2_0],
480  &grad_ptr[HVEC2_1], &grad_ptr[HVEC2_2]);
481  for (int dd = 0; dd != nb_dofs; ++dd) {
482  t_curl(0) = t_grad_base(2, 1) - t_grad_base(1, 2);
483  t_curl(1) = t_grad_base(0, 2) - t_grad_base(2, 0);
484  t_curl(2) = t_grad_base(1, 0) - t_grad_base(0, 1);
485  ++t_curl;
486  ++t_grad_base;
487  }
488 
490 }
field with continuous normal traction
Definition: definitions.h:170
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:459
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490
static const char *const FieldSpaceNames[]
Definition: definitions.h:175
field with continuous tangents
Definition: definitions.h:169
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:403
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 409 of file VolumeElementForcesAndSourcesCore.cpp.

411  {
413 
414  int nb_dofs = data.getFieldData().size();
415  if (nb_dofs == 0)
417 
418  if (data.getSpace() != HDIV && data.getSpace() != HCURL) {
420  "This function should be used for HDIV used but is used with %s",
421  FieldSpaceNames[data.getSpace()]);
422  }
423 
424  if ((unsigned int)nb_dofs != data.getDiffN().size2() / 9) {
426  "Data inositency, wrong number of dofs = %s "
427  "%d != %d/9",
428  FieldSpaceNames[data.getSpace()], nb_dofs,
429  data.getDiffN().size2());
430  }
431 
432  div.resize(nb_dofs, false);
433 
434  FTensor::Tensor0<double *> t_div(&*div.data().begin());
435  const double *grad_ptr = &data.getDiffN()(gg, 0);
437  grad_ptr, &grad_ptr[HVEC1_1], &grad_ptr[HVEC2_2]);
438  for (int dd = 0; dd < nb_dofs; dd++) {
439  t_div = t_grad_base(0) + t_grad_base(1) + t_grad_base(2);
440  ++t_div;
441  ++t_grad_base;
442  }
443 
445 }
field with continuous normal traction
Definition: definitions.h:170
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:459
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490
static const char *const FieldSpaceNames[]
Definition: definitions.h:175
field with continuous tangents
Definition: definitions.h:169
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:403
virtual MPI_Comm & get_comm() const =0

◆ getFTenosr0HoMeasure()

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

◆ 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 187 of file VolumeElementForcesAndSourcesCore.hpp.

187  {
189  &getCoordsAtGaussPts()(0, 0), &getCoordsAtGaussPts()(0, 1),
190  &getCoordsAtGaussPts()(0, 2));
191  }
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 206 of file VolumeElementForcesAndSourcesCore.hpp.

206  {
207  double *ptr = &*getHoCoordsAtGaussPts().data().begin();
208  return FTensor::Tensor1<FTensor::PackPtr<double *, 3>, 3>(ptr, ptr + 1,
209  ptr + 2);
210  }
MatrixDouble & getHoCoordsAtGaussPts()
coordinate at Gauss points (if hierarchical approximation of element geometry)

◆ getFTensor2HoGaussPtsInvJac()

auto MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getFTensor2HoGaussPtsInvJac ( )

Definition at line 219 of file VolumeElementForcesAndSourcesCore.hpp.

219  {
220  double *ptr = &*getHoGaussPtsInvJac().data().begin();
222  ptr, ptr + 1, ptr + 2, ptr + 3, ptr + 4, ptr + 5, ptr + 6, ptr + 7,
223  ptr + 8);
224  }

◆ getFTensor2HoGaussPtsJac()

auto MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator::getFTensor2HoGaussPtsJac ( )

Definition at line 212 of file VolumeElementForcesAndSourcesCore.hpp.

212  {
213  double *ptr = &*getHoGaussPtsJac().data().begin();
215  ptr, ptr + 1, ptr + 2, ptr + 3, ptr + 4, ptr + 5, ptr + 6, ptr + 7,
216  ptr + 8);
217  }

◆ getHoCoordsAtGaussPts()

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

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

Definition at line 150 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getHoGaussPtsDetJac()

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

◆ getHoGaussPtsInvJac()

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

◆ getHoGaussPtsJac()

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

◆ getInvJac()

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

get element inverse Jacobian

Definition at line 120 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getJac()

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

get element Jacobian

Definition at line 113 of file VolumeElementForcesAndSourcesCore.hpp.

◆ getMeasure()

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

get measure of element

Returns
area of face

Definition at line 128 of file VolumeElementForcesAndSourcesCore.hpp.

128 { return getVolume(); }

◆ getNumNodes()

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

◆ getTensor1CoordsAtGaussPts()

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

Definition at line 299 of file VolumeElementForcesAndSourcesCore.hpp.

299  {
301  }
auto getFTensor1CoordsAtGaussPts()
Get coordinates at integration points assuming linear geometry.

◆ getTensor1HoCoordsAtGaussPts()

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

Definition at line 304 of file VolumeElementForcesAndSourcesCore.hpp.

304  {
306  }
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 228 of file VolumeElementForcesAndSourcesCore.hpp.


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