Skip to content

Commit f58fe19

Browse files
Replacing 1e-6 tolerance for f.s check with std::numeric_limits<double>::epsilon()
1 parent eb511b7 commit f58fe19

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/unitTests/material_model_tests/test_material_holzapfel_ogden.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030

3131
#include "test_material_holzapfel_ogden.h"
32+
#include <limits>
3233

3334

3435

@@ -91,7 +92,7 @@ class HolzapfelOgdenTest : public :: MaterialTestFixture {
9192

9293
// Check f.s = 0
9394
double dot_fs = params.f.dot(params.s);
94-
if (fabs(dot_fs) > 1e-6) {
95+
if (fabs(dot_fs) > std::numeric_limits<double>::epsilon()) {
9596
std::cout << "f.s = " << dot_fs << std::endl;
9697
std::cout << "f = [" << params.f[0] << ", " << params.f[1] << ", " << params.f[2] << "]" << std::endl;
9798
std::cout << "s = [" << params.s[0] << ", " << params.s[1] << ", " << params.s[2] << "]" << std::endl;

tests/unitTests/material_model_tests/test_material_holzapfel_ogden_MA.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
*/
3030

3131
#include "test_material_holzapfel_ogden_MA.h"
32+
#include <limits>
3233

3334
// ----------------------------------------------------------------------------
3435
// ------------- Holzapfel-Ogden (Modified Anisotropy) Material --------------
@@ -87,7 +88,7 @@ class HolzapfelOgdenMATest : public MaterialTestFixture {
8788

8889
// Check f.s = 0
8990
double dot_fs = params.f.dot(params.s);
90-
if (fabs(dot_fs) > 1e-6) {
91+
if (fabs(dot_fs) > std::numeric_limits<double>::epsilon()) {
9192
std::cout << "f.s = " << dot_fs << std::endl;
9293
std::cout << "f = [" << params.f[0] << ", " << params.f[1] << ", " << params.f[2] << "]" << std::endl;
9394
std::cout << "s = [" << params.s[0] << ", " << params.s[1] << ", " << params.s[2] << "]" << std::endl;

0 commit comments

Comments
 (0)