23 static inline constexpr std::array<std::array<int, 2>, 6>
edgeNodes = {
24 std::array<int, 2>{0, 1}, std::array<int, 2>{0, 2},
25 std::array<int, 2>{0, 3}, std::array<int, 2>{1, 2},
26 std::array<int, 2>{1, 3}, std::array<int, 2>{2, 3}};
81 static_assert(DIM == 3,
82 "AdolCVolumeLengthQuality is implemented for 3D only");
87 MatrixDouble(DIM * DIM, DIM * DIM));
92 "P_dF", MatrixDouble(DIM * DIM, DIM * DIM));
94 auto t_F = getFTensor2FromPtr<DIM, DIM>(
96 auto t_P = getFTensor2FromPtr<DIM, DIM>(
121 std::array<adouble, 12> refCoords;
122 for (
auto dd = 0; dd != 12; ++dd) {
126 ta_F(
i,
J) <<= t_F(
i,
J);
127 det_aF = determinantTensor(ta_F);
128 CHKERR invertTensor(ta_F, det_aF, ta_invF);
130 const auto x00 = refCoords[0];
131 const auto x01 = refCoords[1];
132 const auto x02 = refCoords[2];
133 const auto x10 = refCoords[3];
134 const auto x11 = refCoords[4];
135 const auto x12 = refCoords[5];
136 const auto x20 = refCoords[6];
137 const auto x21 = refCoords[7];
138 const auto x22 = refCoords[8];
139 const auto x30 = refCoords[9];
140 const auto x31 = refCoords[10];
141 const auto x32 = refCoords[11];
143 const auto ax = x10 - x00;
144 const auto ay = x11 - x01;
145 const auto az = x12 - x02;
147 const auto bx = x20 - x00;
148 const auto by = x21 - x01;
149 const auto bz = x22 - x02;
151 const auto cx = x30 - x00;
152 const auto cy = x31 - x01;
153 const auto cz = x32 - x02;
156 (ax * (by * cz - bz * cy) - ay * (bx * cz - bz * cx) +
157 az * (bx * cy - by * cx)) /
160 dX_dChiT(
i,
J) = 0.0;
165 for (
auto ee = 0; ee != 6; ++ee) {
166 for (
auto dd = 0; dd != DIM; ++dd) {
172 delta_X(
i) = ta_F(
i,
J) * delta_chi(
J);
174 lrms_squared += (1. / 6.) * delta_X(
i) * delta_X(
i);
175 lrms_squared0 += (1. / 6.) * delta_chi(
I) * delta_chi(
I);
176 dX_dChiT(
i,
I) += delta_X(
i) * delta_chi(
I);
179 Q(
i,
j) = ta_invF(
j,
i) - 0.5 * dX_dChiT(
i,
j) / lrms_squared;
181 const adouble lrms_cubed0 = lrms_squared0 * sqrt(lrms_squared0);
183 det_aF / (lrms_squared * sqrt(lrms_squared) / lrms_cubed0);
184 const adouble current_volume = det_aF * signed_volume;
186 6. * sqrt(2.) * current_volume / (lrms_squared * sqrt(lrms_squared));
190 ta_P(
i,
J) = q * Q(
i,
J);
194 ta_P(
i,
J) = t_mp * Q(
i,
J);
199 ta_P(
i,
J) = t_mp * Q(
i,
J);
204 t_mp *= b / (1.0 -
gAmma) - 1.0 / (b -
gAmma);
205 ta_P(
i,
J) = t_mp * Q(
i,
J);
210 "Unknown volume-length-quality type");
213 ta_P(
i,
J) *=
aLpha / signed_volume;
214 ta_P(
i,
J) >>= t_P(
i,
J);