Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
981c0c6
Initial cut of viscoelastic model and test
btalamini Mar 12, 2026
a6661c3
Fix things so that model gives reasonable results in uniaxial test by…
btalamini Mar 13, 2026
4257162
Fix bugs in Newton-bisection univariate solver
btalamini Mar 13, 2026
5752877
Fix finite deformation stress pullback error and add WLF temperature-…
btalamini Mar 14, 2026
976f0b1
Test symmetry of tangents
btalamini Mar 14, 2026
c16413b
Comments
btalamini Mar 16, 2026
f48701b
Implement variational potential
btalamini Mar 17, 2026
bd81cd6
Fix compilation-blocking bug introduced when I fixed errors in solver…
btalamini Mar 17, 2026
cb378df
Add a more demanding test to see if solver fix worked
btalamini Mar 17, 2026
db2114c
Revert "Fix bugs in Newton-bisection univariate solver"
btalamini Mar 17, 2026
8885498
Add a better test of robustness for Newton-bisection solver
btalamini Mar 17, 2026
9896b47
bugfix, setting the filter subspace should not depend on whether or n…
thartland Mar 17, 2026
4dc73ab
adding test
thartland Mar 17, 2026
e76f851
contact beam test reformatting for readability
thartland Mar 18, 2026
e913f36
Merge pull request #1558 from llnl/hartland1/bugfix/contactamgfnowarm…
thartland Mar 18, 2026
f6e572f
Early out of nonlinear solvers when the residual is exactly 0.
tupek2 Mar 19, 2026
a0f8c69
Fix mac builds so there is not a wall of unfixable, uninteresting war…
tupek2 Mar 19, 2026
d213dd4
Merge pull request #1561 from llnl/tupek/solver_early_out
btalamini Mar 19, 2026
a11eebc
Update gretl.
tupek2 Mar 19, 2026
5061ea3
Get compile working after gretl update.
tupek2 Mar 19, 2026
2957d2c
simplify update() to set displacements and pressures
ebchin Mar 19, 2026
ddcd9cd
add an updateGaps() method
ebchin Mar 19, 2026
09c27ca
formatting
ebchin Mar 19, 2026
2d399c5
remove redundant updates
ebchin Mar 19, 2026
40b2699
add option to update gaps with Jacobian
ebchin Mar 19, 2026
c07e9b1
Remove old function.:
tupek2 Mar 20, 2026
cbd5f59
Merge branch 'develop' into tupek/mac_suprpess_warnings
tupek2 Mar 20, 2026
74949e9
make fields optional
ebchin Mar 20, 2026
76f614b
Merge pull request #1563 from llnl/tupek/mac_suprpess_warnings
tupek2 Mar 20, 2026
2fa377f
Merge branch 'develop' into feature/ebchin/contact-update-cleanup
tupek2 Mar 20, 2026
80e8731
Merge branch 'develop' into tupek/gretl_cpp20
white238 Mar 20, 2026
e193db9
Merge pull request #1564 from llnl/tupek/gretl_cpp20
white238 Mar 20, 2026
f72d195
Merge branch 'develop' into feature/ebchin/contact-update-cleanup
ebchin Mar 21, 2026
a23153e
scale up eps slightly so tests pass
ebchin Mar 21, 2026
45aa3d8
Merge pull request #1567 from llnl/feature/ebchin/contact-update-cleanup
ebchin Mar 23, 2026
1dc6788
bump default to C++20
white238 Mar 20, 2026
dcc92eb
remove no c++20 flag
white238 Mar 20, 2026
d1e52c4
remove implicit this capture not allowed by C++20
white238 Mar 20, 2026
9f319fb
use MESHTAG that was already there
white238 Mar 20, 2026
e028b16
be explit which fmt we are using
white238 Mar 20, 2026
c0e6ade
remove lambda so the format string will compile
white238 Mar 20, 2026
2606554
style
white238 Mar 21, 2026
7240918
move clang specific flags out of general warning flags
white238 Mar 21, 2026
8650189
fix pedantic warnings
white238 Mar 21, 2026
bfa372a
more fixing of pedantic
white238 Mar 21, 2026
6a3e56b
move pedantic back to only clang due to false positive
white238 Mar 21, 2026
898d379
add missing format parameters
white238 Mar 23, 2026
aec4145
add missing format parameters
white238 Mar 23, 2026
5a3e333
add check for C++20+
white238 Mar 23, 2026
8d50965
fix docs
white238 Mar 24, 2026
1e91e46
add wrong libstd fix until i can figure out where its coming from
white238 Mar 24, 2026
ef1c5df
force specific libstdc++ when in codevelop+hip
white238 Mar 24, 2026
b20950b
use the actual variable
white238 Mar 25, 2026
2673273
Mention MacOS Deployment Target Warning Fix In Docs
chapman39 Mar 25, 2026
3f77f85
Merge pull request #1569 from llnl/task/white238/C++20
white238 Mar 25, 2026
53ceb10
Merge branch 'develop' into task/chapman39/add-warning-fix-to-docs-mac
tupek2 Mar 25, 2026
ca080a8
Update src/docs/sphinx/build_guide/build_smith.rst
chapman39 Mar 26, 2026
b36a492
fix ownership flags
ebchin Mar 26, 2026
2c11319
Merge pull request #1574 from llnl/task/chapman39/add-warning-fix-to-…
white238 Mar 26, 2026
8e11bfa
Merge branch 'develop' into bugfix/ebchin/contact-data-leak
white238 Mar 26, 2026
887c1cb
Merge pull request #1576 from llnl/bugfix/ebchin/contact-data-leak
ebchin Mar 27, 2026
3f962fb
Initial cut of viscoelastic model and test
btalamini Mar 12, 2026
059b336
Fix things so that model gives reasonable results in uniaxial test by…
btalamini Mar 13, 2026
234c646
Fix bugs in Newton-bisection univariate solver
btalamini Mar 13, 2026
70cd68b
Fix finite deformation stress pullback error and add WLF temperature-…
btalamini Mar 14, 2026
da5a764
Test symmetry of tangents
btalamini Mar 14, 2026
2097ccc
Comments
btalamini Mar 16, 2026
b3dbeb1
Implement variational potential
btalamini Mar 17, 2026
c4405ef
Fix compilation-blocking bug introduced when I fixed errors in solver…
btalamini Mar 17, 2026
67f4f3e
Add a more demanding test to see if solver fix worked
btalamini Mar 17, 2026
dde2724
Revert "Fix bugs in Newton-bisection univariate solver"
btalamini Mar 17, 2026
bb66968
Add a better test of robustness for Newton-bisection solver
btalamini Mar 17, 2026
a818a31
Merge branch 'feature/talamini/viscoelastic_model' of github.com:LLNL…
btalamini Apr 1, 2026
d9becbc
Bring back the material uniaxial test for the old material interface …
btalamini Apr 7, 2026
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ AGENTS.md
agents.md
CLAUDE.md
claude.md
*plan.md
slirp.out
*~
*#
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ endif()

# Tune BLT to our needs
if (NOT BLT_CXX_STD)
set(BLT_CXX_STD "c++17" CACHE STRING "")
set(BLT_CXX_STD "c++20" CACHE STRING "")
elseif (BLT_CXX_STD MATCHES "^c\\+\\+([0-9]+)$" AND CMAKE_MATCH_1 VERSION_LESS 20)
message(FATAL_ERROR "Smith requires BLT_CXX_STD to be c++20 or higher.")
endif()

# These BLT tools are not used in Smith, turn them off
Expand Down
37 changes: 33 additions & 4 deletions cmake/SmithCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,36 @@ endif()
# Need to add symbols to dynamic symtab in order to be visible from stacktraces
string(APPEND CMAKE_EXE_LINKER_FLAGS " -rdynamic")

# ROCm's amdclang++ can drop its implicit C++ standard library on HIP links
# once Fortran runtime libraries are introduced. On this platform the shared
# libstdc++ linker script still points at the old system runtime, so use the
# compiler's GCC 13 static archives instead.
if(SMITH_ENABLE_CODEVELOP AND
ENABLE_HIP AND
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
CMAKE_CXX_COMPILER MATCHES "amdclang\\+\\+")
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libstdc++.a
OUTPUT_VARIABLE _smith_libstdcxx_static
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libstdc++_nonshared.a
OUTPUT_VARIABLE _smith_libstdcxx_nonshared
OUTPUT_STRIP_TRAILING_WHITESPACE)

if(EXISTS "${_smith_libstdcxx_static}" AND EXISTS "${_smith_libstdcxx_nonshared}")
string(APPEND CMAKE_CXX_STANDARD_LIBRARIES
" ${_smith_libstdcxx_static} ${_smith_libstdcxx_nonshared}")
endif()
endif()

# Apple ld warns about duplicate -l flags when the same library is reachable
# via multiple dependency paths (common with Spack-built CMake targets that use
# raw -l strings instead of imported targets). Suppress the spurious warning.
if(APPLE)
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,-no_warn_duplicate_libraries")
endif()

# Prevent unused -Xlinker arguments on Lassen Clang-10
if(DEFINED ENV{SYS_TYPE} AND "$ENV{SYS_TYPE}" STREQUAL "blueos_3_ppc64le_ib_p9")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wno-unused-command-line-argument")
Expand All @@ -23,7 +53,6 @@ endif()
set(_extra_flags "-Wshadow -Wdouble-promotion -Wconversion -Wundef -Wnull-dereference -Wold-style-cast")
blt_append_custom_compiler_flag(FLAGS_VAR CMAKE_CXX_FLAGS DEFAULT ${_extra_flags})

# Only clang has fine-grained control over the designated initializer warnings
# This can be added to the GCC flags when C++20 is available
# This should be compatible with Clang 8 through Clang 12
blt_append_custom_compiler_flag(FLAGS_VAR CMAKE_CXX_FLAGS CLANG "-Wpedantic -Wno-c++2a-extensions -Wunused-private-field")
# Clang specific warnings
# Note: pedantic is a gcc flag but throws a false positive in src/smith/numerics/petsc_solvers.cpp
blt_append_custom_compiler_flag(FLAGS_VAR CMAKE_CXX_FLAGS CLANG "-Wpedantic -Wunused-private-field")
5 changes: 5 additions & 0 deletions cmake/thirdparty/FindMFEM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ else()
set(_mfem_tpl_list ${mfem_tpl_lnk_flags})
separate_arguments(_mfem_tpl_list)
list(FILTER _mfem_tpl_list EXCLUDE REGEX Xlinker)
# On Apple, -Wl,-rpath,... entries duplicate CMake's own rpath management
# (CMAKE_INSTALL_RPATH_USE_LINK_PATH) and cause ld "duplicate -rpath" warnings
if(APPLE)
list(FILTER _mfem_tpl_list EXCLUDE REGEX "^-Wl,-rpath,")
endif()
list(JOIN _mfem_tpl_list " " mfem_tpl_lnk_flags)
else()
message(WARNING "No third party library flags found in ${MFEM_CFG_DIR}/config.mk")
Expand Down
16 changes: 16 additions & 0 deletions cmake/thirdparty/SetupSmithThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,22 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)
endif()
endforeach()
endif()

# On Apple, Spack-built cmake configs embed literal -Wl,-rpath,... entries in
# INTERFACE_LINK_LIBRARIES. These duplicate CMake's own rpath management
# (CMAKE_INSTALL_RPATH_USE_LINK_PATH) and cause ld "duplicate -rpath" warnings.
if(APPLE)
foreach(_target ${_mfem_targets})
if(TARGET ${_target})
get_target_property(_link_libs ${_target} INTERFACE_LINK_LIBRARIES)
if(_link_libs)
list(FILTER _link_libs EXCLUDE REGEX "^-Wl,-rpath,")
set_target_properties(${_target} PROPERTIES INTERFACE_LINK_LIBRARIES "${_link_libs}")
endif()
endif()
endforeach()
unset(_link_libs)
endif()
unset(_mfem_targets)

# Restore cleared Adiak/Caliper directories, reason at top of file.
Expand Down
2 changes: 1 addition & 1 deletion gretl
13 changes: 13 additions & 0 deletions src/docs/sphinx/build_guide/build_smith.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,5 +249,18 @@ We provide the following useful build targets that can be run from the build dir
* ``check``: Runs a set of code checks over source code (CppCheck and clang-format)
* ``install``: Installs Smith into the previously given ``CMAKE_INSTALL_PREFIX`` directory

MacOS Deployment Target Warning
-------------------------------

This section is for MacOS machines only.

If you get the following warning(s) when building Smith...

``ld: warning: object file (/spack_install_path/darwin-tahoe-aarch64/llvm-19.1.7/petsc-3.21.6-gg26icdjjmc5le6de6f5nviiqnhlanvj/lib/libpetsc.a[1377](slregis.o)) was built for newer 'macOS' version (26.0) than being linked (16.0)``

...run the following command to add `MACOSX_DEPLOYMENT_TARGET` to your environment (the target version may be different
for you):

.. code-block:: bash

echo "export MACOSX_DEPLOYMENT_TARGET=26.0" >> ~/.bash_profile
2 changes: 1 addition & 1 deletion src/docs/sphinx/dev_guide/modern_cpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Frequently Used Modern C++ Features
===================================

Smith currently uses C++17. Several modern C++ features and library components are used heavily throughout Smith.
Smith currently uses C++20. Several modern C++ features and library components are used heavily throughout Smith.

Smart pointers are used to avoid directly using ``operator new`` and ``operator delete`` except when absolutely necessary.
``std::unique_ptr<T>`` is used to denote **exclusive** ownership of a pointer to ``T`` - see `this article <https://www.drdobbs.com/cpp/c11-uniqueptr/240002708>`__ for more info.
Expand Down
11 changes: 2 additions & 9 deletions src/smith/differentiable_numerics/differentiable_physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,13 @@
//
// SPDX-License-Identifier: (BSD-3-Clause)

// Copyright (c) Lawrence Livermore National Security, LLC and
// other Smith Project Developers. See the top-level LICENSE file for
// details.
//
// SPDX-License-Identifier: (BSD-3-Clause)

#include "gretl/data_store.hpp"
#include "smith/differentiable_numerics/differentiable_physics.hpp"
#include "smith/physics/weak_form.hpp"
#include "smith/physics/mesh.hpp"
#include "smith/differentiable_numerics/differentiable_physics.hpp"
#include "smith/differentiable_numerics/state_advancer.hpp"
#include "smith/differentiable_numerics/reaction.hpp"
#include "gretl/data_store.hpp"
#include "gretl/upstream_state.hpp"

namespace smith {

Expand Down Expand Up @@ -248,7 +241,7 @@ void DifferentiablePhysics::reverseAdjointTimestep()
current_step = checkpointer_->currentStep_;
}

auto& upstreams = checkpointer_->upstreams_[milestone];
gretl::UpstreamStates upstreams(*checkpointer_, checkpointer_->upstreamSteps_[milestone]);

SLIC_ERROR_IF(field_states_.size() != upstreams.size(), "field states and upstream sizes do not match.");
// recreate the upstream field states with upstream step, field, and dual values.
Expand Down
38 changes: 19 additions & 19 deletions src/smith/infrastructure/about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,26 @@ namespace smith {

std::string about()
{
using namespace axom::fmt;
[[maybe_unused]] constexpr std::string_view on = "ON";
[[maybe_unused]] constexpr std::string_view off = "OFF";

std::string about = "\n";

// Version info
about += format("Smith Version: {0}\n", version());
about += axom::fmt::format("Smith Version: {0}\n", version());
about += "\n";

// General configuration
#ifdef SMITH_DEBUG
about += format("Debug Build: {0}\n", on);
about += axom::fmt::format("Debug Build: {0}\n", on);
#else
about += format("Debug Build: {0}\n", off);
about += axom::fmt::format("Debug Build: {0}\n", off);
#endif

#ifdef SMITH_USE_CUDA
about += format("CUDA: {0}\n", on);
about += axom::fmt::format("CUDA: {0}\n", on);
#else
about += format("CUDA: {0}\n", off);
about += axom::fmt::format("CUDA: {0}\n", off);
#endif

about += "\n";
Expand All @@ -91,21 +90,21 @@ std::string about()
about += "Enabled Libraries:\n";

// Axom
about += format("Axom Version: {0}\n", axom::getVersion());
about += axom::fmt::format("Axom Version: {0}\n", axom::getVersion());

// Camp
about += format("Camp Version: {0}\n", CAMP_VERSION);
about += axom::fmt::format("Camp Version: {0}\n", CAMP_VERSION);

// Caliper
#ifdef SMITH_USE_CALIPER
about += format("Caliper Version: {0}\n", CALIPER_VERSION);
about += axom::fmt::format("Caliper Version: {0}\n", CALIPER_VERSION);
#else
disabled_libs.push_back("Caliper");
#endif

// Conduit
#ifdef SMITH_USE_CONDUIT
about += format("Conduit Version: {0}\n", CONDUIT_VERSION);
about += axom::fmt::format("Conduit Version: {0}\n", CONDUIT_VERSION);
#else
disabled_libs.push_back("Conduit");
#endif
Expand All @@ -117,9 +116,9 @@ std::string about()
if (H5get_libversion(&h5_maj, &h5_min, &h5_rel) < 0) {
SLIC_ERROR("Failed to retrieve HDF5 version.");
} else {
h5_version = format("{0}.{1}.{2}", h5_maj, h5_min, h5_rel);
h5_version = axom::fmt::format("{0}.{1}.{2}", h5_maj, h5_min, h5_rel);
}
about += format("HDF5 Version: {0}\n", h5_version);
about += axom::fmt::format("HDF5 Version: {0}\n", h5_version);
#else
disabled_libs.push_back("HDF5");
#endif
Expand All @@ -130,7 +129,7 @@ std::string about()
if (axom::utilities::string::startsWith(lua_version, "Lua ")) {
lua_version.erase(0, 4);
}
about += format("Lua Version: {0}\n", lua_version);
about += axom::fmt::format("Lua Version: {0}\n", lua_version);
#else
disabled_libs.push_back("Lua");
#endif
Expand All @@ -149,28 +148,29 @@ std::string about()
mfem_full_version.erase(0, 5);
}
if (mfem_sha[0] != '\0') {
mfem_full_version += format(" (Git SHA: {0})", mfem_sha);
mfem_full_version += axom::fmt::format(" (Git SHA: {0})", mfem_sha);
}
about += format("MFEM Version: {0}\n", mfem_full_version);
about += axom::fmt::format("MFEM Version: {0}\n", mfem_full_version);

// RAJA
#ifdef SMITH_USE_RAJA
about += format("RAJA Version: {0}.{1}.{2}\n", RAJA_VERSION_MAJOR, RAJA_VERSION_MINOR, RAJA_VERSION_PATCHLEVEL);
about += axom::fmt::format("RAJA Version: {0}.{1}.{2}\n", RAJA_VERSION_MAJOR, RAJA_VERSION_MINOR,
RAJA_VERSION_PATCHLEVEL);
#else
disabled_libs.push_back("RAJA");
#endif

// Tribol
#ifdef SMITH_USE_TRIBOL
about += format("Tribol Version: {0}\n", TRIBOL_VERSION_FULL);
about += axom::fmt::format("Tribol Version: {0}\n", TRIBOL_VERSION_FULL);
#else
disabled_libs.push_back("Tribol");
#endif

// Umpire
#ifdef SMITH_USE_UMPIRE
about += format("Umpire Version: {0}.{1}.{2}\n", umpire::get_major_version(), umpire::get_minor_version(),
umpire::get_patch_version());
about += axom::fmt::format("Umpire Version: {0}.{1}.{2}\n", umpire::get_major_version(),
umpire::get_minor_version(), umpire::get_patch_version());
#else
disabled_libs.push_back("Umpire");
#endif
Expand Down
3 changes: 3 additions & 0 deletions src/smith/numerics/equation_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class NewtonSolver : public mfem::NewtonSolver {

real_t norm, norm_goal = 0;
norm = initial_norm = evaluateNorm(x, r);
if (norm == 0.0) return;

if (print_level == 1) {
mfem::out << "Newton iteration " << std::setw(3) << 0 << " : ||r|| = " << std::setw(13) << norm << "\n";
Expand Down Expand Up @@ -648,6 +649,8 @@ class TrustRegion : public mfem::NewtonSolver {

real_t norm, norm_goal = 0.0;
norm = initial_norm = computeResidual(X, r);
if (norm == 0.0) return;

norm_goal = std::max(rel_tol * initial_norm, abs_tol);

if (print_level == 1) {
Expand Down
4 changes: 2 additions & 2 deletions src/smith/numerics/functional/tests/test_newton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ TEST(ScalarEquationSolver, ReturnsImmediatelyIfLowerBoundIsARoot)

TEST(ScalarEquationSolver, ConvergesWithGuessOutsideNewtonBasin)
{
double x0 = 9.5;
double x0 = 2.0;
double lower = -10.0;
double upper = 10.0;
auto nasty_function = [](auto x) { return sin(x) + x; };
auto nasty_function = [](auto x) { return x/(1.0 + x*x); };
auto [x, status] = solve_scalar_equation(nasty_function, x0, lower, upper, default_solver_options);
double error = std::abs(x);
EXPECT_LT(error, default_solver_options.xtol);
Expand Down
21 changes: 21 additions & 0 deletions src/smith/numerics/functional/tuple_tensor_dual_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ auto solve_scalar_equation(const function& f, double x0, double lower_bound, dou
if (fl > 0) {
xl = upper_bound;
xh = lower_bound;
// no need to update fl and fh, they're not used any more
}

// move initial guess if it is not between brackets
Expand Down Expand Up @@ -1056,4 +1057,24 @@ auto sqrt_symm(tensor<T, 3, 3> A)
return symmetric_mat3_function(A, [](double x) { return std::sqrt(x); }, g);
}

/**
* @brief Logarithm of a symmetric matrix plus identity
*
* @param A Matrix to operate on. Must be SPD. This is not checked.
* @return log(A + I) \p.
*/
template <typename T>
auto logIp_symm(tensor<T, 3, 3> A)
{
auto g = [](double lam1, double lam2) {
if (lam1 == lam2) {
return 1 / (lam1 + 1.0);
} else {
double y = (1.0 + lam1) / (1.0 + lam2);
return (std::log(y) / (y - 1.0)) / (1.0 + lam2);
}
};
return symmetric_mat3_function(A, [](double x) { return std::log1p(x); }, g);
}

} // namespace smith
Loading
Loading