Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 6692030
Author: Alasdair Gray <alachris@umich.edu>
Date:   Thu Jun 1 17:25:13 2023 -0400

    Update beam constitutive model test tolerances

commit 05b6065
Author: Alasdair Gray <alachris@umich.edu>
Date:   Thu Jun 1 17:14:50 2023 -0400

    Turn off printing for composite shell test

commit 782eca6
Author: Alasdair Gray <alachris@umich.edu>
Date:   Thu Jun 1 16:49:44 2023 -0400

    Make `TacsAssertAllClose` more readable

commit a558e6e
Author: Alasdair Gray <alachris@umich.edu>
Date:   Thu Jun 1 16:49:25 2023 -0400

    Tighten tolerances even more

commit a769c19
Author: Alasdair Gray <alachris@umich.edu>
Date:   Thu Jun 1 16:49:07 2023 -0400

    Fix incorrect ordering of tolerances in composite shell test

commit eedd376
Author: Alasdair Gray <alachris@umich.edu>
Date:   Thu Jun 1 15:55:49 2023 -0400

    `black .`

commit 95c48b6
Author: Alasdair Gray <alachris@umich.edu>
Date:   Thu Jun 1 15:53:42 2023 -0400

    Tighten tolerances more

commit c8db3e5
Author: Alasdair Gray <alachris@umich.edu>
Date:   Thu Jun 1 15:19:02 2023 -0400

    Remove comments about not using `atol`

commit 5ec5c50
Author: Alasdair Gray <alachris@umich.edu>
Date:   Thu Jun 1 14:30:37 2023 -0400

    Tighten tolerances for constitutive tests

commit a83d610
Author: Alasdair Gray <alachris@umich.edu>
Date:   Wed May 31 21:40:17 2023 -0400

    Switch to `TacsAssertAllClose` for all constitutive tests

commit eaf712c
Author: Alasdair Gray <alachris@umich.edu>
Date:   Wed May 31 21:34:18 2023 -0400

    Add abs error printout to `TacsPrintErrorComponents`

commit 90b1a72
Author: Alasdair Gray <alachris@umich.edu>
Date:   Wed May 31 21:34:01 2023 -0400

    Fix `TacsAssertAllClose`

commit e6f3650
Author: Alasdair Gray <alachris@umich.edu>
Date:   Wed May 31 21:33:36 2023 -0400

    Switch to `TacsAssertAllClose` for failure criteria sens tests

commit 44b10ae
Author: Alasdair Gray <alachris@umich.edu>
Date:   Wed May 31 20:00:05 2023 -0400

    Add implementation of `assert_allclose`

commit 7da4b86
Merge: cc3d9f3 12ef9e0
Author: Alasdair Gray <alachris@umich.edu>
Date:   Thu Jun 1 15:04:59 2023 -0400

    Merge branch 'master' of https://github.com/smdogroup/tacs

commit 12ef9e0
Author: Tim Brooks <41971846+timryanb@users.noreply.github.com>
Date:   Tue May 30 13:57:48 2023 -0400

    Fixing issue with mpi4py build requirement on Python 3.11 (smdogroup#215)
  • Loading branch information
A-CGray committed Jun 1, 2023
1 parent 4294b25 commit bdd0e62
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 56 deletions.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#pyproject.toml
[build-system]
# Minimum requirements for the build system to execute.
requires = ['setuptools>=45.0', 'wheel', 'cython>=0.29', 'oldest-supported-numpy', 'mpi4py==3.1.1']
requires = ['setuptools>=45.0', 'wheel', 'cython>=0.29', 'oldest-supported-numpy',
# Build against an old version (3.1.1) of mpi4py for forward compatibility
"mpi4py==3.1.1; python_version<'3.11'",
# Python 3.11 requires 3.1.4+
"mpi4py==3.1.4; python_version>='3.11'"]
5 changes: 3 additions & 2 deletions src/elements/TACSElementVerification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ bool TacsAssertAllClose(TacsScalar *testVals, TacsScalar *refVals, int size,
double atol, double rtol) {
bool all_close = true;
for (int i = 0; i < size; i++) {
if (fabs(TacsRealPart(testVals[i] - refVals[i])) >
atol + rtol * fabs(TacsRealPart(refVals[i]))) {
double absError = fabs(TacsRealPart(testVals[i] - refVals[i]));
double combinedTol = atol + rtol * fabs(TacsRealPart(refVals[i]));
if (absError > combinedTol) {
all_close = false;
break;
}
Expand Down
7 changes: 3 additions & 4 deletions tests/constitutive_tests/test_basic_beam_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.dh = 1e-200
self.rtol = 1e-11
else:
self.dh = 1e-8
self.rtol = 1e-3
self.rtol = 1e-6
self.dtype = TACS.dtype

# Basically, only check relative tolerance
self.atol = self.rtol
self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)
self.print_level = 0

# Set element index
Expand Down
11 changes: 5 additions & 6 deletions tests/constitutive_tests/test_composite_shell_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.rtol = 1e-9
self.dh = 1e-200
self.rtol = 1e-12
else:
self.dh = 1e-8
self.rtol = 1e-3
self.rtol = 1e-6
self.dtype = TACS.dtype

# Basically, only check relative tolerance
self.atol = self.rtol
self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)
self.print_level = 0

# Set element index
Expand Down Expand Up @@ -229,8 +228,8 @@ def test_constitutive_failure_strain_sens(self):
self.x,
self.dh,
self.print_level,
self.rtol,
self.atol,
self.rtol,
)
self.assertFalse(fail)

Expand Down
7 changes: 3 additions & 4 deletions tests/constitutive_tests/test_dof_spring_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.dh = 1e-200
self.rtol = 1e-11
else:
self.dh = 1e-8
self.rtol = 1e-3
self.rtol = 1e-6
self.dtype = TACS.dtype

# Basically, only check relative tolerance
self.atol = self.rtol
self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)
self.print_level = 0

# Set element index
Expand Down
7 changes: 3 additions & 4 deletions tests/constitutive_tests/test_general_mass_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.dh = 1e-200
self.rtol = 1e-11
else:
self.dh = 1e-8
self.rtol = 1e-3
self.rtol = 1e-6
self.dtype = TACS.dtype

# Basically, only check relative tolerance
self.atol = self.rtol
self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)
self.print_level = 0

# Set element index
Expand Down
7 changes: 3 additions & 4 deletions tests/constitutive_tests/test_general_spring_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.dh = 1e-200
self.rtol = 1e-11
else:
self.dh = 1e-8
self.rtol = 1e-3
self.rtol = 1e-6
self.dtype = TACS.dtype

# Basically, only check relative tolerance
self.atol = self.rtol
self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)
self.print_level = 0

# Set element index
Expand Down
11 changes: 5 additions & 6 deletions tests/constitutive_tests/test_iso_rectangle_beam_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.rtol = 1e-11
self.atol = 1e-5
self.dh = 1e-200
self.rtol = 1e-12
else:
self.dh = 1e-8
self.rtol = 1e-3
self.atol = 1e-1

self.rtol = 1e-6
self.dtype = TACS.dtype

self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)

self.print_level = 0

# Set element index
Expand Down
7 changes: 3 additions & 4 deletions tests/constitutive_tests/test_iso_shell_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.dh = 1e-200
self.rtol = 1e-11
else:
self.dh = 1e-8
self.rtol = 1e-3
self.rtol = 1e-6
self.dtype = TACS.dtype

# Basically, only check relative tolerance
self.atol = self.rtol
self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)
self.print_level = 0

# Set element index
Expand Down
10 changes: 5 additions & 5 deletions tests/constitutive_tests/test_iso_tube_beam_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.rtol = 1e-11
self.atol = 1e-5
self.dh = 1e-200
self.rtol = 1e-12
else:
self.dh = 1e-8
self.rtol = 1e-3
self.atol = 1e-1
self.rtol = 1e-6
self.dtype = TACS.dtype

self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)

self.print_level = 0

# Set element index
Expand Down
7 changes: 3 additions & 4 deletions tests/constitutive_tests/test_pcm_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.dh = 1e-200
self.rtol = 1e-11
else:
self.dh = 1e-8
self.rtol = 1e-3
self.rtol = 1e-6
self.dtype = TACS.dtype

# Basically, only check relative tolerance
self.atol = self.rtol
self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)
self.print_level = 0

# Set element index
Expand Down
7 changes: 3 additions & 4 deletions tests/constitutive_tests/test_plane_stress_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.dh = 1e-200
self.rtol = 1e-11
else:
self.dh = 1e-8
self.rtol = 1e-3
self.rtol = 1e-6
self.dtype = TACS.dtype

# Basically, only check relative tolerance
self.atol = self.rtol
self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)
self.print_level = 0

# Set element index
Expand Down
7 changes: 3 additions & 4 deletions tests/constitutive_tests/test_point_mass_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.dh = 1e-200
self.rtol = 1e-11
else:
self.dh = 1e-8
self.rtol = 1e-3
self.rtol = 1e-6
self.dtype = TACS.dtype

# Basically, only check relative tolerance
self.atol = self.rtol
self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)
self.print_level = 0

# Set element index
Expand Down
7 changes: 3 additions & 4 deletions tests/constitutive_tests/test_solid_constitutive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ class ConstitutiveTest(unittest.TestCase):
def setUp(self):
# fd/cs step size
if TACS.dtype is complex:
self.dh = 1e-50
self.dh = 1e-200
self.rtol = 1e-11
else:
self.dh = 1e-8
self.rtol = 1e-3
self.rtol = 1e-6
self.dtype = TACS.dtype

# Basically, only check relative tolerance
self.atol = self.rtol
self.atol = np.clip(1e-5 * self.rtol, 1e-8, 1e-14)
self.print_level = 0

# Set element index
Expand Down

0 comments on commit bdd0e62

Please sign in to comment.