https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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 16 of file umat.C.

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