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);
519 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matInvD));
522 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matInvD));
527 auto conversion_of_biot_stress = [&]() {
531 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
532 *
topoData->getObjDRotationAtPts(), nb_gauss_pts);
533 topoData->getObjDRotationAtPts()->clear();
535 auto t_obj_dbiot =
topoData->getFTensorObjDStress(nb_gauss_pts);
536 auto t_obj_domega =
topoData->getFTensorObjDRotation(nb_gauss_pts);
537 auto t_R =
dataAtPts->getFTensorRotMat(nb_gauss_pts);
538 auto t_P =
dataAtPts->getFTensorApproxP(nb_gauss_pts);
539 auto t_grad_h1 =
dataAtPts->getFTensorSmallWGradH1(nb_gauss_pts);
540 auto t_omega =
dataAtPts->getFTensorRotAxis(nb_gauss_pts);
549 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
551 t_dJ_dbiot(
l, o) = t_obj_dbiot(
l, o);
557 t_obj_dbiot(
i,
k) = t_dJ_dbiot(
i,
k);
569 "rotationSelector not handled");
573 t_obj_dbiot(
i,
k) = t_R(
i,
l) * t_dJ_dbiot(
l,
k);
574 t_obj_domega(
m) = t_dJ_dbiot(
l,
k) * t_diff_R(
i,
l,
m) * t_P(
i,
k);
579 t_h1(o,
k) =
t_kd(o,
k) + t_grad_h1(o,
k);
584 t_diff_R(
i,
l,
m) = levi_civita(
i,
l,
m);
592 "rotationSelector not handled");
596 t_obj_dbiot(
i,
k) = t_R(
i,
l) * (t_dJ_dbiot(
l, o) * t_h1(o,
k));
598 t_dJ_dbiot(
l, o) * (t_diff_R(
i,
l,
m) * t_P(
i,
k)) * t_h1(o,
k);
602 "gradApproximator not handled");
616 auto conversion_of_stretch = [&]() {
620 auto t_obj_dstretch =
topoData->getFTensorObjDStrain(nb_gauss_pts);
621 auto t_diff_stretch =
dataAtPts->getFTensorDiffStretch(nb_gauss_pts);
628 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
630 t_dJ_dstretch(
i,
j) = t_obj_dstretch(
i,
j);
632 t_obj_dstretch(
k,
l) = t_dJ_dstretch(
i,
j) * t_diff_stretch(
i,
j,
k,
l);
641 auto conversion_of_stretch_to_stress_for_no_stretch = [&](
auto t_inv_D) {
645 auto t_obj_dstress =
topoData->getFTensorObjDStress(nb_gauss_pts);
646 auto t_obj_dstretch =
topoData->getFTensorObjDStrain(nb_gauss_pts);
653 for (
auto gg = 0; gg != nb_gauss_pts; ++gg) {
655 t_dstretch_dstress(
i,
j) =
656 ((t_obj_dstretch(
k,
l) || t_obj_dstretch(
l,
k)) / 2.) *
659 t_obj_dstress(
i,
j) += t_dstretch_dstress(
i,
j);
671 CHKERR evaluate_python_objective();
672 CHKERR conversion_of_biot_stress();
677 CHKERR conversion_of_stretch_to_stress_for_no_stretch(
678 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
dataAtPts->matInvD));
680 CHKERR conversion_of_stretch_to_stress_for_no_stretch(
681 getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->matInvD));
684 CHKERR conversion_of_stretch();
689 CHKERR evaluate_energy_of_hencky_model_nostreach();
690 CHKERR conversion_of_biot_stress();
692 CHKERR evaluate_energy_of_hencky_model();
697 "Objective model type not handled");
710 "Topological data pointer is null");
717 const int nb_integration_pts =
getGaussPts().size2();
721 auto t_obj =
topoData->getFTensorObj(nb_integration_pts);
722 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
723 auto t_obj_dStrain =
topoData->getFTensorObjDStrain(nb_integration_pts);
724 auto t_obj_dU =
topoData->getFTensorObjDDisplacement(nb_integration_pts);
725 auto t_P =
dataAtPts->getFTensorApproxP(nb_integration_pts);
726 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
727 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
728 auto t_jac =
topoData->getFTensorJacobian(nb_integration_pts);
745 auto get_ftensor1 = [](
auto &
v) {
747 &
v[0], &
v[1], &
v[2]);
752 const int nb_base_functions = data.
getN().size2();
754 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
755 locJ += (t_w *
v * t_det) * t_obj;
758 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
768 t_inv_jac(
I,
J) * t_jac(
j,
k) * t_P(
i,
k));
770 auto t_nf = get_ftensor1(
nF);
772 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
773 t_nf(
i) += (t_w *
v) * t_dJ_dX(
i,
j) * t_base_diff(
j);
777 for (; bb != nb_base_functions; ++bb)
792 "Topological data pointer is null");
799 const int nb_integration_pts = data.
getN().size1();
803 const int nb_base_functions = data.
getN().size2() /
SPACE_DIM;
809 auto get_ftensor1 = [](
auto &
v) {
811 &
v[0], &
v[1], &
v[2]);
814 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
816 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
817 const double a =
v * t_w;
818 auto t_nf = get_ftensor1(
nF);
821 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
822 t_nf(
i) +=
a * t_row_base_fun(
j) * t_obj_dP(
i,
j);
826 for (; bb != nb_base_functions; ++bb)
842 "Topological data pointer is null");
849 const int nb_integration_pts = data.
getN().size1();
855 auto t_obj_dP =
topoData->getFTensorObjDStress(nb_integration_pts);
860 auto get_ftensor0 = [](
auto &
v) {
864 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
865 const double a =
v * t_w;
866 auto t_nf = get_ftensor0(
nF);
869 for (; bb != nb_dofs; ++bb) {
870 t_nf +=
a * t_row_base_fun(
i,
j) * t_obj_dP(
i,
j);
874 for (; bb != nb_base_functions; ++bb)
890 "Topological data pointer is null");
897 const int nb_integration_pts = data.
getN().size1();
901 const int nb_base_functions = data.
getN().size2();
903 auto t_obj_dw =
topoData->getFTensorObjDDisplacement(nb_integration_pts);
907 auto get_ftensor1 = [](
auto &
v) {
909 &
v[0], &
v[1], &
v[2]);
912 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
913 const double a =
v * t_w;
914 auto t_nf = get_ftensor1(
nF);
917 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
918 t_nf(
i) +=
a * t_row_base_fun * t_obj_dw(
i);
922 for (; bb != nb_base_functions; ++bb)
938 "Topological data pointer is null");
945 const int nb_integration_pts = data.
getN().size1();
949 const int nb_base_functions = data.
getN().size2();
951 auto t_obj_domega =
topoData->getFTensorObjDRotation(nb_integration_pts);
955 auto get_ftensor1 = [](
auto &
v) {
957 &
v[0], &
v[1], &
v[2]);
960 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
961 const double a =
v * t_w;
962 auto t_nf = get_ftensor1(
nF);
965 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
966 t_nf(
i) +=
a * t_row_base_fun * t_obj_domega(
i);
970 for (; bb != nb_base_functions; ++bb)
986 "Topological data pointer is null");
993 const int nb_integration_pts = data.
getN().size1();
995 auto t_w = getFTensor0IntegrationWeight();
996 const int nb_base_functions = data.
getN().size2();
998 auto t_obj_du_gamma =
999 topoData->getFTensorObjDDisplacement(nb_integration_pts);
1003 auto get_ftensor1 = [](
auto &
v) {
1005 &
v[0], &
v[1], &
v[2]);
1008 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1009 const double a = t_w * getMeasure();
1010 auto t_nf = get_ftensor1(
nF);
1013 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1014 t_nf(
i) +=
a * t_row_base_fun * t_obj_du_gamma(
i);
1018 for (; bb != nb_base_functions; ++bb)
1034 "Topological data pointer is null");
1037 const int nb_dofs = data.
getIndices().size();
1041 const int nb_integration_pts = OP::getGaussPts().size2();
1043 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1044 auto t_w = OP::getFTensor0IntegrationWeight();
1045 const int nb_base_functions = data.
getN().size2() /
SPACE_DIM;
1047 auto t_obj_dtraction =
1048 topoData->getFTensorObjDDisplacement(nb_integration_pts);
1053 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1054 auto t_nf = getFTensor1FromPtr<SPACE_DIM>(&*OP::locF.begin());
1056 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1058 t_w * (t_row_base_fun(
j) * t_normal(
j)) * t_obj_dtraction(
i) * 0.5;
1062 for (; bb != nb_base_functions; ++bb)
1081 "Topological data pointer is null");
1084 "Broken displacement data pointer is null");
1087 "Hybrid displacement pointer is null");
1090 "Adjoint hybrid displacement pointer is null");
1093 const int nb_dofs = data.
getIndices().size();
1097 const int nb_integration_pts = getGaussPts().size2();
1098 const int nb_base_functions = data.
getN().size2();
1101 if (this->
nF.size() != nb_dofs)
1103 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1104 if (data.
getDiffN().size1() != nb_integration_pts)
1106 "Differential of base functions should have the same number of "
1107 "integration points as the data");
1108 if (data.
getDiffN().size2() != nb_base_functions * 2)
1110 "Differential of base functions should have the same number of "
1111 "base functions as the data");
1118 auto &coords = getCoords();
1121 const double h = std::get<2>(Tools::getTricircumcenter3d(coords.data().data()));
1123 auto t_w = getFTensor0IntegrationWeight();
1124 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1125 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1126 auto t_u_hybrid = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(*hybridDispPtr);
1127 auto t_var_u_hybrid =
1128 getFTensor1FromMat<
SPACE_DIM, -1,
DL>(*varHybridDispPtr);
1131 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1136 double area = std::sqrt(t_normal(
i) * t_normal(
i));
1138 t_da(
i) = t_normal(
i) / area;
1142 double tau_density = 0;
1145 getFTensor1FromMat<
SPACE_DIM, -1,
DL>(bd.getFlux(), nb_integration_pts);
1146 auto t_var_u_broken = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(
1147 bd.getVarFlux(), nb_integration_pts);
1148 for (
int ss = 0; ss != gg; ++ss) {
1156 const double hybrid_hybrid = t_var_u_hybrid(
i) * t_u_hybrid(
i);
1157 const double broken_broken = t_var_u_broken(
i) * t_u_broken(
i);
1158 const double hybrid_broken = -t_var_u_hybrid(
i) * t_u_broken(
i);
1159 const double broken_hybrid = -t_var_u_broken(
i) * t_u_hybrid(
i);
1161 hybrid_hybrid + broken_broken + hybrid_broken + broken_hybrid;
1165 locJ += t_w * tau * area * tau_density;
1167 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1169 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1176 t_w *
alphaTau * tau_density * (t_da(
i) * t_normal_dX(
i,
I)) /
h;
1180 for (; rr != nb_base_functions; ++rr)
1200 "Broken side data pointer is null");
1204 const int nb_dofs = data.
getIndices().size();
1208 const int nb_integration_pts = getGaussPts().size2();
1209 const int nb_base_functions = data.
getN().size2();
1211 if (data.
getDiffN().size1() != nb_integration_pts)
1213 "Differential of base functions should have the same number of "
1214 "integration points as the data");
1215 if (data.
getDiffN().size2() != nb_base_functions * 2)
1217 "Differential of base functions should have the same number of "
1218 "base functions as the data");
1220 double time = getFEMethod()->ts_t;
1231 if (bc.faces.find(fe_ent) == bc.faces.end())
1239 <<
"No scaling method found for " << bc.blockName;
1247 auto t_w = getFTensor0IntegrationWeight();
1248 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1249 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1251 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1254 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1255 const double a = 0.5 * bd.getSense() * t_w;
1261 locJ +=
a * t_bc_disp(
i) * (t_var_flux(
i,
j) * t_normal(
j));
1263 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1265 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1273 for (; bb != nb_base_functions; ++bb)
1297 "Broken side data pointer is null");
1300 const int nb_dofs = data.
getIndices().size();
1304 const int nb_integration_pts = getGaussPts().size2();
1305 const int nb_base_functions = data.
getN().size2();
1307 if (data.
getDiffN().size1() != nb_integration_pts)
1309 "Differential of base functions should have the same number of "
1310 "integration points as the data");
1311 if (data.
getDiffN().size2() != nb_base_functions * 2)
1313 "Differential of base functions should have the same number of "
1314 "base functions as the data");
1322 if (bc.faces.find(fe_ent) == bc.faces.end())
1325 auto v_analytical_expr =
1329 auto t_w = getFTensor0IntegrationWeight();
1330 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1331 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1333 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(bd.getVarFlux());
1336 getFTensor1FromMat<
SPACE_DIM, -1,
DL>(v_analytical_expr);
1338 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1339 const double a = 0.5 * bd.getSense() * t_w;
1345 locJ +=
a * t_bc_disp(
i) * (t_var_flux(
i,
j) * t_normal(
j));
1347 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1349 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1357 for (; bb != nb_base_functions; ++bb)
1382 int nb_integration_pts = getGaussPts().size2();
1383 int nb_base_functions = data.
getN().size2();
1385 double time = getFEMethod()->ts_t;
1391 if (this->
nF.size() != nb_dofs)
1393 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1396 auto integrate_rhs = [&](
auto &bc,
auto calc_tau,
double time_scale) {
1399 auto t_val = getFTensor1FromPtr<3>(&*bc.vals.begin());
1401 auto t_w = getFTensor0IntegrationWeight();
1402 auto t_coords = getFTensor1CoordsAtGaussPts();
1405 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1406 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1408 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1414 double a = sqrt(t_normal(
i) * t_normal(
i));
1416 t_da(
i) = t_normal(
i) /
a;
1420 const auto tau = calc_tau(t_coords(0), t_coords(1), t_coords(2));
1421 locJ -= (time_scale * t_w *
a * tau) * (t_val(
i) * t_var_u_gamma(
i));
1423 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1425 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1430 t_nf(
I) -= (time_scale * t_w * tau) * (t_val(
i) * t_var_u_gamma(
i)) *
1431 (t_da(
i) * t_normal_dX(
i,
I));
1435 for (; rr != nb_base_functions; ++rr)
1450 for (
auto &bc : *(
bcData)) {
1451 if (bc.faces.find(fe_ent) != bc.faces.end()) {
1453 double time_scale = 1;
1459 if (std::regex_match(bc.blockName, std::regex(
".*COOK.*"))) {
1463 return -y * (y - 1) / 0.25;
1465 CHKERR integrate_rhs(bc, calc_tau, time_scale);
1468 bc, [](
double,
double,
double) {
return 1; }, time_scale);
1490 int nb_integration_pts = getGaussPts().size2();
1491 int nb_base_functions = data.
getN().size2();
1494 if (this->
nF.size() != nb_dofs)
1496 "Size of nF %ld != nb_dofs %d", this->
nF.size(), nb_dofs);
1499 auto integrate_rhs = [&](
auto &bc) {
1502 auto v_analytical_expr =
1505 auto t_val = getFTensor1FromMat<
SPACE_DIM, -1,
DL>(v_analytical_expr);
1507 auto t_w = getFTensor0IntegrationWeight();
1510 auto t_tangent1 = getFTensor1Tangent1AtGaussPts();
1511 auto t_tangent2 = getFTensor1Tangent2AtGaussPts();
1513 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1519 double a = sqrt(t_normal(
i) * t_normal(
i));
1521 t_da(
i) = t_normal(
i) /
a;
1525 locJ -= (t_w *
a) * (t_val(
i) * t_var_u_gamma(
i));
1527 auto t_nf = getFTensor1FromArray<SPACE_DIM, SPACE_DIM>(
nF);
1529 for (; rr != nb_dofs /
SPACE_DIM; ++rr) {
1534 t_nf(
I) -= t_w * (t_val(
i) * t_var_u_gamma(
i)) *
1535 (t_da(
i) * t_normal_dX(
i,
I));
1539 for (; rr != nb_base_functions; ++rr)
1553 for (
auto &bc : *(
bcData)) {
1554 if (bc.faces.find(fe_ent) != bc.faces.end() && nb_dofs) {
1555 CHKERR integrate_rhs(bc);
1568 "Topological data pointer is null");
1571 const int nb_dofs = data.
getIndices().size();
1575 const int nb_integration_pts = data.
getN().size1();
1579 const int nb_base_functions = data.
getN().size2();
1582 auto t_obj_dlog_stretch =
topoData->getFTensorObjDStrain(nb_integration_pts);
1589 auto get_ftensor1 = [](
auto &
v) {
1591 &
v[0], &
v[1], &
v[2], &
v[3], &
v[4], &
v[5]);
1594 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1595 const double a =
v * t_w;
1596 auto t_nf = get_ftensor1(
OP::nF);
1599 t_obj_dU(L) = t_obj_dlog_stretch(
i,
j) * t_L(
i,
j, L);
1602 for (; bb != nb_dofs /
size_symm; ++bb) {
1603 t_nf(L) +=
a * t_row_base_fun * t_obj_dU(L);
1607 for (; bb != nb_base_functions; ++bb)
1611 ++t_obj_dlog_stretch;
1621 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1622 boost::shared_ptr<TopologicalData> topo_ptr,
1623 SmartPetscObj<Vec> assemble_vec,
const double alpha,
const double rho,
1624 const double alpha_viscous_omega = 0,
1625 boost::shared_ptr<double> J_ptr =
nullptr)
1627 field_name, data_ptr, topo_ptr, J_ptr, assemble_vec,
Tag()),
1636 "L2 user base scale is set to %d, current inplementation only "
1637 "hanlde case for false",
1645 "DataAtIntegrationPts pointer is null");
1648 const int nb_dofs = data.
getIndices().size();
1652 const int nb_integration_pts =
getGaussPts().size2();
1657 auto t_div_P =
dataAtPts->getFTensorDivP(nb_integration_pts);
1658 auto t_var_w =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
1660 auto t_approx_P =
dataAtPts->getFTensorApproxP(nb_integration_pts);
1661 auto t_omega =
dataAtPts->getFTensorRotAxis(nb_integration_pts);
1662 auto t_u_h1 =
dataAtPts->getFTensorStretchH1(nb_integration_pts);
1663 auto t_var_omega =
dataAtPts->getFTensorVarRotAxis(nb_integration_pts);
1665 auto t_h =
dataAtPts->getFTensorSmallH(nb_integration_pts);
1666 auto t_var_P =
dataAtPts->getFTensorVarPiola(nb_integration_pts);
1667 auto t_w_l2 =
dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1668 auto t_var_div_P =
dataAtPts->getFTensorDivVarPiola(nb_integration_pts);
1670 auto t_jac =
topoData->getFTensorJacobian(nb_integration_pts);
1672 auto get_ftensor1 = [](
auto &
v) {
1674 &
v[0], &
v[1], &
v[2]);
1705 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1712 t_diff_R(
i,
j,
k) = levi_civita(
i,
j,
k);
1720 "rotationSelector not handled");
1729 const auto beta =
a * (t_div_P(
i) * t_var_w(
i));
1742 ((t_diff_R(
j,
k,
m) * t_var_omega(
m)) * t_u_h1(
k,
l))
1744 * (t_approx_P(
j,
n) * t_jac(
l,
n));
1748 ((t_diff_R(
j,
k,
m) * t_var_omega(
m)) * t_u_h1(
k,
l))
1750 * (t_approx_P(
j,
n) * t_diff(
l,
n,
I,
J));
1756 (levi_civita(
i,
j,
k) * t_var_omega(
k))
1758 * (t_approx_P(
i,
n) * t_jac(
j,
n));
1762 (t_diff_R(
i,
j,
k) * t_var_omega(
k))
1764 * (t_approx_P(
i,
n) * t_diff(
j,
n,
I,
J));
1769 "gradApproximator not handled");
1774 auto t_nf = get_ftensor1(
nF);
1776 for (
int bb = 0; bb != nb_dofs /
SPACE_DIM; ++bb) {
1777 t_nf(
i) -=
a * (t_beta_dX(
i,
j) * t_base_diff(
j));
1785 (t_h(
i,
j) -
t_kd(
i,
j)) * (t_var_P(
i,
n) * t_jac(
j,
n));
1790 auto t_nf = get_ftensor1(
nF);
1792 for (
int bb = 0; bb != nb_dofs /
SPACE_DIM; ++bb) {
1793 t_nf(
i) -=
a * (t_beta_dX(
i,
j) * t_base_diff(
j));
1800 const auto beta = t_w_l2(
i) * t_var_div_P(
i);
1821 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1822 SmartPetscObj<Vec> assemble_vec,
1823 boost::shared_ptr<TopologicalData> topo_ptr,
1824 const double alpha,
const double rho,
1825 const double alpha_viscous_omega = 0)
1827 field_name, data_ptr, topo_ptr, nullptr, assemble_vec,
Tag()),
1837 "DataAtIntegrationPts pointer is null");
1840 const int nb_dofs = data.
getIndices().size();
1847 "OpSensitivity_dX with alpha_viscous_omega != 0 is not "
1852 const int nb_integration_pts =
getGaussPts().size2();
1856 auto t_div_P =
dataAtPts->getFTensorDivP(nb_integration_pts);
1857 auto t_w_l2 =
dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1858 auto t_s_dot_w =
dataAtPts->getFTensorSmallWL2Dot(nb_integration_pts);
1859 auto t_s_dot_dot_w =
1860 dataAtPts->getFTensorSmallWL2DotDot(nb_integration_pts);
1861 auto t_h =
dataAtPts->getFTensorSmallH(nb_integration_pts);
1862 auto t_levi_kirchhoff =
1863 dataAtPts->getFTensorLeviKirchhoff(nb_integration_pts);
1864 auto t_omega_grad_dot =
1865 dataAtPts->getFTensorRotAxisGradDot(nb_integration_pts);
1866 auto t_R =
dataAtPts->getFTensorRotMat(nb_integration_pts);
1867 auto t_u =
dataAtPts->getFTensorStretch(nb_integration_pts);
1869 auto t_var_w =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
1870 auto t_var_omega =
dataAtPts->getFTensorVarRotAxis(nb_integration_pts);
1871 auto t_var_grad_omega =
1872 dataAtPts->getFTensorVarGradRotAxis(nb_integration_pts);
1873 auto t_var_P =
dataAtPts->getFTensorVarPiola(nb_integration_pts);
1874 auto t_var_div_P =
dataAtPts->getFTensorDivVarPiola(nb_integration_pts);
1875 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
1876 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
1878 auto w_l2_dot_dot_at_pts =
dataAtPts->getSmallWL2DotDotAtPts();
1879 if (w_l2_dot_dot_at_pts->size1() != nb_integration_pts ||
1880 w_l2_dot_dot_at_pts->size2() !=
SPACE_DIM) {
1881 MatrixSizeHelper<GetFTensor1FromMatType<
SPACE_DIM, -1,
DL>,
DL>::size(
1882 *w_l2_dot_dot_at_pts, nb_integration_pts);
1883 w_l2_dot_dot_at_pts->clear();
1886 const auto piola_scale =
dataAtPts->piolaScale;
1887 const auto alpha_w =
alphaW / piola_scale;
1888 const auto alpha_rho =
alphaRho / piola_scale;
1890 const int nb_base_functions = data.
getN().size2();
1893 auto get_ftensor1 = [](
auto &
v) {
1895 &
v[0], &
v[1], &
v[2]);
1927 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
1931 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
1933 double consistency_residual = 0;
1935 consistency_residual =
1936 -0.5 * t_var_P(
k,
m) * (t_R(
k,
l) * t_u(
l,
m)) -
1937 0.5 * t_var_P(
k,
l) * (t_R(
k,
m) * t_u(
l,
m)) +
1942 consistency_residual =
1943 t_var_P(
k,
m) * (-t_residuum_P(
k,
m));
1946 auto t_nf = get_ftensor1(
nF);
1948 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
1951 t_div_base(
i) = -(1 / t_det) * (t_inv_jac(
j,
i) * t_base_diff(
j));
1954 t_nf(
i) += (t_w *
v) *
1955 (t_var_w(
k) * (-t_div_P(
k) + alpha_w * t_s_dot_w(
k) +
1956 alpha_rho * t_s_dot_dot_w(
k))) *
1957 t_cof(
i,
j) * t_base_diff(
j);
1958 t_nf(
i) += (t_w *
v) * (-(t_var_w(
k) * t_div_P(
k))) * t_div_base(
i);
1961 t_nf(
i) += (t_w *
v) * (t_var_omega(
k) * (-t_levi_kirchhoff(
k))) *
1962 t_cof(
i,
j) * t_base_diff(
j);
1965 t_nf(
i) += (t_w *
v * consistency_residual) * t_cof(
i,
j) *
1969 t_nf(
i) += (t_w *
v) * (t_var_div_P(
k) * (-t_w_l2(
k))) * t_cof(
i,
j) *
1971 t_nf(
i) += (t_w *
v) * (t_var_div_P(
k) * (-t_w_l2(
k))) * t_div_base(
i);
1976 for (; bb != nb_base_functions; ++bb)
1995 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
1996 SmartPetscObj<Vec> assemble_vec,
1997 boost::shared_ptr<TopologicalData> topo_ptr,
1998 std::vector<boost::shared_ptr<ScalingMethod>> smv,
1999 boost::shared_ptr<double> J_ptr =
nullptr)
2001 field_name, data_ptr, topo_ptr, J_ptr, assemble_vec,
Tag()),
2019 "DataAtIntegrationPts pointer is null");
2022 const int nb_dofs = data.
getIndices().size();
2026 const int nb_integration_pts =
getGaussPts().size2();
2030 auto t_var_w_l2 =
dataAtPts->getFTensorVarWL2(nb_integration_pts);
2031 auto t_det =
topoData->getFTensorDetJacobian(nb_integration_pts);
2032 auto t_inv_jac =
topoData->getFTensorInvJacobian(nb_integration_pts);
2034 const int nb_base_functions = data.
getN().size2();
2037 auto get_ftensor1 = [](
auto &
v) {
2039 &
v[0], &
v[1], &
v[2]);
2051 auto get_scale = [&](
const double t) {
2056 s *= o->getScale(
t);
2063 for (
int gg = 0; gg != nb_integration_pts; ++gg) {
2064 const double alpha =
scale * t_w *
v;
2066 double adjount = t_var_w_l2(
i) *
tForce(
i);
2067 locJ += (alpha * t_det) * adjount;
2070 t_cof(
i,
j) = t_det * t_inv_jac(
j,
i);
2072 auto t_nf = get_ftensor1(
nF);
2074 for (; bb != nb_dofs /
SPACE_DIM; ++bb) {
2075 t_nf(
i) += (alpha * adjount) * t_cof(
i,
J) * t_base_diff(
J);
2080 for (; bb != nb_base_functions; ++bb)
2094 auto cubit_meshset_ptr =
2095 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(ms_id,
2098 std::vector<double> block_data;
2099 CHKERR cubit_meshset_ptr->getAttributes(block_data);
2103 <<
"BLOCKSET is expected to have " <<
SPACE_DIM
2104 <<
" attributes but has size " << block_data.size();
2107 "Size of attribute in BLOCKSET is too small");
2111 for (
unsigned int ii = 0; ii !=
SPACE_DIM; ++ii) {
2112 tForce(ii) = block_data[ii];
2116 <<
"Flux blockset " << cubit_meshset_ptr->getName();
2118 <<
"Number of attributes " << block_data.size();
2120 this->
entsPtr = boost::make_shared<Range>();
2121 CHKERR m_field.
get_moab().get_entities_by_handle(cubit_meshset_ptr->meshset,
2124 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"tForce vector initialised: " <<
tForce;
2125 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"Number of elements " <<
entsPtr->size();
#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
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
static bool isNoStretch()
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)
const double alphaViscousOmega
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
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