diff --git a/tests/src/checkfebyautodiff.hh b/tests/src/checkfebyautodiff.hh index 3782cddf6..01bd44466 100644 --- a/tests/src/checkfebyautodiff.hh +++ b/tests/src/checkfebyautodiff.hh @@ -16,7 +16,7 @@ template auto checkFESByAutoDiffImpl(const GridView& gridView, const BasisHandler& basis, Skills&& skills, - AffordanceColl affordance, VectorType& d, const std::string& messageIfFailed = "", + AffordanceColl affordance, VectorType& d, const std::string& testName = "", double tol = 1e-10) { double lambda = 7.3; auto fe = Ikarus::makeFE(basis, std::forward(skills)); diff --git a/tests/src/testnonlineareas.cpp b/tests/src/testnonlineareas.cpp index ef89fa6e2..3956552a3 100644 --- a/tests/src/testnonlineareas.cpp +++ b/tests/src/testnonlineareas.cpp @@ -41,6 +41,7 @@ using Dune::TestSuite; template auto cantileverBeamTest(const MAT& reducedMat) { + static_assert(MAT::isReduced, "cantileverBeamTest is only valid for a reduced material (planeStress or planeStrain)"); TestSuite t("Cantilever Beam for Nonlinear EAS element (Q1E4)"); constexpr int gridDim = 2; using Grid = Dune::YaspGrid; @@ -117,7 +118,9 @@ auto cantileverBeamTest(const MAT& reducedMat) { const auto controlInfo = lc.run(); double expectedLambda = 1.0; - double expectedMaxDisp = 4.459851990227056; // abs(maxDisp) in ANSYS APDL = 4.48777 + double expectedMaxDisp = std::is_same_v> + ? 4.492526443429457 + : 4.459851990227056; // abs(maxDisp) in ANSYS APDL = 4.48777 (SVK) and = 4.50145 (NH) t.check(controlInfo.success); const auto maxDisp = std::ranges::max(d.cwiseAbs()); @@ -153,9 +156,17 @@ int main(int argc, char** argv) { Dune::TestSuite t("Nonlinear EAS Test"); auto matParameter = toLamesFirstParameterAndShearModulus({.emodul = 100.0, .nu = 0.3}); StVenantKirchhoff matSVK(matParameter); - auto reducedMat = planeStrain(matSVK); - easAutoDiffTest<2>(t, reducedMat); + NeoHooke matNH(matParameter); + auto reducedMatSVK = planeStrain(matSVK); + auto reducedMatNH = planeStrain(matNH); + + easAutoDiffTest<2>(t, reducedMatSVK); easAutoDiffTest<3>(t, matSVK); - t.subTest(cantileverBeamTest(reducedMat)); + + easAutoDiffTest<2>(t, reducedMatNH); + easAutoDiffTest<3>(t, matNH); + + t.subTest(cantileverBeamTest(reducedMatSVK)); + t.subTest(cantileverBeamTest(reducedMatNH)); return t.exit(); } \ No newline at end of file