18template <
typename AssembleOp>
24 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
25 boost::shared_ptr<TopologicalData> topo_ptr,
26 boost::shared_ptr<double> J_ptr, SmartPetscObj<Vec> assemble_vec,
33 if (
type == MBVERTEX) {
40 double *vec_ptr = OP::nF.data().data();
41 const int nb_dofs =
data.getIndices().size();
42 int *ind_ptr =
data.getIndices().data().data();
46 const auto field_ents =
data.getFieldEntities();
47 std::vector<EntityHandle> ents(field_ents.size());
48 std::transform(field_ents.begin(), field_ents.end(), ents.begin(),
49 [](
const auto *fe) { return fe->getEnt(); });
50 if (field_ents.empty())
52 if (type_from_handle(ents[0]) != MBVERTEX)
54 auto &moab = OP::getMoab();
55 VectorDouble topo_values(OP::nF.
size());
57 topo_values.data().data());
58 noalias(topo_values) += OP::nF;
60 OP::nF.data().data());
67 boost::shared_ptr<double>
JPtr;
87 :
public FormsIntegrators<FaceUserDataOperator>::Assembly<A>
::OpBrokenBase {
89 using OP =
typename FormsIntegrators<FaceUserDataOperator>::Assembly<
93 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_base_side_data,
94 boost::shared_ptr<TopologicalData> topo_ptr,
95 boost::shared_ptr<double> J_ptr, SmartPetscObj<Vec> assemble_vec,
96 Tag topo_tag, boost::shared_ptr<Range> ents_ptr =
nullptr)
97 :
OP(broken_base_side_data, ents_ptr),
JPtr(J_ptr),
103 double *vec_ptr = OP::locF.data().data();
104 const int nb_dofs =
data.getIndices().size();
105 int *ind_ptr =
data.getIndices().data().data();
109 const auto field_ents =
data.getFieldEntities();
110 std::vector<EntityHandle> ents(field_ents.size());
111 std::transform(field_ents.begin(), field_ents.end(), ents.begin(),
112 [](
const auto *fe) { return fe->getEnt(); });
113 if (field_ents.empty())
115 if (type_from_handle(ents[0]) != MBVERTEX)
117 auto &moab = getMoab();
118 VectorDouble topo_values(OP::locF.
size());
120 topo_values.data().data());
121 topo_values += OP::locF;
123 OP::locF.data().data());
129 boost::shared_ptr<double>
JPtr;
137 OpAssembleVolumeTopologicalDerivativeImpl;
144 OpAssembleVolumeTopologicalDerivativeImpl;
151 OpAssembleVolumeTopologicalDerivativeImpl;
158 OpAssembleVolumeTopologicalDerivativeImpl;
165 OpAssembleFaceTopologicalDerivativeImpl;
173 OpAssembleBrokenFaceTopologicalDerivativeImplBase;
181 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_disp_data_ptr,
182 boost::shared_ptr<MatrixDouble> hybrid_disp_ptr,
183 boost::shared_ptr<MatrixDouble> var_hybrid_disp_ptr,
184 boost::shared_ptr<TopologicalData> topo_ptr,
const double alpha_tau,
185 SmartPetscObj<Vec> vec, boost::shared_ptr<double> J_ptr =
nullptr,
204 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_side_data_ptr,
205 boost::shared_ptr<BcDispVec> bc_disp_ptr,
206 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
207 boost::shared_ptr<TopologicalData> topo_ptr, SmartPetscObj<Vec> vec,
208 boost::shared_ptr<double> J_ptr =
nullptr,
Tag tag =
Tag())
222template <
typename OP_PTR>
226 auto nb_gauss_pts = op_ptr->getGaussPts().size2();
228 auto ts_time = op_ptr->getTStime();
229 auto ts_time_step = op_ptr->getTStimeStep();
236 MatrixDouble m_ref_coords = op_ptr->getCoordsAtGaussPts();
237 MatrixDouble m_ref_normals = op_ptr->getNormalsAtGaussPts();
239 auto v_analytical_expr =
241 m_ref_coords, m_ref_normals, block_name);
243 if (PetscUnlikely(!v_analytical_expr.size2())) {
245 "Analytical expression is empty or does not exist, "
246 "check python file");
249 return v_analytical_expr;
255 boost::shared_ptr<std::vector<BrokenBaseSideData>> broken_side_data_ptr,
256 boost::shared_ptr<AnalyticalDisplacementBcVec> bc_disp_ptr,
257 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
258 boost::shared_ptr<TopologicalData> topo_ptr, SmartPetscObj<Vec> vec,
259 boost::shared_ptr<double> J_ptr =
nullptr,
Tag tag =
Tag())
269 boost::shared_ptr<AnalyticalDisplacementBcVec>
bcDispPtr;
275 std::string
field_name, boost::shared_ptr<TractionBcVec> bc_data,
276 boost::shared_ptr<MatrixDouble> lambda_hybrid_ptr,
277 boost::shared_ptr<TopologicalData> topo_ptr,
278 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
279 SmartPetscObj<Vec> vec, boost::shared_ptr<double> J_ptr =
nullptr,
299 boost::shared_ptr<AnalyticalTractionBcVec> bc_data,
300 boost::shared_ptr<MatrixDouble> lambda_hybrid_ptr,
301 boost::shared_ptr<TopologicalData> topo_ptr,
302 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv,
303 SmartPetscObj<Vec> vec, boost::shared_ptr<double> J_ptr =
nullptr,
313 boost::shared_ptr<AnalyticalTractionBcVec>
bcData;
321 OpAssembleVolumeTopologicalDerivativeImpl;
328 OpAssembleVolumeTopologicalDerivativeImpl;
334 :
public ForcesAndSourcesCore::UserDataOperator {
335 using OP = ForcesAndSourcesCore::UserDataOperator;
338 boost::shared_ptr<DataAtIntegrationPts> data_at_pts_ptr,
339 boost::shared_ptr<TopologicalData> topo_p,
340 boost::shared_ptr<ObjectiveFunctionData> python_ptr,
362 "DataAtIntegrationPts pointer is null");
365 "Topological data pointer is null");
368 const int nb_gauss_pts = getGaussPts().size2();
372 MatrixSizeHelper<GetFTensor1FromMatType<3, -1,
DL>,
DL>
::size(
373 *
topoData->objConstantRotation, nb_gauss_pts);
374 topoData->objConstantRotation->clear();
376 const auto variable_compliance_mask =
381 auto stress_full_ptr = boost::make_shared<MatrixDouble>();
382 auto get_stress_full =
384 DL>
::size(*stress_full_ptr, nb_gauss_pts);
385 stress_full_ptr->clear();
386 auto strain_full_ptr = boost::make_shared<MatrixDouble>();
387 auto get_strain_full =
389 DL>
::size(*strain_full_ptr, nb_gauss_pts);
390 strain_full_ptr->clear();
392 auto t_stress = get_stress_full();
393 auto t_strain = get_strain_full();
395 auto t_biot =
dataAtPts->getFTensorAdjointPdstretch(nb_gauss_pts);
396 auto t_u =
dataAtPts->getFTensorStretch(nb_gauss_pts);
407 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
410 t_stress(
i,
j) = t_biot(
i,
j);
411 t_strain(
i,
j) = t_u(
i,
j);
415 auto evaluate_python_objective = [&]() {
419 "ObjectiveFunctionData pointer is null");
421 auto &coords = OP::getCoordsAtGaussPts();
423 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
426 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
427 topoData->getObjDStrainAtPts(),
false);
429 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
430 topoData->getObjDDisplacementAtPts(),
false);
432 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
433 topoData->getObjDStressAtPts(),
false);
437 auto evaluate_energy_of_hencky_model = [&]() {
441 *
topoData->getObjDDisplacementAtPts(), nb_gauss_pts);
442 topoData->getObjDDisplacementAtPts()->clear();
445 topoData->getObjDStressAtPts()->clear();
447 *
topoData->getObjDRotationAtPts(), nb_gauss_pts);
449 auto eval_evergy = [&](
auto &&t_D) {
451 MatrixSizeHelper<GetFTensor1FromMatType<1, -1,
DL>,
DL>
::size(
452 *
topoData->getObjAtPts(), nb_gauss_pts);
453 auto get_dstrain_obj =
457 auto t_obj = get_obj();
458 auto t_dstrain_obj = get_dstrain_obj();
459 auto t_log_u =
dataAtPts->getFTensorLogStretchTotal(nb_gauss_pts);
460 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
461 t_obj(0) = 0.5 * (t_log_u(
i,
j) * t_D(
i,
j,
k,
l) * t_log_u(
k,
l));
462 t_dstrain_obj(
i,
j) = t_D(
i,
j,
k,
l) * t_log_u(
k,
l);
472 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matD));
474 eval_evergy(getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matD));
477 topoData->getObjDRotationAtPts()->clear();
481 auto evaluate_energy_of_hencky_model_nostreach = [&]() {
485 *
topoData->getObjDDisplacementAtPts(), nb_gauss_pts);
486 topoData->getObjDDisplacementAtPts()->clear();
489 topoData->getObjDStrainAtPts()->clear();
491 *
topoData->getObjDRotationAtPts(), nb_gauss_pts);
492 topoData->getObjDRotationAtPts()->clear();
494 auto eval_evergy = [&](
auto &&t_inv_D) {
496 MatrixSizeHelper<GetFTensor1FromMatType<1, -1,
DL>,
DL>
::size(
497 *
topoData->getObjAtPts(), nb_gauss_pts);
498 auto get_dstress_obj =
502 auto t_obj = get_obj();
503 auto t_dstress_obj = get_dstress_obj();
504 auto t_stress =
dataAtPts->getFTensorAdjointPdstretch(nb_gauss_pts);
505 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
507 0.5 * (t_stress(
i,
j) * t_inv_D(
i,
j,
k,
l) * t_stress(
k,
l));
508 t_dstress_obj(
i,
j) = t_inv_D(
i,
j,
k,
l) * t_stress(
k,
l);
516 if ((
features & variable_compliance_mask).none()) {
518 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matInvD));
521 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matInvD));
526 auto conversion_of_biot_stress = [&]() {
530 MatrixSizeHelper<GetFTensor1FromMatType<3, -1,
DL>,
DL>
::size(
531 *
topoData->getObjDRotationAtPts(), nb_gauss_pts);
532 topoData->getObjDRotationAtPts()->clear();
533 auto objective =
topoData->getFTensorObjDStress(nb_gauss_pts);
534 auto R =
dataAtPts->getFTensorRotMat(nb_gauss_pts);
535 auto P =
dataAtPts->getFTensorApproxP(nb_gauss_pts);
539 for (
int gg = 0; gg != nb_gauss_pts; ++gg) {
541 covector(
l, o) = objective(
l, o);
542 h1(o,
k) = identity(o,
k);
546 objective(
i,
k) =
R(
i,
l) * (covector(
l, o) * h1(o,
k));
547 for (
int mode = 0; mode != 2; ++mode) {
550 using namespace LogarithmicDirectionalDerivatives;
553 auto view = GetFTensor1FromMatImpl<3, -1, DL, MatrixDouble>::get(
558 const SplitRotation rotation(read(
dataAtPts->constantRotation),
560 derivative(
i,
l,
m) = rotation.firstTensor(mode)(
i,
l,
m);
562 derivative(
i,
l,
m) = levi_civita(
i,
l,
m);
564 auto rotation_covector =
565 topoData->getFTensorObjDRotation(nb_gauss_pts, mode, gg);
566 rotation_covector(
m) =
567 covector(
l, o) * (derivative(
i,
l,
m) *
P(
i,
k)) * h1(o,
k);
578 auto conversion_of_stretch = [&]() {
582 auto t_obj_dstretch =
topoData->getFTensorObjDStrain(nb_gauss_pts);
583 auto t_diff_stretch =
dataAtPts->getFTensorDiffStretch(nb_gauss_pts);
590 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
592 t_dJ_dstretch(
i,
j) = t_obj_dstretch(
i,
j);
594 t_obj_dstretch(
k,
l) = t_dJ_dstretch(
i,
j) * t_diff_stretch(
i,
j,
k,
l);
603 auto conversion_of_stretch_to_stress_for_no_stretch = [&](
auto t_inv_D) {
607 auto t_obj_dstress =
topoData->getFTensorObjDStress(nb_gauss_pts);
608 auto t_obj_dstretch =
topoData->getFTensorObjDStrain(nb_gauss_pts);
615 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
617 t_dstretch_dstress(
i,
j) =
618 ((t_obj_dstretch(
k,
l) || t_obj_dstretch(
l,
k)) / 2.) *
621 t_obj_dstress(
i,
j) += t_dstretch_dstress(
i,
j);
633 CHKERR evaluate_python_objective();
634 CHKERR conversion_of_biot_stress();
636 if ((
features & variable_compliance_mask).none()) {
637 CHKERR conversion_of_stretch_to_stress_for_no_stretch(
638 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matInvD));
640 CHKERR conversion_of_stretch_to_stress_for_no_stretch(
641 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matInvD));
644 CHKERR conversion_of_stretch();
649 CHKERR evaluate_energy_of_hencky_model_nostreach();
650 CHKERR conversion_of_biot_stress();
652 CHKERR evaluate_energy_of_hencky_model();
657 "Objective model type not handled");
670 "Topological data pointer is null");
673 const int nb_dofs =
data.getIndices().size();
677 const int nb_integration_pts =
getGaussPts().size2();
681 auto t_obj =
topoData->getFTensorObj(nb_integration_pts);
682 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
683 auto t_obj_dStrain =
topoData->getFTensorObjDStrain(nb_integration_pts);
684 auto t_obj_dU =
topoData->getFTensorObjDDisplacement(nb_integration_pts);
685 auto t_P =
dataAtPts->getFTensorApproxP(nb_integration_pts);
686 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
687 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
688 auto t_jac =
topoData->getFTensorJacobian(nb_integration_pts);
705 auto get_ftensor1 = [](
auto &
v) {
707 &
v[0], &
v[1], &
v[2]);
712 const int nb_base_functions =
data.getN().size2();
714 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
715 locJ += (t_w *
v * t_det) * t_obj;
718 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
728 t_inv_jac(
I,
J) * t_jac(
j,
k) * t_P(
i,
k));
730 auto t_nf = get_ftensor1(
nF);
732 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
733 t_nf(
i) += (t_w *
v) * t_dJ_dX(
i,
j) * t_base_diff(
j);
737 for (; bb != nb_base_functions; ++bb)
752 "Topological data pointer is null");
755 const int nb_dofs =
data.getIndices().size();
759 const int nb_integration_pts =
data.getN().size1();
763 const int nb_base_functions =
data.getN().size2() /
SPACE_DIM;
769 auto get_ftensor1 = [](
auto &
v) {
771 &
v[0], &
v[1], &
v[2]);
774 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
776 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
777 const double a =
v * t_w;
778 auto t_nf = get_ftensor1(
nF);
781 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
782 t_nf(
i) +=
a * t_row_base_fun(
j) * t_obj_dP(
i,
j);
786 for (; bb != nb_base_functions; ++bb)
802 "Topological data pointer is null");
805 const int nb_dofs =
data.getIndices().size();
809 const int nb_integration_pts =
data.getN().size1();
815 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
820 auto get_ftensor0 = [](
auto &
v) {
824 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
825 const double a =
v * t_w;
826 auto t_nf = get_ftensor0(
nF);
829 for (; bb != nb_dofs; ++bb) {
830 t_nf +=
a * t_row_base_fun(
i,
j) * t_obj_dP(
i,
j);
834 for (; bb != nb_base_functions; ++bb)
850 "Topological data pointer is null");
853 const int nb_dofs =
data.getIndices().size();
857 const int nb_integration_pts =
data.getN().size1();
861 const int nb_base_functions =
data.getN().size2();
862 auto t_row_base_fun =
data.getFTensor0N();
863 auto t_obj_dw =
topoData->getFTensorObjDDisplacement(nb_integration_pts);
867 auto get_ftensor1 = [](
auto &
v) {
869 &
v[0], &
v[1], &
v[2]);
872 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
873 const double a =
v * t_w;
874 auto t_nf = get_ftensor1(
nF);
877 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
878 t_nf(
i) +=
a * t_row_base_fun * t_obj_dw(
i);
882 for (; bb != nb_base_functions; ++bb)
898 "Topological data pointer is null");
901 const int nb_dofs =
data.getIndices().size();
905 const int nb_integration_pts =
data.getN().size1();
909 const int nb_base_functions =
data.getN().size2();
910 auto t_row_base_fun =
data.getFTensor0N();
914 auto get_ftensor1 = [](
auto &
v) {
916 &
v[0], &
v[1], &
v[2]);
919 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
920 const double a =
v * t_w;
921 auto t_nf = get_ftensor1(
nF);
924 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
925 auto objective =
topoData->getFTensorObjDRotation(nb_integration_pts,
926 bb == 0 ? 0 : 1, gg);
927 t_nf(
i) +=
a * t_row_base_fun * objective(
i);
931 for (; bb != nb_base_functions; ++bb)
946 "Topological data pointer is null");
949 const int nb_dofs =
data.getIndices().size();
953 const int nb_integration_pts =
data.getN().size1();
955 auto t_w = getFTensor0IntegrationWeight();
956 const int nb_base_functions =
data.getN().size2();
957 auto t_row_base_fun =
data.getFTensor0N();
958 auto t_obj_du_gamma =
959 topoData->getFTensorObjDDisplacement(nb_integration_pts);
963 auto get_ftensor1 = [](
auto &
v) {
965 &
v[0], &
v[1], &
v[2]);
968 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
969 const double a = t_w * getMeasure();
970 auto t_nf = get_ftensor1(
nF);
973 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
974 t_nf(
i) +=
a * t_row_base_fun * t_obj_du_gamma(
i);
978 for (; bb != nb_base_functions; ++bb)
994 "Topological data pointer is null");
997 const int nb_dofs =
data.getIndices().size();
1001 const int nb_integration_pts = OP::getGaussPts().size2();
1003 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1004 auto t_w = OP::getFTensor0IntegrationWeight();
1005 const int nb_base_functions =
data.getN().size2() /
SPACE_DIM;
1007 auto t_obj_dtraction =
1008 topoData->getFTensorObjDDisplacement(nb_integration_pts);
1013 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1014 auto t_nf = getFTensor1FromPtr<SPACE_DIM>(&*OP::locF.begin());
1016 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1018 t_w * (t_row_base_fun(
j) * t_normal(
j)) * t_obj_dtraction(
i) * 0.5;
1022 for (; bb != nb_base_functions; ++bb)
1041 "Topological data pointer is null");
1044 "Broken displacement data pointer is null");
1047 "Hybrid displacement pointer is null");
1050 "Adjoint hybrid displacement pointer is null");
1053 const int nb_dofs =
data.getIndices().size();
1057 const int nb_integration_pts = getGaussPts().size2();
1058 const int nb_base_functions =
data.getN().size2();
1061 if (this->
nF.size() != nb_dofs)
1063 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1064 if (
data.getDiffN().size1() != nb_integration_pts)
1066 "Differential of base functions should have the same number of "
1067 "integration points as the data");
1068 if (
data.getDiffN().size2() != nb_base_functions * 2)
1070 "Differential of base functions should have the same number of "
1071 "base functions as the data");
1078 auto &coords = getCoords();
1082 std::get<2>(Tools::getTricircumcenter3d(coords.data().data()));
1084 auto t_w = getFTensor0IntegrationWeight();
1085 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1086 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1087 auto t_u_hybrid = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(*hybridDispPtr);
1088 auto t_var_u_hybrid =
1089 getFTensor1FromMat<
SPACE_DIM, -1,
DL>(*varHybridDispPtr);
1090 auto t_diff_base =
data.getFTensor1DiffN<2>();
1092 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1097 double area = std::sqrt(t_normal(
i) * t_normal(
i));
1099 t_da(
i) = t_normal(
i) / area;
1103 double tau_density = 0;
1105 auto t_u_broken = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(
1106 bd.getFlux(), nb_integration_pts);
1107 auto t_var_u_broken = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(
1108 bd.getVarFlux(), nb_integration_pts);
1109 for (
int ss = 0; ss != gg; ++ss) {
1117 const double hybrid_hybrid = t_var_u_hybrid(
i) * t_u_hybrid(
i);
1118 const double broken_broken = t_var_u_broken(
i) * t_u_broken(
i);
1119 const double hybrid_broken = -t_var_u_hybrid(
i) * t_u_broken(
i);
1120 const double broken_hybrid = -t_var_u_broken(
i) * t_u_hybrid(
i);
1122 hybrid_hybrid + broken_broken + hybrid_broken + broken_hybrid;
1126 locJ += t_w * tau * area * tau_density;
1128 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1130 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1137 t_w *
alphaTau * tau_density * (t_da(
i) * t_normal_dX(
i,
I)) /
h;
1141 for (; rr != nb_base_functions; ++rr)
1161 "Broken side data pointer is null");
1164 const int nb_dofs =
data.getIndices().size();
1168 const int nb_integration_pts = getGaussPts().size2();
1169 const int nb_base_functions =
data.getN().size2();
1172 if (
data.getDiffN().size1() != nb_integration_pts)
1174 "Differential of base functions should have the same number of "
1175 "integration points as the data");
1176 if (
data.getDiffN().size2() != nb_base_functions * 2)
1178 "Differential of base functions should have the same number of "
1179 "base functions as the data");
1182 double time = getFEMethod()->ts_t;
1191 const EntityHandle fe_ent = getFEEntityHandle();
1193 if (bc.faces.find(fe_ent) == bc.faces.end())
1201 <<
"No scaling method found for " << bc.blockName;
1209 auto t_w = getFTensor0IntegrationWeight();
1210 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1211 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1213 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1214 auto t_diff_base =
data.getFTensor1DiffN<2>();
1216 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1217 const double a = 0.5 * bd.getSense() * t_w;
1223 locJ +=
a * t_bc_disp(
i) * (t_var_flux(
i,
j) * t_normal(
j));
1225 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1227 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1235 for (; bb != nb_base_functions; ++bb)
1257 "Broken side data pointer is null");
1260 const int nb_dofs =
data.getIndices().size();
1264 const int nb_integration_pts = getGaussPts().size2();
1265 const int nb_base_functions =
data.getN().size2();
1268 if (
data.getDiffN().size1() != nb_integration_pts)
1270 "Differential of base functions should have the same number of "
1271 "integration points as the data");
1272 if (
data.getDiffN().size2() != nb_base_functions * 2)
1274 "Differential of base functions should have the same number of "
1275 "base functions as the data");
1282 const EntityHandle fe_ent = getFEEntityHandle();
1284 if (bc.faces.find(fe_ent) == bc.faces.end())
1290 auto t_w = getFTensor0IntegrationWeight();
1291 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1292 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1294 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1295 auto t_diff_base =
data.getFTensor1DiffN<2>();
1296 auto t_bc_disp = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(v_analytical_expr);
1298 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1299 const double a = 0.5 * bd.getSense() * t_w;
1305 locJ +=
a * t_bc_disp(
i) * (t_var_flux(
i,
j) * t_normal(
j));
1307 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1309 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1317 for (; bb != nb_base_functions; ++bb)
1341 int nb_dofs =
data.getFieldData().size();
1342 int nb_integration_pts = getGaussPts().size2();
1343 int nb_base_functions =
data.getN().size2();
1345 double time = getFEMethod()->ts_t;
1351 if (this->
nF.size() != nb_dofs)
1353 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1356 auto integrate_rhs = [&](
auto &bc,
auto calc_tau,
double time_scale) {
1359 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1360 auto t_diff_base =
data.getFTensor1DiffN<2>();
1361 auto t_w = getFTensor0IntegrationWeight();
1362 auto t_coords = getFTensor1CoordsAtGaussPts();
1365 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1366 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1368 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1374 double a = sqrt(t_normal(
i) * t_normal(
i));
1376 t_da(
i) = t_normal(
i) /
a;
1380 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1381 locJ -= (time_scale * t_w *
a * tau) * (t_val(
i) * t_var_u_gamma(
i));
1383 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1385 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1390 t_nf(
I) -= (time_scale * t_w * tau) * (t_val(
i) * t_var_u_gamma(
i)) *
1391 (t_da(
i) * t_normal_dX(
i,
I));
1395 for (; rr != nb_base_functions; ++rr)
1409 EntityHandle fe_ent = getFEEntityHandle();
1410 for (
auto &bc : *(
bcData)) {
1411 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1413 double time_scale = 1;
1419 if (std::regex_match(bc.blockName, std::regex(
".*COOK.*"))) {
1423 return -y * (y - 1) / 0.25;
1425 CHKERR integrate_rhs(bc, calc_tau, time_scale);
1428 bc, [](
double,
double,
double) {
return 1; }, time_scale);
1449 int nb_dofs =
data.getFieldData().size();
1450 int nb_integration_pts = getGaussPts().size2();
1451 int nb_base_functions =
data.getN().size2();
1454 if (this->
nF.size() != nb_dofs)
1456 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1459 auto integrate_rhs = [&](
auto &bc) {
1464 auto t_val = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(v_analytical_expr);
1465 auto t_diff_base =
data.getFTensor1DiffN<2>();
1466 auto t_w = getFTensor0IntegrationWeight();
1469 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1470 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1472 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1478 double a = sqrt(t_normal(
i) * t_normal(
i));
1480 t_da(
i) = t_normal(
i) /
a;
1484 locJ -= (t_w *
a) * (t_val(
i) * t_var_u_gamma(
i));
1486 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1488 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1494 t_w * (t_val(
i) * t_var_u_gamma(
i)) * (t_da(
i) * t_normal_dX(
i,
I));
1498 for (; rr != nb_base_functions; ++rr)
1511 EntityHandle fe_ent = getFEEntityHandle();
1512 for (
auto &bc : *(
bcData)) {
1513 if (bc.faces.find(fe_ent) != bc.faces.end() && nb_dofs) {
1514 CHKERR integrate_rhs(bc);
1527 "Topological data pointer is null");
1530 const int nb_dofs =
data.getIndices().size();
1534 const int nb_integration_pts =
data.getN().size1();
1538 const int nb_base_functions =
data.getN().size2();
1539 auto t_row_base_fun =
data.getFTensor0N();
1541 auto t_obj_dlog_stretch =
topoData->getFTensorObjDStrain(nb_integration_pts);
1548 auto get_ftensor1 = [](
auto &
v) {
1550 &
v[0], &
v[1], &
v[2], &
v[3], &
v[4], &
v[5]);
1553 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1554 const double a =
v * t_w;
1555 auto t_nf = get_ftensor1(
OP::nF);
1558 t_obj_dU(L) = t_obj_dlog_stretch(
i,
j) * t_L(
i,
j, L);
1561 for (; bb != nb_dofs /
size_symm; ++bb) {
1562 t_nf(L) +=
a * t_row_base_fun * t_obj_dU(L);
1566 for (; bb != nb_base_functions; ++bb)
1570 ++t_obj_dlog_stretch;
1580 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1581 boost::shared_ptr<TopologicalData> topo_ptr,
1582 SmartPetscObj<Vec> assemble_vec,
const double alpha,
const double rho,
1583 const double alpha_viscous_omega = 0,
1584 boost::shared_ptr<double> J_ptr =
nullptr)
1586 field_name, data_ptr, topo_ptr, J_ptr, assemble_vec,
Tag()),
1594 "L2 user base scale is set to %d, current inplementation only "
1595 "hanlde case for false",
1603 "DataAtIntegrationPts pointer is null");
1606 const int nb_dofs =
data.getIndices().size();
1610 const int nb_integration_pts =
getGaussPts().size2();
1615 auto t_div_P =
dataAtPts->getFTensorDivP(nb_integration_pts);
1616 auto t_var_w =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
1618 auto t_approx_P =
dataAtPts->getFTensorApproxP(nb_integration_pts);
1619 auto t_u_h1 =
dataAtPts->getFTensorStretchH1(nb_integration_pts);
1620 auto t_var_omega =
dataAtPts->getFTensorVarRotAxis(nb_integration_pts);
1622 auto t_h =
dataAtPts->getFTensorSmallH(nb_integration_pts);
1623 auto t_var_P =
dataAtPts->getFTensorVarPiola(nb_integration_pts);
1624 auto t_w_l2 =
dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1625 auto t_var_div_P =
dataAtPts->getFTensorDivVarPiola(nb_integration_pts);
1627 auto t_jac =
topoData->getFTensorJacobian(nb_integration_pts);
1629 auto get_ftensor1 = [](
auto &
v) {
1631 &
v[0], &
v[1], &
v[2]);
1661 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1667 using namespace LogarithmicDirectionalDerivatives;
1670 auto view = GetFTensor1FromMatImpl<3, -1, DL, MatrixDouble>::get(
1672 result(
i) = view(
i);
1675 const SplitRotation rotation(read(
dataAtPts->constantRotation),
1678 rotation.first(read(
dataAtPts->varConstantRotation),
1681 variation_R(
i,
j) = levi_civita(
i,
j,
k) * t_var_omega(
k);
1690 const auto beta =
a * (t_div_P(
i) * t_var_w(
i));
1703 (variation_R(
j,
k) * t_u_h1(
k,
l))
1705 * (t_approx_P(
j,
n) * t_jac(
l,
n));
1709 (variation_R(
j,
k) * t_u_h1(
k,
l))
1711 * (t_approx_P(
j,
n) * t_diff(
l,
n,
I,
J));
1719 * (t_approx_P(
i,
n) * t_jac(
j,
n));
1725 * (t_approx_P(
i,
n) * t_diff(
j,
n,
I,
J));
1730 "gradApproximator not handled");
1735 auto t_nf = get_ftensor1(
nF);
1736 auto t_base_diff =
data.getFTensor1DiffN<3>(gg, 0);
1737 for (
int bb = 0; bb != nb_dofs /
SPACE_DIM; ++bb) {
1738 t_nf(
i) -=
a * (t_beta_dX(
i,
j) * t_base_diff(
j));
1746 (t_h(
i,
j) -
t_kd(
i,
j)) * (t_var_P(
i,
n) * t_jac(
j,
n));
1751 auto t_nf = get_ftensor1(
nF);
1752 auto t_base_diff =
data.getFTensor1DiffN<3>(gg, 0);
1753 for (
int bb = 0; bb != nb_dofs /
SPACE_DIM; ++bb) {
1754 t_nf(
i) -=
a * (t_beta_dX(
i,
j) * t_base_diff(
j));
1761 const auto beta = t_w_l2(
i) * t_var_div_P(
i);
1780 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1781 SmartPetscObj<Vec> assemble_vec,
1782 boost::shared_ptr<TopologicalData> topo_ptr,
1783 const double alpha,
const double rho,
1784 const double alpha_viscous_omega = 0)
1786 field_name, data_ptr, topo_ptr, nullptr, assemble_vec,
Tag()),
1788 if (alpha_viscous_omega)
1791 "OpSensitivityInterior_dX with alpha_viscous_omega != 0 is not "
1801 "DataAtIntegrationPts pointer is null");
1804 const int nb_dofs =
data.getIndices().size();
1808 const int nb_integration_pts =
getGaussPts().size2();
1812 auto t_div_P =
dataAtPts->getFTensorDivP(nb_integration_pts);
1813 auto t_w_l2 =
dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1814 auto t_s_dot_w =
dataAtPts->getFTensorSmallWL2Dot(nb_integration_pts);
1815 auto t_s_dot_dot_w =
1816 dataAtPts->getFTensorSmallWL2DotDot(nb_integration_pts);
1817 auto t_h =
dataAtPts->getFTensorSmallH(nb_integration_pts);
1818 auto t_levi_kirchhoff =
1819 dataAtPts->getFTensorLeviKirchhoff(nb_integration_pts);
1820 auto t_omega_grad_dot =
1821 dataAtPts->getFTensorRotAxisGradDot(nb_integration_pts);
1822 auto t_R =
dataAtPts->getFTensorRotMat(nb_integration_pts);
1823 auto t_u =
dataAtPts->getFTensorStretch(nb_integration_pts);
1825 auto t_var_w =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
1826 auto t_var_grad_omega =
1827 dataAtPts->getFTensorVarGradRotAxis(nb_integration_pts);
1828 auto t_var_P =
dataAtPts->getFTensorVarPiola(nb_integration_pts);
1829 auto t_var_div_P =
dataAtPts->getFTensorDivVarPiola(nb_integration_pts);
1830 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
1831 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
1833 auto w_l2_dot_dot_at_pts =
dataAtPts->getSmallWL2DotDotAtPts();
1834 if (w_l2_dot_dot_at_pts->size1() != nb_integration_pts ||
1835 w_l2_dot_dot_at_pts->size2() !=
SPACE_DIM) {
1837 *w_l2_dot_dot_at_pts, nb_integration_pts);
1838 w_l2_dot_dot_at_pts->clear();
1841 const auto piola_scale =
dataAtPts->piolaScale;
1842 const auto alpha_w =
alphaW / piola_scale;
1843 const auto alpha_rho =
alphaRho / piola_scale;
1845 const int nb_base_functions =
data.getN().size2();
1846 auto t_base_diff =
data.getFTensor1DiffN<3>();
1848 auto get_ftensor1 = [](
auto &
v) {
1850 &
v[0], &
v[1], &
v[2]);
1881 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1885 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
1887 double consistency_residual = 0;
1889 consistency_residual = -0.5 * t_var_P(
k,
m) * (t_R(
k,
l) * t_u(
l,
m)) -
1890 0.5 * t_var_P(
k,
l) * (t_R(
k,
m) * t_u(
l,
m)) +
1895 consistency_residual = t_var_P(
k,
m) * (-t_residuum_P(
k,
m));
1898 auto t_nf = get_ftensor1(
nF);
1900 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1903 t_div_base(
i) = -(1 / t_det) * (t_inv_jac(
j,
i) * t_base_diff(
j));
1906 t_nf(
i) += (t_w *
v) *
1907 (t_var_w(
k) * (-t_div_P(
k) + alpha_w * t_s_dot_w(
k) +
1908 alpha_rho * t_s_dot_dot_w(
k))) *
1909 t_cof(
i,
j) * t_base_diff(
j);
1910 t_nf(
i) += (t_w *
v) * (-(t_var_w(
k) * t_div_P(
k))) * t_div_base(
i);
1913 auto constant_work =
1914 dataAtPts->getFTensorLeviKirchhoff(nb_integration_pts, 0, gg);
1915 auto constant_variation =
1916 GetFTensor1FromMatImpl<3, -1, DL, MatrixDouble>::get(
1917 *
dataAtPts->varConstantRotation, gg, 0);
1918 auto higher_variation =
1919 GetFTensor1FromMatImpl<3, -1, DL, MatrixDouble>::get(
1921 const double rotation_work = constant_variation(
k) * constant_work(
k) +
1922 higher_variation(
k) * t_levi_kirchhoff(
k);
1923 t_nf(
i) -= (t_w *
v * rotation_work) * t_cof(
i,
j) * t_base_diff(
j);
1927 (t_w *
v * consistency_residual) * t_cof(
i,
j) * t_base_diff(
j);
1930 t_nf(
i) += (t_w *
v) * (t_var_div_P(
k) * (-t_w_l2(
k))) * t_cof(
i,
j) *
1932 t_nf(
i) += (t_w *
v) * (t_var_div_P(
k) * (-t_w_l2(
k))) * t_div_base(
i);
1937 for (; bb != nb_base_functions; ++bb)
1954 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1955 SmartPetscObj<Vec> assemble_vec,
1956 boost::shared_ptr<TopologicalData> topo_ptr,
1957 std::vector<boost::shared_ptr<ScalingMethod>> smv,
1958 boost::shared_ptr<double> J_ptr =
nullptr)
1960 field_name, data_ptr, topo_ptr, J_ptr, assemble_vec,
Tag()),
1978 "DataAtIntegrationPts pointer is null");
1981 const int nb_dofs =
data.getIndices().size();
1985 const int nb_integration_pts =
getGaussPts().size2();
1989 auto t_var_w_l2 =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
1990 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
1991 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
1993 const int nb_base_functions =
data.getN().size2();
1994 auto t_base_diff =
data.getFTensor1DiffN<3>();
1996 auto get_ftensor1 = [](
auto &
v) {
1998 &
v[0], &
v[1], &
v[2]);
2010 auto get_scale = [&](
const double t) {
2014 s *= o->getScale(
t);
2021 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2022 const double alpha =
scale * t_w *
v;
2024 double adjount = t_var_w_l2(
i) *
tForce(
i);
2025 locJ += (alpha * t_det) * adjount;
2028 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
2030 auto t_nf = get_ftensor1(
nF);
2032 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
2033 t_nf(
i) += (alpha * adjount) * t_cof(
i,
J) * t_base_diff(
J);
2038 for (; bb != nb_base_functions; ++bb)
2051 auto cubit_meshset_ptr =
2052 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
2055 std::vector<double> block_data;
2056 CHKERR cubit_meshset_ptr->getAttributes(block_data);
2060 <<
"BLOCKSET is expected to have " <<
SPACE_DIM
2061 <<
" attributes but has size " << block_data.size();
2064 "Size of attribute in BLOCKSET is too small");
2068 for (
unsigned int ii = 0; ii !=
SPACE_DIM; ++ii) {
2069 tForce(ii) = block_data[ii];
2073 <<
"Flux blockset " << cubit_meshset_ptr->getName();
2075 <<
"Number of attributes " << block_data.size();
2077 this->
entsPtr = boost::make_shared<Range>();
2078 CHKERR m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
2081 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"tForce vector initialised: " <<
tForce;
2082 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"Number of elements " <<
entsPtr->size();
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
boost::shared_ptr< DataAtIntegrationPts > data
SmartPetscObj< Vec > gradient
SmartPetscObj< Vec > values
#define FTENSOR_INDEXES(DIM,...)
#define FTENSOR_INDEX(DIM, I)
Mapping from symmetric tensor indices to packed storage index.
#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
boost::shared_ptr< MatrixDouble > MatrixPtr
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)
virtual moab::Interface & get_moab()=0
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
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