v0.13.2
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/BiLinearFormsIntegrators.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)
 
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...
 

Public Attributes

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

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

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

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 

Detailed Description

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

Definition at line 133 of file BiLinearFormsIntegrators.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 136 of file BiLinearFormsIntegrators.hpp.

141 : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL, ents_ptr),
142 matD(mat_D), betaCoeff(beta) {
143 if (row_field_name == col_field_name)
144 this->sYmm = true;
145 }
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 row_data,
EntitiesFieldData::EntData col_data 
)
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 887 of file BiLinearFormsIntegrators.hpp.

889 {
891
892 const size_t nb_row_dofs = row_data.getIndices().size();
893 const size_t nb_col_dofs = col_data.getIndices().size();
894
895 if (nb_row_dofs && nb_col_dofs) {
896
897 const bool diag = (row_data.getFieldEntities()[0]->getLocalUniqueId() ==
898 col_data.getFieldEntities()[0]->getLocalUniqueId());
899
904
905 // get element volume
906 double vol = OpBase::getMeasure();
907
908 // get intergrayion weights
909 auto t_w = OpBase::getFTensor0IntegrationWeight();
910
911 // get derivatives of base functions on rows
912 auto t_row_diff_base = row_data.getFTensor1DiffN<SPACE_DIM>();
913
914 // Elastic stiffness tensor (4th rank tensor with minor and major
915 // symmetry)
916 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, S>(*matD);
917
918 // get coordinate at integration points
919 auto t_coords = OpBase::getFTensor1CoordsAtGaussPts();
920
921 // iterate over integration points
922 for (int gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
923
924 // calculate scalar weight times element volume
925 double a = t_w * vol * betaCoeff(t_coords(0), t_coords(1), t_coords(2));
926
927 // iterate over row base functions
928 int rr = 0;
929 for (; rr != OpBase::nbRows / SPACE_DIM; ++rr) {
930
931 // get sub matrix for the row
932 auto t_m = OpBase::template getLocMat<SPACE_DIM>(SPACE_DIM * rr);
933
935 // I mix up the indices here so that it behaves like a
936 // Dg. That way I don't have to have a separate wrapper
937 // class Christof_Expr, which simplifies things.
938 t_rowD(l, j, k) = t_D(i, j, k, l) * (a * t_row_diff_base(i));
939
940 // get derivatives of base functions for columns
941 auto t_col_diff_base = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
942
943 // iterate column base functions
944 const auto nb_cols = (diag) ? rr : OpBase::nbCols / SPACE_DIM - 1;
945 for (int cc = 0; cc <= nb_cols; ++cc) {
946
947 // integrate block local stiffens matrix
948 t_m(i, j) += t_rowD(i, j, k) * t_col_diff_base(k);
949
950 // move to next column base function
951 ++t_col_diff_base;
952
953 // move to next block of local stiffens matrix
954 ++t_m;
955 }
956
957 // move to next row base function
958 ++t_row_diff_base;
959 }
960
961 for (; rr < OpBase::nbRowBaseFunctions; ++rr)
962 ++t_row_diff_base;
963
964 // move to next integration weight
965 ++t_w;
966 ++t_D;
967 ++t_coords;
968 }
969
970 // Copy symmetry
971 if (diag) {
972 for (int rr = 0; rr != OpBase::nbRows / SPACE_DIM - 1; ++rr) {
973 auto t_m_rr = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
974 this->locMat, SPACE_DIM * rr, SPACE_DIM * (rr + 1));
975 auto t_m_cc = getFTensor2FromArray<SPACE_DIM, SPACE_DIM>(
976 this->locMat, SPACE_DIM * (rr + 1), SPACE_DIM * rr,
978 for (int cc = rr + 1; cc < OpBase::nbCols / SPACE_DIM; ++cc) {
979 t_m_rr(i, j) = t_m_cc(j, i);
980 ++t_m_rr;
981 ++t_m_cc;
982 }
983 }
984 }
985
986 }
987
989}
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 ...
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< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
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 149 of file BiLinearFormsIntegrators.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 135 of file BiLinearFormsIntegrators.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 148 of file BiLinearFormsIntegrators.hpp.


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