236 {
238
239#ifndef NDEBUG
242 "DataAtIntegrationPts pointer is null");
245 "Topological data pointer is null");
248 "ObjectiveFunctionData pointer is null");
249#endif
250
252 const int nb_gauss_pts = getGaussPts().size2();
253 if (!nb_gauss_pts)
255
256 auto stress_full_ptr = boost::make_shared<MatrixDouble>();
257 stress_full_ptr->resize(size_full, nb_gauss_pts, false);
258 stress_full_ptr->clear();
259 auto strain_full_ptr = boost::make_shared<MatrixDouble>();
260 strain_full_ptr->resize(size_full, nb_gauss_pts, false);
261 strain_full_ptr->clear();
262
263 auto t_stress = getFTensor2FromMat<3, 3>(*stress_full_ptr);
264 auto t_strain = getFTensor2FromMat<3, 3>(*strain_full_ptr);
265
266 auto t_P = getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(
dataAtPts->approxPAtPts);
267 auto t_log_u =
268 getFTensor2SymmetricFromMat<3>(
dataAtPts->logStretchTensorAtPts);
269
270 auto next = [&]() {
271 ++t_stress;
272 ++t_strain;
273 ++t_P;
274 ++t_log_u;
275 };
276
279
280 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
281
282
283 t_stress(
i,
j) = t_P(
i,
j);
284 t_strain(
i,
j) = t_log_u(
i,
j);
285 next();
286 }
287
288 auto &coords = OP::getCoordsAtGaussPts();
290 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
292
294 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
295 topoData->getObjDStrainAtPts(),
false);
296
298 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
299 topoData->getObjDDisplacementAtPts(),
false);
300
302 coords,
dataAtPts->getSmallWL2AtPts(), stress_full_ptr, strain_full_ptr,
303 topoData->getObjDStressAtPts(),
false);
304
306}
#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_DATA_INCONSISTENCY
#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', 3 > j