v0.10.0
Public Member Functions | List of all members
MoFEM::OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator > Struct Template Reference

#include <src/finite_elements/UserDataOperators.hpp>

Inheritance diagram for MoFEM::OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >:
[legend]
Collaboration diagram for MoFEM::OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >:
[legend]

Public Member Functions

 OpCalculateVectorFieldGradient_General (const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBVERTEX)
 
Gradients of tensor fields at integration points

}

MoFEMErrorCode doWork (int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
 calculate values of vector field at integration points More...
 
- Public Member Functions inherited from MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >
 OpCalculateTensor2FieldValues_General (const std::string field_name, boost::shared_ptr< ublas::matrix< double, ublas::row_major, DoubleAllocator >> &data_ptr, const EntityType zero_type=MBVERTEX)
 
- 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)
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement. More...
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle. More...
 
boost::weak_ptr< SideNumber > getSideNumberPtr (const int side_number, const EntityType type)
 Get the side number pointer. More...
 
EntityHandle getSideEntity (const int side_number, const EntityType type)
 Get the side entity. More...
 
int getNumberOfNodesOnElement ()
 Get the number of nodes on finite element. More...
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices. More...
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices. More...
 
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...
 
const PetscData::SwitchesgetDataCtx () const
 
const KspMethod::KSPContext getKSPCtx () const
 
const SnesMethod::SNESContext getSNESCtx () const
 
const TSMethod::TSContext getTSCtx () const
 
Vec getKSPf () const
 
Mat getKSPA () const
 
Mat getKSPB () const
 
Vec getSNESf () const
 
Vec getSNESx () const
 
Mat getSNESA () const
 
Mat getSNESB () const
 
DEPRECATED Vec getSnesF () const
 
DEPRECATED Vec getSnesX () const
 
DEPRECATED Mat getSnesA () const
 
DEPRECATED Mat getSnesB () const
 
Vec getTSu () const
 
Vec getTSu_t () const
 
Vec getTSu_tt () const
 
Vec getTSf () const
 
Mat getTSA () const
 
Mat getTSB () const
 
int getTSstep () const
 
double getTStime () const
 
double getTSa () const
 
double getTSaa () const
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element More...
 
auto getFTensor0IntegrationWeight ()
 Get integration weights. More...
 
DEPRECATED MoFEMErrorCode getPorblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true)
 
virtual ~DataOperator ()=default
 
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 left hand side. More...
 
virtual MoFEMErrorCode opLhs (DataForcesAndSourcesCore &row_data, DataForcesAndSourcesCore &col_data)
 
virtual MoFEMErrorCode opRhs (DataForcesAndSourcesCore &data, const bool error_if_no_base=false)
 
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...
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity. More...
 
booldoVertices
 \deprectaed If false skip vertices More...
 
booldoEdges
 \deprectaed If false skip edges More...
 
booldoQuads
 \deprectaed More...
 
booldoTris
 \deprectaed More...
 
booldoTets
 \deprectaed More...
 
booldoPrisms
 \deprectaed More...
 
- Protected Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
virtual MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
ForcesAndSourcesCoregetPtrFE () const
 
ForcesAndSourcesCoregetSidePtrFE () const
 
- Protected Attributes inherited from MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >
boost::shared_ptr< ublas::matrix< double, ublas::row_major, DoubleAllocator > > dataPtr
 
const EntityHandle zeroType
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 

Detailed Description

template<int Tensor_Dim0, int Tensor_Dim1>
struct MoFEM::OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >

Definition at line 1002 of file UserDataOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculateVectorFieldGradient_General()

template<int Tensor_Dim0, int Tensor_Dim1>
MoFEM::OpCalculateVectorFieldGradient_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >::OpCalculateVectorFieldGradient_General ( const std::string  field_name,
boost::shared_ptr< MatrixDouble data_ptr,
const EntityType  zero_type = MBVERTEX 
)

Definition at line 1007 of file UserDataOperators.hpp.

1010  : OpCalculateTensor2FieldValues_General<Tensor_Dim0, Tensor_Dim1, double,
1012  DoubleAllocator>(
1013  field_name, data_ptr, zero_type) {}

Member Function Documentation

◆ doWork()

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 1034 of file UserDataOperators.hpp.

1035  {
1037  if (!this->dataPtr)
1038  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1039  "Data pointer not allocated");
1040 
1041  const size_t nb_gauss_pts = this->getGaussPts().size2();
1042  auto &mat = *this->dataPtr;
1043  if (type == this->zeroType) {
1044  mat.resize(Tensor_Dim0 * Tensor_Dim1, nb_gauss_pts, false);
1045  mat.clear();
1046  }
1047 
1048  if (nb_gauss_pts) {
1049  const size_t nb_dofs = data.getFieldData().size();
1050 
1051  if (nb_dofs) {
1052 
1053  const int nb_base_functions = data.getN().size2();
1054  auto diff_base_function = data.getFTensor1DiffN<Tensor_Dim1>();
1055  auto gradients_at_gauss_pts =
1056  getFTensor2FromMat<Tensor_Dim0, Tensor_Dim1>(mat);
1059  int size = nb_dofs / Tensor_Dim0;
1060  if (nb_dofs % Tensor_Dim0) {
1061  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1062  "Data inconsistency");
1063  }
1064  for (int gg = 0; gg < nb_gauss_pts; ++gg) {
1065  auto field_data = data.getFTensor1FieldData<Tensor_Dim0>();
1066  int bb = 0;
1067  for (; bb < size; ++bb) {
1068  gradients_at_gauss_pts(I, J) += field_data(I) * diff_base_function(J);
1069  ++field_data;
1070  ++diff_base_function;
1071  }
1072  // Number of dofs can be smaller than number of Tensor_Dim0 x base
1073  // functions
1074  for (; bb != nb_base_functions; ++bb)
1075  ++diff_base_function;
1076  ++gradients_at_gauss_pts;
1077  }
1078  }
1079  }
1081 }

The documentation for this struct was generated from the following file:
MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >::OpCalculateTensor2FieldValues_General
OpCalculateTensor2FieldValues_General(const std::string field_name, boost::shared_ptr< ublas::matrix< double, ublas::row_major, DoubleAllocator >> &data_ptr, const EntityType zero_type=MBVERTEX)
Definition: UserDataOperators.hpp:539
MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >::dataPtr
boost::shared_ptr< ublas::matrix< double, ublas::row_major, DoubleAllocator > > dataPtr
Definition: UserDataOperators.hpp:556
double
convert.type
type
Definition: convert.py:66
FTensor::Index
Definition: Index.hpp:24
FTensor::row_major
@ row_major
Definition: Layout.hpp:13
MoFEM::OpCalculateTensor2FieldValues_General< Tensor_Dim0, Tensor_Dim1, double, ublas::row_major, DoubleAllocator >::zeroType
const EntityHandle zeroType
Definition: UserDataOperators.hpp:557
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:123
MoFEM::Types::DoubleAllocator
std::vector< double, std::allocator< double > > DoubleAllocator
Definition: Types.hpp:70
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
I
static Index< 'I', 3 > I
Definition: BasicFeTools.hpp:82
MoFEM::ForcesAndSourcesCore::UserDataOperator::getGaussPts
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
Definition: ForcesAndSourcesCore.hpp:1016
J
static Index< 'J', 3 > J
Definition: BasicFeTools.hpp:83