6#ifndef __TRILINEAR_FORMS_INTEGRATORS_HPP__
7#define __TRILINEAR_FORMS_INTEGRATORS_HPP__
19template <
int SPACE_DIM,
typename OpBase>
23 const std::string field_name_row,
const std::string field_name_col,
24 boost::shared_ptr<MatrixDouble> y_grad_ptr,
26 :
OpBase(field_name_row, field_name_col,
OpBase::OPROWCOL),
27 yGradPtr(y_grad_ptr), alphaConstant(alpha_fun) {
29 this->assembleTranspose =
false;
30 this->onlyTranspose =
false;
41template <
int SPACE_DIM,
typename OpBase>
45 const std::string field_name_row,
const std::string field_name_col,
46 boost::shared_ptr<MatrixDouble> u_ptr,
48 :
OpBase(field_name_row, field_name_col,
OpBase::OPROWCOL), uPtr(u_ptr),
49 alphaConstant(alpha_fun) {
51 this->assembleTranspose =
false;
52 this->onlyTranspose =
false;
58 boost::shared_ptr<MatrixDouble>
uPtr;
63template <
int FIELD_DIM,
int SPACE_DIM,
typename OpBase>
67 const std::string field_name_row,
const std::string field_name_col,
68 boost::shared_ptr<MatrixDouble> y_grad_ptr,
70 :
OpBase(field_name_row, field_name_col,
OpBase::OPROWCOL),
71 yGradPtr(y_grad_ptr), alphaConstant(alpha_fun) {
73 this->assembleTranspose =
false;
74 this->onlyTranspose =
false;
85template <
int FIELD_DIM,
int SPACE_DIM,
typename OpBase>
89 const std::string field_name_row,
const std::string field_name_col,
90 boost::shared_ptr<MatrixDouble> u_ptr,
92 :
OpBase(field_name_row, field_name_col,
OpBase::OPROWCOL), uPtr(u_ptr),
93 alphaConstant(alpha_fun) {
95 this->assembleTranspose =
false;
96 this->onlyTranspose =
false;
102 boost::shared_ptr<MatrixDouble>
uPtr;
115template <
typename EleOp>
116template <AssemblyType A>
117template <IntegrationType I>
125 template <
int SPACE_DIM>
128 template <
int BASE_DIM,
int FIELD_DIM,
int SPACE_DIM>
132 template <
int BASE_DIM,
int FIELD_DIM,
int SPACE_DIM>
137template <
int SPACE_DIM,
typename OpBase>
145 auto get_grad_y_at_pts =
150 const double vol = OpBase::getMeasure();
152 auto t_w = OpBase::getFTensor0IntegrationWeight();
156 auto get_t_vec = [&](
const int rr) {
157 std::array<double *, SPACE_DIM> ptrs;
164 auto t_grad_y_at_pts = get_grad_y_at_pts();
167 const double alpha_constant = alphaConstant();
171 const double alpha = t_w * vol * alpha_constant;
173 auto t_vec = get_t_vec(0);
182 t_vec(
i) += alpha * t_row_base * t_col_base * t_grad_y_at_pts(
i);
197template <
int SPACE_DIM,
typename OpBase>
210 const double vol = OpBase::getMeasure();
212 auto t_w = OpBase::getFTensor0IntegrationWeight();
216 auto t_u_at_pts = get_u_at_pts();
218 const double alpha_constant = alphaConstant();
222 const double alpha = t_w * vol * alpha_constant;
233 alpha * t_row_base * t_diff_col_base(
i) * t_u_at_pts(
i);
248template <
int FIELD_DIM,
int SPACE_DIM,
typename OpBase>
256 auto get_grad_y_at_pts =
262 const double vol = OpBase::getMeasure();
264 auto t_w = OpBase::getFTensor0IntegrationWeight();
268 auto t_grad_y_at_pts = get_grad_y_at_pts();
272 auto get_t_mat = [&](
const int rr) {
273 std::array<double *, FIELD_DIM * SPACE_DIM> ptrs;
282 const double alpha_constant = alphaConstant();
286 const double alpha = t_w * vol * alpha_constant;
299 (alpha * t_row_base * t_col_base) * t_grad_y_at_pts(
I,
k);
314template <
int FIELD_DIM,
int SPACE_DIM,
typename OpBase>
327 const double vol = OpBase::getMeasure();
329 auto t_w = OpBase::getFTensor0IntegrationWeight();
333 auto get_t_mat = [&](
const int rr) {
334 std::array<double *, FIELD_DIM * FIELD_DIM> ptrs;
343 auto t_u_at_pts = get_u_at_pts();
350 const double alpha_constant = alphaConstant();
354 const double alpha = t_w * vol * alpha_constant;
366 alpha * t_row_base *
t_kd(
I,
L) *
367 (t_diff_col_base(
k) * t_u_at_pts(
k));
Kronecker Delta class symmetric.
#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', 3 > j
FTensor::Index< 'k', 3 > k
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
boost::function< double()> ConstantFun
Constant function type.
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
decltype(GetFTensor2FromMatImpl< Tensor_Dim0, Tensor_Dim1, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2FromMatType
constexpr IntegrationType I
Data on single entity (This is passed as argument to DataOperator::doWork)
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
auto getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
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
OpConvectiveTermLhsDuImpl(const std::string field_name_row, const std::string field_name_col, boost::shared_ptr< MatrixDouble > y_grad_ptr, ConstantFun alpha_fun=[]() { return 1;})
boost::shared_ptr< MatrixDouble > yGradPtr
ConstantFun alphaConstant
OpConvectiveTermLhsDuImpl(const std::string field_name_row, const std::string field_name_col, boost::shared_ptr< MatrixDouble > y_grad_ptr, ConstantFun alpha_fun=[]() { return 1;})
ConstantFun alphaConstant
boost::shared_ptr< MatrixDouble > yGradPtr
boost::shared_ptr< MatrixDouble > uPtr
OpConvectiveTermLhsDyImpl(const std::string field_name_row, const std::string field_name_col, boost::shared_ptr< MatrixDouble > u_ptr, ConstantFun alpha_fun=[]() { return 1;})
ConstantFun alphaConstant
boost::shared_ptr< MatrixDouble > uPtr
OpConvectiveTermLhsDyImpl(const std::string field_name_row, const std::string field_name_col, boost::shared_ptr< MatrixDouble > u_ptr, ConstantFun alpha_fun=[]() { return 1;})
ConstantFun alphaConstant