168 {
171 if (!nb_dofs)
173 int nb_integration_pts = data.
getN().size1();
174 auto *fe_ptr =
const_cast<FEMethod *
>(this->getFEMethod());
176
177 auto get_tag = [&]() {
179 for (
const auto &tag_range_pair : *
physicalPtr->tagVsRangePtr) {
180 if (tag_range_pair.second.find(ent) != tag_range_pair.second.end()) {
181 return tag_range_pair.first;
182 }
183 }
184 }
186 };
187
188 const int current_tag = get_tag();
189
190 auto mat_grad_ptr =
physicalPtr->matOpsDataPtr->getCommonDataPtr(
"grad");
191 auto mat_k_ptr =
physicalPtr->matOpsDataPtr->getCommonDataPtr(
"k");
192 auto mat_k_dF_ptr =
physicalPtr->matOpsDataPtr->getCommonDataPtr(
"k_dF");
193
194#ifndef NDEBUG
195 if (!mat_grad_ptr || !mat_k_ptr || !mat_k_dF_ptr) {
197 "Missing common data for ADOL-C evaluation");
198 }
199 if (mat_grad_ptr->size2() != DIM * DIM) {
201 "Inconsistent size of gradient matrix for ADOL-C evaluation");
202 }
203 if (mat_grad_ptr->size1() != nb_integration_pts) {
205 "Inconsistent size of gradient matrix data for ADOL-C evaluation");
206 }
207#endif
208
210 auto get_grad_at_pts =
212 *mat_grad_ptr, nb_integration_pts);
213 auto get_k_at_pts =
215 *mat_k_ptr, nb_integration_pts);
216 auto get_k_dF_at_pts =
218 *mat_k_dF_ptr, nb_integration_pts);
219
225
226 auto t_grad_at_pts = get_grad_at_pts();
227 auto t_k_at_pts = get_k_at_pts();
228
229 auto next = [&]() {
230 ++t_grad_at_pts;
231 ++t_k_at_pts;
232 };
233
235
236 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
237 auto t_F = getFTensor2FromPtr<DIM, DIM>(
238 physicalPtr->matOpsDataPtr->getActiveDataPtr(
"F")->data().data());
242 t_k_at_pts(0) =
243 (*
physicalPtr->matOpsDataPtr->getDependentDataPtr(
"k"))(0, 0);
244 next();
245 }
246 }
247
253
254 auto t_grad_at_pts = get_grad_at_pts();
255 auto t_k_dF_at_pts = get_k_dF_at_pts();
257
258 auto next = [&]() {
259 ++t_grad_at_pts;
260 ++t_k_dF_at_pts;
261 };
262
263 for (auto gg = 0; gg != nb_integration_pts; ++gg) {
264 auto t_F = getFTensor2FromPtr<DIM, DIM>(
265 physicalPtr->matOpsDataPtr->getActiveDataPtr(
"F")->data().data());
269 auto t_k_dF = getFTensor2FromPtr<DIM, DIM>(
270 physicalPtr->matOpsDataPtr->getDependentDerivativesDataPtr(
"k_dF")
271 ->data()
272 .data());
273 t_k_dF_at_pts(
i,
J) = t_k_dF(
i,
J);
274 next();
275 }
276 }
277
279}
#define FTENSOR_INDEX(DIM, I)
#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_OPERATION_UNSUCCESSFUL
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'J', DIM1 > J
FTensor::Index< 'k', 3 > k
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
decltype(GetFTensor1FromMatImpl< Tensor_Dim, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor1FromMatType
decltype(GetFTensor2FromMatImpl< Tensor_Dim0, Tensor_Dim1, S, DL, M >::get(std::declval< M & >(), 0, 0)) GetFTensor2FromMatType
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
Structure for user loop methods on finite elements.
EntityHandle getFEEntityHandle() const
Get the entity handle of the current finite element.