v0.13.2
Loading...
Searching...
No Matches
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)
 
- Public Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
 OpBaseImpl (const std::string row_field_name, const std::string col_field_name, const OpType type, boost::shared_ptr< Range > ents_ptr=nullptr)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 Do calculations for the left hand side. More...
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side. More...
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set More...
 
FEFun feScalingFun
 assumes that time variable is set More...
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run. More...
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
FTensor::Tensor1< FTensor::PackPtr< double *, DIM >, DIM > getNf ()
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 
virtual MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 Integrate grad-grad operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
int nbRows
 number of dofs on rows More...
 
int nbCols
 number if dof on column More...
 
int nbIntegrationPts
 number of integration points More...
 
int nbRowBaseFunctions
 number or row base functions More...
 
int rowSide
 row side number More...
 
int colSide
 column side number More...
 
EntityType rowType
 row type More...
 
EntityType colType
 column type More...
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix More...
 
MatrixDouble locMatTranspose
 local entity block matrix More...
 
VectorDouble locF
 local entity vector More...
 

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

Definition at line 2692 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 2694 of file UserDataOperators.hpp.

2698 : OpBase(field_name, OpBase::OPROW), dataPtr(data_ptr),
2699 zeroType(zero_type), zeroSide(zero_side) {
2700 if (!dataPtr)
2701 THROW_MESSAGE("Pointer is not set");
2702 }
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:561
EntityType zero_type
constexpr auto field_name
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
boost::shared_ptr< MatrixDouble > dataPtr

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

2705 {
2707 const size_t nb_integration_points = OpBase::getGaussPts().size2();
2708 if (type == zeroType && side == 0) {
2709 dataPtr->resize(Tensor_Dim, nb_integration_points, false);
2710 dataPtr->clear();
2711 }
2712 const size_t nb_dofs = data.getFieldData().size();
2713 if (nb_dofs) {
2714 auto t_normal = OpBase::getFTensor1Normal();
2715 t_normal(i) /= sqrt(t_normal(j) * t_normal(j));
2716 const size_t nb_base_functions = data.getN().size2() / 3;
2717 auto t_base = data.getFTensor1N<3>();
2718 auto t_data = getFTensor1FromMat<Tensor_Dim>(*dataPtr);
2719 for (size_t gg = 0; gg != nb_integration_points; ++gg) {
2720 auto t_dof = data.getFTensor1FieldData<Tensor_Dim>();
2721 size_t bb = 0;
2722 for (; bb != nb_dofs / Tensor_Dim; ++bb) {
2723 t_data(i) += t_dof(i) * (t_base(j) * t_normal(j));
2724 ++t_base;
2725 ++t_dof;
2726 }
2727 for (; bb < nb_base_functions; ++bb)
2728 ++t_base;
2729 ++t_data;
2730 }
2731 }
2733 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FTensor::Index< 'j', Tensor_Dim > j
FTensor::Index< 'i', Tensor_Dim > i

Member Data Documentation

◆ dataPtr

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

Definition at line 2736 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 2739 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 2740 of file UserDataOperators.hpp.

◆ zeroSide

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

Definition at line 2738 of file UserDataOperators.hpp.

◆ zeroType

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

Definition at line 2737 of file UserDataOperators.hpp.


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