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 const double vol = OpBase::getMeasure();
147 auto t_w = OpBase::getFTensor0IntegrationWeight();
151 auto get_t_vec = [&](
const int rr) {
152 std::array<double *, SPACE_DIM> ptrs;
162 const double alpha_constant = alphaConstant();
166 const double alpha = t_w * vol * alpha_constant;
168 auto t_vec = get_t_vec(0);
177 t_vec(
i) += alpha * t_row_base * t_col_base * t_grad_y(
i);
192template <
int SPACE_DIM,
typename OpBase>
200 const double vol = OpBase::getMeasure();
202 auto t_w = OpBase::getFTensor0IntegrationWeight();
208 const double alpha_constant = alphaConstant();
212 const double alpha = t_w * vol * alpha_constant;
222 (*a_mat_ptr) += alpha * t_row_base * t_diff_col_base(
i) * t_u(
i);
237template <
int FIELD_DIM,
int SPACE_DIM,
typename OpBase>
245 const double vol = OpBase::getMeasure();
247 auto t_w = OpBase::getFTensor0IntegrationWeight();
255 auto get_t_mat = [&](
const int rr) {
256 std::array<double *, FIELD_DIM * SPACE_DIM> ptrs;
265 const double alpha_constant = alphaConstant();
269 const double alpha = t_w * vol * alpha_constant;
281 t_mat(
I,
k) += (alpha * t_row_base * t_col_base) * t_grad_y(
I,
k);
296template <
int FIELD_DIM,
int SPACE_DIM,
typename OpBase>
304 const double vol = OpBase::getMeasure();
306 auto t_w = OpBase::getFTensor0IntegrationWeight();
310 auto get_t_mat = [&](
const int rr) {
311 std::array<double *, FIELD_DIM * FIELD_DIM> ptrs;
327 const double alpha_constant = alphaConstant();
331 const double alpha = t_w * vol * alpha_constant;
343 alpha * t_row_base *
t_kd(
I,
L) * (t_diff_col_base(
k) * t_u(
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
FTensor::Tensor1< FTensor::PackPtr< T *, S >, Tensor_Dim > getFTensor1FromMat(ublas::matrix< T, L, A > &data)
Get tensor rank 1 (vector) form data matrix.
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, Tensor_Dim1, Tensor_Dim2 > getFTensor2FromMat(MatrixDouble &data)
Get tensor rank 2 (matrix) form data matrix.
boost::function< double()> ConstantFun
Constant function type.
constexpr IntegrationType I
Data on single entity (This is passed as argument to DataOperator::doWork)
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
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