v0.9.0
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)
 
- 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 241 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 251 of file EshelbianADOL-C.cpp.

251  {
253 
254  double E = 1;
255  double nu = 0;
256 
257  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "stvenant_", "", "none");
258 
259  CHKERR PetscOptionsScalar("-young_modulus", "Young modulus", "", E, &E,
260  PETSC_NULL);
261  CHKERR PetscOptionsScalar("-poisson_ratio", "poisson ratio", "", nu, &nu,
262  PETSC_NULL);
263  CHKERR PetscOptionsScalar("-sigmaY", "plastic strain", "", sigmaY, &sigmaY,
264  PETSC_NULL);
265 
266  ierr = PetscOptionsEnd();
267  CHKERRG(ierr);
268 
269  lambda = LAMBDA(E, nu);
270  mu = MU(E, nu);
271 
273  }
#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:477
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:544
#define CHKERR
Inline error check.
Definition: definitions.h:596
#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:407

◆ recordTape()

MoFEMErrorCode EshelbianPlasticity::HMHStVenantKirchhoff::recordTape ( const int  tape)
virtual

Implements EshelbianPlasticity::PhysicalEquations.

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

318  {
327 
328  CHKERR getOptions();
329 
330  auto ih = get_h();
331  auto iH = get_H();
332  ih(i, j) = 0;
333  iH(i, j) = 0;
334  for (int ii = 0; ii != 3; ++ii) {
335  ih(ii, ii) = 1;
336  iH(ii, ii) = 1;
337  }
338 
339  auto r_P = get_P();
340  auto r_Sigma = get_Sigma();
341  double &r_phi = get_PhiRef();
342  auto r_Flow = get_Flow();
343 
344  enableMinMaxUsingAbs();
345  trace_on(tape);
346 
347  // Set active variables to ADOL-C
348  th(i, j) <<= get_h()(i, j);
349  tH(i, j) <<= get_H()(i, j);
350 
351  // Deformation gradient
354  tF(i, I) = th(i, J) * tInvH(J, I);
357 
358  // Deformation and strain
359  tC(I, J) = tF(i, I) * tF(i, J);
360  tE(I, J) = tC(I, J);
361  tE(N0, N0) -= 1;
362  tE(N1, N1) -= 1;
363  tE(N2, N2) -= 1;
364  tE(I, J) *= 0.5;
365 
366  // Energy
367  trE = tE(I, I);
368  energy = 0.5 * lambda * trE * trE + mu * (tE(I, J) * tE(I, J));
369 
370  // Stress Piola II
371  tS(I, J) = tE(I, J);
372  tS(I, J) *= 2 * mu;
373  tS(N0, N0) += lambda * trE;
374  tS(N1, N1) += lambda * trE;
375  tS(N2, N2) += lambda * trE;
376  // Stress Piola I
377  tP(i, J) = tF(i, I) * tS(I, J);
378  // Stress Cauchy
379  tCauchy(i, j) = tP(i, J) * tF(j, J);
380  tCauchy(i, j) *= (1 / detF);
381 
382  // Stress Eshelby
383  tSigma(I, J) = -tF(i, I) * tP(i, J);
384  tSigma(N0, N0) += energy;
385  tSigma(N1, N1) += energy;
386  tSigma(N2, N2) += energy;
387 
388  // Deviator Cauchy Stress
389  meanCauchy = third * tCauchy(i, i);
390  tDevCauchy(i, j) = tCauchy(i, j);
391  tDevCauchy(N0, N0) -= meanCauchy;
392  tDevCauchy(N1, N1) -= meanCauchy;
393  tDevCauchy(N2, N2) -= meanCauchy;
394 
395  // Plastic surface
396 
397  s2 = tDevCauchy(i, j) * tDevCauchy(i, j); // s:s
398  f = sqrt(1.5 * s2);
399  phi = f - sigmaY;
400 
401  // Flow
402  tPhi_dDevCauchy(i, j) = tDevCauchy(i, j);
403  tPhi_dDevCauchy(i, j) *= 1.5 / f;
404  tPhi_dCauchy(i, j) = tPhi_dDevCauchy(i, j);
405  tPhi_dCauchy(N0, N0) -= third * tPhi_dDevCauchy(i, i);
406  tPhi_dCauchy(N1, N1) -= third * tPhi_dDevCauchy(i, i);
407  tPhi_dCauchy(N2, N2) -= third * tPhi_dDevCauchy(i, i);
408  tPhi_dSigma(I, J) = tInvF(I, i) * (tPhi_dCauchy(i, j) * tF(j, J));
409  tPhi_dSigma(I, J) *= -(1 / detF);
410 
411  // Pull back
412  tPulledP(i, J) = tP(i, I) * tInvH(J, I);
413  tPulledP(i, J) *= detH;
414  tPulledSigma(i, J) = tSigma(i, I) * tInvH(J, I);
415  tPulledSigma(i, J) *= detH;
416  tPulledPhi_dSigma(i, J) = tPhi_dSigma(i, I) * tInvH(J, I);
417  tPulledPhi_dSigma(i, J) *= detH;
418 
419  // Set dependent variables to ADOL-C
420  tPulledP(i, j) >>= r_P(i, j);
421  tPulledSigma(i, j) >>= r_Sigma(i, j);
422  phi >>= r_phi;
423  tPulledPhi_dSigma(i, j) >>= r_Flow(i, j);
424 
425  trace_off();
426 
428  }
MoFEMErrorCode determinantTensor3by3(T1 &t, T2 &det)
Calculate determinant 3 by 3.
Definition: Templates.hpp:415
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
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:396
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
constexpr double third

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

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

Member Data Documentation

◆ detF

adouble EshelbianPlasticity::HMHStVenantKirchhoff::detF

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

◆ detH

adouble EshelbianPlasticity::HMHStVenantKirchhoff::detH

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

◆ energy

adouble EshelbianPlasticity::HMHStVenantKirchhoff::energy

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

◆ f

adouble EshelbianPlasticity::HMHStVenantKirchhoff::f

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

◆ lambda

double EshelbianPlasticity::HMHStVenantKirchhoff::lambda

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

◆ meanCauchy

adouble EshelbianPlasticity::HMHStVenantKirchhoff::meanCauchy

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

◆ mu

double EshelbianPlasticity::HMHStVenantKirchhoff::mu

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

◆ numberOfActiveVariables

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

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

◆ numberOfDependentVariables

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

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

◆ phi

adouble EshelbianPlasticity::HMHStVenantKirchhoff::phi

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

◆ s2

adouble EshelbianPlasticity::HMHStVenantKirchhoff::s2

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

◆ sigmaY

double EshelbianPlasticity::HMHStVenantKirchhoff::sigmaY

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

◆ tC

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tC

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

◆ tCauchy

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tCauchy

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

◆ tDevCauchy

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tDevCauchy

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

◆ tE

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tE

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

◆ tF

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tF

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

◆ th

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::th

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

◆ tH

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tH

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

◆ tInvF

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tInvF

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

◆ tInvH

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tInvH

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

◆ tP

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tP

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

◆ tPhi_dCauchy

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPhi_dCauchy

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

◆ tPhi_dDevCauchy

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPhi_dDevCauchy

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

◆ tPhi_dSigma

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPhi_dSigma

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

◆ tPulledP

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPulledP

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

◆ tPulledPhi_dSigma

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPulledPhi_dSigma

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

◆ tPulledSigma

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tPulledSigma

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

◆ trE

adouble EshelbianPlasticity::HMHStVenantKirchhoff::trE

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

◆ tS

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tS

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

◆ tSigma

ATensor2 EshelbianPlasticity::HMHStVenantKirchhoff::tSigma

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


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