v0.15.4
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 boost::shared_ptr<ScalingMethod> scaling_method_ptr)
401 : OpAssembleVolume(field_name, data_ptr, OPROW),
402 scalingMethodPtr(scaling_method_ptr) {}
403 MoFEMErrorCode integrate(EntData &row_data);
404
405protected:
406 boost::shared_ptr<ScalingMethod> scalingMethodPtr;
407};
408
409template <AssemblyType A, IntegrationType I> struct OpDispBcImpl;
410
411template <AssemblyType A>
412struct OpDispBcImpl<A, GAUSS>
413 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
414
415 using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
417
419 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
420 boost::shared_ptr<BcDispVec> &bc_disp_ptr,
421 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
422 boost::shared_ptr<Range> ents_ptr = nullptr)
423 : OP(broken_base_side_data, ents_ptr), bcDispPtr(bc_disp_ptr),
424 scalingMethodsMap(smv) {}
425
426protected:
427 MoFEMErrorCode iNtegrate(EntData &data);
428 boost::shared_ptr<BcDispVec> bcDispPtr;
429 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
430};
431
432struct OpDispBc : public OpDispBcImpl<PETSC, GAUSS> {
434 using OP::OpDispBcImpl;
435
436protected:
437 MoFEMErrorCode iNtegrate(EntData &data);
438};
439
440template <AssemblyType A, IntegrationType I> struct OpRotationBcImpl;
441
442template <AssemblyType A>
443struct OpRotationBcImpl<A, GAUSS>
444 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
445
446 using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
448
450 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
451 boost::shared_ptr<BcRotVec> &bc_rot_ptr,
452 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
453 boost::shared_ptr<Range> ents_ptr = nullptr)
454 : OP(broken_base_side_data, ents_ptr), bcRotPtr(bc_rot_ptr),
455 scalingMethodsMap(smv) {}
456
457protected:
458 MoFEMErrorCode iNtegrate(EntData &data);
459 boost::shared_ptr<BcRotVec> bcRotPtr;
460 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
461};
462
463/**
464 * @brief Apply rotation boundary condition
465 *
466 * The boundary condition is applied getting data from the SPATIAL_ROTATION_BC
467 * blockset.
468 *
469 * Centre of rotation is given by the first three attributes of the blockset.
470 * The fort parameter is angle of rotation
471 *
472 */
473struct OpRotationBc : public OpRotationBcImpl<PETSC, GAUSS> {
475 using OP::OpRotationBcImpl;
476
477protected:
478 MoFEMErrorCode iNtegrate(EntData &data);
479};
480
482 : public FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase {
484 const std::string row_field, boost::shared_ptr<TractionBcVec> bc_data,
485 boost::shared_ptr<double> piola_scale_ptr,
486 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
487 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
488 row_field, row_field, FaceUserDataOperator::OPROW),
489 bcData(bc_data), piolaScalePtr(), scalingMethodsMap(smv) {}
490
491 MoFEMErrorCode iNtegrate(EntData &data);
492
493protected:
494 boost::shared_ptr<TractionBcVec> bcData;
495 boost::shared_ptr<double> piolaScalePtr;
496 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
497};
498
500 : public FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase {
502 const std::string row_field, boost::shared_ptr<PressureBcVec> bc_data,
503 boost::shared_ptr<double> piola_scale_ptr,
504 boost::shared_ptr<MatrixDouble> hybrid_grad_disp,
505 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
506 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
507 row_field, row_field, FaceUserDataOperator::OPROW),
508 bcData(bc_data), piolaScalePtr(), hybridGradDispPtr(hybrid_grad_disp),
509 scalingMethodsMap(smv) {}
510
511 MoFEMErrorCode iNtegrate(EntData &data);
512
513protected:
514 boost::shared_ptr<PressureBcVec> bcData;
515 boost::shared_ptr<double> piolaScalePtr;
516 boost::shared_ptr<MatrixDouble> hybridGradDispPtr;
517 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
518};
519
520template <AssemblyType A, IntegrationType I>
522
523template <AssemblyType A>
525 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBase {
526
527 using OP =
528 typename FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBase;
529
531 std::string row_field, boost::shared_ptr<PressureBcVec> bc_data,
532 boost::shared_ptr<MatrixDouble> hybrid_grad_disp,
533 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
534 : OP(row_field, row_field, OP::OPROWCOL), bcData(bc_data),
535 hybridGradDispPtr(hybrid_grad_disp), scalingMethodsMap(smv) {}
536
537protected:
538 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
539 boost::shared_ptr<PressureBcVec> bcData;
540 boost::shared_ptr<MatrixDouble> hybridGradDispPtr;
541 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
542};
543
545 : public OpBrokenPressureBcLhsImpl_dU<A, GAUSS> {
548
549protected:
550 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
551};
552
554 : public FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase {
556 const std::string row_field,
557 boost::shared_ptr<AnalyticalTractionBcVec> bc_data,
558 boost::shared_ptr<double> piola_scale_ptr,
559 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv)
560 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
561 row_field, row_field, FaceUserDataOperator::OPROW),
562 bcData(bc_data), piolaScalePtr(), scalingMethodsMap(smv) {}
563
564 MoFEMErrorCode iNtegrate(EntData &data);
565
566protected:
567 boost::shared_ptr<AnalyticalTractionBcVec> bcData;
568 boost::shared_ptr<double> piolaScalePtr;
569 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
570};
571
572template <AssemblyType A, IntegrationType I> struct OpNormalDispBcRhsImpl;
573template <AssemblyType A, IntegrationType I> struct OpNormalDispBcLhsImpl_dU;
574template <AssemblyType A, IntegrationType I> struct OpNormalDispBcLhsImpl_dP;
575
576template <AssemblyType A>
578 : public FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase {
579
580 using OP =
581 typename FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase;
582
584 std::string row_field, boost::shared_ptr<MatrixDouble> hybrid_disp_ptr,
585 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_side_data_ptr,
586 // boost::shared_ptr<MatrixDouble> piola_stress_ptr,
587 boost::shared_ptr<NormalDisplacementBcVec> &bc_disp_ptr,
588 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
589 boost::shared_ptr<Range> ents_ptr = nullptr)
590 : FormsIntegrators<FaceUserDataOperator>::Assembly<PETSC>::OpBase(
591 row_field, row_field, OP::OPROW),
592 hybridDispPtr(hybrid_disp_ptr),
593 brokenBaseSideDataPtr(
594 broken_side_data_ptr), /*piolaStressPtr(piola_stress_ptr),*/
595 bcDispPtr(bc_disp_ptr), scalingMethodsMap(smv) {}
596
597protected:
598 MoFEMErrorCode iNtegrate(EntData &data);
599 boost::shared_ptr<MatrixDouble> hybridDispPtr;
600 boost::shared_ptr<std::vector<BrokenBaseSideData>> brokenBaseSideDataPtr;
601 // boost::shared_ptr<MatrixDouble> piolaStressPtr;
602 boost::shared_ptr<NormalDisplacementBcVec> bcDispPtr;
603 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
604};
605
606template <AssemblyType A>
608 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBase {
609
610 using OP =
611 typename FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBase;
612
614 std::string row_field,
615 boost::shared_ptr<NormalDisplacementBcVec> &bc_disp_ptr,
616 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
617 boost::shared_ptr<Range> ents_ptr = nullptr)
618 : OP(row_field, row_field, OP::OPROWCOL), bcDispPtr(bc_disp_ptr),
619 scalingMethodsMap(smv) {}
620
621protected:
622 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
623 boost::shared_ptr<NormalDisplacementBcVec> bcDispPtr;
624 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
625};
626
627template <AssemblyType A>
629 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
630
631 using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
633
635 std::string row_field,
636 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
637 boost::shared_ptr<NormalDisplacementBcVec> &bc_disp_ptr,
638 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
639 boost::shared_ptr<Range> ents_ptr = nullptr)
640 : OP(row_field, broken_base_side_data, false, false, ents_ptr),
641 bcDispPtr(bc_disp_ptr), scalingMethodsMap(smv) {}
642
643protected:
644 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
645 boost::shared_ptr<NormalDisplacementBcVec> bcDispPtr;
646 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
647};
648
649struct OpNormalDispRhsBc : public OpNormalDispBcRhsImpl<PETSC, GAUSS> {
651 using OP::OpNormalDispBcRhsImpl;
652
653protected:
654 MoFEMErrorCode iNtegrate(EntData &data);
655};
656
660
661protected:
662 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
663};
664
668
669protected:
670 MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data);
671};
672
673template <AssemblyType A, IntegrationType I> struct OpAnalyticalDispBcImpl;
674
675template <AssemblyType A>
677 : public FormsIntegrators<FaceUserDataOperator>::Assembly<A>::OpBrokenBase {
678
679 using OP = typename FormsIntegrators<FaceUserDataOperator>::Assembly<
681
683 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
684 boost::shared_ptr<AnalyticalDisplacementBcVec> &bc_disp_ptr,
685 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
686 boost::shared_ptr<Range> ents_ptr = nullptr)
687 : OP(broken_base_side_data, ents_ptr), bcDispPtr(bc_disp_ptr),
688 scalingMethodsMap(smv) {}
689
690protected:
691 MoFEMErrorCode iNtegrate(EntData &data);
692 boost::shared_ptr<AnalyticalDisplacementBcVec> bcDispPtr;
693 std::map<std::string, boost::shared_ptr<ScalingMethod>> scalingMethodsMap;
694};
695
696struct OpAnalyticalDispBc : public OpAnalyticalDispBcImpl<PETSC, GAUSS> {
698 using OP::OpAnalyticalDispBcImpl;
699
700protected:
701 MoFEMErrorCode iNtegrate(EntData &data);
702};
703
705 OpSpatialEquilibrium_dw_dP(std::string row_field, std::string col_field,
706 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
707 const bool assemble_off = false)
708 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
709 assemble_off) {
710 sYmm = false;
711 }
712 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
713};
714
716 const double alphaW;
717 const double alphaRho;
718 OpSpatialEquilibrium_dw_dw(std::string row_field, std::string col_field,
719 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
720 const double alpha, const double rho)
721 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
722 alphaW(alpha), alphaRho(rho) {
723 sYmm = true;
724 }
725 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
726};
727
729 OpSpatialPhysical_du_dP(std::string row_field, std::string col_field,
730 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
731 const bool assemble_off = false)
732 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
733 assemble_off) {
734 sYmm = false;
735 }
736
737 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
738};
739
741 OpSpatialPhysical_du_dBubble(std::string row_field, std::string col_field,
742 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
743 const bool assemble_off = false)
744 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
745 assemble_off) {
746 sYmm = false;
747 }
748
749 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
750};
751
753 using OpAssembleVolume::OpAssembleVolume;
754 OpSpatialPhysical_du_domega(std::string row_field, std::string col_field,
755 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
756 const bool assemble_off)
757 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
758 assemble_off) {
759 sYmm = false;
760 }
761 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
762};
763
765 OpSpatialRotation_domega_du(std::string row_field, std::string col_field,
766 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
767 double alpha_omega)
768 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false) {
769 sYmm = false;
770 }
771 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
772
773private:
774};
775
777 OpSpatialRotation_domega_dP(std::string row_field, std::string col_field,
778 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
779 const bool assemble_off)
780 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
781 assemble_off) {
782 sYmm = false;
783 }
784 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
785};
786
789 std::string row_field, std::string col_field,
790 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const bool assemble_off)
791 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
792 assemble_off) {
793 sYmm = false;
794 }
795 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
796};
797
800 std::string row_field, std::string col_field,
801 boost::shared_ptr<DataAtIntegrationPts> data_ptr, double alpha_omega)
802 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false),
803 alphaOmega(alpha_omega) {
804 sYmm = false;
805 }
806 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
807
808private:
810};
811
813 OpSpatialConsistency_dP_dP(std::string row_field, std::string col_field,
814 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
815 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false) {
816 sYmm = false;
817 }
818 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
819
820private:
821 template <int S>
822 MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data);
823};
824
827 std::string row_field, std::string col_field,
828 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
829 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false) {
830 sYmm = false;
831 }
832 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
833
834private:
835 template <int S>
836 MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data);
837};
838
841 std::string row_field, std::string col_field,
842 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
843 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, true) {
844 sYmm = false;
845 }
846 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
847
848private:
849 template <int S>
850 MoFEMErrorCode integrateImpl(EntData &row_data, EntData &col_data);
851};
852
855 std::string row_field, std::string col_field,
856 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const bool assemble_off)
857 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
858 assemble_off) {
859 sYmm = false;
860 }
861 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
862
863private:
864};
865
868 std::string row_field, std::string col_field,
869 boost::shared_ptr<DataAtIntegrationPts> data_ptr, const bool assemble_off)
870 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL,
871 assemble_off) {
872 sYmm = false;
873 }
874 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
875
876private:
877};
878
880 : public VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator {
881
882 using OP = VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator;
883
884 moab::Interface &postProcMesh;
885 std::vector<EntityHandle> &mapGaussPts;
886 boost::shared_ptr<DataAtIntegrationPts> dataAtPts;
887
888 OpPostProcDataStructure(moab::Interface &post_proc_mesh,
889 std::vector<EntityHandle> &map_gauss_pts,
890 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
891 int sense)
892 : OP(NOSPACE, UserDataOperator::OPSPACE), postProcMesh(post_proc_mesh),
893 mapGaussPts(map_gauss_pts), dataAtPts(data_ptr), tagSense(sense) {}
894
895 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
896
897private:
899};
900
902 OpSpatialPrj(std::string row_field,
903 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
904 : OpAssembleVolume(row_field, data_ptr, OPROW) {}
905 MoFEMErrorCode integrate(EntData &row_data);
906};
907
909 OpSpatialPrj_dx_dx(std::string row_field, std::string col_field,
910 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
911 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false) {
912 // FIXME: That is symmetric
913 sYmm = false;
914 }
915 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
916};
917
919 OpSpatialPrj_dx_dw(std::string row_field, std::string col_field,
920 boost::shared_ptr<DataAtIntegrationPts> data_ptr)
921 : OpAssembleVolume(row_field, col_field, data_ptr, OPROWCOL, false) {
922 sYmm = false;
923 }
924 MoFEMErrorCode integrate(EntData &row_data, EntData &col_data);
925};
926
928 : public VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator {
929
930 // @note This is not on the side, since, integrate energy in the volume
931 using OP = VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator;
932
933 OpFaceSideMaterialForce(boost::shared_ptr<DataAtIntegrationPts> data_ptr)
934 : OP(NOSPACE, OPSPACE), dataAtPts(data_ptr) {}
935
936 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
937
938private:
939 boost::shared_ptr<DataAtIntegrationPts>
940 dataAtPts; ///< data at integration pts
941};
942
944 : public FaceElementForcesAndSourcesCore::UserDataOperator {
945
946 // @note This is not on the side, since, integrate energy in the volume
947 using OP = FaceElementForcesAndSourcesCore::UserDataOperator;
948
949 OpFaceMaterialForce(boost::shared_ptr<DataAtIntegrationPts> data_ptr)
950 : OP(NOSPACE, OPSPACE), dataAtPts(data_ptr) {}
951
952 MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
953
954private:
955 boost::shared_ptr<DataAtIntegrationPts>
956 dataAtPts; ///< data at integration pts
957};
958
959template <int FE_DIM, int PROBLEM_DIM, int SPACE_DIM> struct AddHOOps;
960
961template <> struct AddHOOps<2, 3, 3> {
962 AddHOOps() = delete;
963 static MoFEMErrorCode
964 add(boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
965 std::vector<FieldSpace> space, std::string geom_field_name,
966 boost::shared_ptr<Range> crack_front_edges_ptr);
967};
968
969template <> struct AddHOOps<2, 2, 3> {
970 AddHOOps() = delete;
971 static MoFEMErrorCode
972 add(boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
973 std::vector<FieldSpace> space, std::string geom_field_name,
974 boost::shared_ptr<Range> crack_front_edges_ptr);
975};
976
977template <> struct AddHOOps<3, 3, 3> {
978 AddHOOps() = delete;
979 static MoFEMErrorCode
980 add(boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
981 std::vector<FieldSpace> space, std::string geom_field_name,
982 boost::shared_ptr<Range> crack_front_edges_ptr,
983 boost::shared_ptr<MatrixDouble> jac = nullptr,
984 boost::shared_ptr<VectorDouble> det = nullptr,
985 boost::shared_ptr<MatrixDouble> inv_jac = nullptr);
986};
987
989 FormsIntegrators<FaceElementForcesAndSourcesCore::UserDataOperator>::
990 Assembly<A>::LinearForm<GAUSS>::OpBaseTimesVector<1, SPACE_DIM, 1>;
991
992template <typename OP>
993struct OpStabBrokenBaseImpl : public OpBrokenBaseImpl<OP> {
994
995 using BASE = OpBrokenBaseImpl<OP>;
996 using BASE::BASE;
997
998 MoFEMErrorCode doWork(int row_side, EntityType row_type,
999 EntitiesFieldData::EntData &row_data) {
1001
1002 if (OP::entsPtr) {
1003 if (OP::entsPtr->find(this->getFEEntityHandle()) == OP::entsPtr->end())
1005 }
1006
1007#ifndef NDEBUG
1008 if (!BASE::brokenBaseSideData) {
1009 SETERRQ(PETSC_COMM_SELF, MOFEM_IMPOSSIBLE_CASE, "space not set");
1010 }
1011#endif // NDEBUG
1012
1013 auto do_work_rhs = [this](int row_side, EntityType row_type,
1014 EntitiesFieldData::EntData &row_data) {
1016 // get number of dofs on row
1017 OP::nbRows = row_data.getIndices().size();
1018 if (!OP::nbRows)
1020 // get number of integration points
1021 OP::nbIntegrationPts = OP::getGaussPts().size2();
1022 // get row base functions
1023 OP::nbRowBaseFunctions = OP::getNbOfBaseFunctions(row_data);
1024 // resize and clear the right hand side vector
1025 OP::locF.resize(OP::nbRows, false);
1026 OP::locF.clear();
1027 // integrate local vector
1028 CHKERR this->iNtegrate(row_data);
1029 // assemble local vector
1030 CHKERR this->aSsemble(row_data);
1032 };
1033
1034 auto do_work_lhs = [this](int row_side, int col_side, EntityType row_type,
1035 EntityType col_type,
1036 EntitiesFieldData::EntData &row_data,
1037 EntitiesFieldData::EntData &col_data) {
1039
1040 auto check_if_assemble_transpose = [&] {
1041 if (this->sYmm) {
1042 if (OP::rowSide != OP::colSide || OP::rowType != OP::colType)
1043 return true;
1044 else
1045 return false;
1046 } else if (OP::assembleTranspose) {
1047 return true;
1048 }
1049 return false;
1050 };
1051
1052 OP::rowSide = row_side;
1053 OP::rowType = row_type;
1054 OP::colSide = col_side;
1055 OP::colType = col_type;
1056 OP::nbCols = col_data.getIndices().size();
1057 OP::locMat.resize(OP::nbRows, OP::nbCols, false);
1058 OP::locMat.clear();
1059 CHKERR this->iNtegrate(row_data, col_data);
1060 CHKERR this->aSsemble(row_data, col_data, check_if_assemble_transpose());
1062 };
1063
1064 switch (OP::opType) {
1065 case OP::OPROW:
1066
1067 OP::nbRows = row_data.getIndices().size();
1068 if (!OP::nbRows)
1070 OP::nbIntegrationPts = OP::getGaussPts().size2();
1071 OP::nbRowBaseFunctions = OP::getNbOfBaseFunctions(row_data);
1072
1073 if (!OP::nbRows)
1075
1076 for (auto &bd : *BASE::brokenBaseSideData) {
1077
1078#ifndef NDEBUG
1079 if (!bd.getData().getNSharedPtr(bd.getData().getBase())) {
1080 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1081 "base functions not set");
1082 }
1083#endif
1084
1085 CHKERR do_work_lhs(
1086
1087 // side
1088 row_side, bd.getSide(),
1089
1090 // type
1091 row_type, bd.getType(),
1092
1093 // row_data
1094 row_data, bd.getData()
1095
1096 );
1097 }
1098
1099 break;
1100 case OP::OPSPACE:
1101 for (auto &bd : *BASE::brokenBaseSideData) {
1102 CHKERR do_work_rhs(bd.getSide(), bd.getType(), bd.getData());
1103 }
1104 break;
1105 default:
1107 (std::string("wrong op type ") +
1108 OpBaseDerivativesBase::OpTypeNames[OP::opType])
1109 .c_str());
1110 }
1111
1113 }
1114};
1115
1117 : public OpStabBrokenBaseImpl<OpBaseTimesVectorFace> {
1118
1121 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
1122 boost::shared_ptr<MatrixDouble> vec,
1123 ScalarFun beta_coeff = [](double, double, double) constexpr { return 1; },
1124 boost::shared_ptr<Range> ents_ptr = nullptr);
1125};
1126
1128 : public OpStabBrokenBaseImpl<OpBaseTimesVectorFace> {
1129
1132 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
1133 ScalarFun beta_coeff = [](double, double, double) constexpr { return 1; },
1134 boost::shared_ptr<Range> ents_ptr = nullptr);
1135
1136protected:
1137 MoFEMErrorCode doWork(int row_side, EntityType row_type,
1138 EntitiesFieldData::EntData &row_data);
1139};
1140
1142
1145 const std::string row_field,
1146 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
1147 ScalarFun beta_coeff, boost::shared_ptr<Range> ents_ptr = nullptr);
1148
1149protected:
1150 MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data);
1151 boost::shared_ptr<std::vector<BrokenBaseSideData>> brokenBaseSideDataPtr;
1152};
1153
1155 FormsIntegrators<FaceElementForcesAndSourcesCore::UserDataOperator>::
1156 Assembly<A>::BiLinearForm<GAUSS>::OpMass<1, SPACE_DIM>;
1157
1159 : public OpStabBrokenBaseImpl<OpMassVectorFace> {
1160
1163 std::string row_field,
1164 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
1165 ScalarFun beta, const bool assmb_transpose, const bool only_transpose,
1166 boost::shared_ptr<Range> ents_ptr = nullptr);
1167};
1168
1170 : public OpStabBrokenBaseImpl<OpMassVectorFace> {
1171
1174 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
1175 ScalarFun beta, boost::shared_ptr<Range> ents_ptr = nullptr);
1176
1177 MoFEMErrorCode doWork(int row_side, EntityType row_type,
1178 EntitiesFieldData::EntData &row_data);
1179};
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 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
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 doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
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="")
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenBaseSideDataPtr
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, boost::shared_ptr< ScalingMethod > scaling_method_ptr)
boost::shared_ptr< ScalingMethod > scalingMethodPtr
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