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

Go to the source code of this file.

Functions

void FOR_NAME (umat, UMAT)
 

Function Documentation

◆ FOR_NAME()

void FOR_NAME ( umat  ,
UMAT   
)

Definition at line 15 of file umat.C.

53 {
54  if (*nprops != 2)
55  throw std::invalid_argument("This UMAT requires exactly two properties.");
56 
57  double E = props[0];
58  double nu = props[1];
59  double G = E / 2.0 / (1.0 + nu);
60  double lambda = 2.0 * G * nu / (1.0 - 2.0 * nu);
61  double eps[6];
62 
63  // Build stress as in
64  // https://github.com/michael-schw/Abaqus-UMAT-Cpp-Subroutine/blob/main/umat.cpp
65  for (int i = 0; i < 6; i++)
66  eps[i] = stran[i] + dstran[i];
67 
68  auto eps_trace = eps[0] + eps[1] + eps[2];
69 
70  for (int i = 0; i < 3; i++)
71  {
72  stress[i] = lambda * eps_trace + 2.0 * G * eps[i];
73  stress[i + 3] = G * eps[i + 3];
74  }
75 
76  Eigen::Matrix<double, 6, 6> C;
77  buildStiffnessMatrix(C, G, lambda);
78 
79  for (int i = 0; i < 6; i++)
80  for (int j = 0; j < 6; j++)
81  ddsdde[6 * i + j] = 0.0;
82 
83  for (int i = 0; i < 3; i++)
84  {
85  ddsdde[6 * i + 0] = C(0, i);
86  ddsdde[6 * i + 1] = C(1, i);
87  ddsdde[6 * i + 2] = C(2, i);
88  ddsdde[6 * (i + 3) + (i + 3)] = C(i + 3, i + 3);
89  }
90 }
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