102 {
103
106 if (!ctx_impl_ptr)
108 "Invalid context pointer type");
109 auto &ep = *ctx_impl_ptr->ep_ptr;
110 auto &m_field = ep.mField;
111 auto interior_integration_hook = ctx_impl_ptr->integrationAtInterior;
112 auto boundary_integration_hook = ctx_impl_ptr->integrationAtFace;
113 auto th_top_tag = ctx_impl_ptr->getVertexMaterialH1PositionsTag();
114 auto th_grad_tag = ctx_impl_ptr->getJdXTag(m_field.get_moab());
115
116 boost::shared_ptr<double> J_ptr = boost::make_shared<double>(0.);
117 auto dJ_dX_vec = ctx_impl_ptr->gradJVec.second;
118
119 auto fe_spatial =
120 boost::make_shared<VolumeElementForcesAndSourcesCore>(m_field);
122 ep, fe_spatial, interior_integration_hook, boundary_integration_hook);
123 auto fe_material =
124 boost::make_shared<VolumeElementForcesAndSourcesCore>(m_field);
126 boundary_integration_hook, J_ptr,
127 th_grad_tag);
128
131 CHKERR KSPSolveTranspose(ksp, dJ_dx_vec, lambda_vec);
132
133 auto fe_adjoint =
134 boost::make_shared<VolumeElementForcesAndSourcesCore>(m_field);
136 ep, fe_adjoint, interior_integration_hook, boundary_integration_hook,
137 lambda_vec, dJ_dX_vec, alpha,
rho, alpha_omega);
138
140}
@ MOFEM_DATA_INCONSISTENCY
auto createDMVector(DM dm)
Get smart vector from DM.
MoFEMErrorCode pushTopologicalOps_dJ_adjont_gradient(EshelbianCore &ep, boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe, ForcesAndSourcesCore::GaussHookFun interior_integration_hook, ForcesAndSourcesCore::GaussHookFun boundary_integration_hook, SmartPetscObj< Vec > lambda_vec, Tag th_grad_tag, const double alpha, const double rho, const double alpha_omega)
SmartPetscObj< Vec > pushTopologicalSpatialOps(EshelbianCore &ep, boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe, ForcesAndSourcesCore::GaussHookFun interior_integration_hook, ForcesAndSourcesCore::GaussHookFun boundary_integration_hook)
MoFEMErrorCode pushTopologicalMaterialOps(EshelbianCore &ep, boost::shared_ptr< VolumeElementForcesAndSourcesCore > fe, ForcesAndSourcesCore::GaussHookFun interior_integration_hook, ForcesAndSourcesCore::GaussHookFun boundary_integration_hook, boost::shared_ptr< double > J_ptr, Tag th_grad_tag)