38 template <AssemblyType A, IntegrationType I,
typename DomainEleOp>
41 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
43 boost::shared_ptr<PhysicalEquations> physical_equations_ptr,
44 Sev sev = Sev::noisy) {
46 constexpr int DIM = (MODEL_TYPE ==
MODEL_3D) ? 3 : 2;
47 auto op_this = getPipThis<DomainEleOp>(m_field, pip, fe_name,
field_name,
48 physical_equations_ptr, sev);
49 auto m_grad_grad = boost::make_shared<MatrixDouble>();
50 op_this->getOpPtrVector().push_back(
52 op_this->getOpPtrVector().push_back(physical_equations_ptr->createOp(
53 physical_equations_ptr,
true,
false,
false));
54 auto m_k = physical_equations_ptr->matOpsDataPtr->getCommonDataPtr(
"k");
55 op_this->getOpPtrVector().push_back(
60 template <AssemblyType A, IntegrationType I,
typename DomainEleOp>
63 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
65 boost::shared_ptr<PhysicalEquations> physical_equations_ptr,
66 Sev sev = Sev::noisy) {
68 constexpr int DIM = (MODEL_TYPE ==
MODEL_3D) ? 3 : 2;
69 auto op_this = getPipThis<DomainEleOp>(m_field, pip, fe_name,
field_name,
70 physical_equations_ptr, sev);
71 auto m_grad_grad = boost::make_shared<MatrixDouble>();
72 op_this->getOpPtrVector().push_back(
74 op_this->getOpPtrVector().push_back(physical_equations_ptr->createOp(
75 physical_equations_ptr,
true,
true,
false));
76 auto m_k = physical_equations_ptr->matOpsDataPtr->getCommonDataPtr(
"k");
78 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr(
"k_dF");
79 op_this->getOpPtrVector().push_back(
81 op_this->getOpPtrVector().push_back(
88 template <
typename DomainEleOp>
91 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
93 boost::shared_ptr<PhysicalEquations> physical_equations_ptr,
96 auto ¶m_vec_by_range = physical_equations_ptr->paramVecByRange;
98 auto r = boost::make_shared<Range>();
99 for (
auto &p : param_vec_by_range) {
102 MOFEM_LOG(
"WORLD", Sev::inform) <<
"HuHu number of entities " << r->size();
104 constexpr int DIM = (MODEL_TYPE ==
MODEL_3D) ? 3 : 2;
108 auto space = field_structure->getSpace();
112 pip.push_back(op_this);
113 auto this_fe_ptr = op_this->getThisFEPtr();
114 auto &this_pip = op_this->getOpPtrVector();
115 this_fe_ptr->getRuleHook = [](
int order_row,
int order_col,
117 return 2 * (order_data - 1);
120 auto base_mass = boost::make_shared<MatrixDouble>();
121 auto data_l2 = boost::make_shared<EntitiesFieldData>(MBENTITYSET);
122 auto jac_ptr = boost::make_shared<MatrixDouble>();
123 auto det_ptr = boost::make_shared<VectorDouble>();
124 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
135 BaseDerivatives::SecondDerivative, base_mass, data_l2, base, space));
148 <<
"Unsupported space: " << space <<
" for field: " <<
field_name;
153 physical_equations_ptr->matOpsDataPtr->getCommonDataPtr(
"grad");
162boost::shared_ptr<PhysicalEquations>
164 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag);
167boost::shared_ptr<PhysicalEquations>
169 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag);
172boost::shared_ptr<PhysicalEquations>
174 boost::shared_ptr<MatOpsData> mat_ops_data_ptr,
int tag);
176template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
183 boost::shared_ptr<MatrixDouble> mat_vals,
184 boost::shared_ptr<MatrixDouble> mat_K,
185 boost::shared_ptr<Range> ents_ptr =
nullptr)
190 boost::shared_ptr<MatrixDouble>
matK;
194template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
200 boost::shared_ptr<Range> ents_ptr =
nullptr)
204 boost::shared_ptr<MatrixDouble>
matK;
209template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
214 boost::shared_ptr<MatrixDouble> mat_vals,
215 boost::shared_ptr<MatrixDouble> mat_diff_K,
216 boost::shared_ptr<Range> ents_ptr =
nullptr)
218 matDiffK(mat_diff_K) {
229template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
240 DL>::get(*matVals, OP::nbIntegrationPts);
243 *matK, OP::nbIntegrationPts);
246 const double vol = OP::getMeasure();
248 auto t_w = OP::getFTensor0IntegrationWeight();
252 auto t_val_grad_at_pts =
253 get_val_grad_at_pts();
255 auto t_K_at_pts = get_K_at_pts();
257 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
259 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
261 const double alpha = t_w * vol * t_K_at_pts(0);
263 auto t_nf = getFTensor1FromArray<FIELD_DIM, FIELD_DIM>(OP::locF);
266 for (; rr != OP::nbRows /
FIELD_DIM; rr++) {
268 t_nf(
i) += alpha * (t_row_grad(
J,
K) * t_val_grad_at_pts(
i,
J,
K));
272 for (; rr < OP::nbRowBaseFunctions; ++rr)
283template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
296 *matK, OP::nbIntegrationPts);
301 const double vol = OP::getMeasure();
303 auto t_w = OP::getFTensor0IntegrationWeight();
307 auto t_K_at_pts = get_K_at_pts();
309 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
311 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
313 const double alpha = t_w * vol * t_K_at_pts(0);
316 for (; rr != OP::nbRows /
FIELD_DIM; rr++) {
318 auto t_mat = getFTensor2FromArray<FIELD_DIM, FIELD_DIM, FIELD_DIM>(
323 for (
int cc = 0; cc != OP::nbCols /
FIELD_DIM; cc++) {
325 alpha * (t_row_grad(
J,
K) * t_col_grad(
J,
K)) *
t_kd(
i,
j);
333 for (; rr < OP::nbRowBaseFunctions; ++rr)
343template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
357 DL>::get(*matVals, OP::nbIntegrationPts);
358 auto get_diff_K_at_pts =
360 DL>::get(*matDiffK, OP::nbIntegrationPts);
363 const double vol = OP::getMeasure();
365 auto t_w = OP::getFTensor0IntegrationWeight();
369 auto t_val_grad_at_pts =
370 get_val_grad_at_pts();
372 auto t_diff_K_at_pts = get_diff_K_at_pts();
374 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
376 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
378 const double alpha = t_w * vol;
381 for (; rr != OP::nbRows /
FIELD_DIM; rr++) {
383 auto t_mat = getFTensor2FromArray<FIELD_DIM, FIELD_DIM, FIELD_DIM>(
386 for (
int bb = 0; bb != OP::nbCols /
FIELD_DIM; ++bb) {
387 t_mat(
i,
j) += alpha * (t_row_grad(
J,
K) * t_val_grad_at_pts(
i,
J,
K)) *
388 (t_diff_K_at_pts(
j, M) * t_col_grad(M));
398 for (; rr < OP::nbRowBaseFunctions; ++rr)
#define FTENSOR_INDEX(DIM, I)
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ L2
field with C-1 continuity
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_OPERATION_UNSUCCESSFUL
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
virtual const Field * get_field_structure(const std::string &name, enum MoFEMTypes bh=MF_EXIST) const =0
get field structure
#define MOFEM_LOG(channel, severity)
Log.
SeverityLevel
Severity levels.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
FTensor::Index< 'j', 3 > j
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< HUHU, MODEL_2D_PLANE_STRAIN >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< HUHU, MODEL_3D >(boost::shared_ptr< MatOpsData > mat_ops_data_ptr, int tag)
boost::shared_ptr< PhysicalEquations > createMatOpsPhysicalEquationsPtr< HUHU, MODEL_AXISYMMETRIC >(boost::shared_ptr< MatOpsData >, int)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
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
constexpr IntegrationType I
constexpr auto field_name
boost::shared_ptr< MatrixDouble > matVals
boost::shared_ptr< MatrixDouble > matDiffK
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)
boost::shared_ptr< MatrixDouble > matK
OpLhsHuHu(const std::string field_name, boost::shared_ptr< MatrixDouble > mat_K, boost::shared_ptr< Range > ents_ptr=nullptr)
static auto getPipThis(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string fe_name, std::string field_name, boost::shared_ptr< PhysicalEquations > physical_equations_ptr, Sev sev)
OpMaterialFactory()=delete
static MoFEMErrorCode opLhsFactory(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string fe_name, std::string field_name, boost::shared_ptr< PhysicalEquations > physical_equations_ptr, Sev sev=Sev::noisy)
static MoFEMErrorCode opRhsFactory(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string fe_name, std::string field_name, boost::shared_ptr< PhysicalEquations > physical_equations_ptr, Sev sev=Sev::noisy)
boost::shared_ptr< MatrixDouble > matK
boost::shared_ptr< MatrixDouble > matVals
OpRhsHu(const std::string field_name, boost::shared_ptr< MatrixDouble > mat_vals, boost::shared_ptr< MatrixDouble > mat_K, boost::shared_ptr< Range > ents_ptr=nullptr)
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
auto getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
auto getFTensor2DiffN2(const FieldApproximationBase base)
Get second derivatives of scalar base functions.
FieldApproximationBase getApproxBase() const
Get approximation basis type.
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Operator for inverting matrices at integration points.
Execute "this" element in the operator.
Set inverse jacobian to base functions.