From 5a94a74b2678e939e0ff4757f0f1b5d11b5865e8 Mon Sep 17 00:00:00 2001 From: "Eric B. Chin" Date: Fri, 1 Aug 2025 16:16:55 -0700 Subject: [PATCH 1/4] update tribol and modify patch to work with tets --- src/serac/physics/tests/contact_patch.cpp | 44 ++++++++++++++++++----- tribol | 2 +- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/serac/physics/tests/contact_patch.cpp b/src/serac/physics/tests/contact_patch.cpp index c2534b3e7..3591f643e 100644 --- a/src/serac/physics/tests/contact_patch.cpp +++ b/src/serac/physics/tests/contact_patch.cpp @@ -13,6 +13,7 @@ #include "axom/slic/core/SimpleLogger.hpp" #include #include "mfem.hpp" +#include "shared/mesh/MeshBuilder.hpp" #include "serac/mesh_utils/mesh_utils.hpp" #include "serac/physics/boundary_conditions/components.hpp" @@ -24,7 +25,9 @@ namespace serac { -class ContactTest : public testing::TestWithParam> {}; +class ContactTest + : public testing::TestWithParam> { +}; TEST_P(ContactTest, patch) { @@ -39,10 +42,23 @@ TEST_P(ContactTest, patch) axom::sidre::DataStore datastore; StateManager::initialize(datastore, name + "_data"); - // Construct the appropriate dimension mesh and give it to the data store - std::string filename = SERAC_REPO_DIR "/data/meshes/twohex_for_contact.mesh"; - - auto mesh = std::make_shared(buildMeshFromFile(filename), "patch_mesh", 2, 0); + // clang-format off + auto mesh = std::make_shared(shared::MeshBuilder::Unify({ + shared::MeshBuilder::CubeMesh(1, 1, 1, std::get<3>(GetParam())) + .updateBdrAttrib(3, 7) + .updateBdrAttrib(1, 3) + .updateBdrAttrib(4, 7) + .updateBdrAttrib(5, 1) + .updateBdrAttrib(6, 4), + shared::MeshBuilder::CubeMesh(1, 1, 1, std::get<3>(GetParam())) + .translate({0.0, 0.0, 1.0}) + .updateBdrAttrib(1, 8) + .updateBdrAttrib(3, 7) + .updateBdrAttrib(4, 7) + .updateBdrAttrib(5, 1) + .updateBdrAttrib(8, 5) + }), "patch_mesh", 2, 0); + // clang-format on mesh->addDomainOfBoundaryElements("x0_faces", serac::by_attr(1)); mesh->addDomainOfBoundaryElements("y0_faces", serac::by_attr(2)); @@ -130,12 +146,22 @@ TEST_P(ContactTest, patch) INSTANTIATE_TEST_SUITE_P( tribol, ContactTest, - testing::Values(std::make_tuple(ContactEnforcement::Penalty, ContactJacobian::Approximate, "penalty_approxJ"), + testing::Values(std::make_tuple(ContactEnforcement::Penalty, ContactJacobian::Approximate, "penalty_approxJ_hex", + mfem::Element::HEXAHEDRON), + std::make_tuple(ContactEnforcement::LagrangeMultiplier, ContactJacobian::Approximate, + "lagrange_multiplier_approxJ_hex", mfem::Element::HEXAHEDRON), + std::make_tuple(ContactEnforcement::Penalty, ContactJacobian::Exact, "penalty_exactJ_hex", + mfem::Element::HEXAHEDRON), + std::make_tuple(ContactEnforcement::LagrangeMultiplier, ContactJacobian::Exact, + "lagrange_multiplier_exactJ_hex", mfem::Element::HEXAHEDRON), + std::make_tuple(ContactEnforcement::Penalty, ContactJacobian::Approximate, "penalty_approxJ_tet", + mfem::Element::TETRAHEDRON), std::make_tuple(ContactEnforcement::LagrangeMultiplier, ContactJacobian::Approximate, - "lagrange_multiplier_approxJ"), - std::make_tuple(ContactEnforcement::Penalty, ContactJacobian::Exact, "penalty_exactJ"), + "lagrange_multiplier_approxJ_tet", mfem::Element::TETRAHEDRON), + std::make_tuple(ContactEnforcement::Penalty, ContactJacobian::Exact, "penalty_exactJ_tet", + mfem::Element::TETRAHEDRON), std::make_tuple(ContactEnforcement::LagrangeMultiplier, ContactJacobian::Exact, - "lagrange_multiplier_exactJ"))); + "lagrange_multiplier_exactJ_tet", mfem::Element::TETRAHEDRON))); } // namespace serac diff --git a/tribol b/tribol index 8351aa4e1..c356592e2 160000 --- a/tribol +++ b/tribol @@ -1 +1 @@ -Subproject commit 8351aa4e104fce00ee25c760a5c3f3c882557d50 +Subproject commit c356592e20d4f517589bf4c20582348d39521a16 From b95b22456f4f103850e9a587af197371dc4442d4 Mon Sep 17 00:00:00 2001 From: "Eric B. Chin" Date: Mon, 25 Aug 2025 10:42:59 -0700 Subject: [PATCH 2/4] update tribol to latest develop --- tribol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tribol b/tribol index c356592e2..f67283f81 160000 --- a/tribol +++ b/tribol @@ -1 +1 @@ -Subproject commit c356592e20d4f517589bf4c20582348d39521a16 +Subproject commit f67283f81b05d3610cc8a811174f5dd3bb6e367f From 63b436c0ff7f17c23fc224b8d0e5aed677a62355 Mon Sep 17 00:00:00 2001 From: "Eric B. Chin" Date: Mon, 25 Aug 2025 10:52:30 -0700 Subject: [PATCH 3/4] update spack tribol hash --- scripts/spack/packages/tribol/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/spack/packages/tribol/package.py b/scripts/spack/packages/tribol/package.py index ca1bfd11d..0a37de2e0 100644 --- a/scripts/spack/packages/tribol/package.py +++ b/scripts/spack/packages/tribol/package.py @@ -44,7 +44,7 @@ class Tribol(CachedCMakePackage, CudaPackage, ROCmPackage): # SERAC EDIT START # Note: We add a number to the end of the real version number to indicate that we have # moved forward past the release. Increment the last number when updating the commit sha. - version("0.1.0.18", commit="8351aa4e104fce00ee25c760a5c3f3c882557d50", submodules=True, preferred=True) + version("0.1.0.19", commit="f67283f81b05d3610cc8a811174f5dd3bb6e367f", submodules=True, preferred=True) # SERAC EDIT END # ----------------------------------------------------------------------- From 123e882388fffd8d5a43f198b4fe6e2e5a513dbe Mon Sep 17 00:00:00 2001 From: "Eric B. Chin" Date: Mon, 25 Aug 2025 13:47:17 -0700 Subject: [PATCH 4/4] update tribol version --- scripts/spack/configs/versions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/spack/configs/versions.yaml b/scripts/spack/configs/versions.yaml index 2f4dd7ccf..15aaafc40 100644 --- a/scripts/spack/configs/versions.yaml +++ b/scripts/spack/configs/versions.yaml @@ -35,7 +35,7 @@ packages: - spec: "@6.7.0" tribol: require: - - spec: "@0.1.0.18" + - spec: "@0.1.0.19" umpire: require: - spec: "@2024.07.0"