v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
EshelbianPlasticity::OpCalculateRotationAndSpatialGradient Struct Reference

#include <users_modules/eshelbian_plasticty/src/EshelbianPlasticity.hpp>

Inheritance diagram for EshelbianPlasticity::OpCalculateRotationAndSpatialGradient:
[legend]
Collaboration diagram for EshelbianPlasticity::OpCalculateRotationAndSpatialGradient:
[legend]

Public Member Functions

 OpCalculateRotationAndSpatialGradient (boost::shared_ptr< DataAtIntegrationPts > &data_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Public Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts More...
 

Detailed Description

Definition at line 483 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpCalculateRotationAndSpatialGradient()

EshelbianPlasticity::OpCalculateRotationAndSpatialGradient::OpCalculateRotationAndSpatialGradient ( boost::shared_ptr< DataAtIntegrationPts > &  data_ptr)
inline

Definition at line 486 of file EshelbianPlasticity.hpp.

488 : VolUserDataOperator(NOSPACE, OPSPACE), dataAtPts(data_ptr) {}
@ NOSPACE
Definition: definitions.h:83
VolumeElementForcesAndSourcesCore::UserDataOperator VolUserDataOperator
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

Member Function Documentation

◆ doWork()

MoFEMErrorCode EshelbianPlasticity::OpCalculateRotationAndSpatialGradient::doWork ( int  side,
EntityType  type,
EntData data 
)
Examples
EshelbianOperators.cpp.

Definition at line 257 of file EshelbianOperators.cpp.

259 {
261
263 auto t_L = symm_L_tensor();
264
265 int nb_integration_pts = getGaussPts().size2();
272
273 dataAtPts->hAtPts.resize(9, nb_integration_pts, false);
274 dataAtPts->hdOmegaAtPts.resize(9 * 3, nb_integration_pts, false);
275 dataAtPts->hdLogStretchAtPts.resize(9 * 6, nb_integration_pts, false);
276 dataAtPts->leviKirchoffAtPts.resize(3, nb_integration_pts, false);
277 dataAtPts->leviKirchoffdPAtPts.resize(9 * 3, nb_integration_pts, false);
278 dataAtPts->leviKirchoffdOmegaAtPts.resize(9, nb_integration_pts, false);
279
280 dataAtPts->adjontPdstretchAtPts.resize(9, nb_integration_pts, false);
281 dataAtPts->adjontPdUAtPts.resize(size_symm, nb_integration_pts, false);
282 dataAtPts->adjontPdUdPAtPts.resize(9 * size_symm, nb_integration_pts, false);
283 dataAtPts->adjontPdUdOmegaAtPts.resize(3 * size_symm, nb_integration_pts,
284 false);
285 dataAtPts->rotMatAtPts.resize(9, nb_integration_pts, false);
286 dataAtPts->diffRotMatAtPts.resize(27, nb_integration_pts, false);
287 dataAtPts->stretchTensorAtPts.resize(6, nb_integration_pts, false);
288 dataAtPts->diffStretchTensorAtPts.resize(36, nb_integration_pts, false);
289 dataAtPts->eigenVals.resize(3, nb_integration_pts, false);
290 dataAtPts->eigenVecs.resize(9, nb_integration_pts, false);
291 dataAtPts->nbUniq.resize(nb_integration_pts, false);
292
293 dataAtPts->logStretchTotalTensorAtPts.resize(6, nb_integration_pts, false);
294
295 auto t_h = getFTensor2FromMat<3, 3>(dataAtPts->hAtPts);
296 auto t_h_domega = getFTensor3FromMat<3, 3, 3>(dataAtPts->hdOmegaAtPts);
297 auto t_h_dlog_u = getFTensor3FromMat<3, 3, size_symm>(dataAtPts->hdLogStretchAtPts);
298 auto t_levi_kirchoff = getFTensor1FromMat<3>(dataAtPts->leviKirchoffAtPts);
299 auto t_levi_kirchoff_dP =
300 getFTensor3FromMat<3, 3, 3>(dataAtPts->leviKirchoffdPAtPts);
301 auto t_levi_kirchoff_domega =
302 getFTensor2FromMat<3, 3>(dataAtPts->leviKirchoffdOmegaAtPts);
303 auto t_approx_P_adjont_dstretch =
304 getFTensor2FromMat<3, 3>(dataAtPts->adjontPdstretchAtPts);
305 auto t_approx_P_adjont_log_du =
306 getFTensor1FromMat<size_symm>(dataAtPts->adjontPdUAtPts);
307 auto t_approx_P_adjont_log_du_dP =
308 getFTensor3FromMat<3, 3, size_symm>(dataAtPts->adjontPdUdPAtPts);
309 auto t_approx_P_adjont_log_du_domega =
310 getFTensor2FromMat<3, size_symm>(dataAtPts->adjontPdUdOmegaAtPts);
311 auto t_omega = getFTensor1FromMat<3>(dataAtPts->rotAxisAtPts);
312 auto t_R = getFTensor2FromMat<3, 3>(dataAtPts->rotMatAtPts);
313 auto t_diff_R = getFTensor3FromMat<3, 3, 3>(dataAtPts->diffRotMatAtPts);
314 auto t_log_u =
315 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTensorAtPts);
316 auto t_u = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
317 auto t_approx_P = getFTensor2FromMat<3, 3>(dataAtPts->approxPAtPts);
318 auto t_diff_u =
319 getFTensor4DdgFromMat<3, 3, 1>(dataAtPts->diffStretchTensorAtPts);
320 auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
321 auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
322
323 auto &nbUniq = dataAtPts->nbUniq;
324 auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
325 auto t_log_stretch_total =
326 getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
328
329 for (int gg = 0; gg != nb_integration_pts; ++gg) {
330
336 FTensor::Tensor2<double, 3, 3> t_approx_P_intermidiata;
337
338 t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
339
340 auto calulate_rotation = [&]() {
341 auto t0_diff =
344 t_diff_R(i, j, k) = t0_diff(i, j, k);
345 t_R(i, j) = t0(i, j);
346 };
347
348 auto calulate_streach = [&]() {
349 eigen_vec(i, j) = t_log_u(i, j);
350 CHKERR computeEigenValuesSymmetric(eigen_vec, eig);
351 // rare case when two eigen values are equal
352 nbUniq[gg] = get_uniq_nb<3>(&eig(0));
353 if (nbUniq[gg] < 3) {
354 sort_eigen_vals<3>(eig, eigen_vec);
355 }
356 t_eigen_vals(i) = eig(i);
357 t_eigen_vecs(i, j) = eigen_vec(i, j);
358 auto t_u_tmp =
359 EigenMatrix::getMat(t_eigen_vals, t_eigen_vecs, EshelbianCore::f);
360 t_u(i, j) = t_u_tmp(i, j);
361 auto t_diff_u_tmp =
362 EigenMatrix::getDiffMat(t_eigen_vals, t_eigen_vecs, EshelbianCore::f,
363 EshelbianCore::d_f, nbUniq[gg]);
364 t_diff_u(i, j, k, l) = t_diff_u_tmp(i, j, k, l);
365 t_Ldiff_u(i, j, L) = t_diff_u(i, j, m, n) * t_L(m, n, L);
366 };
367
368 calulate_rotation();
369 calulate_streach();
370
372 case LARGE_ROT:
373
374 t_Ru(i, m) = t_R(i, l) * t_u(l, m);
375 t_h(i, j) = t_Ru(i, m) * t_h1(m, j);
376 t_h_domega(i, j, k) = (t_diff_R(i, l, k) * t_u(l, m)) * t_h1(m, j);
377 t_h_dlog_u(i, j, L) = (t_R(i, l) * t_Ldiff_u(l, m, L)) * t_h1(m, j);
378
379 t_approx_P_intermidiata(i, m) = t_approx_P(i, j) * t_h1(m, j);
380 t_approx_P_adjont_dstretch(l, m) =
381 t_approx_P_intermidiata(i, m) * t_R(i, l);
382
383 t_levi_kirchoff(k) =
384 levi_civita(l, m, k) * (t_approx_P_adjont_dstretch(l, m));
385 t_levi_kirchoff_dP(i, j, k) =
386 (levi_civita(l, m, k) * t_R(i, l)) * t_h1(m, j);
387 t_levi_kirchoff_domega(k, n) =
388 levi_civita(l, m, k) *
389 (t_approx_P_intermidiata(i, m) * t_diff_R(i, l, n));
390
391 t_approx_P_adjont_log_du(L) =
392 t_Ldiff_u(l, m, L) * t_approx_P_adjont_dstretch(l, m);
393 t_approx_P_adjont_log_du_dP(i, j, L) = t_h_dlog_u(i, j, L);
394 t_approx_P_adjont_log_du_domega(n, L) =
395 t_Ldiff_u(l, m, L) *
396 (t_approx_P_intermidiata(i, m) * t_diff_R(i, l, n));
397
398 break;
399 case MODERATE_ROT:
400
401 t_Ru(i, m) =
402 t_kd(i, m) + (t_R(i, m) - t_kd(i, m)) + (t_u(i, m) - t_kd(i, m));
403 t_h(i, j) = t_Ru(i, m) * t_h1(m, j);
404 t_h_domega(i, j, k) = t_diff_R(i, m, k) * t_h1(m, j);
405 t_h_dlog_u(i, j, L) = t_Ldiff_u(i, m, L) * t_h1(m, j);
406
407 t_approx_P_intermidiata(i, m) = t_approx_P(i, j) * t_h1(m, j);
408 t_approx_P_adjont_dstretch(i, m) = t_approx_P_intermidiata(i, m);
409
410 t_levi_kirchoff(k) =
411 levi_civita(i, m, k) * (t_approx_P_adjont_dstretch(i, m));
412 t_levi_kirchoff_dP(i, j, k) = levi_civita(i, m, k) * t_h1(m, j);
413 t_levi_kirchoff_domega(k, n) = 0;
414
415 t_approx_P_adjont_log_du(L) =
416 t_Ldiff_u(i, m, L) * t_approx_P_adjont_dstretch(i, m);
417 t_approx_P_adjont_log_du_dP(i, j, L) = t_h_dlog_u(i, j, L);
418 t_approx_P_adjont_log_du_domega(n, L) = 0;
419
420 break;
421
422 case SMALL_ROT:
423
424 t_h(i, j) =
425 t_kd(i, j) + (t_R(i, j) - t_kd(i, j)) + (t_u(i, j) - t_kd(i, j));
426 t_h_domega(i, j, k) = t_diff_R(i, j, k);
427 t_h_dlog_u(i, j, L) = t_Ldiff_u(i, j, L);
428
429 t_levi_kirchoff(k) = levi_civita(i, j, k) * t_approx_P(i, j);
430 t_levi_kirchoff_dP(i, j, k) = levi_civita(i, j, k);
431 t_levi_kirchoff_domega(k, l) = 0;
432
433 t_approx_P_adjont_dstretch(i, j) = t_approx_P(i, j);
434 t_approx_P_adjont_log_du(L) =
435 t_Ldiff_u(i, j, L) * t_approx_P_adjont_dstretch(i, j);
436 t_approx_P_adjont_log_du_dP(i, j, L) = t_h_dlog_u(i, j, L);
437 t_approx_P_adjont_log_du_domega(m, L) = 0;
438
439 break;
440 }
441
443 t_C_h1(i, j) = t_h1(k, i) * t_h1(k, j);
444 eigen_vec(i, j) = t_C_h1(i, j);
445 CHKERR computeEigenValuesSymmetric(eigen_vec, eig);
448 break;
450 for (int ii = 0; ii != 3; ++ii) {
451 eig(ii) = std::max(eig(ii),
453 std::numeric_limits<double>::min_exponent)));
454 }
455 break;
456 }
457
458 auto t_log_u2_h1_tmp =
460
462 case LARGE_ROT:
463 case MODERATE_ROT:
464 t_log_stretch_total(i, j) = t_log_u2_h1_tmp(i, j) / 2 + t_log_u(i, j);
465 break;
466 case SMALL_ROT:
467 t_log_stretch_total(i, j) = t_log_u(i, j);
468 break;
469 };
470
471 ++t_h;
472 ++t_h_domega;
473 ++t_h_dlog_u;
474 ++t_levi_kirchoff;
475 ++t_levi_kirchoff_dP;
476 ++t_levi_kirchoff_domega;
477 ++t_approx_P_adjont_dstretch;
478 ++t_approx_P_adjont_log_du;
479 ++t_approx_P_adjont_log_du_dP;
480 ++t_approx_P_adjont_log_du_domega;
481 ++t_approx_P;
482 ++t_R;
483 ++t_diff_R;
484 ++t_log_u;
485 ++t_u;
486 ++t_diff_u;
487 ++t_eigen_vals;
488 ++t_eigen_vecs;
489 ++t_omega;
490 ++t_grad_h1;
491 ++t_log_stretch_total;
492 }
493
495}
Kronecker Delta class.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'm', SPACE_DIM > m
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
FTensor::Ddg< double, 3, 3 > getDiffMat(Val< double, 3 > &t_val, Vec< double, 3 > &t_vec, Fun< double > f, Fun< double > d_f, const int nb)
Get the Diff Mat object.
FTensor::Tensor2_symmetric< double, 3 > getMat(Val< double, 3 > &t_val, Vec< double, 3 > &t_vec, Fun< double > f)
Get the Mat object.
auto get_diff_rotation_form_vector(FTensor::Tensor1< T, 3 > &t_omega, RotSelector rotSelector=LARGE_ROT)
static constexpr auto size_symm
auto get_rotation_form_vector(FTensor::Tensor1< T, 3 > &t_omega, RotSelector rotSelector=LARGE_ROT)
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
MoFEMErrorCode computeEigenValuesSymmetric(const MatrixDouble &mat, VectorDouble &eig, MatrixDouble &eigen_vec)
compute eigenvalues of a symmetric matrix using lapack dsyev
Definition: Templates.hpp:1423
static boost::function< double(const double)> inv_f
static enum StretchSelector stretchSelector
static boost::function< double(const double)> d_f
static boost::function< double(const double)> f

Member Data Documentation

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::OpCalculateRotationAndSpatialGradient::dataAtPts

data at integration pts

Examples
EshelbianOperators.cpp.

Definition at line 485 of file EshelbianPlasticity.hpp.


The documentation for this struct was generated from the following files: