v0.16.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MatOps::OpLhsHuGrad< FIELD_DIM, SPACE_DIM, A, GAUSS, OpBase > Struct Template Reference

#include "src/materials/MatHuHu.hpp"

Inheritance diagram for MatOps::OpLhsHuGrad< FIELD_DIM, SPACE_DIM, A, GAUSS, OpBase >:
[legend]
Collaboration diagram for MatOps::OpLhsHuGrad< FIELD_DIM, SPACE_DIM, A, GAUSS, OpBase >:
[legend]

Public Types

using OP = typename FormsIntegrators< OpBase >::template Assembly< A >::OpBase
 

Public Member Functions

 OpLhsHuGrad (const std::string field_name, boost::shared_ptr< MatrixDouble > mat_vals, boost::shared_ptr< MatrixDouble > mat_diff_K, boost::shared_ptr< Range > ents_ptr=nullptr)
 

Protected Member Functions

MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Protected Attributes

boost::shared_ptr< MatrixDoublematVals
 
boost::shared_ptr< MatrixDoublematDiffK
 

Detailed Description

template<int FIELD_DIM, int SPACE_DIM, AssemblyType A, typename OpBase>
struct MatOps::OpLhsHuGrad< FIELD_DIM, SPACE_DIM, A, GAUSS, OpBase >

Definition at line 205 of file MatHuHu.hpp.

Member Typedef Documentation

◆ OP

template<int FIELD_DIM, int SPACE_DIM, AssemblyType A, typename OpBase >
using MatOps::OpLhsHuGrad< FIELD_DIM, SPACE_DIM, A, GAUSS, OpBase >::OP = typename FormsIntegrators<OpBase>::template Assembly<A>::OpBase

Definition at line 207 of file MatHuHu.hpp.

Constructor & Destructor Documentation

◆ OpLhsHuGrad()

template<int FIELD_DIM, int SPACE_DIM, AssemblyType A, typename OpBase >
MatOps::OpLhsHuGrad< FIELD_DIM, SPACE_DIM, A, GAUSS, OpBase >::OpLhsHuGrad ( const std::string  field_name,
boost::shared_ptr< MatrixDouble mat_vals,
boost::shared_ptr< MatrixDouble mat_diff_K,
boost::shared_ptr< Range ents_ptr = nullptr 
)
inline

Definition at line 208 of file MatHuHu.hpp.

212 : OP(field_name, field_name, OP::OPROWCOL), matVals(mat_vals),
213 matDiffK(mat_diff_K) {
214 OP::sYmm = false;
215 }
constexpr auto field_name
typename FormsIntegrators< OpBase >::template Assembly< A >::OpBase OP
Definition MatHuHu.hpp:207

Member Function Documentation

◆ iNtegrate()

template<int FIELD_DIM, int SPACE_DIM, AssemblyType A, typename OpBase >
MoFEMErrorCode MatOps::OpLhsHuGrad< FIELD_DIM, SPACE_DIM, A, GAUSS, OpBase >::iNtegrate ( EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)
protected

Definition at line 339 of file MatHuHu.hpp.

341 {
343
349
350 auto get_val_grad_at_pts = MatrixSizeHelper<
352 DL>::get(*matVals, OP::nbIntegrationPts);
353 auto get_diff_K_at_pts =
354 MatrixSizeHelper<GetFTensor2FromMatType<FIELD_DIM, SPACE_DIM, -1, DL>,
355 DL>::get(*matDiffK, OP::nbIntegrationPts);
356
357 // get element volume
358 const double vol = OP::getMeasure();
359 // get integration weights
360 auto t_w = OP::getFTensor0IntegrationWeight();
361 // get base function gradient on rows
362 auto t_row_grad = row_data.getFTensor2DiffN2<SPACE_DIM>();
363 // get field gradient values
364 auto t_val_grad_at_pts =
365 get_val_grad_at_pts(); // tensor of second derivatives
366 // get K values
367 auto t_diff_K_at_pts = get_diff_K_at_pts(); // tensor of second derivatives
368 // get coordinate at integration points
369 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
370 // loop over integration points
371 for (int gg = 0; gg != OP::nbIntegrationPts; gg++) {
372 // take into account Jacobian
373 const double alpha = t_w * vol;
374 // loop over rows base functions
375 int rr = 0;
376 for (; rr != OP::nbRows / FIELD_DIM; rr++) {
377
378 auto t_mat = getFTensor2FromArray<FIELD_DIM, FIELD_DIM, FIELD_DIM>(
379 OP::locMat, rr * FIELD_DIM, 0);
380 auto t_col_grad = col_data.getFTensor1DiffN<SPACE_DIM>(gg, 0);
381 for (int bb = 0; bb != OP::nbCols / FIELD_DIM; ++bb) {
382 t_mat(i, j) += alpha * (t_row_grad(J, K) * t_val_grad_at_pts(i, J, K)) *
383 (t_diff_K_at_pts(j, M) * t_col_grad(M));
384
385 ++t_mat; // move to another element of local matrix
386 ++t_col_grad; // move to another element of gradient of base
387 // function on column
388 }
389
390 ++t_row_grad; // move to another element of gradient of base
391 // function on row
392 }
393 for (; rr < OP::nbRowBaseFunctions; ++rr)
394 ++t_row_grad;
395
396 ++t_coords;
397 ++t_val_grad_at_pts;
398 ++t_diff_K_at_pts;
399 ++t_w; // move to another integration weight
400 }
402}
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
constexpr int FIELD_DIM
#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()
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'j', 3 > j
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
Definition MatHuHu.hpp:33
decltype(GetFTensor3FromMatImpl< Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor3FromMatType
decltype(GetFTensor2FromMatImpl< Tensor_Dim0, Tensor_Dim1, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2FromMatType

Member Data Documentation

◆ matDiffK

template<int FIELD_DIM, int SPACE_DIM, AssemblyType A, typename OpBase >
boost::shared_ptr<MatrixDouble> MatOps::OpLhsHuGrad< FIELD_DIM, SPACE_DIM, A, GAUSS, OpBase >::matDiffK
protected

Definition at line 219 of file MatHuHu.hpp.

◆ matVals

template<int FIELD_DIM, int SPACE_DIM, AssemblyType A, typename OpBase >
boost::shared_ptr<MatrixDouble> MatOps::OpLhsHuGrad< FIELD_DIM, SPACE_DIM, A, GAUSS, OpBase >::matVals
protected

Definition at line 218 of file MatHuHu.hpp.


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