v0.16.0
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, boost::shared_ptr< double > scale_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)
 
 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)
 Constructor for base operator implementation.
 
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.
 
MoFEMErrorCode doWork (int row_side, EntityType row_type, EntData &row_data)
 Do calculations for the right hand side.
 

Private Attributes

boost::shared_ptr< MatrixDoubledataPtr
 
boost::shared_ptr< doublescalePtr
 
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
 
using MatSetValuesHook = boost::function< MoFEMErrorCode(ForcesAndSourcesCore::UserDataOperator *op_ptr, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, MatrixDouble &m)>
 
- Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
TimeFun timeScalingFun
 assumes that time variable is set
 
FEFun feScalingFun
 set by fe entity handle
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run.
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 
- Protected Member Functions inherited from MoFEM::OpBaseImpl< A, EleOp >
template<int DIM>
auto getNf ()
 Get local vector tensor for assembly.
 
template<int DIM>
FTensor::Tensor2< FTensor::PackPtr< double *, DIM >, DIM, DIM > getLocMat (const int rr)
 Get local matrix tensor for assembly.
 
virtual MoFEMErrorCode iNtegrate (EntData &, EntData &)
 Integrate grad-grad operator.
 
virtual MoFEMErrorCode aSsemble (EntData &row_data, EntData &col_data, const bool trans)
 Assemble local matrix into global matrix.
 
virtual MoFEMErrorCode iNtegrate (EntData &)
 Class dedicated to integrate operator.
 
virtual MoFEMErrorCode aSsemble (EntData &data)
 Assemble local vector into global vector.
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions.
 
- Protected Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
int nbRows
 number of dofs on rows
 
int nbCols
 number if dof on column
 
int nbIntegrationPts
 number of integration points
 
int nbRowBaseFunctions
 number or row base functions
 
int rowSide
 row side number
 
int colSide
 column side number
 
EntityType rowType
 row type
 
EntityType colType
 column type
 
bool assembleTranspose
 
bool onlyTranspose
 
MatrixDouble locMat
 local entity block matrix
 
MatrixDouble locMatTranspose
 local entity block matrix
 
VectorDouble locF
 local entity vector
 

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
/home/lk58p/mofem_install/vanilla_dev_release/mofem-cephas/mofem/users_modules/eshelbian_plasticity/src/impl/EshelbianPlasticity.cpp, and mofem/atom_tests/tensor_divergence_operator.cpp.

Definition at line 3890 of file UserDataOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculateHVecTensorTrace() [1/2]

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

Definition at line 3892 of file UserDataOperators.hpp.

3897 : OpBase(field_name, OpBase::OPCOL), dataPtr(data_ptr),
3898 scalePtr(scale_ptr), zeroType(zero_type), zeroSide(zero_side) {
3899 if (!dataPtr)
3900 THROW_MESSAGE("Pointer is not set");
3901 }
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
constexpr auto field_name
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition radiation.cpp:29
boost::shared_ptr< MatrixDouble > dataPtr
boost::shared_ptr< double > scalePtr

◆ OpCalculateHVecTensorTrace() [2/2]

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

3907 : OpCalculateHVecTensorTrace(field_name, data_ptr, nullptr, zero_type,
3908 zero_side) {}
OpCalculateHVecTensorTrace(const std::string field_name, boost::shared_ptr< MatrixDouble > data_ptr, boost::shared_ptr< double > scale_ptr, const EntityType zero_type=MBEDGE, const int zero_side=0)

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

3911 {
3913 const size_t nb_integration_points = OpBase::getGaussPts().size2();
3914 auto &mat = *dataPtr;
3915 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
3916 auto get_data_at_pts =
3917 MatrixSizeHelper<GetFTensor1FromMatType<Tensor_Dim, -1, DL>,
3918 DL>::size(mat, nb_integration_points);
3919 if (type == zeroType && side == 0) {
3920 mat.clear();
3921 }
3922 const size_t nb_dofs = data.getFieldData().size();
3923 if (nb_dofs) {
3924 double scale_val = (scalePtr) ? *scalePtr : 1.0;
3925 auto t_normal = OpBase::getFTensor1NormalsAtGaussPts();
3926 const size_t nb_base_functions = data.getN().size2() / 3;
3927 auto t_base = data.getFTensor1N<3>();
3928 auto t_data_at_pts = get_data_at_pts();
3929 for (size_t gg = 0; gg != nb_integration_points; ++gg) {
3930 FTensor::Tensor1<double, Tensor_Dim> t_normalized_normal;
3931 t_normalized_normal(j) = t_normal(j);
3932 t_normalized_normal.normalize();
3933 auto t_dof = data.getFTensor1FieldData<Tensor_Dim>();
3934 size_t bb = 0;
3935 for (; bb != nb_dofs / Tensor_Dim; ++bb) {
3936 t_data_at_pts(i) +=
3937 (scale_val * t_dof(i)) * (t_base(j) * t_normalized_normal(j));
3938 ++t_base;
3939 ++t_dof;
3940 }
3941 for (; bb < nb_base_functions; ++bb) {
3942 ++t_base;
3943 }
3944 ++t_data_at_pts;
3945 ++t_normal;
3946 }
3947 }
3949 }
std::string type
Tensor1< T, Tensor_Dim > normalize()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
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 3952 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 3956 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 3957 of file UserDataOperators.hpp.

◆ scalePtr

template<int Tensor_Dim, typename OpBase >
boost::shared_ptr<double> MoFEM::OpCalculateHVecTensorTrace< Tensor_Dim, OpBase >::scalePtr
private

Definition at line 3953 of file UserDataOperators.hpp.

◆ zeroSide

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

Definition at line 3955 of file UserDataOperators.hpp.

◆ zeroType

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

Definition at line 3954 of file UserDataOperators.hpp.


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