6 #ifndef __TRILINEAR_FORMS_INTEGRATORS_HPP__
7 #define __TRILINEAR_FORMS_INTEGRATORS_HPP__
19 template <
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;
41 template <
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;
63 template <
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;
85 template <
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;
115 template <
typename EleOp>
116 template <AssemblyType A>
117 template <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>
137 template <
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;
159 auto t_grad_y = getFTensor1FromMat<SPACE_DIM>(*yGradPtr);
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);
192 template <
int SPACE_DIM,
typename OpBase>
200 const double vol = OpBase::getMeasure();
202 auto t_w = OpBase::getFTensor0IntegrationWeight();
206 auto t_u = getFTensor1FromMat<SPACE_DIM>(*uPtr);
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);
237 template <
int FIELD_DIM,
int SPACE_DIM,
typename OpBase>
245 const double vol = OpBase::getMeasure();
247 auto t_w = OpBase::getFTensor0IntegrationWeight();
251 auto t_grad_y = getFTensor2FromMat<FIELD_DIM, SPACE_DIM>(*yGradPtr);
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);
296 template <
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;
320 auto t_u = getFTensor1FromMat<SPACE_DIM>(*uPtr);
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));
360 #endif //__TRILINEAR_FORMS_INTEGRATORS_HPP__