v0.14.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, 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...
 

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
 
- 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)
 
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 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 267 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 
)
inline

Definition at line 269 of file shallow_wave.cpp.

270  : AssemblyDomainEleOp(field_name_row, field_name_col,
271  AssemblyDomainEleOp::OPROWCOL) {
272  this->sYmm = false;
273  }

Member Function Documentation

◆ iNtegrate()

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

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

276  {
278 
279  // get element volume
280  const double vol = getMeasure();
281  // get integration weights
282  auto t_w = getFTensor0IntegrationWeight();
283  // get base function gradient on rows
284  auto t_row_base = row_data.getFTensor0N();
285  // normal
286  auto t_normal = getFTensor1NormalsAtGaussPts();
287 
288  auto get_t_vec = [&](const int rr) {
290  &locMat(rr + 0, 0),
291 
292  &locMat(rr + 1, 0),
293 
294  &locMat(rr + 2, 0)};
295  };
296 
297  // loop over integration points
298  for (int gg = 0; gg != nbIntegrationPts; gg++) {
299 
301  t_r(i) = t_normal(i);
302  t_r.normalize();
303 
304  constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
306  t_P(i, j) = t_r(i) * t_r(j);
307  t_Q(i, j) = t_kd(i, j) - t_P(i, j);
308 
309  const double alpha = t_w * vol;
310 
311  int rr = 0;
312  for (; rr != nbRows / 3; rr++) {
313  auto t_vec = get_t_vec(3 * rr);
314  auto t_col_diff_base = col_data.getFTensor1DiffN<3>(gg, 0);
315  const double a = alpha * g * t_row_base;
316 
317  for (int cc = 0; cc != nbCols; cc++) {
318  t_vec(i) += a * (t_Q(i, m) * t_col_diff_base(m));
319  ++t_vec;
320  ++t_col_diff_base;
321  }
322 
323  ++t_row_base;
324  }
325 
326  for (; rr < nbRowBaseFunctions; ++rr)
327  ++t_row_base;
328 
329  ++t_w;
330  ++t_normal;
331  }
332 
334  }

The documentation for this struct was generated from the following file:
MoFEM::OpBaseImpl::nbIntegrationPts
int nbIntegrationPts
number of integration points
Definition: FormsIntegrators.hpp:238
g
constexpr double g
Definition: shallow_wave.cpp:63
MoFEM::OpBaseImpl::locMat
MatrixDouble locMat
local entity block matrix
Definition: FormsIntegrators.hpp:249
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
FTensor::Kronecker_Delta
Kronecker Delta class.
Definition: Kronecker_Delta.hpp:15
i
FTensor::Index< 'i', 3 > i
Definition: shallow_wave.cpp:77
FTensor::Tensor2< double, 3, 3 >
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1502
a
constexpr double a
Definition: approx_sphere.cpp:30
j
FTensor::Index< 'j', 3 > j
Definition: shallow_wave.cpp:78
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
FTensor::Tensor1::normalize
Tensor1< T, Tensor_Dim > normalize()
Definition: Tensor1_value.hpp:77
MoFEM::OpBaseImpl::nbRowBaseFunctions
int nbRowBaseFunctions
number or row base functions
Definition: FormsIntegrators.hpp:239
MoFEM::OpBaseImpl::nbCols
int nbCols
number if dof on column
Definition: FormsIntegrators.hpp:237
MoFEM::EntitiesFieldData::EntData::getFTensor1DiffN
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
Definition: EntitiesFieldData.cpp:526
MoFEM::OpBaseImpl::nbRows
int nbRows
number of dofs on rows
Definition: FormsIntegrators.hpp:236
AssemblyDomainEleOp
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::OpBase AssemblyDomainEleOp
Definition: shallow_wave.cpp:32
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359