Skip to content
Merged
Show file tree
Hide file tree
Changes from 54 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
0d2db38
initial implementation
ebchin May 8, 2025
190edd8
bugfixes
ebchin May 8, 2025
2a7e7a1
refine allocators and memory
ebchin May 9, 2025
78fe154
turn on cpp17
ebchin May 13, 2025
3a095b1
spack package cpp17
ebchin May 13, 2025
c207411
more memory concepts, containers, and tests
ebchin May 13, 2025
498c370
2d arrays and cleanup
ebchin May 14, 2025
8d31ed8
2d arrays and managed arrays
ebchin May 15, 2025
868c730
add benchmark
ebchin May 15, 2025
88bc28c
allocator fixes, benchmarking tests, speed tests
ebchin May 19, 2025
4e5c35d
small fixes
ebchin May 19, 2025
331cb61
small changes, constexpr fixes
ebchin May 30, 2025
749347f
add geometry types
ebchin May 30, 2025
1912756
fix warnings with new data types
ebchin May 30, 2025
990f285
initialize rhs
ebchin May 30, 2025
a1f69b0
consistent define guards
ebchin May 30, 2025
139e487
fix warnings and update ctor
ebchin May 31, 2025
03e70e6
fix axom debug def
ebchin May 31, 2025
19e4a25
get rid of stack array
ebchin Jun 2, 2025
20a8d5c
reduce debug output
ebchin Jun 3, 2025
38451e6
fix axom_debug again
ebchin Jun 3, 2025
d6d92e9
Merge branch 'develop' into flex-array
ebchin Oct 20, 2025
da1bba6
fix compilation issues and warnings
ebchin Oct 21, 2025
20d733d
fix more warnings
ebchin Oct 21, 2025
5d1c39a
Merge branch 'develop' into flex-array
ebchin Oct 24, 2025
58394ac
add comments and refine naming
ebchin Oct 27, 2025
bca0c29
add comments; more clear and consistent naming
ebchin Oct 28, 2025
ba23788
few more comments
ebchin Oct 28, 2025
d1876b0
more comments
ebchin Oct 28, 2025
dfaeaaf
add more comments, clean up comment style
ebchin Oct 28, 2025
37cf352
clean up style
ebchin Oct 28, 2025
c3decc9
add comments
ebchin Oct 28, 2025
461fce8
add comments and make style consistent
ebchin Oct 28, 2025
841b6e7
add type alias
ebchin Oct 29, 2025
0910c40
fix cuda warnings
ebchin Oct 29, 2025
7820c64
add some more benchmarks
ebchin Oct 29, 2025
bce6b7d
fix macros
ebchin Oct 31, 2025
b6a27c1
add another disable
ebchin Oct 31, 2025
6be0f6c
add lots of benchmarks
ebchin Oct 31, 2025
ecd8f9c
turn on more tests
ebchin Nov 3, 2025
d903462
add some more striders
ebchin Nov 5, 2025
35f7b4a
more temp changes
ebchin Nov 6, 2025
824c4c6
Merge branch 'flex-array' of github.com:LLNL/Tribol into flex-array
ebchin Dec 1, 2025
64e24d6
add new stride implementation
ebchin Dec 6, 2025
95f2ef1
change back to axom arrays
ebchin Dec 6, 2025
49e25c1
Merge branch 'develop' into flex-array
ebchin Dec 19, 2025
b8bc5fe
restore containers and remove vector
ebchin Dec 21, 2025
e87b666
fix header list
ebchin Dec 21, 2025
d6b5387
remove vector, add host enzyme vars
ebchin Dec 21, 2025
23ea2df
formatting
ebchin Dec 21, 2025
2fbcae4
clang format
ebchin Dec 21, 2025
5b8e108
fix include guard label
ebchin Dec 21, 2025
0a484bc
refine enzyme implementation
ebchin Dec 21, 2025
78274d1
remove printfs
ebchin Dec 22, 2025
5d811a9
address review comments
ebchin Dec 23, 2025
98a430d
fix indexing
ebchin Dec 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ endif()

set(TRIBOL_DEBUG_DEFINE_STRING "${TRIBOL_DEBUG_DEFINE_STRING}" CACHE STRING "" FORCE)
# Define AXOM_DEBUG for SLIC macros
string(REPLACE "TRIBOL" "AXOM" AXOM_DEBUG_DEFINE_STRING TRIBOL_DEBUG_DEFINE_STRING)
string(REPLACE "TRIBOL" "AXOM" AXOM_DEBUG_DEFINE_STRING "${TRIBOL_DEBUG_DEFINE_STRING}")
set(AXOM_DEBUG_DEFINE_STRING "${AXOM_DEBUG_DEFINE_STRING}" CACHE STRING "" FORCE)

#------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ to build Tribol.

The Tribol contact physics library requires:
- CMake 3.14 or higher
- C++14 compiler
- C++17 compiler
- MPI
- mfem
- axom
Expand Down
2 changes: 1 addition & 1 deletion scripts/spack/packages/mfem/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Mfem(BuiltinMfem):
# Note: Make sure this sha coincides with the git submodule
# 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("4.8.0.1", commit="d9c1c34fdfaf3f7a9f56dfc82f7c083082a36fca")
version("4.9.0", commit="d9d6526cc1749980a2ba1da16e2c1ca1e07d82ec")

variant('asan', default=False, description='Add Address Sanitizer flags')

Expand Down
3 changes: 3 additions & 0 deletions scripts/spack/packages/tribol/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Tribol(CachedCMakePackage, CudaPackage, ROCmPackage):

# Other libraries
depends_on("[email protected]:+lapack")
depends_on("[email protected]:+lapack", when="+enzyme")
depends_on("[email protected]:")

depends_on("[email protected]:", when="+raja")
Expand All @@ -95,6 +96,8 @@ class Tribol(CachedCMakePackage, CudaPackage, ROCmPackage):

depends_on("mfem+metis+mpi", when="+redecomp")
depends_on("mfem+asan", when="+asan")
# Tribol uses MFEM's enzyme header
depends_on("mfem+enzyme", when="+enzyme")

with when("+profiling"):
depends_on("caliper+mpi")
Expand Down
6 changes: 3 additions & 3 deletions src/examples/examples_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
//
// SPDX-License-Identifier: (MIT)

#ifndef EXAMPLES_COMMON_HPP_
#define EXAMPLES_COMMON_HPP_
#ifndef SRC_EXAMPLES_EXAMPLES_COMMON_HPP_
#define SRC_EXAMPLES_EXAMPLES_COMMON_HPP_

// axom includes
#include "axom/core.hpp"
Expand Down Expand Up @@ -425,4 +425,4 @@ void initialize_logger( tribol::CommT problem_comm )
*/
void finalize_logger() { slic::finalize(); }

#endif /* EXAMPLES_COMMON_HPP_ */
#endif /* SRC_EXAMPLES_EXAMPLES_COMMON_HPP_ */
18 changes: 4 additions & 14 deletions src/examples/mortar_lm_patch_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
// Tribol includes
#include "tribol/interface/tribol.hpp"
#include "tribol/utils/TestUtils.hpp"
#include "tribol/utils/Math.hpp"
#include "tribol/common/Parameters.hpp"
#include "tribol/mesh/MethodCouplingData.hpp"
#include "tribol/mesh/CouplingScheme.hpp"
#include "tribol/mesh/InterfacePairs.hpp"
#include "tribol/mesh/MeshData.hpp"
#include "tribol/geom/GeomUtilities.hpp"

// Axom includes
#include "axom/slic.hpp"
Expand All @@ -25,9 +19,7 @@
#endif

// C/C++ includes
#include <cmath> // for std::sin() and std::cos()
#include <string> // for std::string and operators
#include <sstream> // for std::ostringstream
#include <string> // for std::string and operators

//----------------------------------------------------------------------------------
// Example command line arguments for running this example. This test creates two
Expand Down Expand Up @@ -196,10 +188,8 @@ int main( int argc, char** argv )
// instantiate mfem vector for RHS contributions
int rhs_size = mesh.dim * mesh.numTotalNodes + // equilibrium equations
mesh.numNonmortarSurfaceNodes; // gap equations
RealT b[rhs_size];
tribol::initRealArray( &b[0], rhs_size, 0. );
mfem::Vector rhs( &b[0], rhs_size );
rhs = 0.; // initialize
mfem::Vector rhs( rhs_size );
rhs = 0.0; // initialize

SLIC_INFO( "Finalized initial oversized sparse matrix and created rhs vector." );

Expand Down Expand Up @@ -230,7 +220,7 @@ int main( int argc, char** argv )
/////////////////////////////////////////
// populate RHS with gap contributions //
/////////////////////////////////////////
mesh.getGapEvals( &b[0] );
mesh.getGapEvals( rhs.GetData() );

SLIC_INFO( "Populated RHS gap contributions." );

Expand Down
6 changes: 3 additions & 3 deletions src/redecomp/transfer/GridFnTransfer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
//
// SPDX-License-Identifier: (MIT)

#ifndef SRC_REDECOMP_GRIDFNTRANSFER_HPP_
#define SRC_REDECOMP_GRIDFNTRANSFER_HPP_
#ifndef SRC_REDECOMP_TRANSFER_GRIDFNTRANSFER_HPP_
#define SRC_REDECOMP_TRANSFER_GRIDFNTRANSFER_HPP_

#include "mfem.hpp"

Expand Down Expand Up @@ -43,4 +43,4 @@ class GridFnTransfer {

} // end namespace redecomp

#endif /* SRC_REDECOMP_GRIDFNTRANSFER_HPP_ */
#endif /* SRC_REDECOMP_TRANSFER_GRIDFNTRANSFER_HPP_ */
6 changes: 3 additions & 3 deletions src/redecomp/transfer/MatrixTransfer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
//
// SPDX-License-Identifier: (MIT)

#ifndef SRC_REDECOMP_MATRIXTRANSFER_HPP_
#define SRC_REDECOMP_MATRIXTRANSFER_HPP_
#ifndef SRC_REDECOMP_TRANSFER_MATRIXTRANSFER_HPP_
#define SRC_REDECOMP_TRANSFER_MATRIXTRANSFER_HPP_

#include "mfem.hpp"

Expand Down Expand Up @@ -202,4 +202,4 @@ class MatrixTransfer {

} // end namespace redecomp

#endif /* SRC_REDECOMP_MATRIXTRANSFER_HPP_ */
#endif /* SRC_REDECOMP_TRANSFER_MATRIXTRANSFER_HPP_ */
6 changes: 3 additions & 3 deletions src/redecomp/transfer/SparseMatrixTransfer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
//
// SPDX-License-Identifier: (MIT)

#ifndef SRC_REDECOMP_SPARSEMATRIXTRANSFER_HPP_
#define SRC_REDECOMP_SPARSEMATRIXTRANSFER_HPP_
#ifndef SRC_REDECOMP_TRANSFER_SPARSEMATRIXTRANSFER_HPP_
#define SRC_REDECOMP_TRANSFER_SPARSEMATRIXTRANSFER_HPP_

#include <memory>

Expand Down Expand Up @@ -113,4 +113,4 @@ class SparseMatrixTransfer {

} // end namespace redecomp

#endif /* SRC_REDECOMP_SPARSEMATRIXTRANSFER_HPP_ */
#endif /* SRC_REDECOMP_TRANSFER_SPARSEMATRIXTRANSFER_HPP_ */
6 changes: 3 additions & 3 deletions src/redecomp/transfer/TransferByElements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
//
// SPDX-License-Identifier: (MIT)

#ifndef SRC_REDECOMP_TRANSFERBYELEMENTS_HPP_
#define SRC_REDECOMP_TRANSFERBYELEMENTS_HPP_
#ifndef SRC_REDECOMP_TRANSFER_TRANSFERBYELEMENTS_HPP_
#define SRC_REDECOMP_TRANSFER_TRANSFERBYELEMENTS_HPP_

#include "redecomp/transfer/GridFnTransfer.hpp"

Expand Down Expand Up @@ -47,4 +47,4 @@ class TransferByElements : public GridFnTransfer {

} // end namespace redecomp

#endif /* SRC_REDECOMP_TRANSFERBYELEMENTS_HPP_ */
#endif /* SRC_REDECOMP_TRANSFER_TRANSFERBYELEMENTS_HPP_ */
6 changes: 3 additions & 3 deletions src/redecomp/transfer/TransferByNodes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
//
// SPDX-License-Identifier: (MIT)

#ifndef SRC_REDECOMP_TRANSFERBYNODES_HPP_
#define SRC_REDECOMP_TRANSFERBYNODES_HPP_
#ifndef SRC_REDECOMP_TRANSFER_TRANSFERBYNODES_HPP_
#define SRC_REDECOMP_TRANSFER_TRANSFERBYNODES_HPP_

#include "mfem.hpp"

Expand Down Expand Up @@ -120,4 +120,4 @@ class TransferByNodes : public GridFnTransfer {

} // end namespace redecomp

#endif /* SRC_REDECOMP_TRANSFERBYNODES_HPP_ */
#endif /* SRC_REDECOMP_TRANSFER_TRANSFERBYNODES_HPP_ */
2 changes: 1 addition & 1 deletion src/redecomp/utils/BisecTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,4 +331,4 @@ class BisecTree {

} // end namespace redecomp

#endif /* SRC_REDECOMP_BISECTREE_HPP_ */
#endif /* SRC_REDECOMP_UTILS_BISECTREE_HPP_ */
6 changes: 3 additions & 3 deletions src/shared/mesh/MeshBuilder.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef SRC_SHARED_MESHBUILDER_HPP_
#define SRC_SHARED_MESHBUILDER_HPP_
#ifndef SRC_SHARED_MESH_MESHBUILDER_HPP_
#define SRC_SHARED_MESH_MESHBUILDER_HPP_

#include <initializer_list>

Expand Down Expand Up @@ -220,4 +220,4 @@ class ParMeshBuilder {

} // namespace shared

#endif // SRC_SHARED_MESHBUILDER_HPP_
#endif // SRC_SHARED_MESH_MESHBUILDER_HPP_
2 changes: 2 additions & 0 deletions src/tests/tribol_common_plane_gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
//
// SPDX-License-Identifier: (MIT)

#include "tribol/config.hpp"

#include "gtest/gtest.h"

#include "mfem.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/tribol_comp_geom_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class CompGeomTest : public ::testing::Test {
{
// if element thickness is not registered by test, then register dummy
// element thickness in order to use auto contact
RealT element_thickness[numCells];
tribol::Array1D<tribol::RealT> element_thickness( numCells );
if ( !m_isElementThicknessRegistered ) {
for ( int i = 0; i < numCells; ++i ) {
element_thickness[i] = 1.0;
Expand Down
38 changes: 12 additions & 26 deletions src/tests/tribol_coupling_scheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,16 @@
#include "tribol/utils/TestUtils.hpp"
#include "tribol/utils/Math.hpp"
#include "tribol/common/Parameters.hpp"
#include "tribol/mesh/MethodCouplingData.hpp"
#include "tribol/mesh/CouplingScheme.hpp"
#include "tribol/mesh/InterfacePairs.hpp"
#include "tribol/mesh/MeshData.hpp"
#include "tribol/geom/GeomUtilities.hpp"

#ifdef TRIBOL_USE_UMPIRE
// Umpire includes
#include "umpire/ResourceManager.hpp"
#endif

// Axom includes
#include "axom/slic.hpp"

// gtest includes
#include "gtest/gtest.h"

// c++ includes
#include <cmath> // std::abs, std::cos, std::sin
#include <iostream>
#include <sstream>
#include <iomanip>
#include <fstream>

using RealT = tribol::RealT;

/*!
Expand Down Expand Up @@ -211,8 +197,8 @@ TEST_F( CouplingSchemeTest, single_mortar_2D )

// register dummy nodal fields so error doesn't return from field
// registration
RealT gaps[this->m_lengthNodalData];
RealT pressures[this->m_lengthNodalData];
tribol::Array1D<RealT> gaps( this->m_lengthNodalData );
tribol::Array1D<RealT> pressures( this->m_lengthNodalData );

tribol::registerMortarGaps( 1, &gaps[0] );
tribol::registerMortarPressures( 1, &pressures[0] );
Expand Down Expand Up @@ -240,8 +226,8 @@ TEST_F( CouplingSchemeTest, aligned_mortar_2D )

// register dummy nodal fields so error doesn't return from field
// registration
RealT gaps[this->m_lengthNodalData];
RealT pressures[this->m_lengthNodalData];
tribol::Array1D<RealT> gaps( this->m_lengthNodalData );
tribol::Array1D<RealT> pressures( this->m_lengthNodalData );

tribol::registerMortarGaps( 1, &gaps[0] );
tribol::registerMortarPressures( 1, &pressures[0] );
Expand Down Expand Up @@ -290,8 +276,8 @@ TEST_F( CouplingSchemeTest, single_mortar_3D_penalty )

// register dummy nodal fields so error doesn't return from field
// registration
RealT gaps[this->m_lengthNodalData];
RealT pressures[this->m_lengthNodalData];
tribol::Array1D<RealT> gaps( this->m_lengthNodalData );
tribol::Array1D<RealT> pressures( this->m_lengthNodalData );

tribol::registerMortarGaps( 1, &gaps[0] );
tribol::registerMortarPressures( 1, &pressures[0] );
Expand Down Expand Up @@ -358,8 +344,8 @@ TEST_F( CouplingSchemeTest, mortar_tied )

// register dummy nodal fields so error doesn't return from field
// registration
RealT gaps[this->m_lengthNodalData];
RealT pressures[this->m_lengthNodalData];
tribol::Array1D<RealT> gaps( this->m_lengthNodalData );
tribol::Array1D<RealT> pressures( this->m_lengthNodalData );

tribol::registerMortarGaps( 1, &gaps[0] );
tribol::registerMortarPressures( 1, &pressures[0] );
Expand Down Expand Up @@ -387,8 +373,8 @@ TEST_F( CouplingSchemeTest, mortar_coulomb )

// register dummy nodal fields so error doesn't return from field
// registration
RealT gaps[this->m_lengthNodalData];
RealT pressures[this->m_lengthNodalData];
tribol::Array1D<RealT> gaps( this->m_lengthNodalData );
tribol::Array1D<RealT> pressures( this->m_lengthNodalData );

tribol::registerMortarGaps( 1, &gaps[0] );
tribol::registerMortarPressures( 1, &pressures[0] );
Expand Down Expand Up @@ -818,8 +804,8 @@ TEST_F( CouplingSchemeTest, single_mortar_null_response_pointers )
registerDummy3DMesh( 0, numCells, setResponse );
registerDummy3DMesh( 1, numCells, setResponse );

RealT gaps[this->m_lengthNodalData];
RealT pressures[this->m_lengthNodalData];
tribol::Array1D<RealT> gaps( this->m_lengthNodalData );
tribol::Array1D<RealT> pressures( this->m_lengthNodalData );

tribol::registerMortarGaps( 1, &gaps[0] );
tribol::registerMortarPressures( 1, &pressures[0] );
Expand Down
2 changes: 1 addition & 1 deletion src/tests/tribol_enzyme_nodal_normal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class EnzymeNodalNormalTest : public testing::Test {

mfem::DenseMatrix dndx_fd( num_dofs );
auto mesh_view = mesh.getView();
Array2D<RealT> n_base = mesh_view.getNodalNormals();
axom::Array<RealT, 2> n_base = mesh_view.getNodalNormals();
for ( int dx{ 0 }; dx < mesh.spatialDimension(); ++dx ) {
for ( int nx{ 0 }; nx < mesh.numberOfNodes(); ++nx ) {
auto x_idx = dx * mesh.numberOfNodes() + nx;
Expand Down
Loading