v0.15.0
Loading...
Searching...
No Matches
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)
 
- Public Member Functions inherited from EshelbianPlasticity::OpJacobian
 OpJacobian (const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Additional Inherited Members

- Protected Member Functions inherited from EshelbianPlasticity::OpJacobian
 OpJacobian ()
 
- Protected Attributes inherited from EshelbianPlasticity::OpJacobian
int tAg = -1
 adol-c tape
 
bool evalRhs = false
 
bool evalLhs = false
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts
 
boost::shared_ptr< PhysicalEquationsphysicsPtr
 material physical equations
 

Detailed Description

Definition at line 314 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 315 of file EshelbianADOL-C.cpp.

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

Member Function Documentation

◆ evaluateLhs()

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

Implements EshelbianPlasticity::OpJacobian.

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

398 {
400 FTensor::Index<'i', 3> i;
401 FTensor::Index<'j', 3> j;
402 FTensor::Index<'k', 3> k;
403 FTensor::Index<'l', 3> l;
404 FTensor::Index<'m', 3> m;
405 FTensor::Index<'n', 3> n;
406 FTensor::Index<'o', 3> o;
407 FTensor::Index<'p', 3> p;
408
409 const int number_of_active_variables = physicsPtr->activeVariables.size();
410 const int number_of_dependent_variables =
411 physicsPtr->dependentVariablesPiola.size();
412 std::vector<double *> jac_ptr(number_of_dependent_variables);
413 for (unsigned int n = 0; n != number_of_dependent_variables; ++n) {
414 jac_ptr[n] =
415 &(physicsPtr
416 ->dependentVariablesPiolaDirevatives[n *
417 number_of_active_variables]);
418 }
419
420 const auto nb_integration_pts = getGaussPts().size2();
421
422 auto create_data_mat = [nb_integration_pts](auto &m) {
423 m.resize(9, nb_integration_pts, false);
424 };
425
426 dataAtPts->P_du.resize(81, nb_integration_pts, false);
427
428 auto iu = getFTensor2SymmetricFromMat<3>(dataAtPts->stretchTensorAtPts);
429 auto t_grad_h1 = getFTensor2FromMat<3, 3>(dataAtPts->wGradH1AtPts);
430 auto r_P_du = getFTensor4FromMat<3, 3, 3, 3>(dataAtPts->P_du);
431
435
436 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
437
438 for (unsigned int gg = 0; gg != nb_integration_pts; ++gg) {
439
441
444 t_h1(i, j) = t_kd(i, j);
445 physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
446 break;
447 case LARGE_ROT:
448 case MODERATE_ROT:
449 t_h1(i, j) = t_grad_h1(i, j) + t_kd(i, j);
450 physicsPtr->get_h()(i, j) = iu(i, k) * t_h1(k, j);
451 break;
452 case SMALL_ROT:
453 physicsPtr->get_h()(i, j) = iu(i, j);
454 break;
455 };
456
457 // play recorder for jacobians
458 int r = ::jacobian(tAg, number_of_dependent_variables,
459 number_of_active_variables,
460 &physicsPtr->activeVariables[0], &jac_ptr[0]);
461 if (r < 0) {
462 SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
463 "ADOL-C function evaluation with error");
464 }
465
467 t_P_dh_tmp(i, j, N0, k) = physicsPtr->get_P_dh0()(i, j, k);
468 t_P_dh_tmp(i, j, N1, k) = physicsPtr->get_P_dh1()(i, j, k);
469 t_P_dh_tmp(i, j, N2, k) = physicsPtr->get_P_dh2()(i, j, k);
470
472 case NO_H1_CONFIGURATION: {
474 t_h1_du(i, j, m, n) = t_kd(i, m) * t_kd(j, n);
475 r_P_du(k, l, m, n) =
476 (t_P_dh_tmp(i, j, o, p) * t_h1_du(o, p, m, n)) * t_h1_du(i, j, k, l);
477 } break;
478 case LARGE_ROT: {
480 t_h1_du(i, j, m, n) = t_kd(i, m) * (t_kd(k, n) * t_h1(k, j));
481 r_P_du(k, l, m, n) =
482 (t_P_dh_tmp(i, j, o, p) * t_h1_du(o, p, m, n)) * t_h1_du(i, j, k, l);
483 } break;
484 case MODERATE_ROT:
485 case SMALL_ROT:
486 r_P_du(i, j, m, n) = t_P_dh_tmp(i, j, m, n);
487 break;
488 };
489
490 ++iu;
491 ++t_grad_h1;
492 ++r_P_du;
493 }
495}
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
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, Tensor_Dim1, Tensor_Dim2 > getFTensor2FromMat(MatrixDouble &data)
Get tensor rank 2 (matrix) form data matrix.
static auto getFTensor2SymmetricFromMat(ublas::matrix< T, L, A > &data)
Get symmetric tensor rank 2 (matrix) form data matrix.
static FTensor::Tensor4< FTensor::PackPtr< T *, 1 >, Tensor_Dim0, Tensor_Dim1, Tensor_Dim2, Tensor_Dim3 > getFTensor4FromMat(ublas::matrix< T, L, A > &data)
Get tensor rank 4 (non symmetric) form data matrix.
int r
Definition sdf.py:8
FTensor::Index< 'm', 3 > m
boost::shared_ptr< PhysicalEquations > physicsPtr
material physical equations
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

◆ evaluateRhs()

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

Implements EshelbianPlasticity::OpJacobian.

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

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

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