v0.15.0
Loading...
Searching...
No Matches
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)
 

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
Examples
shallow_wave.cpp.

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 }
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::OpBase AssemblyDomainEleOp

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpULhs_dH::iNtegrate ( EntitiesFieldData::EntData & row_data,
EntitiesFieldData::EntData & col_data )
inline
Examples
shallow_wave.cpp.

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 }
constexpr double a
Kronecker Delta class.
Tensor1< T, Tensor_Dim > normalize()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
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.

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