57 inline Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, 0, 9, 9>
VolumePenalty3d_hessian(
const RowVectorNd &p,
const double t,
const int el_id,
const Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3> &
F,
const double k)
59 Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, 0, 9, 9> hess(9, 9);
60 std::array<double, 81> result_0;
61 const double F00 =
F(0, 0);
62 const double F01 =
F(0, 1);
63 const double F02 =
F(0, 2);
64 const double F10 =
F(1, 0);
65 const double F11 =
F(1, 1);
66 const double F12 =
F(1, 2);
67 const double F20 =
F(2, 0);
68 const double F21 =
F(2, 1);
69 const double F22 =
F(2, 2);
70 const auto helper_0 = F11 * F22;
71 const auto helper_1 = F12 * F21;
72 const auto helper_2 = helper_0 - helper_1;
73 const auto helper_3 = F12 * F20;
74 const auto helper_4 = F10 * F21;
75 const auto helper_5 = F10 * F22;
76 const auto helper_6 = F11 * F20;
77 const auto helper_7 = F00 * helper_0 - F00 * helper_1 + F01 * helper_3 - F01 * helper_5 + F02 * helper_4 - F02 * helper_6;
78 const auto helper_8 = pow(helper_7, -2);
79 const auto helper_9 = 0.5 * k;
80 const auto helper_10 = helper_9 * (helper_8 + 1.0);
81 const auto helper_11 = -helper_3 + helper_5;
82 const auto helper_12 = helper_10 * helper_2;
83 const auto helper_13 = -helper_11 * helper_12;
84 const auto helper_14 = helper_4 - helper_6;
85 const auto helper_15 = helper_12 * helper_14;
86 const auto helper_16 = F01 * F22 - F02 * F21;
87 const auto helper_17 = -helper_12 * helper_16;
88 const auto helper_18 = F00 * F22 - F02 * F20;
89 const auto helper_19 = helper_18 * helper_2;
90 const auto helper_20 = 1.0 * helper_7;
91 const auto helper_21 = F22 * helper_20;
92 const auto helper_22 = 1.0 / helper_7;
93 const auto helper_23 = F22 * helper_22;
94 const auto helper_24 = helper_9 * (helper_19 * helper_8 + 1.0 * helper_19 + helper_21 - helper_23);
95 const auto helper_25 = F00 * F21 - F01 * F20;
96 const auto helper_26 = helper_2 * helper_25;
97 const auto helper_27 = F21 * helper_22;
98 const auto helper_28 = -helper_9 * (F21 * helper_20 + helper_26 * helper_8 + 1.0 * helper_26 - helper_27);
99 const auto helper_29 = F01 * F12 - F02 * F11;
100 const auto helper_30 = helper_12 * helper_29;
101 const auto helper_31 = F00 * F12 - F02 * F10;
102 const auto helper_32 = helper_2 * helper_31;
103 const auto helper_33 = F12 * helper_22;
104 const auto helper_34 = -helper_9 * (F12 * helper_20 + helper_32 * helper_8 + 1.0 * helper_32 - helper_33);
105 const auto helper_35 = F00 * F11 - F01 * F10;
106 const auto helper_36 = helper_2 * helper_35;
107 const auto helper_37 = F11 * helper_20;
108 const auto helper_38 = F11 * helper_22;
109 const auto helper_39 = helper_9 * (helper_36 * helper_8 + 1.0 * helper_36 + helper_37 - helper_38);
110 const auto helper_40 = helper_10 * helper_11;
111 const auto helper_41 = -helper_14 * helper_40;
112 const auto helper_42 = helper_11 * helper_16;
113 const auto helper_43 = helper_9 * (-helper_21 + helper_23 + helper_42 * helper_8 + 1.0 * helper_42);
114 const auto helper_44 = -helper_18 * helper_40;
115 const auto helper_45 = helper_11 * helper_25;
116 const auto helper_46 = F20 * helper_20;
117 const auto helper_47 = F20 * helper_22;
118 const auto helper_48 = helper_9 * (helper_45 * helper_8 + 1.0 * helper_45 + helper_46 - helper_47);
119 const auto helper_49 = helper_11 * helper_29;
120 const auto helper_50 = helper_9 * (1.0 * F12 * helper_7 - helper_33 - helper_49 * helper_8 - 1.0 * helper_49);
121 const auto helper_51 = helper_31 * helper_40;
122 const auto helper_52 = helper_11 * helper_35;
123 const auto helper_53 = F10 * helper_22;
124 const auto helper_54 = -helper_9 * (F10 * helper_20 + helper_52 * helper_8 + 1.0 * helper_52 - helper_53);
125 const auto helper_55 = helper_14 * helper_16;
126 const auto helper_56 = helper_9 * (1.0 * F21 * helper_7 - helper_27 - helper_55 * helper_8 - 1.0 * helper_55);
127 const auto helper_57 = helper_14 * helper_18;
128 const auto helper_58 = helper_9 * (-helper_46 + helper_47 + helper_57 * helper_8 + 1.0 * helper_57);
129 const auto helper_59 = helper_10 * helper_14;
130 const auto helper_60 = -helper_25 * helper_59;
131 const auto helper_61 = helper_14 * helper_29;
132 const auto helper_62 = helper_9 * (-helper_37 + helper_38 + helper_61 * helper_8 + 1.0 * helper_61);
133 const auto helper_63 = helper_14 * helper_31;
134 const auto helper_64 = helper_9 * (1.0 * F10 * helper_7 - helper_53 - helper_63 * helper_8 - 1.0 * helper_63);
135 const auto helper_65 = helper_35 * helper_59;
136 const auto helper_66 = helper_10 * helper_16;
137 const auto helper_67 = -helper_18 * helper_66;
138 const auto helper_68 = helper_25 * helper_66;
139 const auto helper_69 = -helper_29 * helper_66;
140 const auto helper_70 = helper_16 * helper_31;
141 const auto helper_71 = F02 * helper_20;
142 const auto helper_72 = F02 * helper_22;
143 const auto helper_73 = helper_9 * (helper_70 * helper_8 + 1.0 * helper_70 + helper_71 - helper_72);
144 const auto helper_74 = helper_16 * helper_35;
145 const auto helper_75 = F01 * helper_22;
146 const auto helper_76 = -helper_9 * (F01 * helper_20 + helper_74 * helper_8 + 1.0 * helper_74 - helper_75);
147 const auto helper_77 = helper_10 * helper_18;
148 const auto helper_78 = -helper_25 * helper_77;
149 const auto helper_79 = helper_18 * helper_29;
150 const auto helper_80 = helper_9 * (-helper_71 + helper_72 + helper_79 * helper_8 + 1.0 * helper_79);
151 const auto helper_81 = -helper_31 * helper_77;
152 const auto helper_82 = helper_18 * helper_35;
153 const auto helper_83 = F00 * helper_20;
154 const auto helper_84 = F00 * helper_22;
155 const auto helper_85 = helper_9 * (helper_8 * helper_82 + 1.0 * helper_82 + helper_83 - helper_84);
156 const auto helper_86 = helper_25 * helper_29;
157 const auto helper_87 = helper_9 * (1.0 * F01 * helper_7 - helper_75 - helper_8 * helper_86 - 1.0 * helper_86);
158 const auto helper_88 = helper_25 * helper_31;
159 const auto helper_89 = helper_9 * (helper_8 * helper_88 - helper_83 + helper_84 + 1.0 * helper_88);
160 const auto helper_90 = helper_10 * helper_35;
161 const auto helper_91 = -helper_25 * helper_90;
162 const auto helper_92 = -helper_10 * helper_29 * helper_31;
163 const auto helper_93 = helper_29 * helper_90;
164 const auto helper_94 = -helper_31 * helper_90;
165 result_0[0] = helper_10 * pow(helper_2, 2);
166 result_0[1] = helper_13;
167 result_0[2] = helper_15;
168 result_0[3] = helper_17;
169 result_0[4] = helper_24;
170 result_0[5] = helper_28;
171 result_0[6] = helper_30;
172 result_0[7] = helper_34;
173 result_0[8] = helper_39;
174 result_0[9] = helper_13;
175 result_0[10] = helper_10 * pow(helper_11, 2);
176 result_0[11] = helper_41;
177 result_0[12] = helper_43;
178 result_0[13] = helper_44;
179 result_0[14] = helper_48;
180 result_0[15] = helper_50;
181 result_0[16] = helper_51;
182 result_0[17] = helper_54;
183 result_0[18] = helper_15;
184 result_0[19] = helper_41;
185 result_0[20] = helper_10 * pow(helper_14, 2);
186 result_0[21] = helper_56;
187 result_0[22] = helper_58;
188 result_0[23] = helper_60;
189 result_0[24] = helper_62;
190 result_0[25] = helper_64;
191 result_0[26] = helper_65;
192 result_0[27] = helper_17;
193 result_0[28] = helper_43;
194 result_0[29] = helper_56;
195 result_0[30] = helper_10 * pow(helper_16, 2);
196 result_0[31] = helper_67;
197 result_0[32] = helper_68;
198 result_0[33] = helper_69;
199 result_0[34] = helper_73;
200 result_0[35] = helper_76;
201 result_0[36] = helper_24;
202 result_0[37] = helper_44;
203 result_0[38] = helper_58;
204 result_0[39] = helper_67;
205 result_0[40] = helper_10 * pow(helper_18, 2);
206 result_0[41] = helper_78;
207 result_0[42] = helper_80;
208 result_0[43] = helper_81;
209 result_0[44] = helper_85;
210 result_0[45] = helper_28;
211 result_0[46] = helper_48;
212 result_0[47] = helper_60;
213 result_0[48] = helper_68;
214 result_0[49] = helper_78;
215 result_0[50] = helper_10 * pow(helper_25, 2);
216 result_0[51] = helper_87;
217 result_0[52] = helper_89;
218 result_0[53] = helper_91;
219 result_0[54] = helper_30;
220 result_0[55] = helper_50;
221 result_0[56] = helper_62;
222 result_0[57] = helper_69;
223 result_0[58] = helper_80;
224 result_0[59] = helper_87;
225 result_0[60] = helper_10 * pow(helper_29, 2);
226 result_0[61] = helper_92;
227 result_0[62] = helper_93;
228 result_0[63] = helper_34;
229 result_0[64] = helper_51;
230 result_0[65] = helper_64;
231 result_0[66] = helper_73;
232 result_0[67] = helper_81;
233 result_0[68] = helper_89;
234 result_0[69] = helper_92;
235 result_0[70] = helper_10 * pow(helper_31, 2);
236 result_0[71] = helper_94;
237 result_0[72] = helper_39;
238 result_0[73] = helper_54;
239 result_0[74] = helper_65;
240 result_0[75] = helper_76;
241 result_0[76] = helper_85;
242 result_0[77] = helper_91;
243 result_0[78] = helper_93;
244 result_0[79] = helper_94;
245 result_0[80] = helper_10 * pow(helper_35, 2);
247 hess(0, 0) = result_0[0];
248 hess(0, 1) = result_0[1];
249 hess(0, 2) = result_0[2];
250 hess(0, 3) = result_0[3];
251 hess(0, 4) = result_0[4];
252 hess(0, 5) = result_0[5];
253 hess(0, 6) = result_0[6];
254 hess(0, 7) = result_0[7];
255 hess(0, 8) = result_0[8];
256 hess(1, 0) = result_0[9];
257 hess(1, 1) = result_0[10];
258 hess(1, 2) = result_0[11];
259 hess(1, 3) = result_0[12];
260 hess(1, 4) = result_0[13];
261 hess(1, 5) = result_0[14];
262 hess(1, 6) = result_0[15];
263 hess(1, 7) = result_0[16];
264 hess(1, 8) = result_0[17];
265 hess(2, 0) = result_0[18];
266 hess(2, 1) = result_0[19];
267 hess(2, 2) = result_0[20];
268 hess(2, 3) = result_0[21];
269 hess(2, 4) = result_0[22];
270 hess(2, 5) = result_0[23];
271 hess(2, 6) = result_0[24];
272 hess(2, 7) = result_0[25];
273 hess(2, 8) = result_0[26];
274 hess(3, 0) = result_0[27];
275 hess(3, 1) = result_0[28];
276 hess(3, 2) = result_0[29];
277 hess(3, 3) = result_0[30];
278 hess(3, 4) = result_0[31];
279 hess(3, 5) = result_0[32];
280 hess(3, 6) = result_0[33];
281 hess(3, 7) = result_0[34];
282 hess(3, 8) = result_0[35];
283 hess(4, 0) = result_0[36];
284 hess(4, 1) = result_0[37];
285 hess(4, 2) = result_0[38];
286 hess(4, 3) = result_0[39];
287 hess(4, 4) = result_0[40];
288 hess(4, 5) = result_0[41];
289 hess(4, 6) = result_0[42];
290 hess(4, 7) = result_0[43];
291 hess(4, 8) = result_0[44];
292 hess(5, 0) = result_0[45];
293 hess(5, 1) = result_0[46];
294 hess(5, 2) = result_0[47];
295 hess(5, 3) = result_0[48];
296 hess(5, 4) = result_0[49];
297 hess(5, 5) = result_0[50];
298 hess(5, 6) = result_0[51];
299 hess(5, 7) = result_0[52];
300 hess(5, 8) = result_0[53];
301 hess(6, 0) = result_0[54];
302 hess(6, 1) = result_0[55];
303 hess(6, 2) = result_0[56];
304 hess(6, 3) = result_0[57];
305 hess(6, 4) = result_0[58];
306 hess(6, 5) = result_0[59];
307 hess(6, 6) = result_0[60];
308 hess(6, 7) = result_0[61];
309 hess(6, 8) = result_0[62];
310 hess(7, 0) = result_0[63];
311 hess(7, 1) = result_0[64];
312 hess(7, 2) = result_0[65];
313 hess(7, 3) = result_0[66];
314 hess(7, 4) = result_0[67];
315 hess(7, 5) = result_0[68];
316 hess(7, 6) = result_0[69];
317 hess(7, 7) = result_0[70];
318 hess(7, 8) = result_0[71];
319 hess(8, 0) = result_0[72];
320 hess(8, 1) = result_0[73];
321 hess(8, 2) = result_0[74];
322 hess(8, 3) = result_0[75];
323 hess(8, 4) = result_0[76];
324 hess(8, 5) = result_0[77];
325 hess(8, 6) = result_0[78];
326 hess(8, 7) = result_0[79];
327 hess(8, 8) = result_0[80];