v0.13.0
Public Member Functions | List of all members
OpULhs_dH Struct Reference
Inheritance diagram for OpULhs_dH:
[legend]
Collaboration diagram for OpULhs_dH:
[legend]

Public Member Functions

 OpULhs_dH (const std::string field_name_row, const std::string field_name_col)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 Integrate grad-grad operator. More...
 
- 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)
 
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...
 

Additional Inherited Members

- Public Types inherited from MoFEM::OpBaseImpl< A, EleOp >
using OpType = typename EleOp::OpType
 
using EntData = EntitiesFieldData::EntData
 
- 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 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 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...
 

Detailed Description

Examples
shallow_wave.cpp.

Definition at line 282 of file shallow_wave.cpp.

Constructor & Destructor Documentation

◆ OpULhs_dH()

OpULhs_dH::OpULhs_dH ( const std::string  field_name_row,
const std::string  field_name_col 
)

Definition at line 284 of file shallow_wave.cpp.

285  : AssemblyDomainEleOp(field_name_row, field_name_col,
286  AssemblyDomainEleOp::OPROWCOL) {
287  this->sYmm = false;
288  }
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::OpBase AssemblyDomainEleOp

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpULhs_dH::iNtegrate ( EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)
virtual

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 290 of file shallow_wave.cpp.

291  {
293 
294  // get element volume
295  const double vol = getMeasure();
296  // get integration weights
297  auto t_w = getFTensor0IntegrationWeight();
298  // get base function gradient on rows
299  auto t_row_base = row_data.getFTensor0N();
300  // normal
301  auto t_normal = getFTensor1NormalsAtGaussPts();
302 
303  auto get_t_vec = [&](const int rr) {
305  &locMat(rr + 0, 0),
306 
307  &locMat(rr + 1, 0),
308 
309  &locMat(rr + 2, 0)};
310  };
311 
312  // loop over integration points
313  for (int gg = 0; gg != nbIntegrationPts; gg++) {
314 
316  t_r(i) = t_normal(i);
317  t_r.normalize();
318 
319  constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
321  t_P(i, j) = t_r(i) * t_r(j);
322  t_Q(i, j) = t_kd(i, j) - t_P(i, j);
323 
324  const double alpha = t_w * vol;
325 
326  int rr = 0;
327  for (; rr != nbRows / 3; rr++) {
328  auto t_vec = get_t_vec(3 * rr);
329  auto t_col_diff_base = col_data.getFTensor1DiffN<3>(gg, 0);
330  const double a = alpha * g * t_row_base;
331 
332  for (int cc = 0; cc != nbCols; cc++) {
333  t_vec(i) += a * (t_Q(i, m) * t_col_diff_base(m));
334  ++t_vec;
335  ++t_col_diff_base;
336  }
337 
338  ++t_row_base;
339  }
340 
341  for (; rr < nbRowBaseFunctions; ++rr)
342  ++t_row_base;
343 
344  ++t_w;
345  ++t_normal;
346  }
347 
349  }
constexpr double a
Kronecker Delta class.
Tensor1< T, Tensor_Dim > normalize()
constexpr double alpha
#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
constexpr auto t_kd
FTensor::Index< 'j', 3 > j
FTensor::Index< 'i', 3 > i
constexpr double g
FTensor::Index< 'm', 3 > m
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
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

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