v0.13.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MoFEM::OpBaseImpl< A, EleOp > Struct Template Referenceabstract

#include <src/finite_elements/FormsIntegrators.hpp>

Inheritance diagram for MoFEM::OpBaseImpl< A, EleOp >:
[legend]
Collaboration diagram for MoFEM::OpBaseImpl< A, EleOp >:
[legend]

Public Types

using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 

Public Member Functions

 OpBaseImpl (const std::string row_field_name, const std::string col_field_name, const OpType type)
 
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...
 

Protected Member Functions

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)=0
 
virtual MoFEMErrorCode iNtegrate (EntData &data)
 Class dedicated to integrate operator. More...
 
virtual MoFEMErrorCode aSsemble (EntData &data)=0
 

Protected Attributes

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<AssemblyType A, typename EleOp>
struct MoFEM::OpBaseImpl< A, EleOp >

Examples
PlasticOps.hpp, PlasticThermalOps.hpp, approx_sphere.cpp, contact.cpp, free_surface.cpp, plastic.cpp, shallow_wave.cpp, and thermo_plastic.cpp.

Definition at line 135 of file FormsIntegrators.hpp.

Member Typedef Documentation

◆ EntData

template<AssemblyType A, typename EleOp >
using MoFEM::OpBaseImpl< A, EleOp >::EntData = EntitiesFieldData::EntData

Definition at line 137 of file FormsIntegrators.hpp.

◆ OpType

template<AssemblyType A, typename EleOp >
using MoFEM::OpBaseImpl< A, EleOp >::OpType = typename EleOp::OpType

Definition at line 136 of file FormsIntegrators.hpp.

Constructor & Destructor Documentation

◆ OpBaseImpl()

template<AssemblyType A, typename EleOp >
MoFEM::OpBaseImpl< A, EleOp >::OpBaseImpl ( const std::string  row_field_name,
const std::string  col_field_name,
const OpType  type 
)

Definition at line 139 of file FormsIntegrators.hpp.

141  : EleOp(row_field_name, col_field_name, type, false),
142  assembleTranspose(false), onlyTranspose(false) {}

Member Function Documentation

◆ aSsemble() [1/2]

template<AssemblyType A, typename EleOp >
virtual MoFEMErrorCode MoFEM::OpBaseImpl< A, EleOp >::aSsemble ( EntData data)
protectedpure virtual

◆ aSsemble() [2/2]

template<AssemblyType A, typename EleOp >
virtual MoFEMErrorCode MoFEM::OpBaseImpl< A, EleOp >::aSsemble ( EntData row_data,
EntData col_data,
const bool  trans 
)
protectedpure virtual

◆ doWork() [1/2]

template<AssemblyType A, typename EleOp >
MoFEMErrorCode MoFEM::OpBaseImpl< A, EleOp >::doWork ( int  row_side,
EntityType  row_type,
EntData row_data 
)

Do calculations for the right hand side.

Parameters
row_side
row_type
row_data
Returns
MoFEMErrorCode

Definition at line 312 of file FormsIntegrators.hpp.

313  {
315  // get number of dofs on row
316  nbRows = row_data.getIndices().size();
317  rowSide = row_side;
318  rowType = row_type;
319 
320  if (!nbRows)
322  // get number of integration points
323  nbIntegrationPts = EleOp::getGaussPts().size2();
324  // get row base functions
325  nbRowBaseFunctions = row_data.getN().size2();
326  // resize and clear the right hand side vector
327  locF.resize(nbRows);
328  locF.clear();
329  // integrate local vector
330  CHKERR this->iNtegrate(row_data);
331  // assemble local vector
332  CHKERR this->aSsemble(row_data);
334 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.
VectorDouble locF
local entity vector
int rowSide
row side number
int nbRows
number of dofs on rows
int nbIntegrationPts
number of integration points
virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrate grad-grad operator.
virtual MoFEMErrorCode aSsemble(EntData &row_data, EntData &col_data, const bool trans)=0
int nbRowBaseFunctions
number or row base functions
EntityType rowType
row type

◆ doWork() [2/2]

template<AssemblyType A, typename EleOp >
MoFEMErrorCode MoFEM::OpBaseImpl< A, EleOp >::doWork ( int  row_side,
int  col_side,
EntityType  row_type,
EntityType  col_type,
EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)

Do calculations for the left hand side.

Parameters
row_siderow side number (local number) of entity on element
col_sidecolumn side number (local number) of entity on element
row_typetype of row entity
col_typetype of column entity
row_datadata for row
col_datadata for column
Returns
error code

Definition at line 264 of file FormsIntegrators.hpp.

267  {
269  // get number of dofs on row
270  nbRows = row_data.getIndices().size();
271  // if no dofs on row, exit that work, nothing to do here
272  if (!nbRows)
274  rowSide = row_side;
275  rowType = row_type;
276  // get number of dofs on column
277  nbCols = col_data.getIndices().size();
278  // if no dofs on Columbia, exit nothing to do here
279  if (!nbCols)
281  colSide = col_side;
282  colType = col_type;
283  // get number of integration points
284  nbIntegrationPts = EleOp::getGaussPts().size2();
285  // get row base functions
286  nbRowBaseFunctions = row_data.getN().size2();
287  // set size of local entity bock
288  locMat.resize(nbRows, nbCols, false);
289  // clear matrix
290  locMat.clear();
291  // integrate local matrix for entity block
292  CHKERR this->iNtegrate(row_data, col_data);
293 
294  // assemble local matrix
295  auto check_if_assemble_transpose = [&] {
296  if (this->sYmm) {
297  if (row_side != col_side || row_type != col_type)
298  return true;
299  else
300  return false;
301  } else if (assembleTranspose) {
302  return true;
303  }
304 
305  return false;
306  };
307  CHKERR aSsemble(row_data, col_data, check_if_assemble_transpose());
309 }
int colSide
column side number
EntityType colType
column type
MatrixDouble locMat
local entity block matrix
int nbCols
number if dof on column

◆ getLocMat()

template<AssemblyType A, typename EleOp >
template<int DIM>
FTensor::Tensor2<FTensor::PackPtr<double *, DIM>, DIM, DIM> MoFEM::OpBaseImpl< A, EleOp >::getLocMat ( const int  rr)
protected

Definition at line 176 of file FormsIntegrators.hpp.

176  {
177  return getFTensor2FromArray<DIM, DIM, DIM>(locMat, rr);
178  }

◆ getNf()

template<AssemblyType A, typename EleOp >
template<int DIM>
FTensor::Tensor1<FTensor::PackPtr<double *, DIM>, DIM> MoFEM::OpBaseImpl< A, EleOp >::getNf ( )
protected

Definition at line 170 of file FormsIntegrators.hpp.

170  {
171  return getFTensor1FromArray<DIM, DIM>(locF);
172  }

◆ iNtegrate() [1/2]

template<AssemblyType A, typename EleOp >
virtual MoFEMErrorCode MoFEM::OpBaseImpl< A, EleOp >::iNtegrate ( EntData data)
protectedvirtual

Class dedicated to integrate operator.

Parameters
dataentity data on element row
Returns
error code

Reimplemented in OpURhs, OpRhs, MoFEM::OpConvectiveTermRhsImpl< 1, FIELD_DIM, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpConvectiveTermRhsImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpNormalMixVecTimesScalarImpl< 2, GAUSS, OpBase >, MoFEM::OpNormalMixVecTimesScalarImpl< 3, GAUSS, OpBase >, MoFEM::OpMixTensorTimesGradUImpl< SPACE_DIM, GAUSS, OpBase >, MoFEM::OpMixVecTimesDivLambdaImpl< SPACE_DIM, GAUSS, OpBase >, MoFEM::OpMixDivTimesUImpl< 1, FIELD_DIM, FIELD_DIM, GAUSS, OpBase >, MoFEM::OpMixDivTimesUImpl< 3, 1, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpMixDivTimesUImpl< 3, FIELD_DIM, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpGradTimesSymTensorImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >, MoFEM::OpGradTimesTensorImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >, MoFEM::OpGradTimesTensorImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >, MoFEM::OpBaseTimesVectorImpl< BASE_DIM, BASE_DIM, S, GAUSS, OpBase >, MoFEM::OpBaseTimesVectorImpl< 1, FIELD_DIM, S, GAUSS, OpBase >, MoFEM::OpBaseTimesScalarFieldImpl< 1, S, GAUSS, OpBase >, MoFEM::OpSourceImpl< BASE_DIM, BASE_DIM, GAUSS, OpBase >, MoFEM::OpSourceImpl< 1, FIELD_DIM, GAUSS, OpBase >, MoFEM::OpSourceImpl< 1, 1, GAUSS, OpBase >, Example::OpFluxRhs, Example::OpRadiationRhs, and OpDomainResidualVector.

Definition at line 215 of file FormsIntegrators.hpp.

215  {
216  return MOFEM_NOT_IMPLEMENTED;
217  }
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:45

◆ iNtegrate() [2/2]

template<AssemblyType A, typename EleOp >
virtual MoFEMErrorCode MoFEM::OpBaseImpl< A, EleOp >::iNtegrate ( EntData row_data,
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 in OpULhs_dH, OpULhs_dU, OpLhs, MoFEM::OpConvectiveTermLhsDyImpl< 1, FIELD_DIM, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpConvectiveTermLhsDuImpl< 1, FIELD_DIM, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpConvectiveTermLhsDyImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpConvectiveTermLhsDuImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpMixTensorTimesGradImpl< SPACE_DIM, GAUSS, OpBase >, MoFEM::OpMixVectorTimesGradImpl< 1, SPACE_DIM, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpMixVectorTimesGradImpl< 3, SPACE_DIM, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpMixScalarTimesDivImpl< SPACE_DIM, GAUSS, OpBase, COORDINATE_SYSTEM >, MoFEM::OpMixDivTimesVecImpl< SPACE_DIM, GAUSS, OpBase >, MoFEM::OpMixDivTimesScalarImpl< SPACE_DIM, GAUSS, OpBase >, MoFEM::OpGradGradSymTensorGradGradImpl< 1, 1, SPACE_DIM, S, GAUSS, OpBase >, MoFEM::OpGradTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >, MoFEM::OpGradSymTensorGradImpl< 1, SPACE_DIM, SPACE_DIM, S, GAUSS, OpBase >, MoFEM::OpMassImpl< 3, 9, GAUSS, OpBase >, MoFEM::OpMassImpl< BASE_DIM, BASE_DIM, GAUSS, OpBase >, MoFEM::OpMassImpl< 1, FIELD_DIM, GAUSS, OpBase >, MoFEM::OpMassImpl< 1, 1, GAUSS, OpBase >, MoFEM::OpGradGradImpl< 1, FIELD_DIM, SPACE_DIM, GAUSS, OpBase >, MoFEM::OpGradGradImpl< 1, 1, SPACE_DIM, GAUSS, OpBase >, Example::OpRadiationLhs, and OpDomainTangentMatrix.

Definition at line 203 of file FormsIntegrators.hpp.

203  {
204  return MOFEM_NOT_IMPLEMENTED;
205  }

Member Data Documentation

◆ assembleTranspose

template<AssemblyType A, typename EleOp >
bool MoFEM::OpBaseImpl< A, EleOp >::assembleTranspose
protected

Definition at line 190 of file FormsIntegrators.hpp.

◆ colSide

template<AssemblyType A, typename EleOp >
int MoFEM::OpBaseImpl< A, EleOp >::colSide
protected

column side number

Definition at line 186 of file FormsIntegrators.hpp.

◆ colType

template<AssemblyType A, typename EleOp >
EntityType MoFEM::OpBaseImpl< A, EleOp >::colType
protected

column type

Definition at line 188 of file FormsIntegrators.hpp.

◆ locF

template<AssemblyType A, typename EleOp >
VectorDouble MoFEM::OpBaseImpl< A, EleOp >::locF
protected

local entity vector

Examples
PlasticOpsGeneric.hpp, and PlasticThermalOps.hpp.

Definition at line 195 of file FormsIntegrators.hpp.

◆ locMat

template<AssemblyType A, typename EleOp >
MatrixDouble MoFEM::OpBaseImpl< A, EleOp >::locMat
protected

◆ locMatTranspose

template<AssemblyType A, typename EleOp >
MatrixDouble MoFEM::OpBaseImpl< A, EleOp >::locMatTranspose
protected

local entity block matrix

Definition at line 194 of file FormsIntegrators.hpp.

◆ nbCols

template<AssemblyType A, typename EleOp >
int MoFEM::OpBaseImpl< A, EleOp >::nbCols
protected

◆ nbIntegrationPts

template<AssemblyType A, typename EleOp >
int MoFEM::OpBaseImpl< A, EleOp >::nbIntegrationPts
protected

number of integration points

Definition at line 182 of file FormsIntegrators.hpp.

◆ nbRowBaseFunctions

template<AssemblyType A, typename EleOp >
int MoFEM::OpBaseImpl< A, EleOp >::nbRowBaseFunctions
protected

number or row base functions

Definition at line 183 of file FormsIntegrators.hpp.

◆ nbRows

template<AssemblyType A, typename EleOp >
int MoFEM::OpBaseImpl< A, EleOp >::nbRows
protected

◆ onlyTranspose

template<AssemblyType A, typename EleOp >
bool MoFEM::OpBaseImpl< A, EleOp >::onlyTranspose
protected

Definition at line 191 of file FormsIntegrators.hpp.

◆ rowSide

template<AssemblyType A, typename EleOp >
int MoFEM::OpBaseImpl< A, EleOp >::rowSide
protected

row side number

Definition at line 185 of file FormsIntegrators.hpp.

◆ rowType

template<AssemblyType A, typename EleOp >
EntityType MoFEM::OpBaseImpl< A, EleOp >::rowType
protected

row type

Definition at line 187 of file FormsIntegrators.hpp.


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