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 400 of file EshelbianADOL-C.cpp.

400 {
402 FTensor::Index<'i', 3> i;
403 FTensor::Index<'j', 3> j;
404 FTensor::Index<'k', 3> k;
405 FTensor::Index<'l', 3> l;
406 FTensor::Index<'m', 3> m;
407 FTensor::Index<'n', 3> n;
408 FTensor::Index<'o', 3> o;
409 FTensor::Index<'p', 3> p;
410
411 const int number_of_active_variables = physicsPtr->activeVariables.size();
412 const int number_of_dependent_variables =
413 physicsPtr->dependentVariablesPiola.size();
414 std::vector<double *> jac_ptr(number_of_dependent_variables);
415 for (unsigned int n = 0; n != number_of_dependent_variables; ++n) {
416 jac_ptr[n] =
417 &(physicsPtr
418 ->dependentVariablesPiolaDirevatives[n *
419 number_of_active_variables]);
420 }
421
422 const auto nb_integration_pts = getGaussPts().size2();
423
424 auto create_data_mat = [nb_integration_pts](auto &m) {
425 m.resize(9, nb_integration_pts, false);
426 };
427
428 dataAtPts->P_du.resize(81, nb_integration_pts, false);
429
430 auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
431 auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
432 auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
433
437
438 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
439
440 for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
441
443
446 t_h1(i, j) = t_kd(i, j);
447 physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
448 break;
449 case LARGE_ROT:
450 case MODERATE_ROT:
451 t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
452 physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
453 break;
454 case SMALL_ROT:
455 physicsPtr->get_h()(i, j) = iu(i, j);
456 break;
457 };
458
459 // play recorder for jacobians
460 int r = ::jacobian(tAg, number_of_dependent_variables,
461 number_of_active_variables,
462 &physicsPtr->activeVariables[0], &jac_ptr[0]);
463 if (r < 0) {
464 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
465 "ADOL-C function evaluation with error");
466 }
467
469 t_P_dh_tmp(i, j, N0, k) = physicsPtr->get_P_dh0()(i, j, k);
470 t_P_dh_tmp(i, j, N1, k) = physicsPtr->get_P_dh1()(i, j, k);
471 t_P_dh_tmp(i, j, N2, k) = physicsPtr->get_P_dh2()(i, j, k);
472
474 case NO_H1_CONFIGURATION: {
476 t_h1_du(i, j, m, n) = t_kd(i, m) * t_kd(j, n);
477 r_P_du(k, l, m, n) =
478 (t_P_dh_tmp(i, j, o, p) * t_h1_du(o, p, m, n)) * t_h1_du(i, j, k, l);
479 } break;
480 case LARGE_ROT: {
482 t_h1_du(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_h1(k, j));
483 r_P_du(k, l, m, n) =
484 (t_P_dh_tmp(i, j, o, p) * t_h1_du(o, p, m, n)) * t_h1_du(i, j, k, l);
485 } break;
486 case MODERATE_ROT:
487 case SMALL_ROT:
488 r_P_du(i, j, m, n) = t_P_dh_tmp(i, j, m, n);
489 break;
490 };
491
492 ++iu;
493 ++t_grad_h1;
494 ++r_P_du;
495 }
497}
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()
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 int r = ::function(tAg, physicsPtr->dependentVariablesPiola.size(),
370 physicsPtr->activeVariables.size(),
371 &physicsPtr->activeVariables[0],
372 &physicsPtr->dependentVariablesPiola[0]);
373 if (r < 0) { // function is locally analytic
374 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
375 "ADOL-C function evaluation with error r = %d", r);
376 }
377
380 r_P(i, j) = physicsPtr->get_P()(i, j);
381 break;
382 case LARGE_ROT:
383 case MODERATE_ROT: {
385 t_h1_du(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_h1(k, j));
386 r_P(k, l) = physicsPtr->get_P()(i, j) * t_h1_du(i, j, k, l);
387 }; break;
388 case SMALL_ROT:
389 r_P(i, j) = physicsPtr->get_P()(i, j);
390 break;
391 };
392
393 ++iu;
394 ++t_grad_h1;
395 ++r_P;
396 }
398}
const double v
phase velocity of light in medium (cm/ns)

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