v0.14.0
Public Member Functions | Private Attributes | List of all members
MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase > Struct Template Reference

Calculate trace of vector (Hdiv/Hcurl) space. More...

#include <src/finite_elements/UserDataOperators.hpp>

Inheritance diagram for MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >:
[legend]

Public Member Functions

 OpCalculateHVecTensorTrace (const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
 
MoFEMErrorCode doWork (int side, EntityType type, EntitiesFieldData::EntData &data)
 

Private Attributes

boost::shared_ptr< MatrixDoubledataPtr
 
const EntityHandle zeroType
 
const int zeroSide
 
FTensor::Index< 'i', Tensor_Dim > i
 
FTensor::Index< 'j', Tensor_Dim > j
 

Detailed Description

template<int Tensor_Dim, typename OpBase>
struct MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >

Calculate trace of vector (Hdiv/Hcurl) space.

Template Parameters
Tensor_Dim
OpBase
Examples
EshelbianPlasticity.cpp, and tensor_divergence_operator.cpp.

Definition at line 2760 of file UserDataOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculateHVecTensorTrace()

template<int Tensor_Dim, typename OpBase >
MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >::OpCalculateHVecTensorTrace ( const std::string  field_name,
boost::shared_ptr< MatrixDouble data_ptr,
const EntityType  zero_type = MBEDGE,
const int  zero_side = 0 
)
inline

Definition at line 2762 of file UserDataOperators.hpp.

2766  : OpBase(field_name, OpBase::OPROW), dataPtr(data_ptr),
2767  zeroType(zero_type), zeroSide(zero_side) {
2768  if (!dataPtr)
2769  THROW_MESSAGE("Pointer is not set");
2770  }

Member Function Documentation

◆ doWork()

template<int Tensor_Dim, typename OpBase >
MoFEMErrorCode MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >::doWork ( int  side,
EntityType  type,
EntitiesFieldData::EntData data 
)
inline

Definition at line 2772 of file UserDataOperators.hpp.

2773  {
2775  const size_t nb_integration_points = OpBase::getGaussPts().size2();
2776  if (type == zeroType && side == 0) {
2777  dataPtr->resize(Tensor_Dim, nb_integration_points, false);
2778  dataPtr->clear();
2779  }
2780  const size_t nb_dofs = data.getFieldData().size();
2781  if (nb_dofs) {
2782  auto t_normal = OpBase::getFTensor1NormalsAtGaussPts();
2783  const size_t nb_base_functions = data.getN().size2() / 3;
2784  auto t_base = data.getFTensor1N<3>();
2785  auto t_data = getFTensor1FromMat<Tensor_Dim>(*dataPtr);
2786  for (size_t gg = 0; gg != nb_integration_points; ++gg) {
2787  FTensor::Tensor1<double, Tensor_Dim> t_normalized_normal;
2788  t_normalized_normal(j) = t_normal(j);
2789  t_normalized_normal.normalize();
2790  auto t_dof = data.getFTensor1FieldData<Tensor_Dim>();
2791  size_t bb = 0;
2792  for (; bb != nb_dofs / Tensor_Dim; ++bb) {
2793  t_data(i) += t_dof(i) * (t_base(j) * t_normalized_normal(j));
2794  ++t_base;
2795  ++t_dof;
2796  }
2797  for (; bb < nb_base_functions; ++bb) {
2798  ++t_base;
2799  }
2800  ++t_data;
2801  ++t_normal;
2802  }
2803  }
2805  }

Member Data Documentation

◆ dataPtr

template<int Tensor_Dim, typename OpBase >
boost::shared_ptr<MatrixDouble> MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >::dataPtr
private

Definition at line 2808 of file UserDataOperators.hpp.

◆ i

template<int Tensor_Dim, typename OpBase >
FTensor::Index<'i', Tensor_Dim> MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >::i
private

Definition at line 2811 of file UserDataOperators.hpp.

◆ j

template<int Tensor_Dim, typename OpBase >
FTensor::Index<'j', Tensor_Dim> MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >::j
private

Definition at line 2812 of file UserDataOperators.hpp.

◆ zeroSide

template<int Tensor_Dim, typename OpBase >
const int MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >::zeroSide
private

Definition at line 2810 of file UserDataOperators.hpp.

◆ zeroType

template<int Tensor_Dim, typename OpBase >
const EntityHandle MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >::zeroType
private

Definition at line 2809 of file UserDataOperators.hpp.


The documentation for this struct was generated from the following file:
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
MoFEM::OpCalculateHVecTensorTrace::zeroSide
const int zeroSide
Definition: UserDataOperators.hpp:2810
MoFEM::OpCalculateHVecTensorTrace::zeroType
const EntityHandle zeroType
Definition: UserDataOperators.hpp:2809
MoFEM::OpCalculateHVecTensorTrace::i
FTensor::Index< 'i', Tensor_Dim > i
Definition: UserDataOperators.hpp:2811
MoFEM::OpCalculateHVecTensorTrace::dataPtr
boost::shared_ptr< MatrixDouble > dataPtr
Definition: UserDataOperators.hpp:2808
convert.type
type
Definition: convert.py:64
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Tensor1::normalize
Tensor1< T, Tensor_Dim > normalize()
Definition: Tensor1_value.hpp:77
MoFEM::OpCalculateHVecTensorTrace::j
FTensor::Index< 'j', Tensor_Dim > j
Definition: UserDataOperators.hpp:2812
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359