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

Public Member Functions

 HMHStVenantKirchhoff (const double lambda, const double mu, const double sigma_y)
 
MoFEMErrorCode getOptions ()
 
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 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 lambda
 
double mu
 
double sigmaY
 
ATensor2 th
 
ATensor2 tH
 
ATensor2 tP
 
ATensor2 tSigma
 
adouble phi
 
adouble s2
 
adouble f
 
adouble energy
 
adouble detH
 
adouble detF
 
adouble trE
 
adouble meanCauchy
 
ATensor2 tInvH
 
ATensor2 tF
 
ATensor2 tInvF
 
ATensor2 tC
 
ATensor2 tE
 
ATensor2 tS
 
ATensor2 tCauchy
 
ATensor2 tDevCauchy
 
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 243 of file EshelbianADOL-C.cpp.

Constructor & Destructor Documentation

◆ HMHStVenantKirchhoff()

EshelbianPlasticity::HMHStVenantKirchhoff::HMHStVenantKirchhoff ( const double  lambda,
const double  mu,
const double  sigma_y 
)

Member Function Documentation

◆ getOptions()

MoFEMErrorCode EshelbianPlasticity::HMHStVenantKirchhoff::getOptions ( )

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

253  {
255 
256  double E = 1;
257  double nu = 0;
258 
259  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "stvenant_", "", "none");
260 
261  CHKERR PetscOptionsScalar("-young_modulus", "Young modulus", "", E, &E,
262  PETSC_NULL);
263  CHKERR PetscOptionsScalar("-poisson_ratio", "poisson ratio", "", nu, &nu,
264  PETSC_NULL);
265  CHKERR PetscOptionsScalar("-sigmaY", "plastic strain", "", sigmaY, &sigmaY,
266  PETSC_NULL);
267 
268  ierr = PetscOptionsEnd();
269  CHKERRG(ierr);
270 
271  lambda = LAMBDA(E, nu);
272  mu = MU(E, nu);
273 
275  }
#define LAMBDA(E, NU)
Definition: fem_tools.h:32
#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 MU(E, NU)
Definition: fem_tools.h:33
#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::HMHStVenantKirchhoff::recordTape ( const int  tape,
DTensor2Ptr t_h_ptr 
)
virtual

Implements EshelbianPlasticity::PhysicalEquations.

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

320  {
329 
330  CHKERR getOptions();
331 
332  auto ih = get_h();
333  auto iH = get_H();
334  if (t_h_ptr)
335  ih(i, j) = (*t_h_ptr)(i, j);
336  else {
337  ih(i, j) = 0;
338  for (auto ii : {0, 1, 2})
339  ih(ii, ii) = 1;
340  }
341 
342  iH(i, j) = 0;
343  for (auto ii : {0, 1, 2})
344  iH(ii, ii) = 1;
345 
346  auto r_P = get_P();
347  auto r_Sigma = get_Sigma();
348  double &r_phi = get_PhiRef();
349  auto r_Flow = get_Flow();
350 
351  enableMinMaxUsingAbs();
352  trace_on(tape);
353 
354  // Set active variables to ADOL-C
355  th(i, j) <<= get_h()(i, j);
356  tH(i, j) <<= get_H()(i, j);
357 
358  // Deformation gradient
361  tF(i, I) = th(i, J) * tInvH(J, I);
364 
365  // Deformation and strain
366  tC(I, J) = tF(i, I) * tF(i, J);
367  tE(I, J) = tC(I, J);
368  tE(N0, N0) -= 1;
369  tE(N1, N1) -= 1;
370  tE(N2, N2) -= 1;
371  tE(I, J) *= 0.5;
372 
373  // Energy
374  trE = tE(I, I);
375  energy = 0.5 * lambda * trE * trE + mu * (tE(I, J) * tE(I, J));
376 
377  // Stress Piola II
378  tS(I, J) = tE(I, J);
379  tS(I, J) *= 2 * mu;
380  tS(N0, N0) += lambda * trE;
381  tS(N1, N1) += lambda * trE;
382  tS(N2, N2) += lambda * trE;
383  // Stress Piola I
384  tP(i, J) = tF(i, I) * tS(I, J);
385  // Stress Cauchy
386  tCauchy(i, j) = tP(i, J) * tF(j, J);
387  tCauchy(i, j) *= (1 / detF);
388 
389  // Stress Eshelby
390  tSigma(I, J) = -tF(i, I) * tP(i, J);
391  tSigma(N0, N0) += energy;
392  tSigma(N1, N1) += energy;
393  tSigma(N2, N2) += energy;
394 
395  // Deviator Cauchy Stress
396  meanCauchy = third * tCauchy(i, i);
397  tDevCauchy(i, j) = tCauchy(i, j);
398  tDevCauchy(N0, N0) -= meanCauchy;
399  tDevCauchy(N1, N1) -= meanCauchy;
400  tDevCauchy(N2, N2) -= meanCauchy;
401 
402  // Plastic surface
403 
404  s2 = tDevCauchy(i, j) * tDevCauchy(i, j); // s:s
405  f = sqrt(1.5 * s2);
406  phi = f - sigmaY;
407 
408  // Flow
410  tPhi_dDevCauchy(i, j) *= 1.5 / f;
412  tPhi_dCauchy(N0, N0) -= third * tPhi_dDevCauchy(i, i);
413  tPhi_dCauchy(N1, N1) -= third * tPhi_dDevCauchy(i, i);
414  tPhi_dCauchy(N2, N2) -= third * tPhi_dDevCauchy(i, i);
415  tPhi_dSigma(I, J) = tInvF(I, i) * (tPhi_dCauchy(i, j) * tF(j, J));
416  tPhi_dSigma(I, J) *= -(1 / detF);
417 
418  // Pull back
419  tPulledP(i, J) = tP(i, I) * tInvH(J, I);
420  tPulledP(i, J) *= detH;
421  tPulledSigma(i, J) = tSigma(i, I) * tInvH(J, I);
422  tPulledSigma(i, J) *= detH;
423  tPulledPhi_dSigma(i, J) = tPhi_dSigma(i, I) * tInvH(J, I);
424  tPulledPhi_dSigma(i, J) *= detH;
425 
426  // Set dependent variables to ADOL-C
427  tPulledP(i, j) >>= r_P(i, j);
428  tPulledSigma(i, j) >>= r_Sigma(i, j);
429  phi >>= r_phi;
430  tPulledPhi_dSigma(i, j) >>= r_Flow(i, j);
431 
432  trace_off();
433 
435  }
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< '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

◆ returnOpJacobian()

virtual OpJacobian* EshelbianPlasticity::HMHStVenantKirchhoff::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 278 of file EshelbianADOL-C.cpp.

281  {
282  return (
283  new OpHMHH(field_name, tag, eval_rhs, eval_lhs, data_ptr, physics_ptr));
284  }

Member Data Documentation

◆ detF

adouble EshelbianPlasticity::HMHStVenantKirchhoff::detF

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

◆ detH

adouble EshelbianPlasticity::HMHStVenantKirchhoff::detH

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

◆ energy

adouble EshelbianPlasticity::HMHStVenantKirchhoff::energy

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

◆ f

adouble EshelbianPlasticity::HMHStVenantKirchhoff::f

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

◆ lambda

double EshelbianPlasticity::HMHStVenantKirchhoff::lambda

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

◆ meanCauchy

adouble EshelbianPlasticity::HMHStVenantKirchhoff::meanCauchy

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

◆ mu

double EshelbianPlasticity::HMHStVenantKirchhoff::mu

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

◆ numberOfActiveVariables

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

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

◆ numberOfDependentVariables

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

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

◆ phi

adouble EshelbianPlasticity::HMHStVenantKirchhoff::phi

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

◆ s2

adouble EshelbianPlasticity::HMHStVenantKirchhoff::s2

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

◆ sigmaY

double EshelbianPlasticity::HMHStVenantKirchhoff::sigmaY

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

◆ tC

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tC

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

◆ tCauchy

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tCauchy

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

◆ tDevCauchy

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tDevCauchy

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

◆ tE

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tE

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

◆ tF

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tF

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

◆ th

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::th

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

◆ tH

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tH

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

◆ tInvF

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tInvF

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

◆ tInvH

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tInvH

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

◆ tP

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tP

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

◆ tPhi_dCauchy

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPhi_dCauchy

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

◆ tPhi_dDevCauchy

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPhi_dDevCauchy

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

◆ tPhi_dSigma

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPhi_dSigma

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

◆ tPulledP

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPulledP

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

◆ tPulledPhi_dSigma

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPulledPhi_dSigma

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

◆ tPulledSigma

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPulledSigma

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

◆ trE

adouble EshelbianPlasticity::HMHStVenantKirchhoff::trE

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

◆ tS

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tS

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

◆ tSigma

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tSigma

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


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