3
3
4
4
#include < config.h>
5
5
6
+ #include " checkfebyautodiff.hh"
6
7
#include " testcommon.hh"
7
8
#include " testhelpers.hh"
8
- #include " checkfebyautodiff.hh"
9
9
10
10
#include < dune/common/test/testsuite.hh>
11
11
#include < dune/functions/functionspacebases/boundarydofs.hh>
@@ -112,8 +112,8 @@ auto KLShellAndAdaptiveStepSizing(const PathFollowingType& pft, const std::vecto
112
112
for (auto & element : elements (gridView))
113
113
fes.emplace_back (basis, element, E, nu, thickness, utils::LoadDefault{}, &neumannBoundary, neumannBoundaryLoad);
114
114
115
- t.subTest (checkFEByAutoDiff<KirchhoffLoveShellHelper>(gridView, power<3 >(nurbs ()), E, nu, thickness, utils::LoadDefault{},
116
- &neumannBoundary, neumannBoundaryLoad));
115
+ t.subTest (checkFEByAutoDiff<KirchhoffLoveShellHelper>(gridView, power<3 >(nurbs ()), E, nu, thickness,
116
+ utils::LoadDefault{}, &neumannBoundary, neumannBoundaryLoad));
117
117
118
118
auto basisP = std::make_shared<const decltype (basis)>(basis);
119
119
DirichletValues dirichletValues (basisP->flat ());
@@ -166,7 +166,6 @@ auto KLShellAndAdaptiveStepSizing(const PathFollowingType& pft, const std::vecto
166
166
auto nonLinOpFull
167
167
= Ikarus::NonLinearOperator (functions (energyFunction, residualFunction, KFunction), parameter (d, lambda));
168
168
169
-
170
169
auto nonLinOp = nonLinOpFull.template subOperator <1 , 2 >();
171
170
auto linSolver = LinearSolver (SolverTypeTag::sd_SimplicialLDLT);
172
171
@@ -219,13 +218,16 @@ auto KLShellAndAdaptiveStepSizing(const PathFollowingType& pft, const std::vecto
219
218
220
219
resetNonLinearOperatorParametersToZero (nonLinOp);
221
220
const auto controlInfoWSS = crWSS.run ();
222
- checkScalars (t, std::ranges::max (d), expectedResults[0 ][0 ], message1 + " <Max Displacement>" );
223
- checkScalars (t, lambda, expectedResults[0 ][1 ], message1 + " <Lambda>" );
221
+ const double tolDisp = 1e-13 ;
222
+ const double tolLoad = 1e-12 ;
223
+ checkScalars (t, std::ranges::max (d), expectedResults[0 ][0 ], message1 + " <Max Displacement>" , tolDisp);
224
+ checkScalars (t, lambda, expectedResults[0 ][1 ], message1 + " <Lambda>" , tolLoad);
224
225
resetNonLinearOperatorParametersToZero (nonLinOp);
225
226
226
227
const auto controlInfoWoSS = crWoSS.run ();
227
- checkScalars (t, std::ranges::max (d), expectedResults[1 ][0 ], message2 + " <Max Displacement>" );
228
- checkScalars (t, lambda, expectedResults[1 ][1 ], message2 + " <Lambda>" );
228
+
229
+ checkScalars (t, std::ranges::max (d), expectedResults[1 ][0 ], message2 + " <Max Displacement>" , tolDisp);
230
+ checkScalars (t, lambda, expectedResults[1 ][1 ], message2 + " <Lambda>" , tolLoad);
229
231
resetNonLinearOperatorParametersToZero (nonLinOp);
230
232
231
233
const int controlInfoWSSIterations
@@ -246,6 +248,9 @@ auto KLShellAndAdaptiveStepSizing(const PathFollowingType& pft, const std::vecto
246
248
checkSolverInfos (t, expectedIterations[0 ], controlInfoWSS, loadSteps, message1);
247
249
checkSolverInfos (t, expectedIterations[1 ], controlInfoWoSS, loadSteps, message2);
248
250
251
+ t.check (utils::checkGradient (nonLinOpFull, {.draw = false })) << " Check gradient failed" ;
252
+ t.check (utils::checkHessian (nonLinOpFull, {.draw = false })) << " Check hessian failed" ;
253
+
249
254
return t;
250
255
}
251
256
@@ -264,7 +269,7 @@ int main(int argc, char** argv) {
264
269
const std::vector<std::vector<double >> expectedResultsALC
265
270
= {{0.1032139637288574 , 0.0003103004514250302 }, {0.162759603260405 , 0.0007765975850229621 }};
266
271
const std::vector<std::vector<double >> expectedResultsLC
267
- = {{0.08741028329554587 , 0.0002318693543601816 }, {0.144353999993308 , 6e-4 }};
272
+ = {{0.08741028329554552 , 0.0002318693543601816 }, {0.144353999993308 , 6e-4 }};
268
273
269
274
t.subTest (KLShellAndAdaptiveStepSizing (alc, expectedIterationsALC, expectedResultsALC, 3 , 0.4 ));
270
275
t.subTest (KLShellAndAdaptiveStepSizing (lc, expectedIterationsLC, expectedResultsLC, 2 , 1e-4 ));
0 commit comments