Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
4ccb49e
Initial gretl in serac. Need to work on some tests, maybe documentin…
tupek2 Mar 14, 2025
77b56ab
Revert back to original gretl.
tupek2 Mar 15, 2025
f7e758b
--amend
tupek2 Mar 15, 2025
c19b7ba
Trying to get original checkpoint tests passing again.
tupek2 Mar 15, 2025
4ec0b48
Operation gretl again.
tupek2 Mar 18, 2025
b72a057
Make it a bit less likely toa accidentally no specify a valid zero_du…
tupek2 Mar 18, 2025
ae86ce3
Additional cleanup of compilation warnings.
tupek2 Mar 18, 2025
0746ec4
Add in a highly nonlinear and more complicated graph.
tupek2 Mar 18, 2025
1ce7e8d
Add in a highly nonlinear and more complicated graph.
tupek2 Mar 18, 2025
2490a51
Get test tolerance in place.
tupek2 Mar 18, 2025
471dfa5
Fix style.
tupek2 Mar 18, 2025
a928494
Try to fix some gcc build issues.
tupek2 Mar 18, 2025
449b438
Fix another gcc issue.
tupek2 Mar 19, 2025
bb271cf
add all headers to cmake lists.
tupek2 Mar 19, 2025
dbe1feb
Another header missing.
tupek2 Mar 19, 2025
f5898c5
Another gcc build fix.
tupek2 Mar 19, 2025
be0ea51
Try again to fix gcc13 warnings.
tupek2 Mar 19, 2025
96fcff9
Trying to address gcc issues.
tupek2 Mar 20, 2025
37c76a7
Try to fix gcc warnings.
tupek2 Mar 20, 2025
61fd848
Try again to resolve gcc warning.
tupek2 Mar 20, 2025
44107f6
Debugging gretl.
tupek2 Jun 6, 2025
c90d23f
Trying to simplify gretl.
tupek2 Jun 6, 2025
0469141
Simplifying gretl implementation, no checkpointing yet.
tupek2 Jun 6, 2025
ba58d95
Seemingly got gretl, no checkpoint working again.
tupek2 Jun 8, 2025
02c56fd
Cleanup the initial, not dynamically checkpointed gretl.
tupek2 Jun 8, 2025
37c7340
Remove some prints, only clear shared pointer if no one else has a ha…
tupek2 Jun 8, 2025
ddee2ce
style.
tupek2 Jun 8, 2025
80d7b4d
Fix build.
tupek2 Jun 8, 2025
fce33b1
Fix style.
tupek2 Jun 8, 2025
094c1d0
Fix style.
tupek2 Jun 9, 2025
0474505
Trying to work out the dynamic checkpointing interface.
tupek2 Jun 12, 2025
5a7c418
Working toward dynamic implementation.
tupek2 Jun 12, 2025
1cb451f
Working toward gretl redesign.
tupek2 Jun 20, 2025
fa0e7cf
Get gretl tests working again with backend refactor.
tupek2 Jun 21, 2025
9e2b7a9
Cleanup some prints.
tupek2 Jun 21, 2025
feb37e1
Get test passing again.
tupek2 Jun 23, 2025
e6ce787
Nearly working dynamic checkpointing. forward pass looks to be correct.
tupek2 Jun 24, 2025
6206f9e
still seeming have forward part operating... need to figure out rever…
tupek2 Jun 24, 2025
065a335
Trying to manage the counting of the pass through states.
tupek2 Jun 24, 2025
0b72bd6
Progressing on graph dynamic checkpointing.
tupek2 Jul 1, 2025
c6078f6
Trying to be more careful tracking states and their passthroughts.
tupek2 Jul 3, 2025
457a261
Progress on checkpointing.
tupek2 Jul 7, 2025
1cc225b
Just have a single data store... we can make the Checkpointmanager vi…
tupek2 Jul 7, 2025
dda8d50
style.
tupek2 Jul 7, 2025
19a6bed
Get all checkpointing tests working again after refactor.
tupek2 Jul 7, 2025
bd16a6b
Remove some prints
tupek2 Jul 7, 2025
6458244
Fix some warnings and small cleanups.
tupek2 Jul 8, 2025
ea31d01
Get optimizations in. Need to document and figure out how to test co…
tupek2 Jul 8, 2025
40b10a6
Some more internal asserts to ensure correctness.
tupek2 Jul 8, 2025
b648971
Get other test working.
tupek2 Jul 9, 2025
0d0fb7a
Remove comments.
tupek2 Aug 4, 2025
1b7366d
Fix style.
tupek2 Aug 4, 2025
450e7b9
Working on documenting the gretl interface a bit more.
tupek2 Aug 5, 2025
3118646
Fix style and docs.
tupek2 Aug 5, 2025
13440ea
Fix last line.
tupek2 Aug 5, 2025
b620140
More ending lines.
tupek2 Aug 5, 2025
3e1423f
More docs improvements and file naming adjustments.
tupek2 Aug 5, 2025
c7a4c66
small fix.
tupek2 Aug 5, 2025
9a67661
Change upstream implementation, fix library name to serac.
tupek2 Aug 5, 2025
6cbf528
Try to fix gcc issues.
tupek2 Aug 5, 2025
d34c80b
Fix maybe nullptr.
tupek2 Aug 5, 2025
d8caccd
Try to fix maybe nullptr.
tupek2 Aug 5, 2025
fd371bf
Merge branch 'develop' into tupek/gretl_refactor
tupek2 Aug 18, 2025
5e3204d
Merge branch 'tupek/residual_interface_adjustments' into tupek/gretl_…
tupek2 Aug 18, 2025
eadb07f
Another working adjustment.
tupek2 Aug 18, 2025
40fab88
Merge branch 'develop' into tupek/gretl_refactor
tupek2 Aug 19, 2025
1f034c9
start introducing differentiable explicit dynamics.
tupek2 Aug 20, 2025
6ea2c9e
Get an explicit dynamics test working.
tupek2 Aug 21, 2025
de421d5
Fix style, put timestep estimator into its own file.
tupek2 Aug 21, 2025
36f578b
Working through documentation and simplifying interface.
tupek2 Aug 22, 2025
84de782
Some more documentations.
tupek2 Aug 22, 2025
daebe5b
Get tests working again.
tupek2 Aug 22, 2025
fd09f4d
Fix style, docs.
tupek2 Aug 22, 2025
0cf84c6
Rename datastore.
tupek2 Aug 22, 2025
027ce61
Merge branch 'develop' into tupek/gretl_field_state
tupek2 Aug 22, 2025
29f61d5
Fix up naming.
tupek2 Aug 24, 2025
59acd92
small naming adjust, more documentation.
tupek2 Aug 25, 2025
6ebe802
Try to fix cmake install.
tupek2 Aug 25, 2025
4f41b1e
Debug some more cases where the dynamic checkpointing was previously …
tupek2 Aug 27, 2025
46f7579
Standard library include.
tupek2 Aug 27, 2025
76ec37c
Fix style.
tupek2 Aug 27, 2025
d54a2a3
Fix some subtle logic with assignment operator.
tupek2 Aug 27, 2025
78bd706
Address state copy constructor.
tupek2 Aug 27, 2025
37799e9
Refactor so weak forms state a timeinfo struct.
tupek2 Aug 28, 2025
7f4fd93
Document time info.
tupek2 Aug 28, 2025
e8bd938
Working on some syntax helpers for adding and sscaling FieldStates.
tupek2 Aug 29, 2025
85006e1
Add some error messaging when objective is not set as the last step.
tupek2 Aug 30, 2025
63d7e23
Implement generic weighted sum.
tupek2 Sep 3, 2025
b2f0b31
Working toward operator overloaded helper functions.
tupek2 Sep 4, 2025
da81c14
Progress on operator overloading abstractions.
tupek2 Sep 4, 2025
d24e8d8
Support some more addition operators with the FieldStateWeightedSum.
tupek2 Sep 4, 2025
c5bd859
A few more additions.
tupek2 Sep 4, 2025
e61ce6a
Implement and test a solid first round of overloaded operators for Fi…
tupek2 Sep 5, 2025
6e29aec
Merge branch 'develop' into tupek/gretl_field_state
tupek2 Sep 5, 2025
bbd6384
Fix docs.
tupek2 Sep 5, 2025
7247f45
Style and test State double double multiply
tupek2 Sep 5, 2025
bc5ffc6
Use the type specific clone and create_state interface for some imple…
tupek2 Sep 5, 2025
da8cf67
Try to resolve constructor ambiguity for gcc.
tupek2 Sep 5, 2025
53b9915
Transition stat advancer to use DoubleState.
tupek2 Sep 5, 2025
6c76be1
Fix style, docs.
tupek2 Sep 5, 2025
3e57c1c
Cleanup a few usages of new interface.
tupek2 Sep 8, 2025
55b2bcd
Add docs.
tupek2 Sep 8, 2025
d9c697b
Improve some error messages, stricter on types for getting duals to a…
tupek2 Sep 11, 2025
df4aac2
Merge branch 'develop' into tupek/gretl_field_state
tupek2 Sep 11, 2025
70966fd
Export the new differentiable utils in the serac library.
tupek2 Sep 11, 2025
33f6146
Rename.
tupek2 Sep 11, 2025
a21f093
Fix style.
tupek2 Sep 11, 2025
859f3d4
Merge branch 'develop' into tupek/gretl_field_state
tupek2 Sep 15, 2025
6fc519a
Fix up graph reset if the graph needs to be rebuilt in the base physics.
tupek2 Sep 17, 2025
f0566d7
Fix style.
tupek2 Sep 17, 2025
b783fe7
Fix the style issues consistent with the original gretl.
tupek2 Sep 18, 2025
f2e6557
New function, less debug info.
tupek2 Sep 22, 2025
ebdd79f
Add subcycle counter to mechanics.
tupek2 Sep 23, 2025
74b55dc
Expand spaces to take potential two vectors.
tupek2 Sep 26, 2025
6f22e78
Fix style.
tupek2 Sep 26, 2025
ac092ae
Merge branch 'develop' into tupek/gretl_field_state_no_error_check
tupek2 Oct 1, 2025
830a42f
Update inertia relief to use some new interface changes.
tupek2 Oct 1, 2025
d96dfb2
Rename mechanics to differentiable_physics.
tupek2 Oct 1, 2025
c2f357a
fix compilation.
tupek2 Oct 1, 2025
fa44b88
Fix style.
tupek2 Oct 1, 2025
684dc37
Do not reset initial conditions on DiffablePhysics when reset is called.
tupek2 Oct 1, 2025
89bf9c7
Slightly adjust some interfaces.
tupek2 Oct 2, 2025
b1cd821
Interface adjustment.
tupek2 Oct 2, 2025
915d9ae
Style.
tupek2 Oct 2, 2025
dad59e5
Change constness.
tupek2 Oct 2, 2025
da54478
Merge branch 'develop' into tupek/gretl_field_state_no_error_check
tupek2 Oct 6, 2025
1834014
Keep up with latest submodules.
tupek2 Oct 6, 2025
c9050b8
Trying to update serac version.
tupek2 Oct 6, 2025
b36dc34
Update inertia relief example.
tupek2 Oct 6, 2025
9c07a25
style.
tupek2 Oct 7, 2025
c0874cd
Add interior integral for functional weak form
lihanyu97 Oct 20, 2025
8f97597
Add epsilon to normalize function
chvillanuevap Oct 24, 2025
eca5b66
Merge branch 'develop' into tupek/gretl_field_state_no_error_check
tupek2 Oct 29, 2025
ea120a4
Fix comments and style.
tupek2 Oct 29, 2025
94b9360
trying to merge.
tupek2 Nov 3, 2025
f24b930
Update submodules.
tupek2 Nov 3, 2025
2941c31
Merge rename changes.
tupek2 Nov 3, 2025
0e55b13
some missed renaming.
tupek2 Nov 3, 2025
baeabc0
Merge branch 'develop' into gretl_field_state_after_rename
tupek2 Nov 4, 2025
b65133f
Merge branch 'develop' into gretl_field_state_after_rename
tupek2 Nov 18, 2025
13714a7
Merge branch 'develop' into gretl_field_state_after_rename
tupek2 Nov 20, 2025
8773991
Put back to smith.
tupek2 Nov 20, 2025
9a25bad
Merge in latest updates to new interface.
tupek2 Nov 20, 2025
51a8522
Fix style.
tupek2 Nov 20, 2025
7e43f3a
Fix a name issue.
tupek2 Nov 20, 2025
8755cc2
Working on rename for consistency.
tupek2 Nov 20, 2025
d860394
style.
tupek2 Nov 20, 2025
a1430b8
Trying to use gretl submodule.
tupek2 Nov 21, 2025
8f00d5b
Install gretl.
tupek2 Nov 21, 2025
82a8a87
Fix cmake list format.
tupek2 Nov 21, 2025
08b4bcc
Fix name.
tupek2 Nov 21, 2025
db6046b
Newest gretl.
tupek2 Dec 3, 2025
585456f
Try to update header includes for updated gretl.
tupek2 Dec 3, 2025
dc166bb
include new target in smith's target chain
white238 Dec 4, 2025
d42ae3e
Example just depend on the entire smith library.
tupek2 Dec 4, 2025
5ffe6e6
Merge branch 'develop' into gretl_submodule
tupek2 Dec 4, 2025
edcbee7
fix install, find gretl in smith install prefix
chapman39 Dec 5, 2025
6a9fa46
Adjust dfem_weak_form to weak_form interface changes.
tupek2 Dec 5, 2025
0362fee
Update src/smith/differentiable_numerics/CMakeLists.txt
tupek2 Dec 8, 2025
a000ebf
Update src/smith/differentiable_numerics/tests/paraview_helper.hpp
tupek2 Dec 8, 2025
f205481
Update src/smith/differentiable_numerics/tests/CMakeLists.txt
tupek2 Dec 8, 2025
a76c437
Update src/smith/differentiable_numerics/tests/paraview_helper.hpp
tupek2 Dec 8, 2025
b8ef7dd
Update src/smith/differentiable_numerics/tests/test_explicit_dynamics…
tupek2 Dec 8, 2025
7b4370b
Update src/smith/differentiable_numerics/tests/test_field_state.cpp
tupek2 Dec 8, 2025
4242eff
Update src/smith/differentiable_numerics/tests/test_field_state.cpp
tupek2 Dec 8, 2025
1b29101
Update src/smith/differentiable_numerics/differentiable_physics.cpp
tupek2 Dec 8, 2025
0bef5fd
Update src/smith/differentiable_numerics/differentiable_utils.cpp
tupek2 Dec 8, 2025
d50cff6
Update src/smith/physics/solid_weak_form.hpp
tupek2 Dec 8, 2025
a315584
Update src/smith/differentiable_numerics/differentiable_utils.cpp
tupek2 Dec 8, 2025
b4e7234
Update src/smith/differentiable_numerics/lumped_mass_explicit_newmark…
tupek2 Dec 8, 2025
88650f6
Update src/smith/differentiable_numerics/differentiable_utils.hpp
tupek2 Dec 8, 2025
524906e
Update src/smith/differentiable_numerics/field_state.cpp
tupek2 Dec 8, 2025
a42ee65
Update src/smith/differentiable_numerics/field_state.cpp
tupek2 Dec 8, 2025
fa4a882
Update src/smith/differentiable_numerics/field_state.hpp
tupek2 Dec 8, 2025
18f4347
Update src/smith/differentiable_numerics/lumped_mass_explicit_newmark…
tupek2 Dec 8, 2025
d6a7d4e
Update src/smith/differentiable_numerics/lumped_mass_explicit_newmark…
tupek2 Dec 8, 2025
a6980f7
Update src/smith/differentiable_numerics/lumped_mass_weak_form.hpp
tupek2 Dec 8, 2025
bbaa967
Update src/smith/differentiable_numerics/state_advancer.hpp
tupek2 Dec 8, 2025
7e2cd78
Update src/smith/differentiable_numerics/timestep_estimator.hpp
tupek2 Dec 8, 2025
678ec06
Update src/smith/physics/functional_weak_form.hpp
tupek2 Dec 8, 2025
d127520
Update cmake/thirdparty/SetupSmithThirdParty.cmake
tupek2 Dec 8, 2025
d89ec82
Merge branch 'develop' into gretl_submodule
tupek2 Dec 8, 2025
f15a351
Update to new uberenv.
tupek2 Dec 8, 2025
4252a44
Fix a copy.
tupek2 Dec 8, 2025
8855f26
Differentiable physics var can be private.
tupek2 Dec 8, 2025
37ba752
Keep up with uberenv.
tupek2 Dec 10, 2025
858dced
Merge branch 'develop' into gretl_submodule
tupek2 Dec 10, 2025
5e0c330
Update submodules.
tupek2 Dec 10, 2025
d189a6e
Use correct submodules.
tupek2 Dec 11, 2025
13e1b72
Update tribol version.
tupek2 Dec 11, 2025
2d929c4
Merge branch 'develop' into gretl_submodule
tupek2 Dec 11, 2025
46695fe
Fix a negation bug.
tupek2 Dec 12, 2025
4e64694
add option for Gretl
white238 Dec 12, 2025
c16a326
remove an extra end line.
tupek2 Dec 12, 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
[submodule "ContinuationSolvers"]
path = ContinuationSolvers
url = https://github.com/LLNL/ContinuationSolvers
[submodule "gretl"]
path = gretl
url = https://github.com/LLNL/gretl
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ set(exported_targets
smith_infrastructure
smith_mesh_utils
smith_numerics
smith_physics)
smith_physics
smith_differentiable_numerics)

add_library(smith INTERFACE)
target_link_libraries(smith INTERFACE ${exported_targets})
Expand All @@ -220,7 +221,7 @@ if (SMITH_ENABLE_CODEVELOP)
)
endif()

install(EXPORT smith-targets
install(EXPORT smith-targets
NAMESPACE smith::
DESTINATION lib/cmake
)
2 changes: 2 additions & 0 deletions cmake/SmithBasics.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ if (NOT SMITH_BASICS_SETUP)
cmake_dependent_option(SMITH_ENABLE_MPI "Enables Smith with MPI support" ON "ENABLE_MPI" OFF)
cmake_dependent_option(SMITH_ENABLE_OPENMP "Enables Smith with OPENMP support" ON "ENABLE_OPENMP" OFF)

option(SMITH_ENABLE_GRETL "Enables Smith with Gretl Support" ON)

#------------------------------------------------------------------------------
# Profiling options
#------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion cmake/SmithConfigHeader.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ message(STATUS "Configuring Smith version ${SMITH_VERSION_FULL}")
#------------------------------------------------------------------------------
# Create variable for every TPL
#------------------------------------------------------------------------------
set(TPL_DEPS ADIAK AXOM CALIPER CAMP CONDUIT CONTINUATION CUDA ENZYME FMT HDF5 HIP LUA MFEM MPI PETSC RAJA SLEPC STRUMPACK SUNDIALS TRIBOL UMPIRE)
set(TPL_DEPS ADIAK AXOM CALIPER CAMP CONDUIT CONTINUATION CUDA ENZYME FMT GRETL HDF5 HIP LUA MFEM MPI PETSC RAJA SLEPC STRUMPACK SUNDIALS TRIBOL UMPIRE)
foreach(dep ${TPL_DEPS})
if( ${dep}_FOUND OR ENABLE_${dep} )
set(SMITH_USE_${dep} TRUE)
Expand Down
7 changes: 7 additions & 0 deletions cmake/smith-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ if(NOT SMITH_FOUND)
set(SMITH_USE_CONTINUATION @SMITH_USE_CONTINUATION@)
set(SMITH_USE_DFEM @SMITH_USE_DFEM@)
set(SMITH_USE_ENZYME @SMITH_USE_ENZYME@)
set(SMITH_USE_GRETL @SMITH_USE_GRETL@)
set(SMITH_USE_HDF5 @SMITH_USE_HDF5@)
set(SMITH_USE_MFEM @SMITH_USE_MFEM@)
set(SMITH_USE_MPI @SMITH_USE_MPI@)
Expand All @@ -58,6 +59,7 @@ if(NOT SMITH_FOUND)
set(SMITH_CONDUIT_DIR "@CONDUIT_DIR@")
set(SMITH_CONTINUATION_DIR "@CONTINUATION_DIR@")
set(SMITH_ENZYME_DIR "@ENZYME_DIR@")
set(SMITH_GRETL_DIR "@SMITH_INSTALL_PREFIX@")
set(SMITH_HDF5_DIR "@HDF5_DIR@")
set(SMITH_MFEM_DIR "@MFEM_DIR@")
set(SMITH_PETSC_DIR "@PETSC_DIR@")
Expand Down Expand Up @@ -170,6 +172,11 @@ if(NOT SMITH_FOUND)
find_dependency(Enzyme REQUIRED)
endif()

# Gretl
if(SMITH_USE_GRETL)
find_dependency(gretl REQUIRED PATHS ${SMITH_GRETL_DIR}/lib/cmake)
endif()

#----------------------------------------------------------------------------
# Load BLT and Smith targets
#----------------------------------------------------------------------------
Expand Down
33 changes: 33 additions & 0 deletions cmake/thirdparty/SetupSmithThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)

set(MFEM_BUILT_WITH_CMAKE TRUE)
endif()

#------------------------------------------------------------------------------
# ContinuationSolvers
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -451,6 +452,7 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)
set(CONTINUATION_FOUND TRUE)
add_subdirectory("${CONTINUATION_SOURCE_DIR}" ${CMAKE_BINARY_DIR}/ContinuationSolvers)
endif()

#------------------------------------------------------------------------------
# Axom
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -553,6 +555,36 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)
set(ENABLE_FORTRAN ON CACHE BOOL "" FORCE)
endif()

#------------------------------------------------------------------------------
# Gretl
#------------------------------------------------------------------------------
message(STATUS "Smith Enable Gretl: ${SMITH_ENABLE_GRETL}")

if(SMITH_ENABLE_GRETL)
# Allow gretl as a non-submodule
if (DEFINED GRETL_SOURCE_DIR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to be able to point to a checked out gretl or an installed one like everything else? I think I would prefer an installed one if we allow it at all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no preference, nor the background to really know the pros and cons. So, up to you! Someone was trying to build with smith_cz and smith with this branch, they were able to get it to work by manually pointing to the gretl.

if(NOT EXISTS "${GRETL_SOURCE_DIR}/CMakeLists.txt")
message(FATAL_ERROR "Given GRETL_SOURCE_DIR does not contain CMakeLists.txt")
endif()
else()
set(GRETL_SOURCE_DIR "${PROJECT_SOURCE_DIR}/gretl" CACHE PATH "")

if (NOT EXISTS "${GRETL_SOURCE_DIR}/CMakeLists.txt")
message(FATAL_ERROR
"The gretl repo is not present. "
"Either run the following command in your git repository: \n"
" git submodule update --init --recursive\n"
"Or add -DGRETL_SOURCE_DIR=/path/to/gretl to your CMake command." )
endif()
endif()

set(GRETL_FOUND TRUE)
message(STATUS "Gretl dir = ${GRETL_SOURCE_DIR}")
add_subdirectory("${GRETL_SOURCE_DIR}" ${CMAKE_BINARY_DIR}/gretl)

endif()


#------------------------------------------------------------------------------
# Tribol
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -678,6 +710,7 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)
# Restore cleared Adiak/Caliper directories, reason at top of file.
set(ADIAK_DIR ${_adiak_dir} CACHE PATH "" FORCE)
set(CALIPER_DIR ${_caliper_dir} CACHE PATH "" FORCE)

#------------------------------------------------------------------------------
# Adiak
#------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/buckling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
smith_add_executable( NAME buckling_cylinder
SOURCES cylinder.cpp
OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY}
DEPENDS_ON smith_physics
DEPENDS_ON smith
)

if(SMITH_ENABLE_HIP)
Expand Down
2 changes: 1 addition & 1 deletion examples/conduction/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
smith_add_executable( NAME simple_conduction
SOURCES simple_conduction.cpp
OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY}
DEPENDS_ON smith_physics
DEPENDS_ON smith
)

install(
Expand Down
2 changes: 1 addition & 1 deletion examples/contact/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if(TRIBOL_FOUND AND STRUMPACK_DIR)
smith_add_executable(NAME contact_${example_name}
SOURCES ${filename}
OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY}
DEPENDS_ON smith_physics smith_mesh_utils)
DEPENDS_ON smith)

smith_add_example_test(NAME contact_${example_name}
COMMAND contact_${example_name}
Expand Down
2 changes: 1 addition & 1 deletion examples/explicit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if(SMITH_USE_DFEM)
blt_add_executable(NAME explicit_${example_name}
SOURCES ${filename}
OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY}
DEPENDS_ON smith_physics smith_mesh_utils)
DEPENDS_ON smith)

smith_add_example_test(NAME explicit_${example_name}
COMMAND explicit_${example_name}
Expand Down
2 changes: 1 addition & 1 deletion examples/explicit/dfem_force_gpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ int main(int argc, char* argv[])

axom::utilities::Timer timer(true);
for (size_t step = 0; step < num_steps; ++step) {
auto no_mass_resid = solid_dfem_weak_form->residual(time, dt, &u_pred, pred_states);
auto no_mass_resid = solid_dfem_weak_form->residual(smith::TimeInfo(time, dt), &u_pred, pred_states);
time += dt;
}
timer.stop();
Expand Down
2 changes: 1 addition & 1 deletion examples/inertia_relief/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (SMITH_ENABLE_CONTINUATION AND STRUMPACK_DIR)
smith_add_executable( NAME inertia_relief_example
SOURCES inertia_relief_example.cpp
OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY}
DEPENDS_ON smith_physics continuation_solver
DEPENDS_ON smith continuation_solver
)
smith_add_example_test(NAME inertia_relief
COMMAND inertia_relief_example
Expand Down
22 changes: 12 additions & 10 deletions examples/inertia_relief/inertia_relief_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ auto createParaviewOutput(const mfem::ParMesh& mesh, const std::vector<smith::Fi
* and thus the NLMC problem is guaranteed to be semi-monotone.
*/
class InertialReliefProblem : public EqualityConstrainedHomotopyProblem {
InertialReliefProblem() : time_info_(0.0, 0.0, 0) {}

protected:
mfem::HypreParMatrix* drdu_ = nullptr;
mfem::HypreParMatrix* dcdu_ = nullptr;
Expand All @@ -141,8 +143,7 @@ class InertialReliefProblem : public EqualityConstrainedHomotopyProblem {
std::unique_ptr<smith::FiniteElementState> shape_disp_;
std::shared_ptr<smith::Mesh> mesh_;
std::vector<std::shared_ptr<smith::ScalarObjective>> constraints_;
double time_ = 0.0;
double dt_ = 0.0;
smith::TimeInfo time_info_;
std::vector<double> jacobian_weights_ = {1.0, 0.0, 0.0, 0.0};

public:
Expand Down Expand Up @@ -257,6 +258,7 @@ int main(int argc, char* argv[])

double time = 0.0;
double dt = 1.0;
smith::TimeInfo time_info(time, dt, 0);
auto all_states = getConstFieldPointers(states, params);
auto objective_states = {all_states[DISP], all_states[DENSITY]};

Expand All @@ -266,7 +268,7 @@ int main(int argc, char* argv[])

mass_objective.addBodyIntegral(smith::DependsOn<1>{}, mesh->entireBodyName(),
[](double /*t*/, auto /*X*/, auto RHO) { return get<smith::VALUE>(RHO); });
double mass = mass_objective.evaluate(time, dt, shape_disp.get(), objective_states);
double mass = mass_objective.evaluate(time_info, shape_disp.get(), objective_states);

smith::tensor<double, dim> initial_cg;

Expand All @@ -278,7 +280,7 @@ int main(int argc, char* argv[])
auto X, auto U, auto RHO) {
return (get<smith::VALUE>(X)[i] + get<smith::VALUE>(U)[i]) * get<smith::VALUE>(RHO);
});
initial_cg[i] = cg_objective->evaluate(time, dt, shape_disp.get(), objective_states) / mass;
initial_cg[i] = cg_objective->evaluate(time_info, shape_disp.get(), objective_states) / mass;

constraints.push_back(cg_objective);
}
Expand Down Expand Up @@ -343,7 +345,7 @@ InertialReliefProblem::InertialReliefProblem(std::vector<smith::FiniteElementSta
std::shared_ptr<smith::Mesh> mesh,
std::shared_ptr<SolidWeakFormT> weak_form,
std::vector<std::shared_ptr<smith::ScalarObjective>> constraints)
: EqualityConstrainedHomotopyProblem()
: EqualityConstrainedHomotopyProblem(), time_info_(0.0, 0.0, 0)
{
weak_form_ = weak_form;
mesh_ = mesh;
Expand Down Expand Up @@ -380,7 +382,7 @@ InertialReliefProblem::InertialReliefProblem(std::vector<smith::FiniteElementSta
mfem::Vector InertialReliefProblem::residual(const mfem::Vector& u) const
{
obj_states_[DISP]->Set(1.0, u);
auto res_vector = weak_form_->residual(time_, dt_, shape_disp_.get(), smith::getConstFieldPointers(all_states_));
auto res_vector = weak_form_->residual(time_info_, shape_disp_.get(), smith::getConstFieldPointers(all_states_));
return res_vector;
}

Expand All @@ -402,7 +404,7 @@ mfem::Vector InertialReliefProblem::constraintJacobianTvp(const mfem::Vector& u,

for (size_t i = 0; i < constraints_.size(); i++) {
mfem::Vector grad_temp =
constraints_[i]->gradient(time_, dt_, shape_disp_.get(), smith::getConstFieldPointers(obj_states_), DISP);
constraints_[i]->gradient(time_info_, shape_disp_.get(), smith::getConstFieldPointers(obj_states_), DISP);
constraint_gradient.Set(1.0, grad_temp);
output_vec.Add(multipliers[i], constraint_gradient);
}
Expand All @@ -414,7 +416,7 @@ mfem::HypreParMatrix* InertialReliefProblem::residualJacobian(const mfem::Vector
{
obj_states_[DISP]->Set(1.0, u);
auto drdu_unique =
weak_form_->jacobian(time_, dt_, shape_disp_.get(), getConstFieldPointers(all_states_), jacobian_weights_);
weak_form_->jacobian(time_info_, shape_disp_.get(), getConstFieldPointers(all_states_), jacobian_weights_);

if (drdu_) {
delete drdu_;
Expand All @@ -437,7 +439,7 @@ mfem::Vector InertialReliefProblem::constraint(const mfem::Vector& u) const
SLIC_ERROR_ROOT_IF(i2 != i, "Constraint index is out of range, bad cast from size_t to int");

double constraint_i =
constraints_[i]->evaluate(time_, dt_, shape_disp_.get(), smith::getConstFieldPointers(obj_states_));
constraints_[i]->evaluate(time_info_, shape_disp_.get(), smith::getConstFieldPointers(obj_states_));
if (dimc_ > 0) {
output_vec(idx) = constraint_i;
}
Expand Down Expand Up @@ -466,7 +468,7 @@ mfem::HypreParMatrix* InertialReliefProblem::constraintJacobian(const mfem::Vect
SLIC_ERROR_ROOT_IF(i2 != i, "Constraint index is out of range, bad cast from size_t to int");
mfem::HypreParVector gradVector(MPI_COMM_WORLD, dimuglb_, uOffsets_);
gradVector.Set(
1.0, constraints_[i]->gradient(time_, dt_, shape_disp_.get(), smith::getConstFieldPointers(obj_states_), DISP));
1.0, constraints_[i]->gradient(time_info_, shape_disp_.get(), smith::getConstFieldPointers(obj_states_), DISP));
mfem::Vector* globalGradVector = gradVector.GlobalVector();
if (myid == 0) {
dcdumat.SetRow(idx, cols, *globalGradVector);
Expand Down
2 changes: 1 addition & 1 deletion examples/uniaxial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (STRUMPACK_DIR)
smith_add_executable( NAME uniaxial_tension
SOURCES uniaxial_tension.cpp
OUTPUT_DIR ${EXAMPLE_OUTPUT_DIRECTORY}
DEPENDS_ON smith_physics
DEPENDS_ON smith
)

smith_add_example_test(NAME uniaxial_tension
Expand Down
1 change: 1 addition & 0 deletions gretl
Submodule gretl added at c84dd3
1 change: 1 addition & 0 deletions src/smith/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ add_subdirectory(infrastructure)
add_subdirectory(numerics)
add_subdirectory(physics)
add_subdirectory(mesh_utils)
add_subdirectory(differentiable_numerics)
55 changes: 55 additions & 0 deletions src/smith/differentiable_numerics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 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)

set(differentiable_numerics_sources
field_state.cpp
differentiable_utils.cpp
differentiable_physics.cpp
lumped_mass_explicit_newmark_state_advancer.cpp
)

set(differentiable_numerics_headers
field_state.hpp
state_advancer.hpp
timestep_estimator.hpp
explicit_dynamic_solve.hpp
lumped_mass_weak_form.hpp
differentiable_utils.hpp
differentiable_physics.hpp
lumped_mass_explicit_newmark_state_advancer.hpp
)

set(differentiable_numerics_depends
gretl
smith_state
smith_boundary_conditions
smith_contact
smith_numerics
smith_physics
)

blt_add_library(
NAME smith_differentiable_numerics
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is differentiable_numerics something that would be better moved to a subdirectory of numerics?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my naming may have caused confusion here. The include dependencies make it clear that differentiable_numerics does not belong in numerics. It combines things in physics, numerics, gretl, etc. to create analogous structures as exist in numerics, but which will be differentiated on the gretl graph. Its not a perfect match to numerics, so perhaps a name change could avoid confusion. differentiable_utilities was another option I was considering. If people have suggestions, I'm happy to change it, but preferably in a follow on PR.

SOURCES ${differentiable_numerics_sources}
HEADERS ${differentiable_numerics_headers}
DEPENDS_ON ${differentiable_numerics_depends}
)

smith_write_unified_header(
NAME differentiable_numerics
HEADERS ${differentiable_numerics_headers}
)

install(FILES ${differentiable_numerics_headers} DESTINATION include/smith/differentiable_numerics )

install(TARGETS smith_differentiable_numerics
EXPORT smith-targets
DESTINATION lib
)

if(SMITH_ENABLE_TESTS)
add_subdirectory(tests)
endif()
Loading