153
155 boost::shared_ptr<DataAtIntegrationPts> data_at_pts);
156
158
159 protected:
160 boost::shared_ptr<DataAtIntegrationPts> dataAtPts;
161 };
162
164
166 boost::shared_ptr<DataAtIntegrationPts> data_at_pts,
168
170
171 protected:
172 boost::shared_ptr<DataAtIntegrationPts>
dataAtPts;
174 };
175
177
179 const std::string row_field, const std::string col_field,
180 boost::shared_ptr<DataAtIntegrationPts> data_at_pts);
181
183
184 protected:
185 boost::shared_ptr<DataAtIntegrationPts>
dataAtPts;
186 };
187
188 template <int S = 0>
190
192 const std::string row_field, const std::string col_field,
193 boost::shared_ptr<map<int, BlockData>> &block_sets_ptr,
194 boost::shared_ptr<DataAtIntegrationPts> data_at_pts);
195
197
198 protected:
199 boost::shared_ptr<map<int, BlockData>>
201
202 boost::shared_ptr<DataAtIntegrationPts>
dataAtPts;
203 };
204
205
206
207
208
209
210
212 : public VolumeElementForcesAndSourcesCore::UserDataOperator {
213
218
219 boost::shared_ptr<DataAtIntegrationPts>
commonData;
220
222 const std::string col_field,
BlockData &data,
224 boost::shared_ptr<DataAtIntegrationPts> &common_data,
225 bool symm = true)
227 row_field, col_field, OPROWCOL, symm),
229
230 PetscErrorCode
doWork(
int row_side,
int col_side, EntityType row_type,
231 EntityType col_type,
235
238 &
m(3 * r + 0, 3 *
c + 0), &
m(3 * r + 0, 3 *
c + 1),
239 &
m(3 * r + 0, 3 *
c + 2), &
m(3 * r + 1, 3 *
c + 0),
240 &
m(3 * r + 1, 3 *
c + 1), &
m(3 * r + 1, 3 *
c + 2),
241 &
m(3 * r + 2, 3 *
c + 0), &
m(3 * r + 2, 3 *
c + 1),
242 &
m(3 * r + 2, 3 *
c + 2));
243 };
244
245 const int row_nb_dofs = row_data.
getIndices().size();
246 if (!row_nb_dofs)
248 const int col_nb_dofs = col_data.
getIndices().size();
249 if (!col_nb_dofs)
251 if (
dAta.tEts.find(getFEEntityHandle()) ==
dAta.tEts.end()) {
253 }
256 }
257
258 const bool diagonal_block =
259 (row_type == col_type) && (row_side == col_side);
260
261
262 locK.resize(row_nb_dofs, col_nb_dofs,
false);
264
265 const int row_nb_gauss_pts = row_data.
getN().size1();
266 const int row_nb_base_functions = row_data.
getN().size2();
267
272
274
275
276 auto t_w = getFTensor0IntegrationWeight();
277
278
279 for (int gg = 0; gg != row_nb_gauss_pts; gg++) {
280
282
283
284 double w = getVolume() * t_w;
285
286 for (int row_bb = 0; row_bb != row_nb_dofs / 3; row_bb++) {
288 for (int col_bb = 0; col_bb != col_nb_dofs / 3; col_bb++) {
289 auto t_assemble = get_tensor2(
locK, row_bb, col_bb);
290 t_assemble(
i,
j) += density * t_row_base_func * t_col_base_func *
w;
291
292 ++t_col_base_func;
293 }
294
295 ++t_row_base_func;
296 }
297
298 ++t_w;
299 }
300
302 ADD_VALUES);
303
304
305 if (row_type != col_type || row_side != col_side) {
306 translocK.resize(col_nb_dofs, row_nb_dofs,
false);
308
310 ADD_VALUES);
311 }
312
314 }
315 };
316
318 protected:
319 boost::shared_ptr<map<int, BlockData>>
321
322 boost::shared_ptr<DataAtIntegrationPts>
dataAtPts;
323
327
328 public:
330 const std::string row_field, const std::string col_field,
331 boost::shared_ptr<map<int, BlockData>> &block_sets_ptr,
332 boost::shared_ptr<DataAtIntegrationPts> data_at_pts,
333 boost::shared_ptr<VectorDouble> rho_at_gauss_pts, const double rho_n,
334 const double rho_0);
335
337 };
338
340
341 OpAssemble(
const std::string row_field,
const std::string col_field,
342 boost::shared_ptr<DataAtIntegrationPts> data_at_pts,
343 const char type,
bool symm =
false);
344
345
346
347
348
349
350
351
352
353
354
356 EntityType col_type,
EntData &row_data,
358
360
361 protected:
362
366
367 boost::shared_ptr<DataAtIntegrationPts>
dataAtPts;
368
371
376
378
380
381
382
383
384
385
386
387
389
390
391
392
393
394
395
396
398 };
399
401
402 OpRhs_dx(
const std::string row_field,
const std::string col_field,
403 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts);
404
405 protected:
407 };
408
410
411 OpLhs_dx_dx(
const std::string row_field,
const std::string col_field,
412 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts);
413
414 protected:
415
416
417
418
419
420
422 };
423
425
426 OpAleRhs_dx(
const std::string row_field,
const std::string col_field,
427 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts);
428
429 protected:
431 };
432
434
435 OpAleLhs_dx_dx(
const std::string row_field,
const std::string col_field,
436 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts);
437
438 protected:
439
440
441
442
443
444
446 };
447
449
450 OpAleLhs_dx_dX(
const std::string row_field,
const std::string col_field,
451 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts);
452
453 protected:
454
455
456
457
458
459
461 };
462
464
469
471 const std::string row_field, const std::string col_field,
472 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts,
473 boost::shared_ptr<VectorDouble> rho_at_gauss_pts,
474 boost::shared_ptr<MatrixDouble> rho_grad_at_gauss_pts,
475 const double rho_n, const double rho_0);
476
477 protected:
478
479
480
481
482
483
485 };
486
488
493
495 const std::string row_field, const std::string col_field,
496 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts,
497 boost::shared_ptr<VectorDouble> rho_at_gauss_pts,
498 boost::shared_ptr<MatrixDouble> rho_grad_at_gauss_pts,
499 const double rho_n, const double rho_0);
500
501 protected:
502
503
504
505
506
507
509 };
510
512
513 OpAleRhs_dX(
const std::string row_field,
const std::string col_field,
514 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts);
515
516 protected:
518 };
519
521
522 OpAleLhs_dX_dX(
const std::string row_field,
const std::string col_field,
523 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts);
524
525 protected:
526
527
528
529
530
531
533 };
534
536
538 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts);
539
541
542 private:
543 boost::shared_ptr<DataAtIntegrationPts>
dataAtPts;
544 };
545
547
548 OpAleLhs_dX_dx(
const std::string row_field,
const std::string col_field,
549 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts)
551
552 protected:
553
554
555
556
557
558
560 };
561
563
564 typedef boost::function<
565
567
569
570 )
571
572 >
574
576 const std::string row_field,
577 boost::shared_ptr<DataAtIntegrationPts> data_at_pts,
579
580 protected:
583 };
584
586
587 typedef boost::function<
588
590
592
593 )
594
595 >
597
599 const std::string row_field,
600 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts,
602 boost::shared_ptr<MatrixDouble> mat_pos_at_pts_ptr);
603
604 protected:
608 };
609
611
612 typedef boost::function<
613
615
617
618 )
619
620 >
622
624 const std::string row_field,
625 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts,
627 boost::shared_ptr<MatrixDouble> mat_pos_at_pts_ptr);
628
629 protected:
633 };
634
635 template <class ELEMENT>
637 boost::shared_ptr<DataAtIntegrationPts>
dataAtPts;
638 map<int, BlockData>
644
646 boost::shared_ptr<DataAtIntegrationPts> data_at_pts,
647 map<int, BlockData> &block_sets_ptr,
648 moab::Interface &post_proc_mesh,
649 std::vector<EntityHandle> &map_gauss_pts,
650 bool is_ale = false, bool is_field_disp = true);
651
654 };
655
658 boost::shared_ptr<map<int, BlockData>> &block_sets_ptr);
659
662 boost::shared_ptr<map<int, BlockData>> &block_sets_ptr,
663 const std::string element_name, const std::string x_field,
664 const std::string X_field, const bool ale);
665
667 setOperators(boost::shared_ptr<ForcesAndSourcesCore> fe_lhs_ptr,
668 boost::shared_ptr<ForcesAndSourcesCore> fe_rhs_ptr,
669 boost::shared_ptr<map<int, BlockData>> block_sets_ptr,
670 const std::string x_field, const std::string X_field,
671 const bool ale, const bool field_disp,
672 const EntityType
type = MBTET,
673 boost::shared_ptr<DataAtIntegrationPts> data_at_pts = nullptr);
674
676 calculateEnergy(DM dm, boost::shared_ptr<map<int, BlockData>> block_sets_ptr,
677 const std::string x_field, const std::string X_field,
678 const bool ale, const bool field_disp,
680
681private:
683};
684
685template <bool D>
686HookeElement::OpCalculateStrain<D>::OpCalculateStrain(
687 const std::string row_field, const std::string col_field,
688 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts)
690 dataAtPts(data_at_pts) {
691 std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE], false);
692}
693
694template <bool D>
695MoFEMErrorCode HookeElement::OpCalculateStrain<D>::doWork(
int row_side,
696 EntityType row_type,
701
702 const int nb_integration_pts = getGaussPts().size2();
703 dataAtPts->smallStrainMat->resize(6, nb_integration_pts, false);
705 *(dataAtPts->smallStrainMat));
706 auto t_h =
707 getFTensor2FromMat<3, 3>(*(dataAtPts->hMat));
708
709 for (int gg = 0; gg != nb_integration_pts; ++gg) {
710 t_strain(
i,
j) = (t_h(
i,
j) || t_h(
j,
i)) / 2.;
711
712
714 t_strain(0, 0) -= 1;
715 t_strain(1, 1) -= 1;
716 t_strain(2, 2) -= 1;
717 }
718
719 ++t_strain;
720 ++t_h;
721 }
723}
724
725template <int S>
726HookeElement::OpAleLhs_dx_dx<S>::OpAleLhs_dx_dx(
727 const std::string row_field, const std::string col_field,
728 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts)
729 :
OpAssemble(row_field, col_field, data_at_pts, OPROWCOL, true) {}
730
731template <int S>
735
736
737
740 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2), &
m(r + 1,
c + 0),
741 &
m(r + 1,
c + 1), &
m(r + 1,
c + 2), &
m(r + 2,
c + 0), &
m(r + 2,
c + 1),
743 };
744
749
750
751 double vol = getVolume();
752
753
754 auto t_w = getFTensor0IntegrationWeight();
755
756
758 const int row_nb_base_fun = row_data.
getN().size2();
759
760
761
764
765 auto t_invH =
767 auto &det_H = *dataAtPts->detHVec;
768
769
770 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
771
772
773 double a = t_w * vol * det_H[gg];
774
775
776 int rr = 0;
777 for (; rr != nbRows / 3; ++rr) {
778
779
780 auto t_m = get_tensor2(
K, 3 * rr, 0);
781
783 t_row_diff_base_pulled(
i) = t_row_diff_base(
j) * t_invH(
j,
i);
784
786
787
788
789 t_rowD(
l,
j,
k) = t_D(
i,
j,
k,
l) * (
a * t_row_diff_base_pulled(
i));
790
791
793
794
795 for (int cc = 0; cc != nbCols / 3; ++cc) {
796
798 t_col_diff_base_pulled(
j) = t_col_diff_base(
i) * t_invH(
i,
j);
799
800
801 t_m(
i,
j) += t_rowD(
i,
j,
k) * t_col_diff_base_pulled(
k);
802
803
804 ++t_col_diff_base;
805
806
807 ++t_m;
808 }
809
810
811 ++t_row_diff_base;
812 }
813
814 for (; rr != row_nb_base_fun; ++rr)
815 ++t_row_diff_base;
816
817
818 ++t_w;
819 ++t_D;
820 ++t_invH;
821 }
822
824}
825
826template <int S>
827HookeElement::OpCalculateHomogeneousStiffness<S>::
828 OpCalculateHomogeneousStiffness(
829 const std::string row_field, const std::string col_field,
830 boost::shared_ptr<map<int, BlockData>> &block_sets_ptr,
831 boost::shared_ptr<DataAtIntegrationPts> data_at_pts)
833 blockSetsPtr(block_sets_ptr), dataAtPts(data_at_pts) {
834 std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE], false);
835}
836
837template <int S>
838MoFEMErrorCode HookeElement::OpCalculateHomogeneousStiffness<S>::doWork(
839 int row_side, EntityType row_type,
EntData &row_data) {
841
842 for (
auto &
m : (*blockSetsPtr)) {
843 if (
m.second.tEts.find(getFEEntityHandle()) !=
m.second.tEts.end()) {
844
845 dataAtPts->stiffnessMat->resize(36, 1, false);
848 const double young =
m.second.E;
849 const double poisson =
m.second.PoissonRatio;
850
851
852 const double coefficient = young / ((1 + poisson) * (1 - 2 * poisson));
853
858
859 t_D(
i,
j,
k,
l) = 0.;
860
861 t_D(0, 0, 0, 0) = 1 - poisson;
862 t_D(1, 1, 1, 1) = 1 - poisson;
863 t_D(2, 2, 2, 2) = 1 - poisson;
864
865 t_D(0, 1, 0, 1) = 0.5 * (1 - 2 * poisson);
866 t_D(0, 2, 0, 2) = 0.5 * (1 - 2 * poisson);
867 t_D(1, 2, 1, 2) = 0.5 * (1 - 2 * poisson);
868
869 t_D(0, 0, 1, 1) = poisson;
870 t_D(1, 1, 0, 0) = poisson;
871 t_D(0, 0, 2, 2) = poisson;
872 t_D(2, 2, 0, 0) = poisson;
873 t_D(1, 1, 2, 2) = poisson;
874 t_D(2, 2, 1, 1) = poisson;
875
876 t_D(
i,
j,
k,
l) *= coefficient;
877
878 break;
879 }
880 }
881
883}
884
885template <int S>
886HookeElement::OpCalculateStress<S>::OpCalculateStress(
887 const std::string row_field, const std::string col_field,
888 boost::shared_ptr<DataAtIntegrationPts> data_at_pts)
890 dataAtPts(data_at_pts) {
891 std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE], false);
892}
893
894template <int S>
895MoFEMErrorCode HookeElement::OpCalculateStress<S>::doWork(
int row_side,
896 EntityType row_type,
899
900 const int nb_integration_pts = getGaussPts().size2();
902 *(dataAtPts->smallStrainMat));
903 dataAtPts->cauchyStressMat->resize(6, nb_integration_pts, false);
904 auto t_cauchy_stress =
906 *(dataAtPts->cauchyStressMat));
907
912
913
914
917 for (int gg = 0; gg != nb_integration_pts; ++gg) {
918 t_cauchy_stress(
i,
j) = t_D(
i,
j,
k,
l) * t_strain(
k,
l);
919 ++t_strain;
920 ++t_cauchy_stress;
921 ++t_D;
922 }
924}
925
926template <int S>
927HookeElement::OpLhs_dx_dx<S>::OpLhs_dx_dx(
928 const std::string row_field, const std::string col_field,
929 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts)
930 :
OpAssemble(row_field, col_field, data_at_pts, OPROWCOL, true) {}
931
932template <int S>
936
937
938
941 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2), &
m(r + 1,
c + 0),
942 &
m(r + 1,
c + 1), &
m(r + 1,
c + 2), &
m(r + 2,
c + 0), &
m(r + 2,
c + 1),
944 };
945
950
951
952 double vol = getVolume();
953
954
955 auto t_w = getFTensor0IntegrationWeight();
956
957
959 const int row_nb_base_fun = row_data.
getN().size2();
960
961
962
965
966
967 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
968
969
970 double a = t_w * vol;
971
972
973 int rr = 0;
974 for (; rr != nbRows / 3; ++rr) {
975
976
977 auto t_m = get_tensor2(
K, 3 * rr, 0);
978
979
981
983
984
985
986 t_rowD(
l,
j,
k) = t_D(
i,
j,
k,
l) * (
a * t_row_diff_base(
i));
987
988
989 for (int cc = 0; cc != nbCols / 3; ++cc) {
990
991
992 t_m(
i,
j) += t_rowD(
i,
j,
k) * t_col_diff_base(
k);
993
994
995 ++t_col_diff_base;
996
997
998 ++t_m;
999 }
1000
1001
1002 ++t_row_diff_base;
1003 }
1004
1005 for (; rr != row_nb_base_fun; ++rr)
1006 ++t_row_diff_base;
1007
1008
1009 ++t_w;
1010 ++t_D;
1011 }
1012
1014}
1015
1016template <int S>
1017HookeElement::OpAleLhs_dx_dX<S>::OpAleLhs_dx_dX(
1018 const std::string row_field, const std::string col_field,
1019 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts)
1020 :
OpAssemble(row_field, col_field, data_at_pts, OPROWCOL, false) {}
1021
1022template <int S>
1026
1027
1028
1031 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2), &
m(r + 1,
c + 0),
1032 &
m(r + 1,
c + 1), &
m(r + 1,
c + 2), &
m(r + 2,
c + 0), &
m(r + 2,
c + 1),
1034 };
1035
1042
1043
1044 double vol = getVolume();
1045
1046
1047 auto t_w = getFTensor0IntegrationWeight();
1048
1049
1051 const int row_nb_base_fun = row_data.
getN().size2();
1052
1053
1054
1057
1058 auto t_cauchy_stress =
1060 *(dataAtPts->cauchyStressMat));
1061 auto t_h = getFTensor2FromMat<3, 3>(*dataAtPts->hMat);
1062 auto t_invH =
1064 auto &det_H = *dataAtPts->detHVec;
1065
1066
1067 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
1068
1069
1070 double a = t_w * vol * det_H[gg];
1071
1073 t_F_dX(
i,
j,
k,
l) = -(t_h(
i,
m) * t_invH(
m,
k)) * t_invH(
l,
j);
1074
1075
1076 int rr = 0;
1077 for (; rr != nbRows / 3; ++rr) {
1078
1079
1080 auto t_m = get_tensor2(
K, 3 * rr, 0);
1081
1083 t_row_diff_base_pulled(
i) = t_row_diff_base(
j) * t_invH(
j,
i);
1084
1086 t_row_stress(
i) =
a * t_row_diff_base_pulled(
j) * t_cauchy_stress(
i,
j);
1087
1089 t_row_diff_base_pulled_dX(
j,
k,
l) =
1090 -(t_invH(
i,
k) * t_row_diff_base(
i)) * t_invH(
l,
j);
1091
1093 t_row_dX_stress(
i,
k,
l) =
1094 a * (t_row_diff_base_pulled_dX(
j,
k,
l) * t_cauchy_stress(
j,
i));
1095
1097 t_row_D(
l,
j,
k) = (
a * t_row_diff_base_pulled(
i)) * t_D(
i,
j,
k,
l);
1098
1100
1101
1102 t_row_stress_dX(
i,
j,
k) = 0;
1103 for (int ii = 0; ii != 3; ++ii)
1104 for (int mm = 0; mm != 3; ++mm)
1105 for (int nn = 0; nn != 3; ++nn) {
1106 auto &
v = t_row_stress_dX(ii, mm, nn);
1107 for (int kk = 0; kk != 3; ++kk)
1108 for (int ll = 0; ll != 3; ++ll)
1109 v += t_row_D(ii, kk, ll) * t_F_dX(kk, ll, mm, nn);
1110 }
1111
1112
1114
1115
1116 for (int cc = 0; cc != nbCols / 3; ++cc) {
1117
1118 t_m(
i,
k) += t_row_stress(
i) * (t_invH(
j,
k) * t_col_diff_base(
j));
1119 t_m(
i,
k) += t_row_dX_stress(
i,
k,
l) * t_col_diff_base(
l);
1120 t_m(
i,
k) += t_row_stress_dX(
i,
k,
l) * t_col_diff_base(
l);
1121
1122
1123 ++t_col_diff_base;
1124
1125
1126 ++t_m;
1127 }
1128
1129
1130 ++t_row_diff_base;
1131 }
1132
1133 for (; rr != row_nb_base_fun; ++rr)
1134 ++t_row_diff_base;
1135
1136
1137 ++t_w;
1138 ++t_D;
1139 ++t_cauchy_stress;
1140 ++t_invH;
1141 ++t_h;
1142 }
1143
1145}
1146
1147template <int S>
1148HookeElement::OpAleLhs_dX_dX<S>::OpAleLhs_dX_dX(
1149 const std::string row_field, const std::string col_field,
1150 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts)
1151 :
OpAssemble(row_field, col_field, data_at_pts, OPROWCOL, true) {}
1152
1153template <int S>
1157
1158
1159
1162 &
m(r + 0,
c + 0), &
m(r + 0,
c + 1), &
m(r + 0,
c + 2), &
m(r + 1,
c + 0),
1163 &
m(r + 1,
c + 1), &
m(r + 1,
c + 2), &
m(r + 2,
c + 0), &
m(r + 2,
c + 1),
1165 };
1166
1173
1174
1175 double vol = getVolume();
1176
1177
1178 auto t_w = getFTensor0IntegrationWeight();
1179
1180
1182 const int row_nb_base_fun = row_data.
getN().size2();
1183
1184
1185
1188 auto t_cauchy_stress =
1190 *(dataAtPts->cauchyStressMat));
1192 *(dataAtPts->smallStrainMat));
1193 auto t_eshelby_stress =
1195 *dataAtPts->eshelbyStressMat);
1196 auto t_h = getFTensor2FromMat<3, 3>(*dataAtPts->hMat);
1197 auto t_invH =
1200 auto &det_H = *dataAtPts->detHVec;
1201
1202
1203 for (int gg = 0; gg != nbIntegrationPts; ++gg) {
1204
1205
1206 double a = t_w * vol * det_H[gg];
1207
1209 t_F_dX(
i,
j,
k,
l) = -(t_h(
i,
m) * t_invH(
m,
k)) * t_invH(
l,
j);
1210
1212 t_D_strain_dX(
i,
j,
m,
n) = 0.;
1213 for (int ii = 0; ii != 3; ++ii)
1214 for (int jj = 0; jj != 3; ++jj)
1215 for (int ll = 0; ll != 3; ++ll)
1216 for (int kk = 0; kk != 3; ++kk) {
1217 auto &
v = t_D_strain_dX(ii, jj, kk, ll);
1218 for (int mm = 0; mm != 3; ++mm)
1219 for (int nn = 0; nn != 3; ++nn)
1220 v += t_D(ii, jj, mm, nn) * t_F_dX(mm, nn, kk, ll);
1221 }
1222
1224 t_eshelby_stress_dX(
i,
j,
m,
n) = t_F(
k,
i) * t_D_strain_dX(
k,
j,
m,
n);
1225
1226 for (int ii = 0; ii != 3; ++ii)
1227 for (int jj = 0; jj != 3; ++jj)
1228 for (int mm = 0; mm != 3; ++mm)
1229 for (int nn = 0; nn != 3; ++nn) {
1230 auto &
v = t_eshelby_stress_dX(ii, jj, mm, nn);
1231 for (int kk = 0; kk != 3; ++kk)
1232 v += t_F_dX(kk, ii, mm, nn) * t_cauchy_stress(kk, jj);
1233 }
1234
1235 t_eshelby_stress_dX(
i,
j,
k,
l) *= -1;
1236
1238 t_energy_dX(
k,
l) = t_F_dX(
i,
j,
k,
l) * t_cauchy_stress(
i,
j);
1239 t_energy_dX(
k,
l) +=
1240 (t_strain(
m,
n) * t_D(
m,
n,
i,
j)) * t_F_dX(
i,
j,
k,
l);
1241 t_energy_dX(
k,
l) /= 2.;
1242
1243 for (int kk = 0; kk != 3; ++kk)
1244 for (int ll = 0; ll != 3; ++ll) {
1245 auto v = t_energy_dX(kk, ll);
1246 for (int ii = 0; ii != 3; ++ii)
1247 t_eshelby_stress_dX(ii, ii, kk, ll) +=
v;
1248 }
1249
1250
1251 int rr = 0;
1252 for (; rr != nbRows / 3; ++rr) {
1253
1254
1255 auto t_m = get_tensor2(
K, 3 * rr, 0);
1256
1258 t_row_diff_base_pulled(
i) = t_row_diff_base(
j) * t_invH(
j,
i);
1259
1261 t_row_stress(
i) =
a * t_row_diff_base_pulled(
j) * t_eshelby_stress(
i,
j);
1262
1264 t_row_diff_base_pulled_dX(
j,
k,
l) =
1265 -(t_row_diff_base(
i) * t_invH(
i,
k)) * t_invH(
l,
j);
1266
1268 t_row_dX_stress(
i,
k,
l) =
1269 a * (t_row_diff_base_pulled_dX(
j,
k,
l) * t_eshelby_stress(
i,
j));
1270
1272 t_row_stress_dX(
i,
m,
n) =
1273 a * t_row_diff_base_pulled(
j) * t_eshelby_stress_dX(
i,
j,
m,
n);
1274
1275
1277
1278
1279 for (int cc = 0; cc != nbCols / 3; ++cc) {
1280
1281 t_m(
i,
k) += t_row_stress(
i) * (t_invH(
j,
k) * t_col_diff_base(
j));
1282 t_m(
i,
k) += t_row_dX_stress(
i,
k,
l) * t_col_diff_base(
l);
1283 t_m(
i,
k) += t_row_stress_dX(
i,
k,
l) * t_col_diff_base(
l);
1284
1285
1286 ++t_col_diff_base;
1287
1288
1289 ++t_m;
1290 }
1291
1292
1293 ++t_row_diff_base;
1294 }
1295
1296 for (; rr != row_nb_base_fun; ++rr)
1297 ++t_row_diff_base;
1298
1299
1300 ++t_w;
1301 ++t_D;
1302 ++t_cauchy_stress;
1303 ++t_strain;
1304 ++t_eshelby_stress;
1305 ++t_h;
1306 ++t_invH;
1307 ++t_F;
1308 }
1309
1311}
1312
1313template <int S>
1314HookeElement::OpAleLhsPre_dX_dx<S>::OpAleLhsPre_dX_dx(
1315 const std::string row_field, const std::string col_field,
1316 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts)
1318 dataAtPts(data_at_pts) {
1319 std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE], false);
1320}
1321
1322template <int S>
1323MoFEMErrorCode HookeElement::OpAleLhsPre_dX_dx<S>::doWork(
int row_side,
1324 EntityType row_type,
1327
1328 const int nb_integration_pts = row_data.
getN().size1();
1329
1330 auto get_eshelby_stress_dx = [this, nb_integration_pts]() {
1332 t_eshelby_stress_dx;
1333 dataAtPts->eshelbyStress_dx->resize(81, nb_integration_pts, false);
1334 int mm = 0;
1335 for (int ii = 0; ii != 3; ++ii)
1336 for (int jj = 0; jj != 3; ++jj)
1337 for (int kk = 0; kk != 3; ++kk)
1338 for (int ll = 0; ll != 3; ++ll)
1339 t_eshelby_stress_dx.ptr(ii, jj, kk, ll) =
1340 &(*dataAtPts->eshelbyStress_dx)(mm++, 0);
1341 return t_eshelby_stress_dx;
1342 };
1343
1344 auto t_eshelby_stress_dx = get_eshelby_stress_dx();
1345
1352
1353
1354
1357 auto t_cauchy_stress =
1359 *(dataAtPts->cauchyStressMat));
1360 auto t_invH =
1363
1364 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1365
1366 t_eshelby_stress_dx(
i,
j,
m,
n) =
1367 (t_F(
k,
i) * t_D(
k,
j,
m,
l)) * t_invH(
n,
l);
1368 for (int ii = 0; ii != 3; ++ii)
1369 for (int jj = 0; jj != 3; ++jj)
1370 for (int mm = 0; mm != 3; ++mm)
1371 for (int nn = 0; nn != 3; ++nn) {
1372 auto &
v = t_eshelby_stress_dx(ii, jj, mm, nn);
1373 v += t_invH(nn, ii) * t_cauchy_stress(mm, jj);
1374 }
1375 t_eshelby_stress_dx(
i,
j,
k,
l) *= -1;
1376
1378 t_energy_dx(
m,
n) = t_invH(
n,
j) * t_cauchy_stress(
m,
j);
1379
1380 for (int mm = 0; mm != 3; ++mm)
1381 for (int nn = 0; nn != 3; ++nn) {
1382 auto v = t_energy_dx(mm, nn);
1383 for (int ii = 0; ii != 3; ++ii)
1384 t_eshelby_stress_dx(ii, ii, mm, nn) +=
v;
1385 }
1386
1387 ++t_D;
1388 ++t_invH;
1389 ++t_cauchy_stress;
1390 ++t_eshelby_stress_dx;
1391 ++t_F;
1392 }
1393
1395}
1396
1397template <class ELEMENT>
1398HookeElement::OpPostProcHookeElement<ELEMENT>::OpPostProcHookeElement(
1399 const string row_field, boost::shared_ptr<DataAtIntegrationPts> data_at_pts,
1400 map<int, BlockData> &block_sets_ptr, moab::Interface &post_proc_mesh,
1401 std::vector<EntityHandle> &map_gauss_pts, bool is_ale, bool is_field_disp)
1403 dataAtPts(data_at_pts), blockSetsPtr(block_sets_ptr),
1404 postProcMesh(post_proc_mesh), mapGaussPts(map_gauss_pts), isALE(is_ale),
1405 isFieldDisp(is_field_disp) {}
1406
1407template <class ELEMENT>
1408MoFEMErrorCode HookeElement::OpPostProcHookeElement<ELEMENT>::doWork(
1411
1412 if (
type != MBVERTEX) {
1414 }
1415
1416 auto tensor_to_tensor = [](const auto &t1, auto &t2) {
1417 t2(0, 0) = t1(0, 0);
1418 t2(1, 1) = t1(1, 1);
1419 t2(2, 2) = t1(2, 2);
1420 t2(0, 1) = t2(1, 0) = t1(1, 0);
1421 t2(0, 2) = t2(2, 0) = t1(2, 0);
1422 t2(1, 2) = t2(2, 1) = t1(2, 1);
1423 };
1424
1425 std::array<double, 9> def_val;
1426 def_val.fill(0);
1427
1428 auto make_tag = [&](auto name, auto size) {
1430 CHKERR postProcMesh.tag_get_handle(name, size, MB_TYPE_DOUBLE,
th,
1431 MB_TAG_CREAT | MB_TAG_SPARSE,
1432 def_val.data());
1434 };
1435
1436 auto th_stress = make_tag("STRESS", 9);
1437 auto th_psi = make_tag("ENERGY", 1);
1438
1439 const int nb_integration_pts = mapGaussPts.size();
1440
1445
1446 auto t_h = getFTensor2FromMat<3, 3>(*dataAtPts->hMat);
1447 auto t_H = getFTensor2FromMat<3, 3>(*dataAtPts->HMat);
1448
1449 dataAtPts->stiffnessMat->resize(36, 1, false);
1452
1453 EntityHandle ent = this->getFEEntityHandle();
1455 EntityHandle ent_3d = ent;
1456 if (
type == MBTRI ||
type == MBQUAD) {
1458 auto &m_field = this->getPtrFE()->mField;
1459 CHKERR m_field.get_moab().get_adjacencies(&ent, 1, 3,
false, ents,
1460 moab::Interface::UNION);
1461#ifndef NDEBUG
1462 if (ents.empty())
1464 "Could not find a 3D element adjacent to a given face element");
1465#endif
1466 ent_3d = ents.front();
1467 }
1468
1469 bool found_block = false;
1470 int block_id = -1;
1471 for (
auto &
m : (blockSetsPtr)) {
1472 if (
m.second.tEts.find(ent_3d) !=
m.second.tEts.end()) {
1473 const double young =
m.second.E;
1474 const double poisson =
m.second.PoissonRatio;
1475 const double coefficient = young / ((1 + poisson) * (1 - 2 * poisson));
1476 block_id =
m.second.iD;
1477
1478 t_D(
i,
j,
k,
l) = 0.;
1479 t_D(0, 0, 0, 0) = t_D(1, 1, 1, 1) = t_D(2, 2, 2, 2) = 1 - poisson;
1480 t_D(0, 1, 0, 1) = t_D(0, 2, 0, 2) = t_D(1, 2, 1, 2) =
1481 0.5 * (1 - 2 * poisson);
1482 t_D(0, 0, 1, 1) = t_D(1, 1, 0, 0) = t_D(0, 0, 2, 2) = t_D(2, 2, 0, 0) =
1483 t_D(1, 1, 2, 2) = t_D(2, 2, 1, 1) = poisson;
1484 t_D(
i,
j,
k,
l) *= coefficient;
1485
1486 found_block = true;
1487 break;
1488 }
1489 }
1490 if (!found_block)
1492 "Element not found in any of material blocksets");
1493
1494 int def_val_int = 0;
1496 CHKERR postProcMesh.tag_get_handle(
"MAT_ELASTIC", 1, MB_TYPE_INTEGER, tag_mat,
1497 MB_TAG_CREAT | MB_TAG_SPARSE, &def_val_int);
1498 double detH = 0.;
1505
1506 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1507
1508 if (isFieldDisp) {
1509 t_h(0, 0) += 1;
1510 t_h(1, 1) += 1;
1511 t_h(2, 2) += 1;
1512 }
1513
1514 if (!isALE) {
1515 t_small_strain_symm(
i,
j) = (t_h(
i,
j) || t_h(
j,
i)) / 2.;
1516 } else {
1519 t_F(
i,
j) = t_h(
i,
k) * t_invH(
k,
j);
1520 t_small_strain_symm(
i,
j) = (t_F(
i,
j) || t_F(
j,
i)) / 2.;
1521 ++t_H;
1522 }
1523
1524 t_small_strain_symm(0, 0) -= 1;
1525 t_small_strain_symm(1, 1) -= 1;
1526 t_small_strain_symm(2, 2) -= 1;
1527
1528
1529 t_stress_symm(
i,
j) = t_D(
i,
j,
k,
l) * t_small_strain_symm(
k,
l);
1530 tensor_to_tensor(t_stress_symm, t_stress);
1531
1532 const double psi = 0.5 * t_stress_symm(
i,
j) * t_small_strain_symm(
i,
j);
1533
1534 CHKERR postProcMesh.tag_set_data(th_psi, &mapGaussPts[gg], 1, &psi);
1535 CHKERR postProcMesh.tag_set_data(th_stress, &mapGaussPts[gg], 1,
1536 &t_stress(0, 0));
1537 CHKERR postProcMesh.tag_set_data(tag_mat, &mapGaussPts[gg], 1,
1538 &block_id);
1539
1540 ++t_h;
1541 }
1542
1544}
1545
1546template <int S>
1547HookeElement::OpAnalyticalInternalStrain_dx<S>::OpAnalyticalInternalStrain_dx(
1548 const std::string row_field,
1549 boost::shared_ptr<DataAtIntegrationPts> data_at_pts,
1550 StrainFunction strain_fun)
1551 :
OpAssemble(row_field, row_field, data_at_pts, OPROW, true),
1552 strainFun(strain_fun) {}
1553
1554template <int S>
1556HookeElement::OpAnalyticalInternalStrain_dx<S>::iNtegrate(
EntData &row_data) {
1562
1565 &
v(r + 0), &
v(r + 1), &
v(r + 2));
1566 };
1567
1568 const int nb_integration_pts = getGaussPts().size2();
1569 auto t_coords = getFTensor1CoordsAtGaussPts();
1570
1571
1572 double vol = getVolume();
1573 auto t_w = getFTensor0IntegrationWeight();
1574
1575 nF.resize(nbRows, false);
1576 nF.clear();
1577
1578
1579
1582
1583
1585 const int row_nb_base_fun = row_data.
getN().size2();
1586
1587 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
1588
1589 auto t_fun_strain = strainFun(t_coords);
1591 t_stress(
i,
j) = -t_D(
i,
j,
k,
l) * t_fun_strain(
k,
l);
1592
1593
1594 double a = t_w * vol;
1595
1596 auto t_nf = get_tensor1(nF, 0);
1597
1598 int rr = 0;
1599 for (; rr != nbRows / 3; ++rr) {
1600 t_nf(
i) +=
a * t_row_diff_base(
j) * t_stress(
i,
j);
1601 ++t_row_diff_base;
1602 ++t_nf;
1603 }
1604
1605 for (; rr != row_nb_base_fun; ++rr)
1606 ++t_row_diff_base;
1607
1608 ++t_w;
1609 ++t_coords;
1610 ++t_D;
1611 }
1612
1614}
1615
1616template <int S>
1617HookeElement::OpAnalyticalInternalAleStrain_dX<S>::
1618 OpAnalyticalInternalAleStrain_dX(
1619 const std::string row_field,
1620 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts,
1621 StrainFunction strain_fun,
1622 boost::shared_ptr<MatrixDouble> mat_pos_at_pts_ptr)
1623 :
OpAssemble(row_field, row_field, data_at_pts, OPROW, true),
1624 strainFun(strain_fun), matPosAtPtsPtr(mat_pos_at_pts_ptr) {}
1625
1626template <int S>
1627MoFEMErrorCode HookeElement::OpAnalyticalInternalAleStrain_dX<S>::iNtegrate(
1634
1637 &
v(r + 0), &
v(r + 1), &
v(r + 2));
1638 };
1639
1640 const int nb_integration_pts = getGaussPts().size2();
1641
1642 auto get_coords = [&]() {
1643 return getFTensor1FromMat<3>(*matPosAtPtsPtr);
1644 };
1645 auto t_coords = get_coords();
1646
1647
1648 double vol = getVolume();
1649 auto t_w = getFTensor0IntegrationWeight();
1650
1651 nF.resize(nbRows, false);
1652 nF.clear();
1653
1654
1655
1659 *(dataAtPts->FMat));
1660 auto &det_H = *dataAtPts->detHVec;
1661 auto t_invH =
1663
1664
1666 const int row_nb_base_fun = row_data.
getN().size2();
1667
1668 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
1669
1670 auto t_fun_strain = strainFun(t_coords);
1672 t_stress(
i,
j) = -t_D(
i,
j,
k,
l) * t_fun_strain(
k,
l);
1674 t_eshelby_stress(
i,
j) = -t_F(
k,
i) * t_stress(
k,
j);
1675
1676
1677 double a = t_w * vol * det_H[gg];
1678
1679 auto t_nf = get_tensor1(nF, 0);
1680
1681 int rr = 0;
1682 for (; rr != nbRows / 3; ++rr) {
1684 t_row_diff_base_pulled(
i) = t_row_diff_base(
j) * t_invH(
j,
i);
1685 t_nf(
i) +=
a * t_row_diff_base_pulled(
j) * t_eshelby_stress(
i,
j);
1686 ++t_row_diff_base;
1687 ++t_nf;
1688 }
1689
1690 for (; rr != row_nb_base_fun; ++rr)
1691 ++t_row_diff_base;
1692
1693 ++t_w;
1694 ++t_coords;
1695 ++t_F;
1696 ++t_invH;
1697 ++t_D;
1698 }
1699
1701}
1702
1703template <int S>
1704HookeElement::OpAnalyticalInternalAleStrain_dx<S>::
1705 OpAnalyticalInternalAleStrain_dx(
1706 const std::string row_field,
1707 boost::shared_ptr<DataAtIntegrationPts> &data_at_pts,
1708 StrainFunction strain_fun,
1709 boost::shared_ptr<MatrixDouble> mat_pos_at_pts_ptr)
1710 :
OpAssemble(row_field, row_field, data_at_pts, OPROW, true),
1711 strainFun(strain_fun), matPosAtPtsPtr(mat_pos_at_pts_ptr) {}
1712
1713template <int S>
1714MoFEMErrorCode HookeElement::OpAnalyticalInternalAleStrain_dx<S>::iNtegrate(
1721
1724 &
v(r + 0), &
v(r + 1), &
v(r + 2));
1725 };
1726
1727 const int nb_integration_pts = getGaussPts().size2();
1728
1729 auto get_coords = [&]() {
1730 return getFTensor1FromMat<3>(*matPosAtPtsPtr);
1731 };
1732 auto t_coords = get_coords();
1733
1734
1735 double vol = getVolume();
1736 auto t_w = getFTensor0IntegrationWeight();
1737
1738 nF.resize(nbRows, false);
1739 nF.clear();
1740
1741
1742
1745 auto &det_H = *dataAtPts->detHVec;
1746 auto t_invH =
1748
1749
1751 const int row_nb_base_fun = row_data.
getN().size2();
1752
1753 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
1754
1755 auto t_fun_strain = strainFun(t_coords);
1757 t_stress(
i,
j) = -t_D(
i,
j,
k,
l) * t_fun_strain(
k,
l);
1758
1759
1760 double a = t_w * vol * det_H[gg];
1761
1762 auto t_nf = get_tensor1(nF, 0);
1763
1764 int rr = 0;
1765 for (; rr != nbRows / 3; ++rr) {
1767 t_row_diff_base_pulled(
i) = t_row_diff_base(
j) * t_invH(
j,
i);
1768 t_nf(
i) +=
a * t_row_diff_base_pulled(
j) * t_stress(
i,
j);
1769 ++t_row_diff_base;
1770 ++t_nf;
1771 }
1772
1773 for (; rr != row_nb_base_fun; ++rr)
1774 ++t_row_diff_base;
1775
1776 ++t_w;
1777 ++t_coords;
1778 ++t_invH;
1779 ++t_D;
1780 }
1781
1783}
1784
1785#endif
static MoFEMErrorCode addElasticElement(MoFEM::Interface &m_field, boost::shared_ptr< map< int, BlockData > > &block_sets_ptr, const std::string element_name, const std::string x_field, const std::string X_field, const bool ale)
static MoFEMErrorCode setOperators(boost::shared_ptr< ForcesAndSourcesCore > fe_lhs_ptr, boost::shared_ptr< ForcesAndSourcesCore > fe_rhs_ptr, boost::shared_ptr< map< int, BlockData > > block_sets_ptr, const std::string x_field, const std::string X_field, const bool ale, const bool field_disp, const EntityType type=MBTET, boost::shared_ptr< DataAtIntegrationPts > data_at_pts=nullptr)
static MoFEMErrorCode setBlocks(MoFEM::Interface &m_field, boost::shared_ptr< map< int, BlockData > > &block_sets_ptr)
static MoFEMErrorCode calculateEnergy(DM dm, boost::shared_ptr< map< int, BlockData > > block_sets_ptr, const std::string x_field, const std::string X_field, const bool ale, const bool field_disp, SmartPetscObj< Vec > &v_energy_ptr)
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#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 c
speed of light (cm/ns)
const double v
phase velocity of light in medium (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasVector< int > VectorInt
auto type_from_handle(const EntityHandle h)
get type from entity handle
auto getFTensor2FromMat(M &data)
Get tensor rank 2 (matrix) form data matrix.
static auto getFTensor2SymmetricFromMat(M &data)
Get symmetric tensor rank 2 (matrix) form data matrix.
MoFEMErrorCode invertTensor3by3(ublas::matrix< T, L, A > &jac_data, ublas::vector< T, A > &det_data, ublas::matrix< T, L, A > &inv_jac_data)
Calculate inverse of tensor rank 2 at integration points.
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
FTensor::Index< 'm', 3 > m
data for calculation inertia forces
Range tEts
elements in block set
double rho0
reference density
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
auto getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
@ OPROWCOL
operator doWork is executed on FE rows &columns
intrusive_ptr for managing petsc objects
Volume finite element base.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntData &row_data)
Operator for linear form, usually to calculate values on right hand side.
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrate tangent stiffness for material momentum.
boost::shared_ptr< VectorDouble > rhoAtGaussPtsPtr
boost::shared_ptr< MatrixDouble > rhoGradAtGaussPtsPtr
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrate tangent stiffness for spatial momentum.
boost::shared_ptr< VectorDouble > rhoAtGaussPtsPtr
boost::shared_ptr< MatrixDouble > rhoGradAtGaussPtsPtr
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrate tangent stiffness for material momentum.
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrate tangent stiffness for material momentum.
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrate tangent stiffness for spatial momentum.
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrate B^T D B operator.
MoFEMErrorCode iNtegrate(EntData &row_data)
MoFEMErrorCode iNtegrate(EntData &row_data)
MoFEMErrorCode iNtegrate(EntData &row_data)
boost::shared_ptr< MatrixDouble > matPosAtPtsPtr
boost::function< FTensor::Tensor2_symmetric< double, 3 >(FTensor::Tensor1< FTensor::PackPtr< double *, 1 >, 3 > &t_coords) > StrainFunction
boost::shared_ptr< MatrixDouble > matPosAtPtsPtr
MoFEMErrorCode iNtegrate(EntData &row_data)
boost::function< FTensor::Tensor2_symmetric< double, 3 >(FTensor::Tensor1< FTensor::PackPtr< double *, 1 >, 3 > &t_coords) > StrainFunction
boost::function< FTensor::Tensor2_symmetric< double, 3 >(FTensor::Tensor1< FTensor::PackPtr< double *, 3 >, 3 > &t_coords) > StrainFunction
MoFEMErrorCode iNtegrate(EntData &row_data)
int nbCols
number if dof on column
virtual MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
bool isDiag
true if this block is on diagonal
MoFEMErrorCode aSsemble(EntData &row_data, EntData &col_data)
Assemble local entity block matrix.
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
Do calculations for give operator.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
int nbIntegrationPts
number of integration points
int nbRows
number of dofs on rows
SmartPetscObj< Vec > ghostVec
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntData &row_data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntData &row_data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntData &row_data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< map< int, BlockData > > blockSetsPtr
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
Assemble mass matrix for elastic element TODO: CHANGE FORMULA *.
PetscErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
boost::shared_ptr< DataAtIntegrationPts > commonData
const double rHo0
p_0 reference density in E(p) = E * (p / p_0)^n
boost::shared_ptr< map< int, BlockData > > blockSetsPtr
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
boost::shared_ptr< VectorDouble > rhoAtGaussPtsPtr
const double rhoN
exponent n in E(p) = E * (p / p_0)^n
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntData &row_data)
Operator for linear form, usually to calculate values on right hand side.
MoFEMErrorCode iNtegrate(EntData &row_data, EntData &col_data)
Integrate B^T D B operator.
std::vector< EntityHandle > & mapGaussPts
map< int, BlockData > & blockSetsPtr
moab::Interface & postProcMesh
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
MoFEMErrorCode iNtegrate(EntData &row_data)