19template <
typename AssembleOp>
25 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
26 boost::shared_ptr<TopologicalData> topo_ptr,
27 boost::shared_ptr<double> J_ptr, SmartPetscObj<Vec> assemble_vec,
34 if (
type == MBVERTEX) {
41 double *vec_ptr = OP::nF.data().data();
43 int *ind_ptr = data.
getIndices().data().data();
48 std::vector<EntityHandle> ents(field_ents.size());
49 std::transform(field_ents.begin(), field_ents.end(), ents.begin(),
50 [](
const auto *fe) { return fe->getEnt(); });
51 if (field_ents.empty())
53 if (type_from_handle(ents[0]) != MBVERTEX)
55 auto &moab = OP::getMoab();
56 VectorDouble topo_values(OP::nF.size());
58 topo_values.data().data());
59 noalias(topo_values) += OP::nF;
61 OP::nF.data().data());
68 boost::shared_ptr<double>
JPtr;
88 :
public FormsIntegrators<FaceUserDataOperator>::Assembly<A>
::OpBrokenBase {
90 using OP =
typename FormsIntegrators<FaceUserDataOperator>::Assembly<
94 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
95 boost::shared_ptr<TopologicalData> topo_ptr,
96 boost::shared_ptr<double> J_ptr,
97 SmartPetscObj<Vec> assemble_vec,
99 boost::shared_ptr<Range> ents_ptr =
nullptr)
100 :
OP(broken_base_side_data, ents_ptr),
JPtr(J_ptr),
107 double *vec_ptr = OP::locF.data().data();
109 int *ind_ptr = data.
getIndices().data().data();
114 std::vector<EntityHandle> ents(field_ents.size());
115 std::transform(field_ents.begin(), field_ents.end(), ents.begin(),
116 [](
const auto *fe) { return fe->getEnt(); });
117 if (field_ents.empty())
119 if (type_from_handle(ents[0]) != MBVERTEX)
121 auto &moab = getMoab();
122 VectorDouble topo_values(OP::locF.size());
124 topo_values.data().data());
125 topo_values += OP::locF;
127 OP::locF.data().data());
133 boost::shared_ptr<double>
JPtr;
141 OpAssembleVolumeTopologicalDerivativeImpl;
148 OpAssembleVolumeTopologicalDerivativeImpl;
155 OpAssembleVolumeTopologicalDerivativeImpl;
162 OpAssembleVolumeTopologicalDerivativeImpl;
169 OpAssembleFaceTopologicalDerivativeImpl;
177 OpAssembleBrokenFaceTopologicalDerivativeImplBase;
185 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_disp_data_ptr,
186 boost::shared_ptr<MatrixDouble> hybrid_disp_ptr,
187 boost::shared_ptr<MatrixDouble> var_hybrid_disp_ptr,
188 boost::shared_ptr<TopologicalData> topo_ptr,
const double alpha_tau,
189 SmartPetscObj<Vec> vec, boost::shared_ptr<double> J_ptr =
nullptr,
208 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_side_data_ptr,
209 boost::shared_ptr<BcDispVec> bc_disp_ptr,
210 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
211 boost::shared_ptr<TopologicalData> topo_ptr, SmartPetscObj<Vec> vec,
212 boost::shared_ptr<double> J_ptr =
nullptr,
Tag tag =
Tag())
226template <
typename OP_PTR>
228 OP_PTR op_ptr,
const std::string &block_name) {
230 auto nb_gauss_pts = op_ptr->getGaussPts().size2();
232 auto ts_time = op_ptr->getTStime();
233 auto ts_time_step = op_ptr->getTStimeStep();
240 MatrixDouble m_ref_coords = op_ptr->getCoordsAtGaussPts();
241 MatrixDouble m_ref_normals = op_ptr->getNormalsAtGaussPts();
243 auto v_analytical_expr =
245 m_ref_coords, m_ref_normals, block_name);
247 if (PetscUnlikely(!v_analytical_expr.size2())) {
249 "Analytical expression is empty or does not exist, "
250 "check python file");
253 return v_analytical_expr;
259 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_side_data_ptr,
260 boost::shared_ptr<AnalyticalDisplacementBcVec> bc_disp_ptr,
261 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
262 boost::shared_ptr<TopologicalData> topo_ptr, SmartPetscObj<Vec> vec,
263 boost::shared_ptr<double> J_ptr =
nullptr,
Tag tag =
Tag())
273 boost::shared_ptr<AnalyticalDisplacementBcVec>
bcDispPtr;
280 std::string
field_name, boost::shared_ptr<TractionBcVec> bc_data,
281 boost::shared_ptr<MatrixDouble> lambda_hybrid_ptr,
282 boost::shared_ptr<TopologicalData> topo_ptr,
283 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
284 SmartPetscObj<Vec> vec, boost::shared_ptr<double> J_ptr =
nullptr,
304 boost::shared_ptr<AnalyticalTractionBcVec> bc_data,
305 boost::shared_ptr<MatrixDouble> lambda_hybrid_ptr,
306 boost::shared_ptr<TopologicalData> topo_ptr,
307 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
308 SmartPetscObj<Vec> vec, boost::shared_ptr<double> J_ptr =
nullptr,
318 boost::shared_ptr<AnalyticalTractionBcVec>
bcData;
326 OpAssembleVolumeTopologicalDerivativeImpl;
333 OpAssembleVolumeTopologicalDerivativeImpl;
339 :
public ForcesAndSourcesCore::UserDataOperator {
340 using OP = ForcesAndSourcesCore::UserDataOperator;
343 boost::shared_ptr<DataAtIntegrationPts> data_at_pts_ptr,
344 boost::shared_ptr<TopologicalData> topo_p,
345 boost::shared_ptr<ObjectiveFunctionData> python_ptr,
370 "DataAtIntegrationPts pointer is null");
373 "Topological data pointer is null");
376 const int nb_gauss_pts = getGaussPts().size2();
380 auto stress_full_ptr = boost::make_shared<MatrixDouble>();
381 auto get_stress_full =
383 DL>::size(*stress_full_ptr, nb_gauss_pts);
384 stress_full_ptr->clear();
385 auto strain_full_ptr = boost::make_shared<MatrixDouble>();
386 auto get_strain_full =
388 DL>::size(*strain_full_ptr, nb_gauss_pts);
389 strain_full_ptr->clear();
391 auto t_stress = get_stress_full();
392 auto t_strain = get_strain_full();
394 auto t_biot =
dataAtPts->getFTensorAdjointPdstretch(nb_gauss_pts);
395 auto t_u =
dataAtPts->getFTensorStretch(nb_gauss_pts);
406 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
409 t_stress(
i,
j) = t_biot(
i,
j);
410 t_strain(
i,
j) = t_u(
i,
j);
414 auto evaluate_python_objective = [&]() {
418 "ObjectiveFunctionData pointer is null");
420 auto &coords = OP::getCoordsAtGaussPts();
422 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
425 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
426 topoData->getObjDStrainAtPts(),
false);
428 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
429 topoData->getObjDDisplacementAtPts(),
false);
431 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
432 topoData->getObjDStressAtPts(),
false);
436 auto evaluate_energy_of_hencky_model = [&]() {
439 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
440 *
topoData->getObjDDisplacementAtPts(), nb_gauss_pts);
441 topoData->getObjDDisplacementAtPts()->clear();
443 DL>::size(*
topoData->getObjDStressAtPts(), nb_gauss_pts);
444 topoData->getObjDStressAtPts()->clear();
445 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
446 *
topoData->getObjDRotationAtPts(), nb_gauss_pts);
448 auto eval_evergy = [&](
auto &&t_D) {
450 MatrixSizeHelper<GetFTensor1FromMatType<1, -1,
DL>,
DL>::size(
451 *
topoData->getObjAtPts(), nb_gauss_pts);
452 auto get_dstrain_obj =
456 auto t_obj = get_obj();
457 auto t_dstrain_obj = get_dstrain_obj();
458 auto t_log_u =
dataAtPts->getFTensorLogStretchTotal(nb_gauss_pts);
459 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
460 t_obj(0) = 0.5 * (t_log_u(
i,
j) * t_D(
i,
j,
k,
l) * t_log_u(
k,
l));
461 t_dstrain_obj(
i,
j) = t_D(
i,
j,
k,
l) * t_log_u(
k,
l);
471 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matD));
473 eval_evergy(getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matD));
476 topoData->getObjDRotationAtPts()->clear();
480 auto evaluate_energy_of_hencky_model_nostreach = [&]() {
483 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
484 *
topoData->getObjDDisplacementAtPts(), nb_gauss_pts);
485 topoData->getObjDDisplacementAtPts()->clear();
487 DL>::size(*
topoData->getObjDStrainAtPts(), nb_gauss_pts);
488 topoData->getObjDStrainAtPts()->clear();
489 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
490 *
topoData->getObjDRotationAtPts(), nb_gauss_pts);
491 topoData->getObjDRotationAtPts()->clear();
493 auto eval_evergy = [&](
auto &&t_inv_D) {
495 MatrixSizeHelper<GetFTensor1FromMatType<1, -1,
DL>,
DL>::size(
496 *
topoData->getObjAtPts(), nb_gauss_pts);
497 auto get_dstress_obj =
501 auto t_obj = get_obj();
502 auto t_dstress_obj = get_dstress_obj();
503 auto t_stress =
dataAtPts->getFTensorAdjointPdstretch(nb_gauss_pts);
504 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
506 0.5 * (t_stress(
i,
j) * t_inv_D(
i,
j,
k,
l) * t_stress(
k,
l));
507 t_dstress_obj(
i,
j) = t_inv_D(
i,
j,
k,
l) * t_stress(
k,
l);
517 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matInvD));
520 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matInvD));
525 auto conversion_of_biot_stress = [&]() {
529 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
530 *
topoData->getObjDRotationAtPts(), nb_gauss_pts);
531 topoData->getObjDRotationAtPts()->clear();
533 auto t_obj_dbiot =
topoData->getFTensorObjDStress(nb_gauss_pts);
534 auto t_obj_domega =
topoData->getFTensorObjDRotation(nb_gauss_pts);
535 auto t_R =
dataAtPts->getFTensorRotMat(nb_gauss_pts);
536 auto t_P =
dataAtPts->getFTensorApproxP(nb_gauss_pts);
537 auto t_grad_h1 =
dataAtPts->getFTensorSmallWGradH1(nb_gauss_pts);
538 auto t_omega =
dataAtPts->getFTensorRotAxis(nb_gauss_pts);
547 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
549 t_dJ_dbiot(
l, o) = t_obj_dbiot(
l, o);
555 t_obj_dbiot(
i,
k) = t_dJ_dbiot(
i,
k);
567 "rotationSelector not handled");
571 t_obj_dbiot(
i,
k) = t_R(
i,
l) * t_dJ_dbiot(
l,
k);
572 t_obj_domega(
m) = t_dJ_dbiot(
l,
k) * t_diff_R(
i,
l,
m) * t_P(
i,
k);
577 t_h1(o,
k) =
t_kd(o,
k) + t_grad_h1(o,
k);
582 t_diff_R(
i,
l,
m) = levi_civita(
i,
l,
m);
590 "rotationSelector not handled");
594 t_obj_dbiot(
i,
k) = t_R(
i,
l) * (t_dJ_dbiot(
l, o) * t_h1(o,
k));
596 t_dJ_dbiot(
l, o) * (t_diff_R(
i,
l,
m) * t_P(
i,
k)) * t_h1(o,
k);
600 "gradApproximator not handled");
614 auto conversion_of_stretch = [&]() {
618 auto t_obj_dstretch =
topoData->getFTensorObjDStrain(nb_gauss_pts);
619 auto t_diff_stretch =
dataAtPts->getFTensorDiffStretch(nb_gauss_pts);
626 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
628 t_dJ_dstretch(
i,
j) = t_obj_dstretch(
i,
j);
630 t_obj_dstretch(
k,
l) = t_dJ_dstretch(
i,
j) * t_diff_stretch(
i,
j,
k,
l);
639 auto conversion_of_stretch_to_stress_for_no_stretch = [&](
auto t_inv_D) {
643 auto t_obj_dstress =
topoData->getFTensorObjDStress(nb_gauss_pts);
644 auto t_obj_dstretch =
topoData->getFTensorObjDStrain(nb_gauss_pts);
651 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
653 t_dstretch_dstress(
i,
j) =
654 ((t_obj_dstretch(
k,
l) || t_obj_dstretch(
l,
k)) / 2.) *
657 t_obj_dstress(
i,
j) += t_dstretch_dstress(
i,
j);
669 CHKERR evaluate_python_objective();
670 CHKERR conversion_of_biot_stress();
673 CHKERR conversion_of_stretch_to_stress_for_no_stretch(
674 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matInvD));
676 CHKERR conversion_of_stretch_to_stress_for_no_stretch(
677 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matInvD));
680 CHKERR conversion_of_stretch();
685 CHKERR evaluate_energy_of_hencky_model_nostreach();
686 CHKERR conversion_of_biot_stress();
688 CHKERR evaluate_energy_of_hencky_model();
693 "Objective model type not handled");
706 "Topological data pointer is null");
713 const int nb_integration_pts =
getGaussPts().size2();
717 auto t_obj =
topoData->getFTensorObj(nb_integration_pts);
718 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
719 auto t_obj_dStrain =
topoData->getFTensorObjDStrain(nb_integration_pts);
720 auto t_obj_dU =
topoData->getFTensorObjDDisplacement(nb_integration_pts);
721 auto t_P =
dataAtPts->getFTensorApproxP(nb_integration_pts);
722 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
723 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
724 auto t_jac =
topoData->getFTensorJacobian(nb_integration_pts);
741 auto get_ftensor1 = [](
auto &
v) {
743 &
v[0], &
v[1], &
v[2]);
748 const int nb_base_functions = data.
getN().size2();
750 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
751 locJ += (t_w *
v * t_det) * t_obj;
754 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
764 t_inv_jac(
I,
J) * t_jac(
j,
k) * t_P(
i,
k));
766 auto t_nf = get_ftensor1(
nF);
768 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
769 t_nf(
i) += (t_w *
v) * t_dJ_dX(
i,
j) * t_base_diff(
j);
773 for (; bb != nb_base_functions; ++bb)
788 "Topological data pointer is null");
795 const int nb_integration_pts = data.
getN().size1();
799 const int nb_base_functions = data.
getN().size2() /
SPACE_DIM;
805 auto get_ftensor1 = [](
auto &
v) {
807 &
v[0], &
v[1], &
v[2]);
810 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
812 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
813 const double a =
v * t_w;
814 auto t_nf = get_ftensor1(
nF);
817 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
818 t_nf(
i) +=
a * t_row_base_fun(
j) * t_obj_dP(
i,
j);
822 for (; bb != nb_base_functions; ++bb)
838 "Topological data pointer is null");
845 const int nb_integration_pts = data.
getN().size1();
851 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
856 auto get_ftensor0 = [](
auto &
v) {
860 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
861 const double a =
v * t_w;
862 auto t_nf = get_ftensor0(
nF);
865 for (; bb != nb_dofs; ++bb) {
866 t_nf +=
a * t_row_base_fun(
i,
j) * t_obj_dP(
i,
j);
870 for (; bb != nb_base_functions; ++bb)
886 "Topological data pointer is null");
893 const int nb_integration_pts = data.
getN().size1();
897 const int nb_base_functions = data.
getN().size2();
899 auto t_obj_dw =
topoData->getFTensorObjDDisplacement(nb_integration_pts);
903 auto get_ftensor1 = [](
auto &
v) {
905 &
v[0], &
v[1], &
v[2]);
908 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
909 const double a =
v * t_w;
910 auto t_nf = get_ftensor1(
nF);
913 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
914 t_nf(
i) +=
a * t_row_base_fun * t_obj_dw(
i);
918 for (; bb != nb_base_functions; ++bb)
934 "Topological data pointer is null");
941 const int nb_integration_pts = data.
getN().size1();
945 const int nb_base_functions = data.
getN().size2();
947 auto t_obj_domega =
topoData->getFTensorObjDRotation(nb_integration_pts);
951 auto get_ftensor1 = [](
auto &
v) {
953 &
v[0], &
v[1], &
v[2]);
956 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
957 const double a =
v * t_w;
958 auto t_nf = get_ftensor1(
nF);
961 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
962 t_nf(
i) +=
a * t_row_base_fun * t_obj_domega(
i);
966 for (; bb != nb_base_functions; ++bb)
982 "Topological data pointer is null");
989 const int nb_integration_pts = data.
getN().size1();
991 auto t_w = getFTensor0IntegrationWeight();
992 const int nb_base_functions = data.
getN().size2();
994 auto t_obj_du_gamma =
995 topoData->getFTensorObjDDisplacement(nb_integration_pts);
999 auto get_ftensor1 = [](
auto &
v) {
1001 &
v[0], &
v[1], &
v[2]);
1004 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1005 const double a = t_w * getMeasure();
1006 auto t_nf = get_ftensor1(
nF);
1009 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1010 t_nf(
i) +=
a * t_row_base_fun * t_obj_du_gamma(
i);
1014 for (; bb != nb_base_functions; ++bb)
1030 "Topological data pointer is null");
1033 const int nb_dofs = data.
getIndices().size();
1037 const int nb_integration_pts = OP::getGaussPts().size2();
1039 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1040 auto t_w = OP::getFTensor0IntegrationWeight();
1041 const int nb_base_functions = data.
getN().size2() /
SPACE_DIM;
1043 auto t_obj_dtraction =
1044 topoData->getFTensorObjDDisplacement(nb_integration_pts);
1049 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1050 auto t_nf = getFTensor1FromPtr<SPACE_DIM>(&*OP::locF.begin());
1052 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1054 t_w * (t_row_base_fun(
j) * t_normal(
j)) * t_obj_dtraction(
i) * 0.5;
1058 for (; bb != nb_base_functions; ++bb)
1077 "Topological data pointer is null");
1080 "Broken displacement data pointer is null");
1083 "Hybrid displacement pointer is null");
1086 "Adjoint hybrid displacement pointer is null");
1089 const int nb_dofs = data.
getIndices().size();
1093 const int nb_integration_pts = getGaussPts().size2();
1094 const int nb_base_functions = data.
getN().size2();
1097 if (this->
nF.size() != nb_dofs)
1099 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1100 if (data.
getDiffN().size1() != nb_integration_pts)
1102 "Differential of base functions should have the same number of "
1103 "integration points as the data");
1104 if (data.
getDiffN().size2() != nb_base_functions * 2)
1106 "Differential of base functions should have the same number of "
1107 "base functions as the data");
1114 auto &coords = getCoords();
1117 const double h = std::get<2>(Tools::getTricircumcenter3d(coords.data().data()));
1119 auto t_w = getFTensor0IntegrationWeight();
1120 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1121 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1122 auto t_u_hybrid = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(*hybridDispPtr);
1123 auto t_var_u_hybrid =
1124 getFTensor1FromMat<
SPACE_DIM, -1,
DL>(*varHybridDispPtr);
1127 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1132 double area = std::sqrt(t_normal(
i) * t_normal(
i));
1134 t_da(
i) = t_normal(
i) / area;
1138 double tau_density = 0;
1141 getFTensor1FromMat<
SPACE_DIM, -1,
DL>(bd.getFlux(), nb_integration_pts);
1142 auto t_var_u_broken = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(
1143 bd.getVarFlux(), nb_integration_pts);
1144 for (
int ss = 0; ss != gg; ++ss) {
1152 const double hybrid_hybrid = t_var_u_hybrid(
i) * t_u_hybrid(
i);
1153 const double broken_broken = t_var_u_broken(
i) * t_u_broken(
i);
1154 const double hybrid_broken = -t_var_u_hybrid(
i) * t_u_broken(
i);
1155 const double broken_hybrid = -t_var_u_broken(
i) * t_u_hybrid(
i);
1157 hybrid_hybrid + broken_broken + hybrid_broken + broken_hybrid;
1161 locJ += t_w * tau * area * tau_density;
1163 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1165 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1172 t_w *
alphaTau * tau_density * (t_da(
i) * t_normal_dX(
i,
I)) /
h;
1176 for (; rr != nb_base_functions; ++rr)
1196 "Broken side data pointer is null");
1200 const int nb_dofs = data.
getIndices().size();
1204 const int nb_integration_pts = getGaussPts().size2();
1205 const int nb_base_functions = data.
getN().size2();
1207 if (data.
getDiffN().size1() != nb_integration_pts)
1209 "Differential of base functions should have the same number of "
1210 "integration points as the data");
1211 if (data.
getDiffN().size2() != nb_base_functions * 2)
1213 "Differential of base functions should have the same number of "
1214 "base functions as the data");
1216 double time = getFEMethod()->ts_t;
1227 if (bc.faces.find(fe_ent) == bc.faces.end())
1235 <<
"No scaling method found for " << bc.blockName;
1243 auto t_w = getFTensor0IntegrationWeight();
1244 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1245 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1247 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1250 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1251 const double a = 0.5 * bd.getSense() * t_w;
1257 locJ +=
a * t_bc_disp(
i) * (t_var_flux(
i,
j) * t_normal(
j));
1259 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1261 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1269 for (; bb != nb_base_functions; ++bb)
1293 "Broken side data pointer is null");
1296 const int nb_dofs = data.
getIndices().size();
1300 const int nb_integration_pts = getGaussPts().size2();
1301 const int nb_base_functions = data.
getN().size2();
1303 if (data.
getDiffN().size1() != nb_integration_pts)
1305 "Differential of base functions should have the same number of "
1306 "integration points as the data");
1307 if (data.
getDiffN().size2() != nb_base_functions * 2)
1309 "Differential of base functions should have the same number of "
1310 "base functions as the data");
1318 if (bc.faces.find(fe_ent) == bc.faces.end())
1321 auto v_analytical_expr =
1325 auto t_w = getFTensor0IntegrationWeight();
1326 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1327 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1329 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1332 getFTensor1FromMat<
SPACE_DIM, -1,
DL>(v_analytical_expr);
1334 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1335 const double a = 0.5 * bd.getSense() * t_w;
1341 locJ +=
a * t_bc_disp(
i) * (t_var_flux(
i,
j) * t_normal(
j));
1343 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1345 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1353 for (; bb != nb_base_functions; ++bb)
1378 int nb_integration_pts = getGaussPts().size2();
1379 int nb_base_functions = data.
getN().size2();
1381 double time = getFEMethod()->ts_t;
1387 if (this->
nF.size() != nb_dofs)
1389 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1392 auto integrate_rhs = [&](
auto &bc,
auto calc_tau,
double time_scale) {
1395 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1397 auto t_w = getFTensor0IntegrationWeight();
1398 auto t_coords = getFTensor1CoordsAtGaussPts();
1401 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1402 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1404 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1410 double a = sqrt(t_normal(
i) * t_normal(
i));
1412 t_da(
i) = t_normal(
i) /
a;
1416 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1417 locJ -= (time_scale * t_w *
a * tau) * (t_val(
i) * t_var_u_gamma(
i));
1419 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1421 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1426 t_nf(
I) -= (time_scale * t_w * tau) * (t_val(
i) * t_var_u_gamma(
i)) *
1427 (t_da(
i) * t_normal_dX(
i,
I));
1431 for (; rr != nb_base_functions; ++rr)
1446 for (
auto &bc : *(
bcData)) {
1447 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1449 double time_scale = 1;
1455 if (std::regex_match(bc.blockName, std::regex(
".*COOK.*"))) {
1459 return -y * (y - 1) / 0.25;
1461 CHKERR integrate_rhs(bc, calc_tau, time_scale);
1464 bc, [](
double,
double,
double) {
return 1; }, time_scale);
1486 int nb_integration_pts = getGaussPts().size2();
1487 int nb_base_functions = data.
getN().size2();
1490 if (this->
nF.size() != nb_dofs)
1492 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1495 auto integrate_rhs = [&](
auto &bc) {
1498 auto v_analytical_expr =
1501 auto t_val = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(v_analytical_expr);
1503 auto t_w = getFTensor0IntegrationWeight();
1506 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1507 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1509 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1515 double a = sqrt(t_normal(
i) * t_normal(
i));
1517 t_da(
i) = t_normal(
i) /
a;
1521 locJ -= (t_w *
a) * (t_val(
i) * t_var_u_gamma(
i));
1523 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1525 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1530 t_nf(
I) -= t_w * (t_val(
i) * t_var_u_gamma(
i)) *
1531 (t_da(
i) * t_normal_dX(
i,
I));
1535 for (; rr != nb_base_functions; ++rr)
1549 for (
auto &bc : *(
bcData)) {
1550 if (bc.faces.find(fe_ent) != bc.faces.end() && nb_dofs) {
1551 CHKERR integrate_rhs(bc);
1564 "Topological data pointer is null");
1567 const int nb_dofs = data.
getIndices().size();
1571 const int nb_integration_pts = data.
getN().size1();
1575 const int nb_base_functions = data.
getN().size2();
1578 auto t_obj_dlog_stretch =
topoData->getFTensorObjDStrain(nb_integration_pts);
1585 auto get_ftensor1 = [](
auto &
v) {
1587 &
v[0], &
v[1], &
v[2], &
v[3], &
v[4], &
v[5]);
1590 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1591 const double a =
v * t_w;
1592 auto t_nf = get_ftensor1(
OP::nF);
1595 t_obj_dU(L) = t_obj_dlog_stretch(
i,
j) * t_L(
i,
j, L);
1598 for (; bb != nb_dofs /
size_symm; ++bb) {
1599 t_nf(L) +=
a * t_row_base_fun * t_obj_dU(L);
1603 for (; bb != nb_base_functions; ++bb)
1607 ++t_obj_dlog_stretch;
1617 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1618 boost::shared_ptr<TopologicalData> topo_ptr,
1619 SmartPetscObj<Vec> assemble_vec,
const double alpha,
const double rho,
1620 const double alpha_omega = 0, boost::shared_ptr<double> J_ptr =
nullptr)
1622 field_name, data_ptr, topo_ptr, J_ptr, assemble_vec,
Tag()),
1630 "L2 user base scale is set to %d, current inplementation only "
1631 "hanlde case for false",
1639 "DataAtIntegrationPts pointer is null");
1642 const int nb_dofs = data.
getIndices().size();
1646 const int nb_integration_pts =
getGaussPts().size2();
1651 auto t_div_P =
dataAtPts->getFTensorDivP(nb_integration_pts);
1652 auto t_var_w =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
1654 auto t_approx_P =
dataAtPts->getFTensorApproxP(nb_integration_pts);
1655 auto t_omega =
dataAtPts->getFTensorRotAxis(nb_integration_pts);
1656 auto t_u_h1 =
dataAtPts->getFTensorStretchH1(nb_integration_pts);
1657 auto t_var_omega =
dataAtPts->getFTensorVarRotAxis(nb_integration_pts);
1659 auto t_h =
dataAtPts->getFTensorSmallH(nb_integration_pts);
1660 auto t_var_P =
dataAtPts->getFTensorVarPiola(nb_integration_pts);
1661 auto t_w_l2 =
dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1662 auto t_var_div_P =
dataAtPts->getFTensorDivVarPiola(nb_integration_pts);
1664 auto t_jac =
topoData->getFTensorJacobian(nb_integration_pts);
1666 auto get_ftensor1 = [](
auto &
v) {
1668 &
v[0], &
v[1], &
v[2]);
1699 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1706 t_diff_R(
i,
j,
k) = levi_civita(
i,
j,
k);
1714 "rotationSelector not handled");
1723 const auto beta =
a * (t_div_P(
i) * t_var_w(
i));
1736 ((t_diff_R(
j,
k,
m) * t_var_omega(
m)) * t_u_h1(
k,
l))
1738 * (t_approx_P(
j,
n) * t_jac(
l,
n));
1742 ((t_diff_R(
j,
k,
m) * t_var_omega(
m)) * t_u_h1(
k,
l))
1744 * (t_approx_P(
j,
n) * t_diff(
l,
n,
I,
J));
1750 (levi_civita(
i,
j,
k) * t_var_omega(
k))
1752 * (t_approx_P(
i,
n) * t_jac(
j,
n));
1756 (t_diff_R(
i,
j,
k) * t_var_omega(
k))
1758 * (t_approx_P(
i,
n) * t_diff(
j,
n,
I,
J));
1763 "gradApproximator not handled");
1768 auto t_nf = get_ftensor1(
nF);
1770 for (
int bb = 0; bb != nb_dofs /
SPACE_DIM; ++bb) {
1771 t_nf(
i) -=
a * (t_beta_dX(
i,
j) * t_base_diff(
j));
1779 (t_h(
i,
j) -
t_kd(
i,
j)) * (t_var_P(
i,
n) * t_jac(
j,
n));
1784 auto t_nf = get_ftensor1(
nF);
1786 for (
int bb = 0; bb != nb_dofs /
SPACE_DIM; ++bb) {
1787 t_nf(
i) -=
a * (t_beta_dX(
i,
j) * t_base_diff(
j));
1794 const auto beta = t_w_l2(
i) * t_var_div_P(
i);
1815 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1816 SmartPetscObj<Vec> assemble_vec,
1817 boost::shared_ptr<TopologicalData> topo_ptr,
1818 const double alpha,
const double rho,
1819 const double alpha_omega = 0)
1821 field_name, data_ptr, topo_ptr, nullptr, assemble_vec,
Tag()),
1830 "DataAtIntegrationPts pointer is null");
1833 const int nb_dofs = data.
getIndices().size();
1837 const int nb_integration_pts =
getGaussPts().size2();
1841 auto t_div_P =
dataAtPts->getFTensorDivP(nb_integration_pts);
1842 auto t_w_l2 =
dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1843 auto t_s_dot_w =
dataAtPts->getFTensorSmallWL2Dot(nb_integration_pts);
1844 auto t_s_dot_dot_w =
1845 dataAtPts->getFTensorSmallWL2DotDot(nb_integration_pts);
1846 auto t_h =
dataAtPts->getFTensorSmallH(nb_integration_pts);
1847 auto t_levi_kirchhoff =
1848 dataAtPts->getFTensorLeviKirchhoff(nb_integration_pts);
1849 auto t_omega_grad_dot =
1850 dataAtPts->getFTensorRotAxisGradDot(nb_integration_pts);
1851 auto t_R =
dataAtPts->getFTensorRotMat(nb_integration_pts);
1852 auto t_u =
dataAtPts->getFTensorStretch(nb_integration_pts);
1854 auto t_var_w =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
1855 auto t_var_omega =
dataAtPts->getFTensorVarRotAxis(nb_integration_pts);
1856 auto t_var_grad_omega =
1857 dataAtPts->getFTensorVarGradRotAxis(nb_integration_pts);
1858 auto t_var_P =
dataAtPts->getFTensorVarPiola(nb_integration_pts);
1859 auto t_var_div_P =
dataAtPts->getFTensorDivVarPiola(nb_integration_pts);
1860 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
1861 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
1863 auto w_l2_dot_dot_at_pts =
dataAtPts->getSmallWL2DotDotAtPts();
1864 if (w_l2_dot_dot_at_pts->size1() != nb_integration_pts ||
1865 w_l2_dot_dot_at_pts->size2() !=
SPACE_DIM) {
1866 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
1867 *w_l2_dot_dot_at_pts, nb_integration_pts);
1868 w_l2_dot_dot_at_pts->clear();
1871 const auto piola_scale =
dataAtPts->piolaScale;
1872 const auto alpha_w =
alphaW / piola_scale;
1873 const auto alpha_rho =
alphaRho / piola_scale;
1875 const int nb_base_functions = data.
getN().size2();
1878 auto get_ftensor1 = [](
auto &
v) {
1880 &
v[0], &
v[1], &
v[2]);
1912 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1916 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
1918 auto t_nf = get_ftensor1(
nF);
1920 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1923 t_div_base(
i) = -(1 / t_det) * (t_inv_jac(
j,
i) * t_base_diff(
j));
1926 t_nf(
i) += (t_w *
v) *
1927 (t_var_w(
k) * (-t_div_P(
k) + alpha_w * t_s_dot_w(
k) +
1928 alpha_rho * t_s_dot_dot_w(
k))) *
1929 t_cof(
i,
j) * t_base_diff(
j);
1930 t_nf(
i) += (t_w *
v) * (-(t_var_w(
k) * t_div_P(
k))) * t_div_base(
i);
1933 t_nf(
i) += (t_w *
v) * (t_var_omega(
k) * (-t_levi_kirchhoff(
k))) *
1934 t_cof(
i,
j) * t_base_diff(
j);
1940 "OpSensitivity_dX with alpha_omega != 0 is not implemented yet");
1946 t_nf(
i) -= (t_w *
v) * (t_var_P(
i,
k) * (t_R(
i,
l) * t_u(
l,
k)) / 2) *
1947 t_cof(
i,
j) * t_base_diff(
j);
1948 t_nf(
i) -= (t_w *
v) * (t_var_P(
i,
l) * (t_R(
i,
k) * t_u(
l,
k)) / 2) *
1949 t_cof(
i,
j) * t_base_diff(
j);
1950 t_nf(
i) += (t_w *
v) * (t_var_P(
i,
j) *
t_kd(
i,
j)) * t_cof(
i,
j) *
1955 t_nf(
i) += (t_w *
v) * (t_var_P(
k,
m) * (-t_residuum_P(
k,
m))) *
1956 t_cof(
i,
j) * t_base_diff(
j);
1960 t_nf(
i) += (t_w *
v) * (t_var_div_P(
k) * (-t_w_l2(
k))) * t_cof(
i,
j) *
1962 t_nf(
i) += (t_w *
v) * (t_var_div_P(
k) * (-t_w_l2(
k))) * t_div_base(
i);
1967 for (; bb != nb_base_functions; ++bb)
1986 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1987 SmartPetscObj<Vec> assemble_vec,
1988 boost::shared_ptr<TopologicalData> topo_ptr,
1989 std::vector<boost::shared_ptr<ScalingMethod>> smv,
1990 boost::shared_ptr<double> J_ptr =
nullptr)
1992 field_name, data_ptr, topo_ptr, J_ptr, assemble_vec,
Tag()),
2010 "DataAtIntegrationPts pointer is null");
2013 const int nb_dofs = data.
getIndices().size();
2017 const int nb_integration_pts =
getGaussPts().size2();
2021 auto t_var_w_l2 =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
2022 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
2023 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
2025 const int nb_base_functions = data.
getN().size2();
2028 auto get_ftensor1 = [](
auto &
v) {
2030 &
v[0], &
v[1], &
v[2]);
2042 auto get_scale = [&](
const double t) {
2047 s *= o->getScale(
t);
2054 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2055 const double alpha =
scale * t_w *
v;
2057 double adjount = t_var_w_l2(
i) *
tForce(
i);
2058 locJ += (alpha * t_det) * adjount;
2061 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
2063 auto t_nf = get_ftensor1(
nF);
2065 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
2066 t_nf(
i) += (alpha * adjount) * t_cof(
i,
J) * t_base_diff(
J);
2071 for (; bb != nb_base_functions; ++bb)
2085 auto cubit_meshset_ptr =
2086 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
2089 std::vector<double> block_data;
2090 CHKERR cubit_meshset_ptr->getAttributes(block_data);
2094 <<
"BLOCKSET is expected to have " <<
SPACE_DIM
2095 <<
" attributes but has size " << block_data.size();
2098 "Size of attribute in BLOCKSET is too small");
2102 for (
unsigned int ii = 0; ii !=
SPACE_DIM; ++ii) {
2103 tForce(ii) = block_data[ii];
2107 <<
"Flux blockset " << cubit_meshset_ptr->getName();
2109 <<
"Number of attributes " << block_data.size();
2111 this->
entsPtr = boost::make_shared<Range>();
2112 CHKERR m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
2115 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"tForce vector initialised: " <<
tForce;
2116 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"Number of elements " <<
entsPtr->size();
#define FTENSOR_INDEXES(DIM,...)
#define FTENSOR_INDEX(DIM, I)
#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()
#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.
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'J', DIM1 > J
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
EntitiesFieldData::EntData EntData
static MatrixDouble getTopologicalAnalyticalExpr(OP_PTR op_ptr, const std::string &block_name)
static constexpr auto size_symm
MatrixDouble analytical_expr_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_ref_coords, MatrixDouble &m_ref_normals, const std::string block_name)
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
constexpr IntegrationType I
constexpr double t
plate stiffness
constexpr auto field_name
FTensor::Index< 'm', 3 > m
static PetscBool l2UserBaseScale
static enum StretchHandling stretchHandling
static enum RotSelector rotSelector
static enum RotSelector gradApproximator
static PetscBool physicalTimeFlg
static double currentPhysicalTime
static bool hasNonHomogeneousMaterialBlock
MoFEMErrorCode integrate(int side, EntityType type, EntData &data) override
boost::shared_ptr< AnalyticalDisplacementBcVec > bcDispPtr
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenSideDataPtr
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
OpAnalyticalDispBc_dX(const std::string &field_name, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_side_data_ptr, boost::shared_ptr< AnalyticalDisplacementBcVec > bc_disp_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< TopologicalData > topo_ptr, SmartPetscObj< Vec > vec, boost::shared_ptr< double > J_ptr=nullptr, Tag tag=Tag())
MoFEMErrorCode aSsemble(EntData &data) override
boost::shared_ptr< TopologicalData > topoData
SmartPetscObj< Vec > assembleVec
OpAssembleBrokenFaceTopologicalDerivativeImplBase(boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_base_side_data, boost::shared_ptr< TopologicalData > topo_ptr, boost::shared_ptr< double > J_ptr, SmartPetscObj< Vec > assemble_vec, Tag topo_tag, boost::shared_ptr< Range > ents_ptr=nullptr)
boost::shared_ptr< double > JPtr
OpAssembleTopologicalObjectiveDerivativeImplBase(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< TopologicalData > topo_ptr, boost::shared_ptr< double > J_ptr, SmartPetscObj< Vec > assemble_vec, Tag topo_tag)
MoFEMErrorCode assemble(int side, EntityType type, EntData &data) override
boost::shared_ptr< double > JPtr
boost::shared_ptr< TopologicalData > topoData
SmartPetscObj< Vec > assembleVec
OpBodyForce_dX(MoFEM::Interface &m_field, int ms_id, const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, SmartPetscObj< Vec > assemble_vec, boost::shared_ptr< TopologicalData > topo_ptr, std::vector< boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< double > J_ptr=nullptr)
boost::shared_ptr< Range > entsPtr
MoFEMErrorCode getMeshsetData(MoFEM::Interface &m_field, int ms_id)
MoFEMErrorCode integrate(EntData &data)
std::vector< boost::shared_ptr< ScalingMethod > > scalingMethods
FTensor::Tensor1< double, SPACE_DIM > tForce
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< AnalyticalTractionBcVec > bcData
boost::shared_ptr< MatrixDouble > lambdaHybridPtr
MoFEMErrorCode integrate(int side, EntityType type, EntData &data) override
boost::shared_ptr< TopologicalData > topoData
OpBrokenAnalyticalTractionBc_dX(std::string field_name, boost::shared_ptr< AnalyticalTractionBcVec > bc_data, boost::shared_ptr< MatrixDouble > lambda_hybrid_ptr, boost::shared_ptr< TopologicalData > topo_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, SmartPetscObj< Vec > vec, boost::shared_ptr< double > J_ptr=nullptr, Tag tag=Tag())
boost::shared_ptr< TopologicalData > topoData
boost::shared_ptr< TractionBcVec > bcData
MoFEMErrorCode integrate(int side, EntityType type, EntData &data) override
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
OpBrokenTractionBc_dX(std::string field_name, boost::shared_ptr< TractionBcVec > bc_data, boost::shared_ptr< MatrixDouble > lambda_hybrid_ptr, boost::shared_ptr< TopologicalData > topo_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, SmartPetscObj< Vec > vec, boost::shared_ptr< double > J_ptr=nullptr, Tag tag=Tag())
boost::shared_ptr< MatrixDouble > lambdaHybridPtr
OpDispBc_dX(const std::string &field_name, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_side_data_ptr, boost::shared_ptr< BcDispVec > bc_disp_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv, boost::shared_ptr< TopologicalData > topo_ptr, SmartPetscObj< Vec > vec, boost::shared_ptr< double > J_ptr=nullptr, Tag tag=Tag())
std::map< std::string, boost::shared_ptr< ScalingMethod > > scalingMethodsMap
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenSideDataPtr
MoFEMErrorCode integrate(int side, EntityType type, EntData &data) override
boost::shared_ptr< BcDispVec > bcDispPtr
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
OpSensitivityInteriorGradient(const std::string field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< TopologicalData > topo_ptr, SmartPetscObj< Vec > assemble_vec, const double alpha, const double rho, const double alpha_omega=0, boost::shared_ptr< double > J_ptr=nullptr)
MoFEMErrorCode integrate(EntData &data)
OpSensitivityInterior_dX(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, SmartPetscObj< Vec > assemble_vec, boost::shared_ptr< TopologicalData > topo_ptr, const double alpha, const double rho, const double alpha_omega=0)
boost::shared_ptr< MatrixDouble > hybridDispPtr
boost::shared_ptr< MatrixDouble > varHybridDispPtr
MoFEMErrorCode integrate(int side, EntityType type, EntData &data) override
OpTauStabilisation_dX(const std::string &field_name, boost::shared_ptr< std::vector< BrokenBaseSideData > > broken_disp_data_ptr, boost::shared_ptr< MatrixDouble > hybrid_disp_ptr, boost::shared_ptr< MatrixDouble > var_hybrid_disp_ptr, boost::shared_ptr< TopologicalData > topo_ptr, const double alpha_tau, SmartPetscObj< Vec > vec, boost::shared_ptr< double > J_ptr=nullptr, Tag tag=Tag())
boost::shared_ptr< std::vector< BrokenBaseSideData > > brokenDispDataPtr
boost::shared_ptr< ObjectiveFunctionData > pythonPtr
ObjectiveModelType evalEnergyModel
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
ForcesAndSourcesCore::UserDataOperator OP
OpTopologicalObjectivePythonImpl(boost::shared_ptr< DataAtIntegrationPts > data_at_pts_ptr, boost::shared_ptr< TopologicalData > topo_p, boost::shared_ptr< ObjectiveFunctionData > python_ptr, const ObjectiveModelType eval_energy_model=PYTHON_MODEL)
boost::shared_ptr< TopologicalData > topoData
MoFEMErrorCode iNtegrate(EntData &data)
MoFEMErrorCode integrate(EntData &data)
static auto diffExp(A &&t_w_vee, B &&theta)
virtual moab::Interface & get_moab()=0
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.
MatrixDouble & getDiffN(const FieldApproximationBase base)
get derivatives of base functions
const VectorFieldEntities & getFieldEntities() const
Get field entities (const version)
auto getFTensor2N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
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 VectorDouble & getFieldData() const
Get DOF values on entity.
auto getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
auto getFTensor0IntegrationWeight()
Get integration weights.
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
double getVolume() const
element volume (linear geometry)
VectorDouble nF
local right hand side vector
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts