59{
60 if (*NPROPS != 2)
61 mooseError(
"Wrong number of properties passed in.");
62
63
64 Eigen::Matrix<Real, 6, 1> u;
65 u << U_[0], U_[1], U_[2], U_[3], U_[4], U_[5];
66
67
68 Eigen::Matrix<Real, 6, 1> du;
69 du << DU_[0], DU_[1], DU_[2], DU_[3], DU_[4], DU_[5];
70
71
72 u += du;
73
74 const auto & x1 = COORDS[0];
75 const auto & y1 = COORDS[1];
76 const auto & x2 = COORDS[2];
77 const auto & y2 = COORDS[3];
78 const auto & x3 = COORDS[4];
79 const auto & y3 = COORDS[5];
80
81 const auto x13 = x1 - x3;
82 const auto x21 = x2 - x1;
83 const auto y12 = y1 - y2;
84 const auto y21 = y2 - y1;
85 const auto x31 = x3 - x1;
86 const auto y31 = y3 - y1;
87 const auto x32 = x3 - x2;
88 const auto y23 = y2 - y3;
89
90
91 Eigen::Matrix<Real, 2, 2> J;
92 J << x21, y21,
93 x31, y31;
94
95 const auto Jdet = J.determinant();
96 if (Jdet <= 0)
97 mooseError(
"Negative Jacobian in element ", *JELEM);
98
99
100
101
102 const auto A = Jdet / 2.0;
103
104 Eigen::Matrix<Real, 3, 6>
B;
105 B << y23, 0.0, y31, 0.0, y12, 0.0,
106 0.0, x32, 0.0, x13, 0.0, x21,
107 x32, y23, x13, y31, x21, y12;
109
110 const auto Bt =
B.transpose();
111
112
114
115
116 const auto Y = PROPS[0];
117
118
119 const auto nu = PROPS[1];
120
121 Eigen::Matrix<Real, 3, 3> E;
122
123
124
125
126
127
128
129
130 E << 1.0 - nu, nu, 0.0,
131 nu, 1.0 - nu, 0.0,
132 0.0, 0.0, (1.0 - 2.0 * nu) / 2.0;
133 E *= Y / (1.0 + nu) / (1.0 - 2.0 * nu);
134
135
136 const auto ke = Bt * E *
B * t *
A;
137
138
139 const auto re = ke * u;
140
141
143 {
144 RHS[i] = -re(i);
146 AMATRX[i * 6 + j] = -ke(i, j);
147 }
148}
void mooseError(Args &&... args)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)