https://mooseframework.inl.gov
Functions
elastic_print_eigen.C File Reference

Go to the source code of this file.

Functions

void buildStiffnessMatrix (Eigen::Ref< Eigen::Matrix< double, 6, 6 >> C, const double &G, const double &lambda)
 build a 6x6 representation of the stiffness tensor in C from the shear modulus G and Lame's first parameter lambda. More...
 
void umat_ (double *stress, double *statev, double *ddsdde, double *sse, double *spd, double *scd, double *rpl, double *ddsddt, double *drplde, double *drpldt, double *stran, double *dstran, double *time, double *dtime, double *temp, double *dtemp, double *predef, double *dpred, char *cmname, int *ndi, int *nshr, int *ntens, int *nstatv, double *props, int *nprops, double *coords, double *drot, double *pnewdt, double *celent, double *dfgrd0, double *dfgrd1, int *noel, int *npt, int *layer, int *kspt, int *kstep, int *kinc, short cmname_len)
 

Function Documentation

◆ buildStiffnessMatrix()

void buildStiffnessMatrix ( Eigen::Ref< Eigen::Matrix< double, 6, 6 >>  C,
const double &  G,
const double &  lambda 
)

build a 6x6 representation of the stiffness tensor in C from the shear modulus G and Lame's first parameter lambda.

Definition at line 22 of file elastic_print_eigen.C.

Referenced by FOR_NAME(), and umat_().

25 {
26  C = Eigen::Matrix<double, 6, 6>::Zero();
27 
28  for (int i = 0; i < 3; i++)
29  {
30  C(i, i) += 2 * G;
31  C(i + 3, i + 3) += G;
32  for (int j = 0; j < 3; j++)
33  C(i, j) += lambda;
34  }
35 }
static const std::string G
Definition: NS.h:166
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static const std::string C
Definition: NS.h:168

◆ umat_()

void umat_ ( double *  stress,
double *  statev,
double *  ddsdde,
double *  sse,
double *  spd,
double *  scd,
double *  rpl,
double *  ddsddt,
double *  drplde,
double *  drpldt,
double *  stran,
double *  dstran,
double *  time,
double *  dtime,
double *  temp,
double *  dtemp,
double *  predef,
double *  dpred,
char *  cmname,
int ndi,
int nshr,
int ntens,
int nstatv,
double *  props,
int nprops,
double *  coords,
double *  drot,
double *  pnewdt,
double *  celent,
double *  dfgrd0,
double *  dfgrd1,
int noel,
int npt,
int layer,
int kspt,
int kstep,
int kinc,
short  cmname_len 
)

Definition at line 38 of file elastic_print_eigen.C.

76 {
77 
78  double E = props[0];
79  double nu = props[1];
80  double G = E / 2.0 / (1.0 + nu);
81  double lambda = 2.0 * G * nu / (1.0 - 2.0 * nu);
82  double eps[6];
83  double eps_trace;
84 
85  for (int i = 0; i < 6; i++)
86  eps[i] = stran[i] + dstran[i];
87 
88  eps_trace = eps[0] + eps[1] + eps[2];
89 
90  for (int i = 0; i < 3; i++)
91  {
92  stress[i] = lambda * eps_trace + 2.0 * G * eps[i];
93  stress[i + 3] = G * eps[i + 3];
94  }
95 
96  Eigen::Matrix<double, 6, 6> C;
97  buildStiffnessMatrix(C, G, lambda);
98 
99  for (int i = 0; i < 6; i++)
100  for (int j = 0; j < 6; j++)
101  ddsdde[6 * i + j] = 0.0;
102 
103  for (int i = 0; i < 3; i++)
104  {
105  ddsdde[6 * i + 0] = C(0, i);
106  ddsdde[6 * i + 1] = C(1, i);
107  ddsdde[6 * i + 2] = C(2, i);
108  ddsdde[6 * (i + 3) + (i + 3)] = C(i + 3, i + 3);
109  }
110 
111  // Print out eigenvalue using Eigen matrix
112  auto eigenvalues = C.eigenvalues();
113 
114  if (*npt == 8 && time[0] == 0.0)
115  for (int index_i = 0; index_i < *ntens; index_i++)
116  Moose::out << "Eigenvalues " << index_i << " " << eigenvalues(index_i).real() << std::endl;
117 }
const Real eps
static const std::string G
Definition: NS.h:166
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
void buildStiffnessMatrix(Eigen::Ref< Eigen::Matrix< double, 6, 6 >> C, const double &G, const double &lambda)
build a 6x6 representation of the stiffness tensor in C from the shear modulus G and Lame&#39;s first par...
static const std::string C
Definition: NS.h:168