v0.15.5
Loading...
Searching...
No Matches
Public Member Functions | List of all members
EshelbianPlasticity::OpHMHH Struct Reference
Inheritance diagram for EshelbianPlasticity::OpHMHH:
[legend]
Collaboration diagram for EshelbianPlasticity::OpHMHH:
[legend]

Public Member Functions

 OpHMHH (const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
MoFEMErrorCode evaluateRhs (EntData &data)
 
MoFEMErrorCode evaluateLhs (EntData &data)
 

Detailed Description

Definition at line 316 of file EshelbianADOL-C.cpp.

Constructor & Destructor Documentation

◆ OpHMHH()

EshelbianPlasticity::OpHMHH::OpHMHH ( const int  tag,
const bool  eval_rhs,
const bool  eval_lhs,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< PhysicalEquations physics_ptr 
)
inline

Definition at line 317 of file EshelbianADOL-C.cpp.

320 : OpJacobian(tag, eval_rhs, eval_lhs, data_ptr, physics_ptr) {}

Member Function Documentation

◆ evaluateLhs()

MoFEMErrorCode EshelbianPlasticity::OpHMHH::evaluateLhs ( EntData data)

Definition at line 401 of file EshelbianADOL-C.cpp.

401 {
403 FTensor::Index<'i', 3> i;
404 FTensor::Index<'j', 3> j;
405 FTensor::Index<'k', 3> k;
406 FTensor::Index<'l', 3> l;
407 FTensor::Index<'m', 3> m;
408 FTensor::Index<'n', 3> n;
409 FTensor::Index<'o', 3> o;
410 FTensor::Index<'p', 3> p;
411
412 const int number_of_active_variables = physicsPtr->activeVariables.size();
413 const int number_of_dependent_variables =
414 physicsPtr->dependentVariablesPiola.size();
415 std::vector<double *> jac_ptr(number_of_dependent_variables);
416 for (unsigned int n = 0; n != number_of_dependent_variables; ++n) {
417 jac_ptr[n] =
418 &(physicsPtr
419 ->dependentVariablesPiolaDirevatives[n *
420 number_of_active_variables]);
421 }
422
423 const auto nb_integration_pts = getGaussPts().size2();
424
425 auto create_data_mat = [nb_integration_pts](auto &m) {
426 m.resize(9, nb_integration_pts, false);
427 };
428
429 dataAtPts->P_du.resize(81, nb_integration_pts, false);
430
431 auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
432 auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
433 auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
434
438
439 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
440
441 for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
442
444
447 t_h1(i, j) = t_kd(i, j);
448 physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
449 break;
450 case LARGE_ROT:
451 case MODERATE_ROT:
452 t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
453 physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
454 break;
455 case SMALL_ROT:
456 physicsPtr->get_h()(i, j) = iu(i, j);
457 break;
458 };
459
460 // play recorder for jacobians
461 CHKERR physicsPtr->setParams(tAg, getFEEntityHandle(), gg);
462 int r = ::jacobian(tAg, number_of_dependent_variables,
463 number_of_active_variables,
464 &physicsPtr->activeVariables[0], &jac_ptr[0]);
465 if (r < 0) {
466 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
467 "ADOL-C function evaluation with error");
468 }
469
471 t_P_dh_tmp(i, j, N0, k) = physicsPtr->get_P_dh0()(i, j, k);
472 t_P_dh_tmp(i, j, N1, k) = physicsPtr->get_P_dh1()(i, j, k);
473 t_P_dh_tmp(i, j, N2, k) = physicsPtr->get_P_dh2()(i, j, k);
474
476 case NO_H1_CONFIGURATION: {
478 t_h1_du(i, j, m, n) = t_kd(i, m) * t_kd(j, n);
479 r_P_du(k, l, m, n) =
480 (t_P_dh_tmp(i, j, o, p) * t_h1_du(o, p, m, n)) * t_h1_du(i, j, k, l);
481 } break;
482 case LARGE_ROT: {
484 t_h1_du(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_h1(k, j));
485 r_P_du(k, l, m, n) =
486 (t_P_dh_tmp(i, j, o, p) * t_h1_du(o, p, m, n)) * t_h1_du(i, j, k, l);
487 } break;
488 case MODERATE_ROT:
489 case SMALL_ROT:
490 r_P_du(i, j, m, n) = t_P_dh_tmp(i, j, m, n);
491 break;
492 };
493
494 ++iu;
495 ++t_grad_h1;
496 ++r_P_du;
497 }
499}
Kronecker Delta class.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition definitions.h:34
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
int r
Definition sdf.py:205
FTensor::Index< 'm', 3 > m
static enum RotSelector gradApproximator

◆ evaluateRhs()

MoFEMErrorCode EshelbianPlasticity::OpHMHH::evaluateRhs ( EntData data)

Definition at line 326 of file EshelbianADOL-C.cpp.

326 {
328 FTensor::Index<'i', 3> i;
329 FTensor::Index<'j', 3> j;
330 FTensor::Index<'k', 3> k;
331 FTensor::Index<'l', 3> l;
332 FTensor::Index<'m', 3> m;
333 FTensor::Index<'n', 3> n;
334
335 const auto nb_integration_pts = getGaussPts().size2();
336 auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
337 auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
338
339 auto create_data_vec = [nb_integration_pts](auto &v) {
340 v.resize(nb_integration_pts, false);
341 };
342 auto create_data_mat = [nb_integration_pts](auto &m) {
343 m.resize(9, nb_integration_pts, false);
344 };
345
346 create_data_mat(dataAtPts->PAtPts);
347
348 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
349 auto r_P = getFTensor2FromMat<3, 3>(dataAtPts->PAtPts);
350 for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
351
353
356 t_h1(i, j) = t_kd(i, j);
357 physicsPtr->get_h()(i, j) = iu(i, j);
358 break;
359 case LARGE_ROT:
360 case MODERATE_ROT:
361 t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
362 physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
363 break;
364 case SMALL_ROT:
365 physicsPtr->get_h()(i, j) = iu(i, j);
366 break;
367 };
368
369 CHKERR physicsPtr->setParams(tAg, getFEEntityHandle(), gg);
370 int r = ::function(tAg, physicsPtr->dependentVariablesPiola.size(),
371 physicsPtr->activeVariables.size(),
372 &physicsPtr->activeVariables[0],
373 &physicsPtr->dependentVariablesPiola[0]);
374 if (r < 0) { // function is locally analytic
375 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
376 "ADOL-C function evaluation with error r = %d", r);
377 }
378
381 r_P(i, j) = physicsPtr->get_P()(i, j);
382 break;
383 case LARGE_ROT:
384 case MODERATE_ROT: {
386 t_h1_du(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_h1(k, j));
387 r_P(k, l) = physicsPtr->get_P()(i, j) * t_h1_du(i, j, k, l);
388 }; break;
389 case SMALL_ROT:
390 r_P(i, j) = physicsPtr->get_P()(i, j);
391 break;
392 };
393
394 ++iu;
395 ++t_grad_h1;
396 ++r_P;
397 }
399}
const double v
phase velocity of light in medium (cm/ns)

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