v0.9.1
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63 Struct Reference
Inheritance diagram for EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63:
[legend]
Collaboration diagram for EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63:
[legend]

Public Member Functions

 HMHPMooneyRivlinWriggersEq63 (const double alpha, const double beta, const double lambda, const double sigma_y)
 
virtual OpJacobianreturnOpJacobian (const std::string &field_name, const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > &data_ptr, boost::shared_ptr< PhysicalEquations > &physics_ptr)
 
MoFEMErrorCode getOptions ()
 
MoFEMErrorCode recordTape (const int tape, DTensor2Ptr *t_h_ptr)
 
- Public Member Functions inherited from EshelbianPlasticity::PhysicalEquations
 PhysicalEquations ()=delete
 
 PhysicalEquations (const int size_active, const int size_dependent)
 
virtual ~PhysicalEquations ()
 
DTensor2Ptr get_P ()
 
DTensor2Ptr get_Sigma ()
 
DTensor0Ptr get_Phi ()
 
doubleget_PhiRef ()
 
DTensor2Ptr get_Flow ()
 
DTensor3Ptr get_P_dh0 ()
 
DTensor3Ptr get_P_dH0 ()
 
DTensor3Ptr get_P_dh1 ()
 
DTensor3Ptr get_P_dH1 ()
 
DTensor3Ptr get_P_dh2 ()
 
DTensor3Ptr get_P_dH2 ()
 
DTensor3Ptr get_Sigma_dh0 ()
 
DTensor3Ptr get_Sigma_dH0 ()
 
DTensor3Ptr get_Sigma_dh1 ()
 
DTensor3Ptr get_Sigma_dH1 ()
 
DTensor3Ptr get_Sigma_dh2 ()
 
DTensor3Ptr get_Sigma_dH2 ()
 
DTensor2Ptr get_Phi_dh ()
 
DTensor2Ptr get_Phi_dH ()
 
DTensor3Ptr get_Flow_dh0 ()
 
DTensor3Ptr get_Flow_dH0 ()
 
DTensor3Ptr get_Flow_dh1 ()
 
DTensor3Ptr get_Flow_dH1 ()
 
DTensor3Ptr get_Flow_dh2 ()
 
DTensor3Ptr get_Flow_dH2 ()
 
DTensor2Ptr get_h ()
 
DTensor2Ptr get_H ()
 

Public Attributes

double alpha
 
double beta
 
double lambda
 
double epsilon
 
double sigmaY
 
ATensor2 th
 
ATensor2 tH
 
ATensor2 tF
 
adouble detH
 
adouble detF
 
ATensor2 tInvH
 
ATensor2 tInvF
 
ATensor2 tP
 
ATensor2 tSigma
 
ATensor2 tCauchy
 
ATensor2 tDevCauchy
 
ATensor2 tCof
 
ATensor2 tBF
 
ATensor2 tBCof
 
adouble tBj
 
adouble energy
 
adouble meanCauchy
 
adouble s2
 
adouble f
 
adouble phi
 
adouble A
 
adouble B
 
ATensor2 tPhi_dDevCauchy
 
ATensor2 tPhi_dCauchy
 
ATensor2 tPhi_dSigma
 
ATensor2 tPulledP
 
ATensor2 tPulledSigma
 
ATensor2 tPulledPhi_dSigma
 
- Public Attributes inherited from EshelbianPlasticity::PhysicalEquations
std::vector< doubleactiveVariables
 
std::vector< doubledependentVariables
 
std::vector< doubledependentVariablesDirevatives
 

Static Public Attributes

static constexpr int numberOfActiveVariables = 9 + 9
 
static constexpr int numberOfDependentVariables = 9 + 9 + 1 + 9
 

Additional Inherited Members

- Public Types inherited from EshelbianPlasticity::PhysicalEquations
typedef FTensor::Tensor1< adouble, 3 > ATensor1
 
typedef FTensor::Tensor2< adouble, 3, 3 > ATensor2
 
typedef FTensor::Tensor3< adouble, 3, 3, 3 > ATensor3
 
typedef FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > DTensor0Ptr
 
typedef FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, 3, 3 > DTensor2Ptr
 
typedef FTensor::Tensor3< FTensor::PackPtr< double *, 1 >, 3, 3, 3 > DTensor3Ptr
 
- Static Public Member Functions inherited from EshelbianPlasticity::PhysicalEquations
template<int S>
static DTensor2Ptr get_VecTensor2 (std::vector< double > &v)
 
template<int S>
static DTensor0Ptr get_VecTensor0 (std::vector< double > &v)
 
template<int S0, int S1, int S2>
static DTensor3Ptr get_vecTensor3 (std::vector< double > &v)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ HMHPMooneyRivlinWriggersEq63()

EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::HMHPMooneyRivlinWriggersEq63 ( const double  alpha,
const double  beta,
const double  lambda,
const double  sigma_y 
)

Member Function Documentation

◆ getOptions()

MoFEMErrorCode EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::getOptions ( )

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

457  {
459  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "mooneyrivlin_", "", "none");
460 
461  alpha = 1;
462  CHKERR PetscOptionsScalar("-alpha", "Alpha", "", alpha, &alpha, PETSC_NULL);
463  beta = 1;
464  CHKERR PetscOptionsScalar("-beta", "Beta", "", beta, &beta, PETSC_NULL);
465 
466  lambda = 1;
467  CHKERR PetscOptionsScalar("-lambda", "Lambda", "", lambda, &lambda,
468  PETSC_NULL);
469 
470  epsilon = 0;
471  CHKERR PetscOptionsScalar("-epsilon", "Epsilon", "", epsilon, &epsilon,
472  PETSC_NULL);
473 
474  CHKERR PetscOptionsScalar("-sigma_y", "plastic strain", "", sigmaY, &sigmaY,
475  PETSC_NULL);
476 
477  ierr = PetscOptionsEnd();
478  CHKERRG(ierr);
480  }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:549
#define CHKERR
Inline error check.
Definition: definitions.h:601
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412

◆ recordTape()

MoFEMErrorCode EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::recordTape ( const int  tape,
DTensor2Ptr t_h_ptr 
)
virtual

Implements EshelbianPlasticity::PhysicalEquations.

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

525  {
527 
537 
538  CHKERR getOptions();
539 
540  auto ih = get_h();
541  auto iH = get_H();
542  if (t_h_ptr)
543  ih(i, j) = (*t_h_ptr)(i, j);
544  else {
545  ih(i, j) = 0;
546  for (auto ii : {0, 1, 2})
547  ih(ii, ii) = 1;
548  }
549 
550  iH(i, j) = 0;
551  for (auto ii : {0, 1, 2})
552  iH(ii, ii) = 1;
553 
554  auto r_P = get_P();
555  auto r_Sigma = get_Sigma();
556  double &r_phi = get_PhiRef();
557  auto r_Flow = get_Flow();
558 
559  enableMinMaxUsingAbs();
560  trace_on(tape);
561 
562  // Set active variables to ADOL-C
563  th(i, j) <<= get_h()(i, j);
564  tH(i, j) <<= get_H()(i, j);
565 
566  // Deformation gradient
569 
570  tF(i, I) = th(i, J) * tInvH(J, I);
573 
574  tCof(i, I) = detF * tInvF(I, i);
575 
576  A = tF(k, K) * tF(k, K);
577  B = tCof(k, K) * tCof(k, K);
578 
579  tBF(i, I) = 4 * alpha * (A * tF(i, I));
580  tBCof(i, I) = 4 * beta * (B * tCof(i, I));
581  tBj = (-12 * alpha - 24 * beta) / detF +
582  0.5 * (lambda / epsilon) *
583  (pow(detF, epsilon - 1) - pow(detF, -epsilon - 1));
584 
585  tP(i, I) = tBF(i, I);
586  tP(i, I) += (levi_civita(i, j, k) * tBCof(j, J)) *
587  (levi_civita(I, J, K) * tF(k, K));
588  tP(i, I) += tCof(i, I) * tBj;
589 
590  energy = alpha * pow(A, 2) + beta * pow(B, 2);
591  energy += (-12 * alpha - 24 * beta) * log(detF) +
592  (lambda / (2 * epsilon * epsilon)) *
593  (pow(detF, epsilon) + pow(detF, -epsilon));
594 
595  // Stress Eshelby
596  tSigma(I, J) = -tF(i, I) * tP(i, J);
597  tSigma(N0, N0) += energy;
598  tSigma(N1, N1) += energy;
599  tSigma(N2, N2) += energy;
600 
601  // Deviator Cauchy Stress
602  meanCauchy = third * tCauchy(i, i);
603  tDevCauchy(i, j) = tCauchy(i, j);
604  tDevCauchy(N0, N0) -= meanCauchy;
605  tDevCauchy(N1, N1) -= meanCauchy;
606  tDevCauchy(N2, N2) -= meanCauchy;
607 
608  // // Plastic surface
609 
610  s2 = tDevCauchy(i, j) * tDevCauchy(i, j); // s:s
611  f = sqrt(1.5 * s2);
612  phi = f - sigmaY;
613 
614  // Flow
616  tPhi_dDevCauchy(i, j) *= 1.5 / f;
618  tPhi_dCauchy(N0, N0) -= third * tPhi_dDevCauchy(i, i);
619  tPhi_dCauchy(N1, N1) -= third * tPhi_dDevCauchy(i, i);
620  tPhi_dCauchy(N2, N2) -= third * tPhi_dDevCauchy(i, i);
621  tPhi_dSigma(I, J) = tInvF(I, i) * (tPhi_dCauchy(i, j) * tF(j, J));
622  tPhi_dSigma(I, J) *= -(1 / detF);
623 
624  // Pull back
625  tPulledP(i, J) = tP(i, I) * tInvH(J, I);
626  tPulledP(i, J) *= detH;
627  tPulledSigma(i, J) = tSigma(i, I) * tInvH(J, I);
628  tPulledSigma(i, J) *= detH;
629  tPulledPhi_dSigma(i, J) = tPhi_dSigma(i, I) * tInvH(J, I);
630  tPulledPhi_dSigma(i, J) *= detH;
631 
632  // Set dependent variables to ADOL-C
633  tPulledP(i, j) >>= r_P(i, j);
634  tPulledSigma(i, j) >>= r_Sigma(i, j);
635  phi >>= r_phi;
636  tPulledPhi_dSigma(i, j) >>= r_Flow(i, j);
637 
638  trace_off();
639 
641  }
MoFEMErrorCode determinantTensor3by3(T1 &t, T2 &det)
Calculate determinant 3 by 3.
Definition: Templates.hpp:482
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
FTensor::Index< 'I', 3 > I
Definition: PlasticOps.hpp:70
FTensor::Index< 'J', 3 > J
Definition: PlasticOps.hpp:71
MoFEMErrorCode invertTensor3by3(ublas::matrix< T, L, A > &jac_data, ublas::vector< T, A > &det_data, ublas::matrix< T, L, A > &inv_jac_data)
Calculate inverse of tensor rank 2 at integration points.
Definition: Templates.hpp:463
#define CHKERR
Inline error check.
Definition: definitions.h:601
FTensor::Index< 'k', 2 > k
Definition: ContactOps.hpp:28
FTensor::Index< 'j', 2 > j
Definition: ContactOps.hpp:27
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
constexpr double third
FTensor::Index< 'i', 2 > i
[Common data]
Definition: ContactOps.hpp:26
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

◆ returnOpJacobian()

virtual OpJacobian* EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::returnOpJacobian ( const std::string &  field_name,
const int  tag,
const bool  eval_rhs,
const bool  eval_lhs,
boost::shared_ptr< DataAtIntegrationPts > &  data_ptr,
boost::shared_ptr< PhysicalEquations > &  physics_ptr 
)
virtual

Implements EshelbianPlasticity::PhysicalEquations.

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

452  {
453  return (
454  new OpHMHH(field_name, tag, eval_rhs, eval_lhs, data_ptr, physics_ptr));
455  }

Member Data Documentation

◆ A

adouble EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::A

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

◆ alpha

double EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::alpha

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

◆ B

adouble EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::B

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

◆ beta

double EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::beta

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

◆ detF

adouble EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::detF

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

◆ detH

adouble EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::detH

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

◆ energy

adouble EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::energy

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

◆ epsilon

double EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::epsilon

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

◆ f

adouble EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::f

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

◆ lambda

double EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::lambda

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

◆ meanCauchy

adouble EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::meanCauchy

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

◆ numberOfActiveVariables

constexpr int EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::numberOfActiveVariables = 9 + 9
static

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

◆ numberOfDependentVariables

constexpr int EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::numberOfDependentVariables = 9 + 9 + 1 + 9
static

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

◆ phi

adouble EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::phi

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

◆ s2

adouble EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::s2

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

◆ sigmaY

double EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::sigmaY

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

◆ tBCof

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tBCof

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

◆ tBF

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tBF

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

◆ tBj

adouble EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tBj

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

◆ tCauchy

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tCauchy

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

◆ tCof

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tCof

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

◆ tDevCauchy

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tDevCauchy

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

◆ tF

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tF

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

◆ th

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::th

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

◆ tH

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tH

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

◆ tInvF

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tInvF

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

◆ tInvH

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tInvH

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

◆ tP

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tP

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

◆ tPhi_dCauchy

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tPhi_dCauchy

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

◆ tPhi_dDevCauchy

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tPhi_dDevCauchy

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

◆ tPhi_dSigma

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tPhi_dSigma

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

◆ tPulledP

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tPulledP

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

◆ tPulledPhi_dSigma

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tPulledPhi_dSigma

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

◆ tPulledSigma

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tPulledSigma

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

◆ tSigma

ATensor2 EshelbianPlasticity::HMHPMooneyRivlinWriggersEq63::tSigma

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


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