v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MoFEM::OpMixScalarTimesDivImpl< SPACE_DIM, GAUSS, OpBase, COORDINATE_SYSTEM > Struct Template Reference

#include <src/finite_elements/BiLinearFormsIntegrators.hpp>

Inheritance diagram for MoFEM::OpMixScalarTimesDivImpl< SPACE_DIM, GAUSS, OpBase, COORDINATE_SYSTEM >:
[legend]
Collaboration diagram for MoFEM::OpMixScalarTimesDivImpl< SPACE_DIM, GAUSS, OpBase, COORDINATE_SYSTEM >:
[legend]

Public Member Functions

 OpMixScalarTimesDivImpl (const std::string row_field_name, const std::string col_field_name, ScalarFun alpha_fun=[](double, double, double) constexpr { return 1;}, const bool assemble_transpose=false, const bool only_transpose=false)
 
- 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...
 

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)
 
virtual size_t getNbOfBaseFunctions (EntitiesFieldData::EntData &data)
 Get number of base functions. More...
 

Protected Attributes

FTensor::Index< 'i', SPACE_DIMi
 summit Index More...
 
ScalarFun alphaConstant
 
- 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
 
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 More...
 
FEFun feScalingFun
 assumes that time variable is set More...
 
boost::shared_ptr< RangeentsPtr
 Entities on which element is run. More...
 
- Static Public Attributes inherited from MoFEM::OpBaseImpl< A, EleOp >
static MatSetValuesHook matSetValuesHook
 

Detailed Description

template<int SPACE_DIM, typename OpBase, CoordinateTypes COORDINATE_SYSTEM>
struct MoFEM::OpMixScalarTimesDivImpl< SPACE_DIM, GAUSS, OpBase, COORDINATE_SYSTEM >

Definition at line 283 of file BiLinearFormsIntegrators.hpp.

Constructor & Destructor Documentation

◆ OpMixScalarTimesDivImpl()

template<int SPACE_DIM, typename OpBase , CoordinateTypes COORDINATE_SYSTEM>
MoFEM::OpMixScalarTimesDivImpl< SPACE_DIM, GAUSS, OpBase, COORDINATE_SYSTEM >::OpMixScalarTimesDivImpl ( const std::string  row_field_name,
const std::string  col_field_name,
ScalarFun  alpha_fun = [](doubledoubledouble) constexpr { return 1; },
const bool  assemble_transpose = false,
const bool  only_transpose = false 
)
inline

Definition at line 285 of file BiLinearFormsIntegrators.hpp.

287 { return 1; },
288 const bool assemble_transpose = false, const bool only_transpose = false)
289 : OpBase(row_field_name, col_field_name, OpBase::OPROWCOL),
290 alphaConstant(alpha_fun) {
291 this->assembleTranspose = assemble_transpose;
292 this->onlyTranspose = only_transpose;
293 this->sYmm = false;
294 }
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29

Member Function Documentation

◆ iNtegrate()

template<int SPACE_DIM, typename OpBase , CoordinateTypes COORDINATE_SYSTEM>
MoFEMErrorCode MoFEM::OpMixScalarTimesDivImpl< SPACE_DIM, GAUSS, OpBase, COORDINATE_SYSTEM >::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 1264 of file BiLinearFormsIntegrators.hpp.

1266 {
1268
1269#ifndef NDEBUG
1270 if (OpBase::locMat.size2() % SPACE_DIM)
1271 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1272 "Number of rows in matrix should be multiple of space dimensions");
1273#endif
1274
1275 // When we move to C++17 add if constexpr()
1276 if constexpr (COORDINATE_SYSTEM == POLAR || COORDINATE_SYSTEM == SPHERICAL)
1277 SETERRQ1(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
1278 "%s coordiante not implemented",
1279 CoordinateTypesNames[COORDINATE_SYSTEM]);
1280
1281 auto t_w = this->getFTensor0IntegrationWeight();
1282 auto t_coords = this->getFTensor1CoordsAtGaussPts();
1283 size_t nb_base_functions_row = row_data.getN().size2();
1284 auto t_row_base = row_data.getFTensor0N();
1285 const double vol = this->getMeasure();
1286 for (size_t gg = 0; gg != OpBase::nbIntegrationPts; ++gg) {
1287
1288 const double alpha =
1289 alphaConstant(t_coords(0), t_coords(1), t_coords(2)) * t_w * vol;
1290
1291 size_t rr = 0;
1292 auto t_m = getFTensor1FromPtr<SPACE_DIM>(OpBase::locMat.data().data());
1293
1294 // When we move to C++17 add if constexpr()
1295 if constexpr (COORDINATE_SYSTEM == CARTESIAN) {
1296 for (; rr != OpBase::nbRows; ++rr) {
1297 const double r_val = alpha * t_row_base;
1298 auto t_col_diff_base = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
1299 for (size_t cc = 0; cc != OpBase::nbCols / SPACE_DIM; ++cc) {
1300 t_m(i) += r_val * t_col_diff_base(i);
1301 ++t_col_diff_base;
1302 ++t_m;
1303 }
1304 ++t_row_base;
1305 }
1306 }
1307
1308 // When we move to C++17 add if constexpr()
1309 if constexpr (COORDINATE_SYSTEM == CYLINDRICAL) {
1310 for (; rr != OpBase::nbRows; ++rr) {
1311 const double r_val = alpha * t_row_base;
1312 auto t_col_base = col_data.getFTensor0N(gg, 0);
1313 auto t_col_diff_base = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
1314 for (size_t cc = 0; cc != OpBase::nbCols / SPACE_DIM; ++cc) {
1315 t_m(i) += r_val * t_col_diff_base(i);
1316 t_m(0) += (r_val / t_coords(0)) * t_col_base;
1317 ++t_col_base;
1318 ++t_col_diff_base;
1319 ++t_m;
1320 }
1321 ++t_row_base;
1322 }
1323 }
1324
1325 for (; rr < nb_base_functions_row; ++rr)
1326 ++t_row_base;
1327
1328 ++t_w;
1329 ++t_coords;
1330 }
1331
1333}
constexpr int SPACE_DIM
static const char *const CoordinateTypesNames[]
Coordinate system names.
Definition: definitions.h:108
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
@ CYLINDRICAL
Definition: definitions.h:117
@ POLAR
Definition: definitions.h:116
@ CARTESIAN
Definition: definitions.h:115
@ SPHERICAL
Definition: definitions.h:118
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
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

Member Data Documentation

◆ alphaConstant

template<int SPACE_DIM, typename OpBase , CoordinateTypes COORDINATE_SYSTEM>
ScalarFun MoFEM::OpMixScalarTimesDivImpl< SPACE_DIM, GAUSS, OpBase, COORDINATE_SYSTEM >::alphaConstant
protected

Definition at line 298 of file BiLinearFormsIntegrators.hpp.

◆ i

template<int SPACE_DIM, typename OpBase , CoordinateTypes COORDINATE_SYSTEM>
FTensor::Index<'i', SPACE_DIM> MoFEM::OpMixScalarTimesDivImpl< SPACE_DIM, GAUSS, OpBase, COORDINATE_SYSTEM >::i
protected

summit Index

Definition at line 297 of file BiLinearFormsIntegrators.hpp.


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