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();
381 const auto variable_compliance_mask =
386 auto stress_full_ptr = boost::make_shared<MatrixDouble>();
387 auto get_stress_full =
389 DL>::size(*stress_full_ptr, nb_gauss_pts);
390 stress_full_ptr->clear();
391 auto strain_full_ptr = boost::make_shared<MatrixDouble>();
392 auto get_strain_full =
394 DL>::size(*strain_full_ptr, nb_gauss_pts);
395 strain_full_ptr->clear();
397 auto t_stress = get_stress_full();
398 auto t_strain = get_strain_full();
400 auto t_biot =
dataAtPts->getFTensorAdjointPdstretch(nb_gauss_pts);
401 auto t_u =
dataAtPts->getFTensorStretch(nb_gauss_pts);
412 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
415 t_stress(
i,
j) = t_biot(
i,
j);
416 t_strain(
i,
j) = t_u(
i,
j);
420 auto evaluate_python_objective = [&]() {
424 "ObjectiveFunctionData pointer is null");
426 auto &coords = OP::getCoordsAtGaussPts();
428 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
431 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
432 topoData->getObjDStrainAtPts(),
false);
434 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
435 topoData->getObjDDisplacementAtPts(),
false);
437 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
438 topoData->getObjDStressAtPts(),
false);
442 auto evaluate_energy_of_hencky_model = [&]() {
445 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
446 *
topoData->getObjDDisplacementAtPts(), nb_gauss_pts);
447 topoData->getObjDDisplacementAtPts()->clear();
449 DL>::size(*
topoData->getObjDStressAtPts(), nb_gauss_pts);
450 topoData->getObjDStressAtPts()->clear();
451 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
452 *
topoData->getObjDRotationAtPts(), nb_gauss_pts);
454 auto eval_evergy = [&](
auto &&t_D) {
456 MatrixSizeHelper<GetFTensor1FromMatType<1, -1,
DL>,
DL>::size(
457 *
topoData->getObjAtPts(), nb_gauss_pts);
458 auto get_dstrain_obj =
462 auto t_obj = get_obj();
463 auto t_dstrain_obj = get_dstrain_obj();
464 auto t_log_u =
dataAtPts->getFTensorLogStretchTotal(nb_gauss_pts);
465 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
466 t_obj(0) = 0.5 * (t_log_u(
i,
j) * t_D(
i,
j,
k,
l) * t_log_u(
k,
l));
467 t_dstrain_obj(
i,
j) = t_D(
i,
j,
k,
l) * t_log_u(
k,
l);
477 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matD));
479 eval_evergy(getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matD));
482 topoData->getObjDRotationAtPts()->clear();
486 auto evaluate_energy_of_hencky_model_nostreach = [&]() {
489 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
490 *
topoData->getObjDDisplacementAtPts(), nb_gauss_pts);
491 topoData->getObjDDisplacementAtPts()->clear();
493 DL>::size(*
topoData->getObjDStrainAtPts(), nb_gauss_pts);
494 topoData->getObjDStrainAtPts()->clear();
495 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
496 *
topoData->getObjDRotationAtPts(), nb_gauss_pts);
497 topoData->getObjDRotationAtPts()->clear();
499 auto eval_evergy = [&](
auto &&t_inv_D) {
501 MatrixSizeHelper<GetFTensor1FromMatType<1, -1,
DL>,
DL>::size(
502 *
topoData->getObjAtPts(), nb_gauss_pts);
503 auto get_dstress_obj =
507 auto t_obj = get_obj();
508 auto t_dstress_obj = get_dstress_obj();
509 auto t_stress =
dataAtPts->getFTensorAdjointPdstretch(nb_gauss_pts);
510 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
512 0.5 * (t_stress(
i,
j) * t_inv_D(
i,
j,
k,
l) * t_stress(
k,
l));
513 t_dstress_obj(
i,
j) = t_inv_D(
i,
j,
k,
l) * t_stress(
k,
l);
521 if ((
features & variable_compliance_mask).none()) {
523 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matInvD));
526 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matInvD));
531 auto conversion_of_biot_stress = [&]() {
535 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
536 *
topoData->getObjDRotationAtPts(), nb_gauss_pts);
537 topoData->getObjDRotationAtPts()->clear();
539 auto t_obj_dbiot =
topoData->getFTensorObjDStress(nb_gauss_pts);
540 auto t_obj_domega =
topoData->getFTensorObjDRotation(nb_gauss_pts);
541 auto t_R =
dataAtPts->getFTensorRotMat(nb_gauss_pts);
542 auto t_P =
dataAtPts->getFTensorApproxP(nb_gauss_pts);
543 auto t_grad_h1 =
dataAtPts->getFTensorSmallWGradH1(nb_gauss_pts);
544 auto t_omega =
dataAtPts->getFTensorRotAxis(nb_gauss_pts);
553 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
555 t_dJ_dbiot(
l, o) = t_obj_dbiot(
l, o);
561 t_obj_dbiot(
i,
k) = t_dJ_dbiot(
i,
k);
573 "rotationSelector not handled");
577 t_obj_dbiot(
i,
k) = t_R(
i,
l) * t_dJ_dbiot(
l,
k);
578 t_obj_domega(
m) = t_dJ_dbiot(
l,
k) * t_diff_R(
i,
l,
m) * t_P(
i,
k);
583 t_h1(o,
k) =
t_kd(o,
k) + t_grad_h1(o,
k);
588 t_diff_R(
i,
l,
m) = levi_civita(
i,
l,
m);
596 "rotationSelector not handled");
600 t_obj_dbiot(
i,
k) = t_R(
i,
l) * (t_dJ_dbiot(
l, o) * t_h1(o,
k));
602 t_dJ_dbiot(
l, o) * (t_diff_R(
i,
l,
m) * t_P(
i,
k)) * t_h1(o,
k);
606 "gradApproximator not handled");
620 auto conversion_of_stretch = [&]() {
624 auto t_obj_dstretch =
topoData->getFTensorObjDStrain(nb_gauss_pts);
625 auto t_diff_stretch =
dataAtPts->getFTensorDiffStretch(nb_gauss_pts);
632 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
634 t_dJ_dstretch(
i,
j) = t_obj_dstretch(
i,
j);
636 t_obj_dstretch(
k,
l) = t_dJ_dstretch(
i,
j) * t_diff_stretch(
i,
j,
k,
l);
645 auto conversion_of_stretch_to_stress_for_no_stretch = [&](
auto t_inv_D) {
649 auto t_obj_dstress =
topoData->getFTensorObjDStress(nb_gauss_pts);
650 auto t_obj_dstretch =
topoData->getFTensorObjDStrain(nb_gauss_pts);
657 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
659 t_dstretch_dstress(
i,
j) =
660 ((t_obj_dstretch(
k,
l) || t_obj_dstretch(
l,
k)) / 2.) *
663 t_obj_dstress(
i,
j) += t_dstretch_dstress(
i,
j);
675 CHKERR evaluate_python_objective();
676 CHKERR conversion_of_biot_stress();
678 if ((
features & variable_compliance_mask).none()) {
679 CHKERR conversion_of_stretch_to_stress_for_no_stretch(
680 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matInvD));
682 CHKERR conversion_of_stretch_to_stress_for_no_stretch(
683 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matInvD));
686 CHKERR conversion_of_stretch();
691 CHKERR evaluate_energy_of_hencky_model_nostreach();
692 CHKERR conversion_of_biot_stress();
694 CHKERR evaluate_energy_of_hencky_model();
699 "Objective model type not handled");
712 "Topological data pointer is null");
719 const int nb_integration_pts =
getGaussPts().size2();
723 auto t_obj =
topoData->getFTensorObj(nb_integration_pts);
724 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
725 auto t_obj_dStrain =
topoData->getFTensorObjDStrain(nb_integration_pts);
726 auto t_obj_dU =
topoData->getFTensorObjDDisplacement(nb_integration_pts);
727 auto t_P =
dataAtPts->getFTensorApproxP(nb_integration_pts);
728 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
729 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
730 auto t_jac =
topoData->getFTensorJacobian(nb_integration_pts);
747 auto get_ftensor1 = [](
auto &
v) {
749 &
v[0], &
v[1], &
v[2]);
754 const int nb_base_functions = data.
getN().size2();
756 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
757 locJ += (t_w *
v * t_det) * t_obj;
760 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
770 t_inv_jac(
I,
J) * t_jac(
j,
k) * t_P(
i,
k));
772 auto t_nf = get_ftensor1(
nF);
774 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
775 t_nf(
i) += (t_w *
v) * t_dJ_dX(
i,
j) * t_base_diff(
j);
779 for (; bb != nb_base_functions; ++bb)
794 "Topological data pointer is null");
801 const int nb_integration_pts = data.
getN().size1();
805 const int nb_base_functions = data.
getN().size2() /
SPACE_DIM;
811 auto get_ftensor1 = [](
auto &
v) {
813 &
v[0], &
v[1], &
v[2]);
816 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
818 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
819 const double a =
v * t_w;
820 auto t_nf = get_ftensor1(
nF);
823 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
824 t_nf(
i) +=
a * t_row_base_fun(
j) * t_obj_dP(
i,
j);
828 for (; bb != nb_base_functions; ++bb)
844 "Topological data pointer is null");
851 const int nb_integration_pts = data.
getN().size1();
857 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
862 auto get_ftensor0 = [](
auto &
v) {
866 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
867 const double a =
v * t_w;
868 auto t_nf = get_ftensor0(
nF);
871 for (; bb != nb_dofs; ++bb) {
872 t_nf +=
a * t_row_base_fun(
i,
j) * t_obj_dP(
i,
j);
876 for (; bb != nb_base_functions; ++bb)
892 "Topological data pointer is null");
899 const int nb_integration_pts = data.
getN().size1();
903 const int nb_base_functions = data.
getN().size2();
905 auto t_obj_dw =
topoData->getFTensorObjDDisplacement(nb_integration_pts);
909 auto get_ftensor1 = [](
auto &
v) {
911 &
v[0], &
v[1], &
v[2]);
914 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
915 const double a =
v * t_w;
916 auto t_nf = get_ftensor1(
nF);
919 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
920 t_nf(
i) +=
a * t_row_base_fun * t_obj_dw(
i);
924 for (; bb != nb_base_functions; ++bb)
940 "Topological data pointer is null");
947 const int nb_integration_pts = data.
getN().size1();
951 const int nb_base_functions = data.
getN().size2();
953 auto t_obj_domega =
topoData->getFTensorObjDRotation(nb_integration_pts);
957 auto get_ftensor1 = [](
auto &
v) {
959 &
v[0], &
v[1], &
v[2]);
962 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
963 const double a =
v * t_w;
964 auto t_nf = get_ftensor1(
nF);
967 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
968 t_nf(
i) +=
a * t_row_base_fun * t_obj_domega(
i);
972 for (; bb != nb_base_functions; ++bb)
988 "Topological data pointer is null");
995 const int nb_integration_pts = data.
getN().size1();
997 auto t_w = getFTensor0IntegrationWeight();
998 const int nb_base_functions = data.
getN().size2();
1000 auto t_obj_du_gamma =
1001 topoData->getFTensorObjDDisplacement(nb_integration_pts);
1005 auto get_ftensor1 = [](
auto &
v) {
1007 &
v[0], &
v[1], &
v[2]);
1010 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1011 const double a = t_w * getMeasure();
1012 auto t_nf = get_ftensor1(
nF);
1015 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1016 t_nf(
i) +=
a * t_row_base_fun * t_obj_du_gamma(
i);
1020 for (; bb != nb_base_functions; ++bb)
1036 "Topological data pointer is null");
1039 const int nb_dofs = data.
getIndices().size();
1043 const int nb_integration_pts = OP::getGaussPts().size2();
1045 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1046 auto t_w = OP::getFTensor0IntegrationWeight();
1047 const int nb_base_functions = data.
getN().size2() /
SPACE_DIM;
1049 auto t_obj_dtraction =
1050 topoData->getFTensorObjDDisplacement(nb_integration_pts);
1055 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1056 auto t_nf = getFTensor1FromPtr<SPACE_DIM>(&*OP::locF.begin());
1058 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1060 t_w * (t_row_base_fun(
j) * t_normal(
j)) * t_obj_dtraction(
i) * 0.5;
1064 for (; bb != nb_base_functions; ++bb)
1083 "Topological data pointer is null");
1086 "Broken displacement data pointer is null");
1089 "Hybrid displacement pointer is null");
1092 "Adjoint hybrid displacement pointer is null");
1095 const int nb_dofs = data.
getIndices().size();
1099 const int nb_integration_pts = getGaussPts().size2();
1100 const int nb_base_functions = data.
getN().size2();
1103 if (this->
nF.size() != nb_dofs)
1105 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1106 if (data.
getDiffN().size1() != nb_integration_pts)
1108 "Differential of base functions should have the same number of "
1109 "integration points as the data");
1110 if (data.
getDiffN().size2() != nb_base_functions * 2)
1112 "Differential of base functions should have the same number of "
1113 "base functions as the data");
1120 auto &coords = getCoords();
1123 const double h = std::get<2>(Tools::getTricircumcenter3d(coords.data().data()));
1125 auto t_w = getFTensor0IntegrationWeight();
1126 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1127 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1128 auto t_u_hybrid = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(*hybridDispPtr);
1129 auto t_var_u_hybrid =
1130 getFTensor1FromMat<
SPACE_DIM, -1,
DL>(*varHybridDispPtr);
1133 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1138 double area = std::sqrt(t_normal(
i) * t_normal(
i));
1140 t_da(
i) = t_normal(
i) / area;
1144 double tau_density = 0;
1147 getFTensor1FromMat<
SPACE_DIM, -1,
DL>(bd.getFlux(), nb_integration_pts);
1148 auto t_var_u_broken = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(
1149 bd.getVarFlux(), nb_integration_pts);
1150 for (
int ss = 0; ss != gg; ++ss) {
1158 const double hybrid_hybrid = t_var_u_hybrid(
i) * t_u_hybrid(
i);
1159 const double broken_broken = t_var_u_broken(
i) * t_u_broken(
i);
1160 const double hybrid_broken = -t_var_u_hybrid(
i) * t_u_broken(
i);
1161 const double broken_hybrid = -t_var_u_broken(
i) * t_u_hybrid(
i);
1163 hybrid_hybrid + broken_broken + hybrid_broken + broken_hybrid;
1167 locJ += t_w * tau * area * tau_density;
1169 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1171 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1178 t_w *
alphaTau * tau_density * (t_da(
i) * t_normal_dX(
i,
I)) /
h;
1182 for (; rr != nb_base_functions; ++rr)
1202 "Broken side data pointer is null");
1206 const int nb_dofs = data.
getIndices().size();
1210 const int nb_integration_pts = getGaussPts().size2();
1211 const int nb_base_functions = data.
getN().size2();
1214 if (data.
getDiffN().size1() != nb_integration_pts)
1216 "Differential of base functions should have the same number of "
1217 "integration points as the data");
1218 if (data.
getDiffN().size2() != nb_base_functions * 2)
1220 "Differential of base functions should have the same number of "
1221 "base functions as the data");
1224 double time = getFEMethod()->ts_t;
1233 const EntityHandle fe_ent = getFEEntityHandle();
1235 if (bc.faces.find(fe_ent) == bc.faces.end())
1243 <<
"No scaling method found for " << bc.blockName;
1251 auto t_w = getFTensor0IntegrationWeight();
1252 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1253 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1255 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1258 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1259 const double a = 0.5 * bd.getSense() * t_w;
1265 locJ +=
a * t_bc_disp(
i) * (t_var_flux(
i,
j) * t_normal(
j));
1267 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1269 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1277 for (; bb != nb_base_functions; ++bb)
1301 "Broken side data pointer is null");
1304 const int nb_dofs = data.
getIndices().size();
1308 const int nb_integration_pts = getGaussPts().size2();
1309 const int nb_base_functions = data.
getN().size2();
1312 if (data.
getDiffN().size1() != nb_integration_pts)
1314 "Differential of base functions should have the same number of "
1315 "integration points as the data");
1316 if (data.
getDiffN().size2() != nb_base_functions * 2)
1318 "Differential of base functions should have the same number of "
1319 "base functions as the data");
1326 const EntityHandle fe_ent = getFEEntityHandle();
1328 if (bc.faces.find(fe_ent) == bc.faces.end())
1331 auto v_analytical_expr =
1335 auto t_w = getFTensor0IntegrationWeight();
1336 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1337 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1339 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1342 getFTensor1FromMat<
SPACE_DIM, -1,
DL>(v_analytical_expr);
1344 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1345 const double a = 0.5 * bd.getSense() * t_w;
1351 locJ +=
a * t_bc_disp(
i) * (t_var_flux(
i,
j) * t_normal(
j));
1353 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1355 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1363 for (; bb != nb_base_functions; ++bb)
1388 int nb_integration_pts = getGaussPts().size2();
1389 int nb_base_functions = data.
getN().size2();
1391 double time = getFEMethod()->ts_t;
1397 if (this->
nF.size() != nb_dofs)
1399 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1402 auto integrate_rhs = [&](
auto &bc,
auto calc_tau,
double time_scale) {
1405 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1407 auto t_w = getFTensor0IntegrationWeight();
1408 auto t_coords = getFTensor1CoordsAtGaussPts();
1411 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1412 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1414 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1420 double a = sqrt(t_normal(
i) * t_normal(
i));
1422 t_da(
i) = t_normal(
i) /
a;
1426 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1427 locJ -= (time_scale * t_w *
a * tau) * (t_val(
i) * t_var_u_gamma(
i));
1429 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1431 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1436 t_nf(
I) -= (time_scale * t_w * tau) * (t_val(
i) * t_var_u_gamma(
i)) *
1437 (t_da(
i) * t_normal_dX(
i,
I));
1441 for (; rr != nb_base_functions; ++rr)
1455 EntityHandle fe_ent = getFEEntityHandle();
1456 for (
auto &bc : *(
bcData)) {
1457 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1459 double time_scale = 1;
1465 if (std::regex_match(bc.blockName, std::regex(
".*COOK.*"))) {
1469 return -y * (y - 1) / 0.25;
1471 CHKERR integrate_rhs(bc, calc_tau, time_scale);
1474 bc, [](
double,
double,
double) {
return 1; }, time_scale);
1496 int nb_integration_pts = getGaussPts().size2();
1497 int nb_base_functions = data.
getN().size2();
1500 if (this->
nF.size() != nb_dofs)
1502 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1505 auto integrate_rhs = [&](
auto &bc) {
1508 auto v_analytical_expr =
1511 auto t_val = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(v_analytical_expr);
1513 auto t_w = getFTensor0IntegrationWeight();
1516 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1517 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1519 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1525 double a = sqrt(t_normal(
i) * t_normal(
i));
1527 t_da(
i) = t_normal(
i) /
a;
1531 locJ -= (t_w *
a) * (t_val(
i) * t_var_u_gamma(
i));
1533 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1535 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1540 t_nf(
I) -= t_w * (t_val(
i) * t_var_u_gamma(
i)) *
1541 (t_da(
i) * t_normal_dX(
i,
I));
1545 for (; rr != nb_base_functions; ++rr)
1558 EntityHandle fe_ent = getFEEntityHandle();
1559 for (
auto &bc : *(
bcData)) {
1560 if (bc.faces.find(fe_ent) != bc.faces.end() && nb_dofs) {
1561 CHKERR integrate_rhs(bc);
1574 "Topological data pointer is null");
1577 const int nb_dofs = data.
getIndices().size();
1581 const int nb_integration_pts = data.
getN().size1();
1585 const int nb_base_functions = data.
getN().size2();
1588 auto t_obj_dlog_stretch =
topoData->getFTensorObjDStrain(nb_integration_pts);
1593 auto t_L = FTensor::SymmLTensor<double, 3>();
1595 auto get_ftensor1 = [](
auto &
v) {
1597 &
v[0], &
v[1], &
v[2], &
v[3], &
v[4], &
v[5]);
1600 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1601 const double a =
v * t_w;
1602 auto t_nf = get_ftensor1(
OP::nF);
1605 t_obj_dU(L) = t_obj_dlog_stretch(
i,
j) * t_L(
i,
j, L);
1608 for (; bb != nb_dofs /
size_symm; ++bb) {
1609 t_nf(L) +=
a * t_row_base_fun * t_obj_dU(L);
1613 for (; bb != nb_base_functions; ++bb)
1617 ++t_obj_dlog_stretch;
1627 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1628 boost::shared_ptr<TopologicalData> topo_ptr,
1629 SmartPetscObj<Vec> assemble_vec,
const double alpha,
const double rho,
1630 const double alpha_viscous_omega = 0,
1631 boost::shared_ptr<double> J_ptr =
nullptr)
1633 field_name, data_ptr, topo_ptr, J_ptr, assemble_vec,
Tag()),
1642 "L2 user base scale is set to %d, current inplementation only "
1643 "hanlde case for false",
1651 "DataAtIntegrationPts pointer is null");
1654 const int nb_dofs = data.
getIndices().size();
1658 const int nb_integration_pts =
getGaussPts().size2();
1663 auto t_div_P =
dataAtPts->getFTensorDivP(nb_integration_pts);
1664 auto t_var_w =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
1666 auto t_approx_P =
dataAtPts->getFTensorApproxP(nb_integration_pts);
1667 auto t_omega =
dataAtPts->getFTensorRotAxis(nb_integration_pts);
1668 auto t_u_h1 =
dataAtPts->getFTensorStretchH1(nb_integration_pts);
1669 auto t_var_omega =
dataAtPts->getFTensorVarRotAxis(nb_integration_pts);
1671 auto t_h =
dataAtPts->getFTensorSmallH(nb_integration_pts);
1672 auto t_var_P =
dataAtPts->getFTensorVarPiola(nb_integration_pts);
1673 auto t_w_l2 =
dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1674 auto t_var_div_P =
dataAtPts->getFTensorDivVarPiola(nb_integration_pts);
1676 auto t_jac =
topoData->getFTensorJacobian(nb_integration_pts);
1678 auto get_ftensor1 = [](
auto &
v) {
1680 &
v[0], &
v[1], &
v[2]);
1711 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1718 t_diff_R(
i,
j,
k) = levi_civita(
i,
j,
k);
1726 "rotationSelector not handled");
1735 const auto beta =
a * (t_div_P(
i) * t_var_w(
i));
1748 ((t_diff_R(
j,
k,
m) * t_var_omega(
m)) * t_u_h1(
k,
l))
1750 * (t_approx_P(
j,
n) * t_jac(
l,
n));
1754 ((t_diff_R(
j,
k,
m) * t_var_omega(
m)) * t_u_h1(
k,
l))
1756 * (t_approx_P(
j,
n) * t_diff(
l,
n,
I,
J));
1762 (levi_civita(
i,
j,
k) * t_var_omega(
k))
1764 * (t_approx_P(
i,
n) * t_jac(
j,
n));
1768 (t_diff_R(
i,
j,
k) * t_var_omega(
k))
1770 * (t_approx_P(
i,
n) * t_diff(
j,
n,
I,
J));
1775 "gradApproximator not handled");
1780 auto t_nf = get_ftensor1(
nF);
1782 for (
int bb = 0; bb != nb_dofs /
SPACE_DIM; ++bb) {
1783 t_nf(
i) -=
a * (t_beta_dX(
i,
j) * t_base_diff(
j));
1791 (t_h(
i,
j) -
t_kd(
i,
j)) * (t_var_P(
i,
n) * t_jac(
j,
n));
1796 auto t_nf = get_ftensor1(
nF);
1798 for (
int bb = 0; bb != nb_dofs /
SPACE_DIM; ++bb) {
1799 t_nf(
i) -=
a * (t_beta_dX(
i,
j) * t_base_diff(
j));
1806 const auto beta = t_w_l2(
i) * t_var_div_P(
i);
1827 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1828 SmartPetscObj<Vec> assemble_vec,
1829 boost::shared_ptr<TopologicalData> topo_ptr,
1830 const double alpha,
const double rho,
1831 const double alpha_viscous_omega = 0)
1833 field_name, data_ptr, topo_ptr, nullptr, assemble_vec,
Tag()),
1835 if (alpha_viscous_omega)
1838 "OpSensitivityInterior_dX with alpha_viscous_omega != 0 is not "
1848 "DataAtIntegrationPts pointer is null");
1851 const int nb_dofs = data.
getIndices().size();
1855 const int nb_integration_pts =
getGaussPts().size2();
1859 auto t_div_P =
dataAtPts->getFTensorDivP(nb_integration_pts);
1860 auto t_w_l2 =
dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1861 auto t_s_dot_w =
dataAtPts->getFTensorSmallWL2Dot(nb_integration_pts);
1862 auto t_s_dot_dot_w =
1863 dataAtPts->getFTensorSmallWL2DotDot(nb_integration_pts);
1864 auto t_h =
dataAtPts->getFTensorSmallH(nb_integration_pts);
1865 auto t_levi_kirchhoff =
1866 dataAtPts->getFTensorLeviKirchhoff(nb_integration_pts);
1867 auto t_omega_grad_dot =
1868 dataAtPts->getFTensorRotAxisGradDot(nb_integration_pts);
1869 auto t_R =
dataAtPts->getFTensorRotMat(nb_integration_pts);
1870 auto t_u =
dataAtPts->getFTensorStretch(nb_integration_pts);
1872 auto t_var_w =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
1873 auto t_var_omega =
dataAtPts->getFTensorVarRotAxis(nb_integration_pts);
1874 auto t_var_grad_omega =
1875 dataAtPts->getFTensorVarGradRotAxis(nb_integration_pts);
1876 auto t_var_P =
dataAtPts->getFTensorVarPiola(nb_integration_pts);
1877 auto t_var_div_P =
dataAtPts->getFTensorDivVarPiola(nb_integration_pts);
1878 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
1879 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
1881 auto w_l2_dot_dot_at_pts =
dataAtPts->getSmallWL2DotDotAtPts();
1882 if (w_l2_dot_dot_at_pts->size1() != nb_integration_pts ||
1883 w_l2_dot_dot_at_pts->size2() !=
SPACE_DIM) {
1884 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
1885 *w_l2_dot_dot_at_pts, nb_integration_pts);
1886 w_l2_dot_dot_at_pts->clear();
1889 const auto piola_scale =
dataAtPts->piolaScale;
1890 const auto alpha_w =
alphaW / piola_scale;
1891 const auto alpha_rho =
alphaRho / piola_scale;
1893 const int nb_base_functions = data.
getN().size2();
1896 auto get_ftensor1 = [](
auto &
v) {
1898 &
v[0], &
v[1], &
v[2]);
1930 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1934 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
1936 double consistency_residual = 0;
1938 consistency_residual =
1939 -0.5 * t_var_P(
k,
m) * (t_R(
k,
l) * t_u(
l,
m)) -
1940 0.5 * t_var_P(
k,
l) * (t_R(
k,
m) * t_u(
l,
m)) +
1945 consistency_residual =
1946 t_var_P(
k,
m) * (-t_residuum_P(
k,
m));
1949 auto t_nf = get_ftensor1(
nF);
1951 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1954 t_div_base(
i) = -(1 / t_det) * (t_inv_jac(
j,
i) * t_base_diff(
j));
1957 t_nf(
i) += (t_w *
v) *
1958 (t_var_w(
k) * (-t_div_P(
k) + alpha_w * t_s_dot_w(
k) +
1959 alpha_rho * t_s_dot_dot_w(
k))) *
1960 t_cof(
i,
j) * t_base_diff(
j);
1961 t_nf(
i) += (t_w *
v) * (-(t_var_w(
k) * t_div_P(
k))) * t_div_base(
i);
1964 t_nf(
i) += (t_w *
v) * (t_var_omega(
k) * (-t_levi_kirchhoff(
k))) *
1965 t_cof(
i,
j) * t_base_diff(
j);
1968 t_nf(
i) += (t_w *
v * consistency_residual) * t_cof(
i,
j) *
1972 t_nf(
i) += (t_w *
v) * (t_var_div_P(
k) * (-t_w_l2(
k))) * t_cof(
i,
j) *
1974 t_nf(
i) += (t_w *
v) * (t_var_div_P(
k) * (-t_w_l2(
k))) * t_div_base(
i);
1979 for (; bb != nb_base_functions; ++bb)
1997 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1998 SmartPetscObj<Vec> assemble_vec,
1999 boost::shared_ptr<TopologicalData> topo_ptr,
2000 std::vector<boost::shared_ptr<ScalingMethod>> smv,
2001 boost::shared_ptr<double> J_ptr =
nullptr)
2003 field_name, data_ptr, topo_ptr, J_ptr, assemble_vec,
Tag()),
2021 "DataAtIntegrationPts pointer is null");
2024 const int nb_dofs = data.
getIndices().size();
2028 const int nb_integration_pts =
getGaussPts().size2();
2032 auto t_var_w_l2 =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
2033 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
2034 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
2036 const int nb_base_functions = data.
getN().size2();
2039 auto get_ftensor1 = [](
auto &
v) {
2041 &
v[0], &
v[1], &
v[2]);
2053 auto get_scale = [&](
const double t) {
2058 s *= o->getScale(
t);
2065 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2066 const double alpha =
scale * t_w *
v;
2068 double adjount = t_var_w_l2(
i) *
tForce(
i);
2069 locJ += (alpha * t_det) * adjount;
2072 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
2074 auto t_nf = get_ftensor1(
nF);
2076 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
2077 t_nf(
i) += (alpha * adjount) * t_cof(
i,
J) * t_base_diff(
J);
2082 for (; bb != nb_base_functions; ++bb)
2096 auto cubit_meshset_ptr =
2097 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
2100 std::vector<double> block_data;
2101 CHKERR cubit_meshset_ptr->getAttributes(block_data);
2105 <<
"BLOCKSET is expected to have " <<
SPACE_DIM
2106 <<
" attributes but has size " << block_data.size();
2109 "Size of attribute in BLOCKSET is too small");
2113 for (
unsigned int ii = 0; ii !=
SPACE_DIM; ++ii) {
2114 tForce(ii) = block_data[ii];
2118 <<
"Flux blockset " << cubit_meshset_ptr->getName();
2120 <<
"Number of attributes " << block_data.size();
2122 this->
entsPtr = boost::make_shared<Range>();
2123 CHKERR m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
2126 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"tForce vector initialised: " <<
tForce;
2127 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"Number of elements " <<
entsPtr->size();
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
#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 RotSelector rotSelector
static enum RotSelector gradApproximator
static PetscBool physicalTimeFlg
static double currentPhysicalTime
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)
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_viscous_omega=0, boost::shared_ptr< double > J_ptr=nullptr)
const double alphaViscousOmega
MoFEMErrorCode integrate(EntData &data)
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_viscous_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
static const Features noStretchMask
std::bitset< LAST_FEATURE > Features
@ NO_STRETCH_NONLINEAR
No-stretch nonlinear formulation.
@ NON_HOMOGENEOUS_MATERIAL
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