v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoFEM::OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase > Struct Template Reference

#include "src/finite_elements/BiLinearFormsIntegratorsImpl.hpp"

Inheritance diagram for MoFEM::OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >:
[legend]
Collaboration diagram for MoFEM::OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >:
[legend]

Public Member Functions

 OpGradSymTensorGradImpl (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< MatrixDouble > mat_D, boost::shared_ptr< Range > ents_ptr=nullptr, ScalarFun beta=scalar_fun_one)
 
- 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.
 

Public Attributes

FTensor::Index< 'i', SPACE_DIMi
 summit Index
 
- 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.
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Integrate grad-grad operator.
 
- 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 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

boost::shared_ptr< MatrixDoublematD
 
ScalarFun betaCoeff
 
- 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
 

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)>
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 

Detailed Description

template<int SPACE_DIM, int S, typename OpBase>
struct MoFEM::OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >

Definition at line 208 of file BiLinearFormsIntegratorsImpl.hpp.

Constructor & Destructor Documentation

◆ OpGradSymTensorGradImpl()

template<int SPACE_DIM, int S, typename OpBase >
MoFEM::OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::OpGradSymTensorGradImpl ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< MatrixDouble mat_D,
boost::shared_ptr< Range ents_ptr = nullptr,
ScalarFun  beta = scalar_fun_one 
)
inline

Definition at line 211 of file BiLinearFormsIntegratorsImpl.hpp.

216 : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL, ents_ptr),
217 matD(mat_D), betaCoeff(beta) {
218 if (row_field_name == col_field_name)
219 this->sYmm = true;
220 }
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition radiation.cpp:29

Member Function Documentation

◆ iNtegrate()

template<int SPACE_DIM, int S, typename OpBase >
MoFEMErrorCode MoFEM::OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData ,
EntitiesFieldData::EntData  
)
protectedvirtual

Integrate grad-grad operator.

Parameters
row_datarow data (consist base functions on row entity)
col_datacolumn data (consist base functions on column entity)
Returns
error code

Reimplemented from MoFEM::OpBaseImpl< A, EleOp >.

Definition at line 918 of file BiLinearFormsIntegratorsImpl.hpp.

920 {
922
923 const size_t nb_row_dofs = row_data.getIndices().size();
924 const size_t nb_col_dofs = col_data.getIndices().size();
925
926 if (nb_row_dofs && nb_col_dofs) {
927
928 const bool diag = (row_data.getFieldEntities()[0]->getLocalUniqueId() ==
929 col_data.getFieldEntities()[0]->getLocalUniqueId());
930
935
936 // get element volume
937 double vol = OpBase::getMeasure();
938
939 // get intergrayion weights
940 auto t_w = OpBase::getFTensor0IntegrationWeight();
941
942 // get derivatives of base functions on rows
943 auto t_row_diff_base = row_data.getFTensor1DiffN<SPACE_DIM>();
944
945 // Elastic stiffness tensor (4th rank tensor with minor and major
946 // symmetry)
947 using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
948 auto get_D_at_pts =
949 MatrixSizeHelper<GetFTensor4DdgFromMatType<SPACE_DIM, SPACE_DIM, S, DL>,
951 auto t_D_at_pts = get_D_at_pts();
952
953 // get coordinate at integration points
954 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
955
956 // iterate over integration points
957 for (int gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
958
959 // calculate scalar weight times element volume
960 double a = t_w * vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
961
962 // iterate over row base functions
963 int rr = 0;
964 for (; rr != OpBase::nbRows / SPACE_DIM; ++rr) {
965
966 // get sub matrix for the row
967 auto t_m = OpBase::template getLocMat<SPACE_DIM>(SPACE_DIM * rr);
968
970 // I mix up the indices here so that it behaves like a
971 // Dg. That way I don't have to have a separate wrapper
972 // class Christof_Expr, which simplifies things.
973 t_rowD(l, j, k) = t_D_at_pts(i, j, k, l) * (a * t_row_diff_base(i));
974
975 // get derivatives of base functions for columns
976 auto t_col_diff_base = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
977
978 // iterate column base functions
979 const auto nb_cols = (diag) ? rr : OpBase::nbCols / SPACE_DIM - 1;
980 for (int cc = 0; cc <= nb_cols; ++cc) {
981
982 // integrate block local stiffens matrix
983 t_m(i, j) += t_rowD(i, j, k) * t_col_diff_base(k);
984
985 // move to next column base function
986 ++t_col_diff_base;
987
988 // move to next block of local stiffens matrix
989 ++t_m;
990 }
991
992 // move to next row base function
993 ++t_row_diff_base;
994 }
995
996 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
997 ++t_row_diff_base;
998
999 // move to next integration weight
1000 ++t_w;
1001 ++t_D_at_pts;
1002 ++t_coords;
1003 }
1004
1005 // Copy symmetry
1006 if (diag) {
1007 for (int rr = 0; rr != OpBase::nbRows / SPACE_DIM - 1; ++rr) {
1008 auto t_m_rr = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
1009 this->locMat, SPACE_DIM * rr, SPACE_DIM * (rr + 1));
1010 auto t_m_cc = getFTensor2FromArray<SPACE_DIM, SPACE_DIM>(
1011 this->locMat, SPACE_DIM * (rr + 1), SPACE_DIM * rr,
1013 for (int cc = rr + 1; cc < OpBase::nbCols / SPACE_DIM; ++cc) {
1014 t_m_rr(i, j) = t_m_cc(j, i);
1015 ++t_m_rr;
1016 ++t_m_cc;
1017 }
1018 }
1019 }
1020 }
1021
1023}
constexpr double a
constexpr int SPACE_DIM
#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()
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
MatrixDouble locMat
local entity block matrix
int nbCols
number if dof on column
int nbRowBaseFunctions
number or row base functions

Member Data Documentation

◆ betaCoeff

template<int SPACE_DIM, int S, typename OpBase >
ScalarFun MoFEM::OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::betaCoeff
protected

Definition at line 224 of file BiLinearFormsIntegratorsImpl.hpp.

◆ i

template<int SPACE_DIM, int S, typename OpBase >
FTensor::Index<'i', SPACE_DIM> MoFEM::OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::i

summit Index

Definition at line 210 of file BiLinearFormsIntegratorsImpl.hpp.

◆ matD

template<int SPACE_DIM, int S, typename OpBase >
boost::shared_ptr<MatrixDouble> MoFEM::OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >::matD
protected

Definition at line 223 of file BiLinearFormsIntegratorsImpl.hpp.


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