v0.15.0
Loading...
Searching...
No Matches
EshelbianOperators.hpp
Go to the documentation of this file.
1/**
2 * @file EshelbianOperators.hpp
3 * @author your name (you@domain.com)
4 * @brief
5 * @version 0.1
6 * @date 2024-12-31
7 *
8 * @copyright Copyright (c) 2024
9 *
10 */
11
13
14 OpJacobian(const int tag, const bool eval_rhs, const bool eval_lhs,
15 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
16 boost::shared_ptr<PhysicalEquations> physics_ptr)
17 : UserDataOperator(NOSPACE, OPSPACE), tAg(tag), evalRhs(eval_rhs),
18 evalLhs(eval_lhs), dataAtPts(data_ptr), physicsPtr(physics_ptr) {}
19
20 virtual MoFEMErrorCode evaluateRhs(EntData &data) = 0;
21 virtual MoFEMErrorCode evaluateLhs(EntData &data) = 0;
22
23 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
24
25protected:
27
28 int tAg = -1; ///< adol-c tape
29 bool evalRhs = false;
30 bool evalLhs = false;
31
32 boost::shared_ptr<DataAtIntegrationPts>
33 dataAtPts; ///< data at integration pts
34 boost::shared_ptr<PhysicalEquations>
35 physicsPtr; ///< material physical equations
36};
37
38template <typename T> struct OpAssembleBasic : public T {
39
40 using ScaleOff = boost::function<double()>;
41 const bool assembleSymmetry;
42
43 boost::shared_ptr<DataAtIntegrationPts>
44 dataAtPts; ///< data at integration pts
45
46 OpAssembleBasic(const std::string &field_name,
47 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
48 const char type)
49 : T(field_name, type), dataAtPts(data_ptr), assembleSymmetry(false) {}
50
52 std::string row_field, std::string col_field,
53 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const char type,
54 const bool assemble_symmetry, ScaleOff scale_off = []() { return 1; })
55 : T(row_field, col_field, type, false), dataAtPts(data_ptr),
56 assembleSymmetry(assemble_symmetry), scaleOff(scale_off) {}
57
59 : T(space, T::OPSPACE), assembleSymmetry(false) {}
60
61 VectorDouble nF; ///< local right hand side vector
62 MatrixDouble K; ///< local tangent matrix
63 MatrixDouble transposeK;
64
66
67 virtual MoFEMErrorCode integrate(EntData &data) {
69 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
71 }
72
73 virtual MoFEMErrorCode integrate(int row_side, EntityType row_type,
74 EntData &data) {
76 CHKERR integrate(data);
78 }
79
80 virtual MoFEMErrorCode assemble(EntData &data) {
82 double *vec_ptr = &*nF.begin();
83 int nb_dofs = data.getIndices().size();
84 int *ind_ptr = &*data.getIndices().begin();
85 CHKERR VecSetValues(this->getTSf(), nb_dofs, ind_ptr, vec_ptr, ADD_VALUES);
87 }
88
89 virtual MoFEMErrorCode assemble(int row_side, EntityType row_type,
90 EntData &data) {
92 CHKERR assemble(data);
94 }
95
96 virtual MoFEMErrorCode integrate(EntData &row_data, EntData &col_data) {
98 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
100 }
101
102 virtual MoFEMErrorCode assemble(int row_side, int col_side,
103 EntityType row_type, EntityType col_type,
104 EntData &row_data, EntData &col_data) {
106
107 if (assembleSymmetry) {
108 const auto row_nb_dofs = row_data.getIndices().size();
109 const auto col_nb_dofs = col_data.getIndices().size();
110 transposeK.resize(col_nb_dofs, row_nb_dofs, false);
111 noalias(transposeK) = trans(K);
112 transposeK *= scaleOff();
113 }
114
115 CHKERR MatSetValues<AssemblyTypeSelector<A>>(this->getTSB(), row_data,
116 col_data, K, ADD_VALUES);
117 if (assembleSymmetry) {
118 CHKERR MatSetValues<AssemblyTypeSelector<A>>(
119 this->getTSB(), col_data, row_data, transposeK, ADD_VALUES);
120 }
121
123 }
124
125 MoFEMErrorCode doWork(int side, EntityType type, EntData &data) {
127 if (data.getIndices().empty())
129 nF.resize(data.getIndices().size(), false);
130 nF.clear();
131 CHKERR integrate(side, type, data);
132 CHKERR assemble(side, type, data);
134 }
135
136 MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
137 EntityType col_type, EntData &row_data,
138 EntData &col_data) {
140 if (row_data.getIndices().empty())
142 if (col_data.getIndices().empty())
144 K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
145 K.clear();
146 CHKERR integrate(row_data, col_data);
147 CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
149 }
150};
151
152struct OpAssembleVolume : public OpAssembleBasic<VolUserDataOperator> {
155 MoFEMErrorCode assemble(int row_side, int col_side, EntityType row_type,
156 EntityType col_type, EntData &row_data,
157 EntData &col_data) {
159 CHKERR OP::assemble(row_side, col_side, row_type, col_type, row_data,
160 col_data);
161 constexpr bool store_matrices = false;
162 if constexpr (store_matrices) {
164 m.resize(K.size1(), K.size2(), false);
165 noalias(m) = K;
166 if (assembleSymmetry) {
168 m.resize(K.size2(), K.size1(), false);
169 noalias(m) = transposeK;
170 }
171 }
173 };
174
175protected:
176 static inline std::map<std::pair<std::string, std::string>, MatrixDouble>
178};
179
180struct OpAssembleFace : public OpAssembleBasic<FaceUserDataOperator> {
181 using OpAssembleBasic<FaceUserDataOperator>::OpAssembleBasic;
182};
183
185 using OpAssembleVolume::OpAssembleVolume;
186 MoFEMErrorCode doWork(int side, EntityType type, EntData &data) {
188 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
189 "OpAssembleVolumePositiveDefine not implemented");
191 }
192
193 MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
194 EntityType col_type, EntData &row_data,
195 EntData &col_data) {
197 if (row_data.getIndices().empty())
199 if (col_data.getIndices().empty())
201 K.resize(row_data.getIndices().size(), col_data.getIndices().size(), false);
202 K.clear();
203 CHKERR integrate(row_data, col_data);
204
205 constexpr bool run_psd = true;
206
207 if (run_psd) {
208
209 auto symmetrize = [](MatrixDouble &mat) {
210 MatrixDouble r = (mat + trans(mat)) / 2.0;
211 return r;
212 };
213 auto check_positive_definite = [](MatrixDouble &mat) {
214 int n = mat.size1();
215 return (lapack_dpotrf('U', n, mat.data().data(), n) == 0);
216 };
217 auto frobenius_norm = [](MatrixDouble &mat) {
218 double sum = 0.0;
219 for (std::size_t i = 0; i < mat.size1(); ++i)
220 for (std::size_t j = 0; j < mat.size2(); ++j)
221 sum += mat(i, j) * mat(i, j);
222 return std::sqrt(sum);
223 };
224
225 auto higham_method_one_pass = [&](MatrixDouble &mat) {
226 int n = mat.size1();
227 const int lda = n;
228 const int size = (n + 2) * n;
229 int lwork = size;
230 double *work = new double[size];
231
232 VectorDouble eig(n, 0.0);
233 MatrixDouble eigen_vec = prod(trans(mat), mat);
234 if (lapack_dsyev('V', 'U', n, eigen_vec.data().data(), lda,
235 eig.data().data(), work, lwork) > 0)
237 "The algorithm failed to compute eigenvalues.");
238 delete[] work;
239
240 for (auto &e : eig) {
241 constexpr double eps = std::numeric_limits<double>::epsilon();
242 e = std::max(std::sqrt(std::abs(e)), eps);
243 }
244
245 auto diagonal_matrix =
246 ublas::diagonal_matrix<double, ublas::row_major,
247 VecAllocator<double>>(n, eig.data());
248 MatrixDouble symm_mat;
249 symm_mat = prod(trans(eigen_vec), diagonal_matrix);
250 symm_mat = prod(symm_mat, eigen_vec);
251
252 MatrixDouble hat_m = (mat + symm_mat) / 2.0;
253
254 return hat_m;
255 };
256
257 auto hat_k = higham_method_one_pass(K);
258 K.swap(hat_k);
259 }
260
261 CHKERR assemble(row_side, col_side, row_type, col_type, row_data, col_data);
263 }
264
265private:
266};
267
268// Add operator to calculate Eshelby tensor
269
271 : public ForcesAndSourcesCore::UserDataOperator {
272 OpCalculateEshelbyStress(boost::shared_ptr<DataAtIntegrationPts> data_ptr)
274 dataAtPts(data_ptr) {}
275 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
276
277private:
278 boost::shared_ptr<DataAtIntegrationPts>
279 dataAtPts; ///< data at integration pts
280};
281
283
285 boost::shared_ptr<DataAtIntegrationPts> data_ptr, double alpha_omega = 0)
287 alphaOmega(alpha_omega) {}
288 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
289
290private:
291 boost::shared_ptr<DataAtIntegrationPts>
292 dataAtPts; ///< data at integration pts
294};
295
298 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
299 : SideEleOp(NOSPACE, SideEleOp::OPSPACE), dataAtPts(data_ptr) {
300 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
301 for (auto t = moab::CN::TypeDimensionMap[SPACE_DIM].first;
302 t <= moab::CN::TypeDimensionMap[SPACE_DIM].second; ++t)
303 doEntities[t] = true;
304 sYmm = false;
305 }
306 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
307
308private:
309 boost::shared_ptr<DataAtIntegrationPts>
310 dataAtPts; ///< data at integration pts
311};
312
313struct OpCalculateReactionForces : public FaceUserDataOperator {
314 OpCalculateReactionForces(boost::shared_ptr<DataAtIntegrationPts> data_ptr,
315 std::string block_name, Range block_entities,
316 std::array<double, 6> &reaction_vec)
317 : FaceUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr),
318 blockName(block_name), blockEntities(block_entities),
319 reactionVec(reaction_vec) {}
320 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
321
322private:
323 boost::shared_ptr<DataAtIntegrationPts>
324 dataAtPts; ///< data at integration pts
326 std::string blockName;
327 std::array<double, 6> &reactionVec;
328};
329
332 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
333 const double alpha, const double rho)
334 : OpAssembleVolume(field_name, data_ptr, OPROW), alphaW(alpha),
335 alphaRho(rho) {}
336 MoFEMErrorCode integrate(EntData &data);
337
338private:
339 const double alphaW;
340 const double alphaRho;
341};
342
344 OpSpatialRotation(const std::string &field_name,
345 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
346 double alpha_omega)
347 : OpAssembleVolume(field_name, data_ptr, OPROW), alphaOmega(alpha_omega) {
348 }
349 MoFEMErrorCode integrate(EntData &data);
350
351private:
353};
354
357 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
358 : OpAssembleVolume(field_name, data_ptr, OPROW) {}
359 MoFEMErrorCode integrate(EntData &data);
360
361private:
362};
363
366 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
367 : OpAssembleVolume(field_name, data_ptr, OPROW) {}
368 MoFEMErrorCode integrate(EntData &data);
369
370private:
371};
372
375 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
376 : OpAssembleVolume(field_name, data_ptr, OPROW) {}
377 MoFEMErrorCode integrate(EntData &data);
378};
379
380template <int INTERP_ORDER>
382 OpGetInternalStress(boost::shared_ptr<DataAtIntegrationPts> data_ptr,
383 std::string tag_name = "")
384 : UserDataOperator(H1, OPLAST), dataAtPts(data_ptr), tagName(tag_name) {
385 std::fill(&doEntities[MBVERTEX], &doEntities[MBMAXTYPE], false);
386 doEntities[MBVERTEX] = true;
387 }
388 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
389
390private:
391 boost::shared_ptr<DataAtIntegrationPts> dataAtPts;
392 std::string tagName;
393};
394
395template <bool VOIGT>
398 const std::string &field_name,
399 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
400 : OpAssembleVolume(field_name, data_ptr, OPROW) {}
401 MoFEMErrorCode integrate(EntData &row_data);
402};
403
404template <AssemblyType A, IntegrationType I> struct OpDispBcImpl;
405
406template <AssemblyType A>
407struct OpDispBcImpl<A, GAUSS>
408 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
409
410 using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
412
414 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
415 boost::shared_ptr<BcDispVec> &bc_disp_ptr,
416 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
417 boost::shared_ptr<Range> ents_ptr = nullptr)
418 : OP(broken_base_side_data, ents_ptr), bcDispPtr(bc_disp_ptr),
419 scalingMethodsMap(smv) {}
420
421protected:
422 MoFEMErrorCode iNtegrate(EntData &data);
423 boost::shared_ptr<BcDispVec> bcDispPtr;
424 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
425};
426
427struct OpDispBc : public OpDispBcImpl<PETSC, GAUSS> {
429 using OP::OpDispBcImpl;
430
431protected:
432 MoFEMErrorCode iNtegrate(EntData &data);
433};
434
435template <AssemblyType A, IntegrationType I> struct OpRotationBcImpl;
436
437template <AssemblyType A>
438struct OpRotationBcImpl<A, GAUSS>
439 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
440
441 using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
443
445 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
446 boost::shared_ptr<BcRotVec> &bc_rot_ptr,
447 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
448 boost::shared_ptr<Range> ents_ptr = nullptr)
449 : OP(broken_base_side_data, ents_ptr), bcRotPtr(bc_rot_ptr),
450 scalingMethodsMap(smv) {}
451
452protected:
453 MoFEMErrorCode iNtegrate(EntData &data);
454 boost::shared_ptr<BcRotVec> bcRotPtr;
455 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
456};
457
458/**
459 * @brief Apply rotation boundary condition
460 *
461 * The boundary condition is applied getting data from the SPATIAL_ROTATION_BC
462 * blockset.
463 *
464 * Centre of rotation is given by the first three attributes of the blockset.
465 * The fort parameter is angle of rotation
466 *
467 */
468struct OpRotationBc : public OpRotationBcImpl<PETSC, GAUSS> {
470 using OP::OpRotationBcImpl;
471
472protected:
473 MoFEMErrorCode iNtegrate(EntData &data);
474};
475
477 : public FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase {
479 const std::string row_field, boost::shared_ptr<TractionBcVec> bc_data,
480 boost::shared_ptr<double> piola_scale_ptr,
481 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
482 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
483 row_field, row_field, FaceUserDataOperator::OPROW),
484 bcData(bc_data), piolaScalePtr(), scalingMethodsMap(smv) {}
485
486 MoFEMErrorCode iNtegrate(EntData &data);
487
488protected:
489 boost::shared_ptr<TractionBcVec> bcData;
490 boost::shared_ptr<double> piolaScalePtr;
491 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
492};
493
495 : public FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase {
497 const std::string row_field, boost::shared_ptr<PressureBcVec> bc_data,
498 boost::shared_ptr<double> piola_scale_ptr,
499 boost::shared_ptr<MatrixDouble> hybrid_grad_disp,
500 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
501 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
502 row_field, row_field, FaceUserDataOperator::OPROW),
503 bcData(bc_data), piolaScalePtr(), hybridGradDispPtr(hybrid_grad_disp),
504 scalingMethodsMap(smv) {}
505
506 MoFEMErrorCode iNtegrate(EntData &data);
507
508protected:
509 boost::shared_ptr<PressureBcVec> bcData;
510 boost::shared_ptr<double> piolaScalePtr;
511 boost::shared_ptr<MatrixDouble> hybridGradDispPtr;
512 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
513};
514
515template <AssemblyType A, IntegrationType I>
517
518template <AssemblyType A>
520 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBase {
521
522 using OP =
523 typename FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBase;
524
526 std::string row_field, boost::shared_ptr<PressureBcVec> bc_data,
527 boost::shared_ptr<MatrixDouble> hybrid_grad_disp,
528 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
529 : OP(row_field, row_field, OP::OPROWCOL), bcData(bc_data),
530 hybridGradDispPtr(hybrid_grad_disp), scalingMethodsMap(smv) {}
531
532protected:
533 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
534 boost::shared_ptr<PressureBcVec> bcData;
535 boost::shared_ptr<MatrixDouble> hybridGradDispPtr;
536 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
537};
538
540 : public OpBrokenPressureBcLhsImpl_dU<A, GAUSS> {
543
544protected:
545 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
546};
547
549 : public FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase {
551 const std::string row_field,
552 boost::shared_ptr<AnalyticalTractionBcVec> bc_data,
553 boost::shared_ptr<double> piola_scale_ptr,
554 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
555 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
556 row_field, row_field, FaceUserDataOperator::OPROW),
557 bcData(bc_data), piolaScalePtr(), scalingMethodsMap(smv) {}
558
559 MoFEMErrorCode iNtegrate(EntData &data);
560
561protected:
562 boost::shared_ptr<AnalyticalTractionBcVec> bcData;
563 boost::shared_ptr<double> piolaScalePtr;
564 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
565};
566
567template <AssemblyType A, IntegrationType I> struct OpNormalDispBcRhsImpl;
568template <AssemblyType A, IntegrationType I> struct OpNormalDispBcLhsImpl_dU;
569template <AssemblyType A, IntegrationType I> struct OpNormalDispBcLhsImpl_dP;
570
571template <AssemblyType A>
573 : public FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase {
574
575 using OP =
576 typename FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase;
577
579 std::string row_field, boost::shared_ptr<MatrixDouble> hybrid_disp_ptr,
580 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_side_data_ptr,
581 // boost::shared_ptr<MatrixDouble> piola_stress_ptr,
582 boost::shared_ptr<NormalDisplacementBcVec> &bc_disp_ptr,
583 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
584 boost::shared_ptr<Range> ents_ptr = nullptr)
585 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
586 row_field, row_field, OP::OPROW),
587 hybridDispPtr(hybrid_disp_ptr),
588 brokenBaseSideDataPtr(
589 broken_side_data_ptr), /*piolaStressPtr(piola_stress_ptr),*/
590 bcDispPtr(bc_disp_ptr), scalingMethodsMap(smv) {}
591
592protected:
593 MoFEMErrorCode iNtegrate(EntData &data);
594 boost::shared_ptr<MatrixDouble> hybridDispPtr;
595 boost::shared_ptr<std::vector<BrokenBaseSideData>> brokenBaseSideDataPtr;
596 // boost::shared_ptr<MatrixDouble> piolaStressPtr;
597 boost::shared_ptr<NormalDisplacementBcVec> bcDispPtr;
598 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
599};
600
601template <AssemblyType A>
603 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBase {
604
605 using OP =
606 typename FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBase;
607
609 std::string row_field,
610 boost::shared_ptr<NormalDisplacementBcVec> &bc_disp_ptr,
611 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
612 boost::shared_ptr<Range> ents_ptr = nullptr)
613 : OP(row_field, row_field, OP::OPROWCOL), bcDispPtr(bc_disp_ptr),
614 scalingMethodsMap(smv) {}
615
616protected:
617 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
618 boost::shared_ptr<NormalDisplacementBcVec> bcDispPtr;
619 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
620};
621
622template <AssemblyType A>
624 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
625
626 using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
628
630 std::string row_field,
631 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
632 boost::shared_ptr<NormalDisplacementBcVec> &bc_disp_ptr,
633 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
634 boost::shared_ptr<Range> ents_ptr = nullptr)
635 : OP(row_field, broken_base_side_data, false, false, ents_ptr),
636 bcDispPtr(bc_disp_ptr), scalingMethodsMap(smv) {}
637
638protected:
639 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
640 boost::shared_ptr<NormalDisplacementBcVec> bcDispPtr;
641 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
642};
643
644struct OpNormalDispRhsBc : public OpNormalDispBcRhsImpl<PETSC, GAUSS> {
646 using OP::OpNormalDispBcRhsImpl;
647
648protected:
649 MoFEMErrorCode iNtegrate(EntData &data);
650};
651
655
656protected:
657 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
658};
659
663
664protected:
665 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
666};
667
668template <AssemblyType A, IntegrationType I> struct OpAnalyticalDispBcImpl;
669
670template <AssemblyType A>
672 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
673
674 using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
676
678 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
679 boost::shared_ptr<AnalyticalDisplacementBcVec> &bc_disp_ptr,
680 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
681 boost::shared_ptr<Range> ents_ptr = nullptr)
682 : OP(broken_base_side_data, ents_ptr), bcDispPtr(bc_disp_ptr),
683 scalingMethodsMap(smv) {}
684
685protected:
686 MoFEMErrorCode iNtegrate(EntData &data);
687 boost::shared_ptr<AnalyticalDisplacementBcVec> bcDispPtr;
688 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
689};
690
691struct OpAnalyticalDispBc : public OpAnalyticalDispBcImpl<PETSC, GAUSS> {
693 using OP::OpAnalyticalDispBcImpl;
694
695protected:
696 MoFEMErrorCode iNtegrate(EntData &data);
697};
698
700 OpSpatialEquilibrium_dw_dP(std::string row_field, std::string col_field,
701 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
702 const bool assemble_off = false)
703 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
704 assemble_off) {
705 sYmm = false;
706 }
707 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
708};
709
711 const double alphaW;
712 const double alphaRho;
713 OpSpatialEquilibrium_dw_dw(std::string row_field, std::string col_field,
714 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
715 const double alpha, const double rho)
716 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
717 alphaW(alpha), alphaRho(rho) {
718 sYmm = true;
719 }
720 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
721};
722
724 OpSpatialPhysical_du_dP(std::string row_field, std::string col_field,
725 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
726 const bool assemble_off = false)
727 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
728 assemble_off) {
729 sYmm = false;
730 }
731
732 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
733};
734
736 OpSpatialPhysical_du_dBubble(std::string row_field, std::string col_field,
737 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
738 const bool assemble_off = false)
739 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
740 assemble_off) {
741 sYmm = false;
742 }
743
744 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
745};
746
748 using OpAssembleVolume::OpAssembleVolume;
749 OpSpatialPhysical_du_domega(std::string row_field, std::string col_field,
750 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
751 const bool assemble_off)
752 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
753 assemble_off) {
754 sYmm = false;
755 }
756 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
757};
758
760 OpSpatialRotation_domega_du(std::string row_field, std::string col_field,
761 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
762 double alpha_omega)
763 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false) {
764 sYmm = false;
765 }
766 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
767
768private:
769};
770
772 OpSpatialRotation_domega_dP(std::string row_field, std::string col_field,
773 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
774 const bool assemble_off)
775 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
776 assemble_off) {
777 sYmm = false;
778 }
779 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
780};
781
784 std::string row_field, std::string col_field,
785 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const bool assemble_off)
786 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
787 assemble_off) {
788 sYmm = false;
789 }
790 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
791};
792
795 std::string row_field, std::string col_field,
796 boost::shared_ptr<DataAtIntegrationPts> data_ptr, double alpha_omega)
797 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
798 alphaOmega(alpha_omega) {
799 sYmm = false;
800 }
801 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
802
803private:
805};
806
808 OpSpatialConsistency_dP_dP(std::string row_field, std::string col_field,
809 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
810 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false) {
811 sYmm = false;
812 }
813 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
814
815private:
816 template <int S>
817 MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data);
818};
819
822 std::string row_field, std::string col_field,
823 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
824 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false) {
825 sYmm = false;
826 }
827 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
828
829private:
830 template <int S>
831 MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data);
832};
833
836 std::string row_field, std::string col_field,
837 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
838 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, true) {
839 sYmm = false;
840 }
841 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
842
843private:
844 template <int S>
845 MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data);
846};
847
850 std::string row_field, std::string col_field,
851 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const bool assemble_off)
852 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
853 assemble_off) {
854 sYmm = false;
855 }
856 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
857
858private:
859};
860
863 std::string row_field, std::string col_field,
864 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const bool assemble_off)
865 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
866 assemble_off) {
867 sYmm = false;
868 }
869 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
870
871private:
872};
873
875 : public VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator {
876
877 using OP = VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator;
878
879 moab::Interface &postProcMesh;
880 std::vector<EntityHandle> &mapGaussPts;
881 boost::shared_ptr<DataAtIntegrationPts> dataAtPts;
882
883 OpPostProcDataStructure(moab::Interface &post_proc_mesh,
884 std::vector<EntityHandle> &map_gauss_pts,
885 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
886 int sense)
887 : OP(NOSPACE, UserDataOperator::OPSPACE), postProcMesh(post_proc_mesh),
888 mapGaussPts(map_gauss_pts), dataAtPts(data_ptr), tagSense(sense) {}
889
890 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
891
892private:
894};
895
897 OpSpatialPrj(std::string row_field,
898 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
899 : OpAssembleVolume(row_field, data_ptr, OPROW) {}
900 MoFEMErrorCode integrate(EntData &row_data);
901};
902
904 OpSpatialPrj_dx_dx(std::string row_field, std::string col_field,
905 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
906 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false) {
907 // FIXME: That is symmetric
908 sYmm = false;
909 }
910 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
911};
912
914 OpSpatialPrj_dx_dw(std::string row_field, std::string col_field,
915 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
916 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false) {
917 sYmm = false;
918 }
919 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
920};
921
923 : public VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator {
924
925 // @note This is not on the side, since, integrate energy in the volume
926 using OP = VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator;
927
928 OpFaceSideMaterialForce(boost::shared_ptr<DataAtIntegrationPts> data_ptr)
929 : OP(NOSPACE, OPSPACE), dataAtPts(data_ptr) {}
930
931 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
932
933private:
934 boost::shared_ptr<DataAtIntegrationPts>
935 dataAtPts; ///< data at integration pts
936};
937
939 : public FaceElementForcesAndSourcesCore::UserDataOperator {
940
941 // @note This is not on the side, since, integrate energy in the volume
942 using OP = FaceElementForcesAndSourcesCore::UserDataOperator;
943
944 OpFaceMaterialForce(boost::shared_ptr<DataAtIntegrationPts> data_ptr)
945 : OP(NOSPACE, OPSPACE), dataAtPts(data_ptr) {}
946
947 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
948
949private:
950 boost::shared_ptr<DataAtIntegrationPts>
951 dataAtPts; ///< data at integration pts
952};
953
954template <int FE_DIM, int PROBLEM_DIM, int SPACE_DIM> struct AddHOOps;
955
956template <> struct AddHOOps<2, 3, 3> {
957 AddHOOps() = delete;
958 static MoFEMErrorCode
959 add(boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
960 std::vector<FieldSpace> space, std::string geom_field_name,
961 boost::shared_ptr<Range> crack_front_edges_ptr);
962};
963
964template <> struct AddHOOps<2, 2, 3> {
965 AddHOOps() = delete;
966 static MoFEMErrorCode
967 add(boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
968 std::vector<FieldSpace> space, std::string geom_field_name,
969 boost::shared_ptr<Range> crack_front_edges_ptr);
970};
971
972template <> struct AddHOOps<3, 3, 3> {
973 AddHOOps() = delete;
974 static MoFEMErrorCode
975 add(boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
976 std::vector<FieldSpace> space, std::string geom_field_name,
977 boost::shared_ptr<Range> crack_front_edges_ptr,
978 boost::shared_ptr<MatrixDouble> jac = nullptr,
979 boost::shared_ptr<VectorDouble> det = nullptr,
980 boost::shared_ptr<MatrixDouble> inv_jac = nullptr);
981};
982
984 FormsIntegrators<FaceElementForcesAndSourcesCore::UserDataOperator>::
985 Assembly<A>::LinearForm<GAUSS>::OpBaseTimesVector<1, SPACE_DIM, 1>;
986
987template <typename OP>
988struct OpStabBrokenBaseImpl : public OpBrokenBaseImpl<OP> {
989
990 using BASE = OpBrokenBaseImpl<OP>;
991 using BASE::BASE;
992
993 MoFEMErrorCode doWork(int row_side, EntityType row_type,
994 EntitiesFieldData::EntData &row_data) {
996
997 if (OP::entsPtr) {
998 if (OP::entsPtr->find(this->getFEEntityHandle()) == OP::entsPtr->end())
1000 }
1001
1002#ifndef NDEBUG
1003 if (!BASE::brokenBaseSideData) {
1004 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "space not set");
1005 }
1006#endif // NDEBUG
1007
1008 auto do_work_rhs = [this](int row_side, EntityType row_type,
1009 EntitiesFieldData::EntData &row_data) {
1011 // get number of dofs on row
1012 OP::nbRows = row_data.getIndices().size();
1013 if (!OP::nbRows)
1015 // get number of integration points
1016 OP::nbIntegrationPts = OP::getGaussPts().size2();
1017 // get row base functions
1018 OP::nbRowBaseFunctions = OP::getNbOfBaseFunctions(row_data);
1019 // resize and clear the right hand side vector
1020 OP::locF.resize(OP::nbRows, false);
1021 OP::locF.clear();
1022 // integrate local vector
1023 CHKERR this->iNtegrate(row_data);
1024 // assemble local vector
1025 CHKERR this->aSsemble(row_data);
1027 };
1028
1029 auto do_work_lhs = [this](int row_side, int col_side, EntityType row_type,
1030 EntityType col_type,
1031 EntitiesFieldData::EntData &row_data,
1032 EntitiesFieldData::EntData &col_data) {
1034
1035 auto check_if_assemble_transpose = [&] {
1036 if (this->sYmm) {
1037 if (OP::rowSide != OP::colSide || OP::rowType != OP::colType)
1038 return true;
1039 else
1040 return false;
1041 } else if (OP::assembleTranspose) {
1042 return true;
1043 }
1044 return false;
1045 };
1046
1047 OP::rowSide = row_side;
1048 OP::rowType = row_type;
1049 OP::colSide = col_side;
1050 OP::colType = col_type;
1051 OP::nbCols = col_data.getIndices().size();
1052 OP::locMat.resize(OP::nbRows, OP::nbCols, false);
1053 OP::locMat.clear();
1054 CHKERR this->iNtegrate(row_data, col_data);
1055 CHKERR this->aSsemble(row_data, col_data, check_if_assemble_transpose());
1057 };
1058
1059 switch (OP::opType) {
1060 case OP::OPROW:
1061
1062 OP::nbRows = row_data.getIndices().size();
1063 if (!OP::nbRows)
1065 OP::nbIntegrationPts = OP::getGaussPts().size2();
1066 OP::nbRowBaseFunctions = OP::getNbOfBaseFunctions(row_data);
1067
1068 if (!OP::nbRows)
1070
1071 for (auto &bd : *BASE::brokenBaseSideData) {
1072
1073#ifndef NDEBUG
1074 if (!bd.getData().getNSharedPtr(bd.getData().getBase())) {
1075 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1076 "base functions not set");
1077 }
1078#endif
1079
1080 CHKERR do_work_lhs(
1081
1082 // side
1083 row_side, bd.getSide(),
1084
1085 // type
1086 row_type, bd.getType(),
1087
1088 // row_data
1089 row_data, bd.getData()
1090
1091 );
1092 }
1093
1094 break;
1095 case OP::OPSPACE:
1096 for (auto &bd : *BASE::brokenBaseSideData) {
1097 CHKERR do_work_rhs(bd.getSide(), bd.getType(), bd.getData());
1098 }
1099 break;
1100 default:
1102 (std::string("wrong op type ") +
1103 OpBaseDerivativesBase::OpTypeNames[OP::opType])
1104 .c_str());
1105 }
1106
1108 }
1109};
1110
1112 : public OpStabBrokenBaseImpl<OpBaseTimesVectorFace> {
1113
1116 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
1117 boost::shared_ptr<MatrixDouble> vec,
1118 ScalarFun beta_coeff = [](double, double, double) constexpr { return 1; },
1119 boost::shared_ptr<Range> ents_ptr = nullptr)
1120 : OP(broken_base_side_data, ents_ptr) {
1121 this->sourceVec = vec;
1122 this->betaCoeff = beta_coeff;
1123 }
1124};
1125
1127
1130 const std::string row_field,
1131 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
1132 ScalarFun beta_coeff, boost::shared_ptr<Range> ents_ptr = nullptr)
1133 : OP(row_field, boost::shared_ptr<MatrixDouble>(), beta_coeff, ents_ptr),
1134 brokenBaseSideDataPtr(broken_base_side_data) {
1135 this->betaCoeff = beta_coeff;
1136 }
1137
1138protected:
1139 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data) {
1141 for (auto &bd : (*brokenBaseSideDataPtr)) {
1142 this->sourceVec =
1143 boost::shared_ptr<MatrixDouble>(brokenBaseSideDataPtr, &bd.getFlux());
1144
1145#ifndef NDEBUG
1146 if (this->sourceVec->size1() != SPACE_DIM) {
1147 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1148 "Inconsistent size of the source vector");
1149 }
1150 if (this->sourceVec->size2() != OP::getGaussPts().size2()) {
1151 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1152 "Inconsistent size of the source vector");
1153 }
1154#endif // NDEBUG
1155
1156 CHKERR OP::iNtegrate(data);
1157
1158 this->sourceVec.reset();
1159 }
1161 }
1162 boost::shared_ptr<std::vector<BrokenBaseSideData>> brokenBaseSideDataPtr;
1163};
1164
1166 FormsIntegrators<FaceElementForcesAndSourcesCore::UserDataOperator>::
1167 Assembly<A>::BiLinearForm<GAUSS>::OpMass<1, SPACE_DIM>;
1168
1170 : public OpStabBrokenBaseImpl<OpMassVectorFace> {
1171
1174 std::string row_field,
1175 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
1176 ScalarFun beta, const bool assmb_transpose, const bool only_transpose,
1177 boost::shared_ptr<Range> ents_ptr = nullptr)
1178 : OP(row_field, broken_base_side_data, assmb_transpose, only_transpose,
1179 ents_ptr) {
1180 this->betaCoeff = beta;
1181 this->sYmm = false;
1182 }
1183};
FormsIntegrators< FaceElementForcesAndSourcesCore::UserDataOperator >::Assembly< A >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpMassVectorFace
FormsIntegrators< FaceElementForcesAndSourcesCore::UserDataOperator >::Assembly< A >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 > OpBaseTimesVectorFace
static const double eps
constexpr int SPACE_DIM
[Define dimension]
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FieldSpace
approximation spaces
Definition definitions.h:82
@ H1
continuous field
Definition definitions.h:85
@ NOSPACE
Definition definitions.h:83
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ MOFEM_IMPOSSIBLE_CASE
Definition definitions.h:35
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
@ MOFEM_INVALID_DATA
Definition definitions.h:36
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
const double n
refractive index of diffusive medium
static __CLPK_integer lapack_dpotrf(char uplo, __CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda)
static __CLPK_integer lapack_dsyev(char jobz, char uplo, __CLPK_integer n, __CLPK_doublereal *a, __CLPK_integer lda, __CLPK_doublereal *w, __CLPK_doublereal *work, __CLPK_integer lwork)
FTensor::Index< 'j', 3 > j
constexpr AssemblyType A
[Define dimension]
constexpr double t
plate stiffness
Definition plate.cpp:58
constexpr auto field_name
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition radiation.cpp:29
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpMass
[Only used with Hooke equation (linear material model)]
Definition seepage.cpp:56
FTensor::Index< 'm', 3 > m
static MoFEMErrorCode add(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, std::vector< FieldSpace > space, std::string geom_field_name, boost::shared_ptr< Range > crack_front_edges_ptr)
static MoFEMErrorCode add(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, std::vector< FieldSpace > space, std::string geom_field_name, boost::shared_ptr< Range > crack_front_edges_ptr)
static MoFEMErrorCode add(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, std::vector< FieldSpace > space, std::string geom_field_name, boost::shared_ptr< Range > crack_front_edges_ptr, boost::shared_ptr< MatrixDouble > jac=nullptr, boost::shared_ptr< VectorDouble > det=nullptr, boost::shared_ptr< MatrixDouble > inv_jac=nullptr)
std::array< bool, MBMAXTYPE > doEntities
If true operator is executed for entity.
bool sYmm
If true assume that matrix is symmetric structure.
Data on single entity (This is passed as argument to DataOperator::doWork)
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
@ OPROW
operator doWork function is executed on FE rows
@ OPROWCOL
operator doWork is executed on FE rows &columns
@ OPSPACE
operator do Work is execute on space data
boost::shared_ptr< AnalyticalDisplacementBcVec > bcDispPtr
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
MoFEMErrorCode iNtegrate(EntData &data)
OpAnalyticalDispBcImpl(boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< AnalyticalDisplacementBcVec > &bc_disp_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< Range > ents_ptr=nullptr)
MoFEMErrorCode iNtegrate(EntData &data)
MatrixDouble K
local tangent matrix
virtual MoFEMErrorCode integrate(int row_side, EntityType row_type, EntData &data)
VectorDouble nF
local right hand side vector
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
virtual MoFEMErrorCode assemble(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
virtual MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
virtual MoFEMErrorCode assemble(EntData &data)
OpAssembleBasic(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
virtual MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
boost::function< double()> ScaleOff
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
OpAssembleBasic(const FieldSpace space)
virtual MoFEMErrorCode assemble(int row_side, EntityType row_type, EntData &data)
OpAssembleBasic(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type, const bool assemble_symmetry, ScaleOff scale_off=[]() { return 1;})
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
static std::map< std::pair< std::string, std::string >, MatrixDouble > mapMatrix
MoFEMErrorCode assemble(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
boost::shared_ptr< AnalyticalTractionBcVec > bcData
OpBrokenAnalyticalTractionBc(const std::string row_field, boost::shared_ptr< AnalyticalTractionBcVec > bc_data, boost::shared_ptr< double > piola_scale_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
boost::shared_ptr< double > piolaScalePtr
MoFEMErrorCode iNtegrate(EntData &data)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideDataPtr
OpBrokenBaseTimesVectorDisp(const std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, ScalarFun beta_coeff, boost::shared_ptr< Range > ents_ptr=nullptr)
OpBrokenBaseTimesVectorHybridDisp(boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< MatrixDouble > vec, ScalarFun beta_coeff=[](double, double, double) constexpr { return 1;}, boost::shared_ptr< Range > ents_ptr=nullptr)
OpBrokenMassVectorHybrid(std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, ScalarFun beta, const bool assmb_transpose, const bool only_transpose, boost::shared_ptr< Range > ents_ptr=nullptr)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
boost::shared_ptr< MatrixDouble > hybridGradDispPtr
OpBrokenPressureBcLhsImpl_dU(std::string row_field, boost::shared_ptr< PressureBcVec > bc_data, boost::shared_ptr< MatrixDouble > hybrid_grad_disp, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< PressureBcVec > bcData
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
boost::shared_ptr< MatrixDouble > hybridGradDispPtr
boost::shared_ptr< double > piolaScalePtr
MoFEMErrorCode iNtegrate(EntData &data)
OpBrokenPressureBc(const std::string row_field, boost::shared_ptr< PressureBcVec > bc_data, boost::shared_ptr< double > piola_scale_ptr, boost::shared_ptr< MatrixDouble > hybrid_grad_disp, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< PressureBcVec > bcData
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
OpBrokenTractionBc(const std::string row_field, boost::shared_ptr< TractionBcVec > bc_data, boost::shared_ptr< double > piola_scale_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
boost::shared_ptr< double > piolaScalePtr
boost::shared_ptr< TractionBcVec > bcData
MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
OpCalculateEshelbyStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
std::array< double, 6 > & reactionVec
OpCalculateReactionForces(boost::shared_ptr< DataAtIntegrationPts > data_ptr, std::string block_name, Range block_entities, std::array< double, 6 > &reaction_vec)
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
OpCalculateRotationAndSpatialGradient(boost::shared_ptr< DataAtIntegrationPts > data_ptr, double alpha_omega=0)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
OpCalculateTractionFromSideEl(boost::shared_ptr< DataAtIntegrationPts > data_ptr)
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
OpDispBcImpl(boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< BcDispVec > &bc_disp_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< Range > ents_ptr=nullptr)
MoFEMErrorCode iNtegrate(EntData &data)
boost::shared_ptr< BcDispVec > bcDispPtr
MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
FaceElementForcesAndSourcesCore::UserDataOperator OP
OpFaceMaterialForce(boost::shared_ptr< DataAtIntegrationPts > data_ptr)
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Caluclate face material force and normal pressure at gauss points.
OpFaceSideMaterialForce(boost::shared_ptr< DataAtIntegrationPts > data_ptr)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
OpGetInternalStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, std::string tag_name="")
virtual MoFEMErrorCode evaluateLhs(EntData &data)=0
boost::shared_ptr< PhysicalEquations > physicsPtr
material physical equations
virtual MoFEMErrorCode evaluateRhs(EntData &data)=0
OpJacobian(const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
int tAg
adol-c tape
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< NormalDisplacementBcVec > bcDispPtr
OpNormalDispBcLhsImpl_dP(std::string row_field, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< NormalDisplacementBcVec > &bc_disp_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< Range > ents_ptr=nullptr)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
OpNormalDispBcLhsImpl_dU(std::string row_field, boost::shared_ptr< NormalDisplacementBcVec > &bc_disp_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< Range > ents_ptr=nullptr)
boost::shared_ptr< NormalDisplacementBcVec > bcDispPtr
boost::shared_ptr< MatrixDouble > hybridDispPtr
OpNormalDispBcRhsImpl(std::string row_field, boost::shared_ptr< MatrixDouble > hybrid_disp_ptr, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_side_data_ptr, boost::shared_ptr< NormalDisplacementBcVec > &bc_disp_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< Range > ents_ptr=nullptr)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
MoFEMErrorCode iNtegrate(EntData &data)
boost::shared_ptr< NormalDisplacementBcVec > bcDispPtr
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideDataPtr
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode iNtegrate(EntData &data)
std::vector< EntityHandle > & mapGaussPts
OpPostProcDataStructure(moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, boost::shared_ptr< DataAtIntegrationPts > data_ptr, int sense)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator OP
OpRotationBcImpl(boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< BcRotVec > &bc_rot_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< Range > ents_ptr=nullptr)
MoFEMErrorCode iNtegrate(EntData &data)
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< BcRotVec > bcRotPtr
Apply rotation boundary condition.
MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
OpSpatialConsistencyBubble(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
MoFEMErrorCode integrate(EntData &data)
OpSpatialConsistencyDivTerm(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
MoFEMErrorCode integrate(EntData &data)
OpSpatialConsistencyP(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialConsistency_dBubble_dBubble(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data)
OpSpatialConsistency_dBubble_dP(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialConsistency_dBubble_domega(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const bool assemble_off)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data)
OpSpatialConsistency_dP_dP(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialConsistency_dP_domega(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const bool assemble_off)
OpSpatialEquilibrium_dw_dP(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const bool assemble_off=false)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialEquilibrium_dw_dw(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha, const double rho)
MoFEMErrorCode integrate(EntData &data)
OpSpatialEquilibrium(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha, const double rho)
MoFEMErrorCode integrate(EntData &row_data)
OpSpatialPhysicalInternalStress(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
OpSpatialPhysical_du_dBubble(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const bool assemble_off=false)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialPhysical_du_dP(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const bool assemble_off=false)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialPhysical_du_domega(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const bool assemble_off)
OpSpatialPrj_dx_dw(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialPrj_dx_dx(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
OpSpatialPrj(std::string row_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr)
MoFEMErrorCode integrate(EntData &row_data)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialRotation_domega_dBubble(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const bool assemble_off)
OpSpatialRotation_domega_dP(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const bool assemble_off)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialRotation_domega_domega(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, double alpha_omega)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialRotation_domega_du(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, double alpha_omega)
MoFEMErrorCode integrate(EntData &row_data, EntData &col_data)
OpSpatialRotation(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, double alpha_omega)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
OpBrokenBaseImpl< OP > BASE
double rho
Definition plastic.cpp:144