v0.9.0
Classes | Functions
User data operator

Users data structures and operator. More...

Collaboration diagram for User data operator:

Classes

struct  MoFEM::DataForcesAndSourcesCore::EntData
 Data on single entity (This is passed as argument to DataOperator::doWork) More...
 
struct  MoFEM::DataForcesAndSourcesCore
 data structure for finite element entityIt keeps that about indices of degrees of freedom, dofs data, base functions functions, entity side number, type of entities, approximation order, etc. More...
 
struct  MoFEM::DerivedDataForcesAndSourcesCore::DerivedEntData
 Derived ata on single entity (This is passed as argument to DataOperator::doWork) More...
 
struct  MoFEM::DerivedDataForcesAndSourcesCore
 this class derive data form other data structure More...
 
struct  MoFEM::OpCalculateScalarFieldValues_General< T, A >
 Calculate field values for tenor field rank 0, i.e. scalar field. More...
 
struct  MoFEM::OpCalculateScalarFieldValues
 Get value at integration points for scalar field. More...
 
struct  MoFEM::OpCalculateVectorFieldValues_General< Tensor_Dim, T, L, A >
 Calculate field values for tenor field rank 1, i.e. vector field. More...
 
struct  MoFEM::OpCalculateVectorFieldValues< Tensor_Dim >
 Get values at integration pts for tensor filed rank 1, i.e. vector field. More...
 
struct  MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, T, L, A >
 Calculate field values for tenor field rank 2. More...
 
struct  MoFEM::OpCalculateTensor2FieldValues< Tensor_Dim0, Tensor_Dim1 >
 Get values at integration pts for tensor filed rank 2, i.e. matrix field. More...
 
struct  MoFEM::OpCalculateTensor2FieldValuesDot< Tensor_Dim0, Tensor_Dim1 >
 Get time direvarive values at integration pts for tensor filed rank 2, i.e. matrix field. More...
 
struct  MoFEM::OpCalculateScalarFieldGradient_General< Tensor_Dim, T, L, A >
 Evaluate field gradient values for scalar field, i.e. gradient is tensor rank 1 (vector) More...
 
struct  MoFEM::OpCalculateScalarFieldGradient< Tensor_Dim >
 Get field gradients at integration pts for scalar filed rank 0, i.e. vector field. More...
 
struct  MoFEM::OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, T, L, A >
 Evaluate field gradient values for vector field, i.e. gradient is tensor rank 2. More...
 
struct  MoFEM::OpCalculateVectorFieldGradient< Tensor_Dim0, Tensor_Dim1 >
 Get field gradients at integration pts for scalar filed rank 0, i.e. vector field. More...
 
struct  MoFEM::OpCalculateHdivVectorField_General< Tensor_Dim0, T, L, A >
 Get vector field for H-div approximation. More...
 
struct  MoFEM::OpCalculateHdivVectorField_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >
 Get vector field for H-div approximation. More...
 
struct  MoFEM::OpCalculateHdivVectorField< Tensor_Dim >
 Get vector field for H-div approximation. More...
 
struct  MoFEM::OpCalculateHdivVectorDivergence< Tensor_Dim1, Tensor_Dim2 >
 Calculate divergence of vector field. More...
 
struct  MoFEM::OpCalculateHcurlVectorCurl< Tensor_Dim >
 Calculate curl of vector field. More...
 
struct  MoFEM::OpCalculateHVecTensorField< Tensor_Dim0, Tensor_Dim1 >
 Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl. More...
 
struct  MoFEM::OpCalculateHTensorTensorField< Tensor_Dim0, Tensor_Dim1 >
 Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl. More...
 
struct  MoFEM::OpCalculateHVecTensorDivergence< Tensor_Dim0, Tensor_Dim1 >
 Calculate divergence of tonsorial field using vectorial base. More...
 

Functions

MoFEMErrorCode MoFEM::OpCalculateScalarFieldValues_General< T, A >::doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 calculate values of scalar field at integration points More...
 
MoFEMErrorCode MoFEM::OpCalculateVectorFieldValues_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >::doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 Member function specialization calculating values for tenor field rank 1. More...
 
MoFEMErrorCode MoFEM::OpCalculateScalarFieldGradient_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >::doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 calculate gradient values of scalar field at integration points More...
 
MoFEMErrorCode MoFEM::OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >::doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 calculate values of vector field at integration points More...
 

Detailed Description

Users data structures and operator.

Classes and functions used to evaluate fields at integration pts, jacobians, etc..

data structures

Data structures passed by argument to MoFEM::DataOperator::doWork and generic user operators operating on those structures.

Function Documentation

◆ doWork() [1/4]

template<class T , class A >
MoFEMErrorCode MoFEM::OpCalculateScalarFieldValues_General< T, A >::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
virtual

calculate values of scalar field at integration points

Specialization of member function.

Parameters
sideside entity number
typeside entity type
dataentity data
Returns
error code

Reimplemented from MoFEM::DataOperator.

Definition at line 66 of file UserDataOperators.hpp.

67  {
69  SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not implemented for T = %s",
70  typeid(T).name() // boost::core::demangle(typeid(T).name()).c_str()
71  );
73 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ doWork() [2/4]

template<int Tensor_Dim>
MoFEMErrorCode MoFEM::OpCalculateVectorFieldValues_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
virtual

Member function specialization calculating values for tenor field rank 1.

Reimplemented from MoFEM::DataOperator.

Reimplemented in MoFEM::OpCalculateScalarFieldGradient_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >.

Definition at line 275 of file UserDataOperators.hpp.

276  {
278  const int nb_dofs = data.getFieldData().size();
279  if (!nb_dofs && type == this->zeroType) {
280  dataPtr->resize(Tensor_Dim, 0, false);
282  }
283  if (!nb_dofs) {
285  }
286  const int nb_gauss_pts = data.getN().size1();
287  const int nb_base_functions = data.getN().size2();
288  MatrixDouble &mat = *dataPtr;
289  if (type == zeroType) {
290  mat.resize(Tensor_Dim, nb_gauss_pts, false);
291  mat.clear();
292  }
293  auto base_function = data.getFTensor0N();
294  auto values_at_gauss_pts = getFTensor1FromMat<Tensor_Dim>(mat);
296  const int size = nb_dofs / Tensor_Dim;
297  if (nb_dofs % Tensor_Dim) {
298  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Data inconsistency");
299  }
300  for (int gg = 0; gg != nb_gauss_pts; ++gg) {
301  auto field_data = data.getFTensor1FieldData<Tensor_Dim>();
302  int bb = 0;
303  for (; bb != size; ++bb) {
304  values_at_gauss_pts(I) += field_data(I) * base_function;
305  ++field_data;
306  ++base_function;
307  }
308  // Number of dofs can be smaller than number of Tensor_Dim x base functions
309  for (; bb != nb_base_functions; ++bb)
310  ++base_function;
311  ++values_at_gauss_pts;
312  }
314 }
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:74
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ doWork() [3/4]

template<int Tensor_Dim>
MoFEMErrorCode MoFEM::OpCalculateScalarFieldGradient_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
virtual

calculate gradient values of scalar field at integration points

Member function specialization calculating scalar field gradients for tenor field rank 1.

Parameters
sideside entity number
typeside entity type
dataentity data
Returns
error code

Reimplemented from MoFEM::OpCalculateVectorFieldValues_General< Tensor_Dim, double, ublas::row_major, DoubleAllocator >.

Definition at line 814 of file UserDataOperators.hpp.

815  {
817  const int nb_dofs = data.getFieldData().size();
818  if (!this->dataPtr) {
819  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
820  "Data pointer not allocated");
821  }
822  if (!nb_dofs && type == this->zeroType) {
823  this->dataPtr->resize(Tensor_Dim, 0, false);
825  }
826  if (!nb_dofs) {
828  }
829  const int nb_gauss_pts = data.getN().size1();
830  const int nb_base_functions = data.getN().size2();
831  ublas::matrix<double, ublas::row_major, DoubleAllocator> &mat =
832  *this->dataPtr;
833  if (type == this->zeroType) {
834  mat.resize(Tensor_Dim, nb_gauss_pts, false);
835  mat.clear();
836  }
837  auto diff_base_function = data.getFTensor1DiffN<Tensor_Dim>();
838  auto gradients_at_gauss_pts = getFTensor1FromMat<Tensor_Dim>(mat);
840  for (int gg = 0; gg < nb_gauss_pts; ++gg) {
841  auto field_data = data.getFTensor0FieldData();
842  int bb = 0;
843  for (; bb < nb_dofs; ++bb) {
844  gradients_at_gauss_pts(I) += field_data * diff_base_function(I);
845  ++field_data;
846  ++diff_base_function;
847  }
848  // Number of dofs can be smaller than number of base functions
849  for (; bb != nb_base_functions; ++bb)
850  ++diff_base_function;
851  ++gradients_at_gauss_pts;
852  }
854 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ doWork() [4/4]

template<int Tensor_Dim0, int Tensor_Dim1>
MoFEMErrorCode MoFEM::OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >::doWork ( int  side,
EntityType  type,
DataForcesAndSourcesCore::EntData data 
)
virtual

calculate values of vector field at integration points

Member function specialization calculating vector field gradients for tenor field rank 2.

Parameters
sideside entity number
typeside entity type
dataentity data
Returns
error code

Reimplemented from MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >.

Definition at line 921 of file UserDataOperators.hpp.

922  {
924  const int nb_dofs = data.getFieldData().size();
925  if (!nb_dofs && type == this->zeroType) {
926  this->dataPtr->resize(Tensor_Dim0 * Tensor_Dim1, 0, false);
928  }
929  if (!nb_dofs) {
931  }
932  const int nb_gauss_pts = data.getN().size1();
933  const int nb_base_functions = data.getN().size2();
934  ublas::matrix<double, ublas::row_major, DoubleAllocator> &mat =
935  *this->dataPtr;
936  if (type == this->zeroType) {
937  mat.resize(Tensor_Dim0 * Tensor_Dim1, nb_gauss_pts, false);
938  mat.clear();
939  }
940  auto diff_base_function = data.getFTensor1DiffN<Tensor_Dim1>();
941  auto gradients_at_gauss_pts =
942  getFTensor2FromMat<Tensor_Dim0, Tensor_Dim1>(mat);
945  int size = nb_dofs / Tensor_Dim0;
946  if (nb_dofs % Tensor_Dim0) {
947  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "Data inconsistency");
948  }
949  for (int gg = 0; gg < nb_gauss_pts; ++gg) {
950  auto field_data = data.getFTensor1FieldData<Tensor_Dim0>();
951  int bb = 0;
952  for (; bb < size; ++bb) {
953  gradients_at_gauss_pts(I, J) += field_data(I) * diff_base_function(J);
954  ++field_data;
955  ++diff_base_function;
956  }
957  // Number of dofs can be smaller than number of Tensor_Dim0 x base functions
958  for (; bb != nb_base_functions; ++bb)
959  ++diff_base_function;
960  ++gradients_at_gauss_pts;
961  }
963 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407