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);
171template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
178 boost::shared_ptr<MatrixDouble> mat_vals,
179 boost::shared_ptr<MatrixDouble> mat_K,
180 boost::shared_ptr<Range> ents_ptr =
nullptr)
185 boost::shared_ptr<MatrixDouble>
matK;
189template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
195 boost::shared_ptr<Range> ents_ptr =
nullptr)
199 boost::shared_ptr<MatrixDouble>
matK;
204template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
209 boost::shared_ptr<MatrixDouble> mat_vals,
210 boost::shared_ptr<MatrixDouble> mat_diff_K,
211 boost::shared_ptr<Range> ents_ptr =
nullptr)
213 matDiffK(mat_diff_K) {
224template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
235 DL>::get(*matVals, OP::nbIntegrationPts);
238 *matK, OP::nbIntegrationPts);
241 const double vol = OP::getMeasure();
243 auto t_w = OP::getFTensor0IntegrationWeight();
247 auto t_val_grad_at_pts =
248 get_val_grad_at_pts();
250 auto t_K_at_pts = get_K_at_pts();
252 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
254 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
256 const double alpha = t_w * vol * t_K_at_pts(0);
258 auto t_nf = getFTensor1FromArray<FIELD_DIM, FIELD_DIM>(OP::locF);
261 for (; rr != OP::nbRows /
FIELD_DIM; rr++) {
263 t_nf(
i) += alpha * (t_row_grad(
J,
K) * t_val_grad_at_pts(
i,
J,
K));
267 for (; rr < OP::nbRowBaseFunctions; ++rr)
278template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
291 *matK, OP::nbIntegrationPts);
296 const double vol = OP::getMeasure();
298 auto t_w = OP::getFTensor0IntegrationWeight();
302 auto t_K_at_pts = get_K_at_pts();
304 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
306 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
308 const double alpha = t_w * vol * t_K_at_pts(0);
311 for (; rr != OP::nbRows /
FIELD_DIM; rr++) {
313 auto t_mat = getFTensor2FromArray<FIELD_DIM, FIELD_DIM, FIELD_DIM>(
318 for (
int cc = 0; cc != OP::nbCols /
FIELD_DIM; cc++) {
320 alpha * (t_row_grad(
J,
K) * t_col_grad(
J,
K)) *
t_kd(
i,
j);
328 for (; rr < OP::nbRowBaseFunctions; ++rr)
338template <
int FIELD_DIM,
int SPACE_DIM, AssemblyType A,
typename OpBase>
352 DL>::get(*matVals, OP::nbIntegrationPts);
353 auto get_diff_K_at_pts =
355 DL>::get(*matDiffK, OP::nbIntegrationPts);
358 const double vol = OP::getMeasure();
360 auto t_w = OP::getFTensor0IntegrationWeight();
364 auto t_val_grad_at_pts =
365 get_val_grad_at_pts();
367 auto t_diff_K_at_pts = get_diff_K_at_pts();
369 auto t_coords = OP::getFTensor1CoordsAtGaussPts();
371 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
373 const double alpha = t_w * vol;
376 for (; rr != OP::nbRows /
FIELD_DIM; rr++) {
378 auto t_mat = getFTensor2FromArray<FIELD_DIM, FIELD_DIM, FIELD_DIM>(
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));
393 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)
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.