Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
9b74235
Add start of dynamics code
zfergus May 31, 2024
75d0588
Add comments to OrthogonalityPotential::hessian
zfergus May 31, 2024
8b3a1b2
Add J matrix to AffineBody class
zfergus Jun 6, 2024
1e31d41
Merge branch 'main' into dynamics
zfergus Nov 10, 2024
5c73e27
Fix comment
zfergus Nov 11, 2024
73c28ce
Merge branch 'main' into dynamics
zfergus Jun 8, 2025
47c282b
[WIP] Implement rigid body dynamics framework
zfergus Jun 13, 2025
caf4d50
Fix rotation_vector_to_matrix derivatives
zfergus Jun 14, 2025
59edd85
Test RigidBody class
zfergus Jun 17, 2025
5cbe3d4
Test InertialTerm
zfergus Jun 18, 2025
dbad1ba
Add density parameter to mass calculations; store R0 in RB
zfergus Jun 18, 2025
5d7512a
Add (empty) simulator loop
zfergus Jun 18, 2025
0107073
Move body forces into separate class
zfergus Jun 21, 2025
e118277
Merge branch 'main' into dynamics
zfergus Aug 18, 2025
6987872
Remove duplicate cross_product_matrix function
zfergus Aug 18, 2025
3bb8029
Refactor error handling in matrix projection functions to use log_and…
zfergus Aug 18, 2025
f34250b
Remove cross_product_matrix function from pose.cpp
zfergus Aug 18, 2025
42510aa
Fix CMake option syntax for CCD Query IO, filib, libigl, and scalable…
zfergus Aug 18, 2025
e560de5
Initialize integral array in compute_mass_properties_3D with empty br…
zfergus Aug 18, 2025
3a9b326
Remove unicode from test names for Windows CI
zfergus Aug 18, 2025
3491217
Remove unused K_dKj_plus_K_dKj_T
zfergus Aug 19, 2025
e10542a
Add RigidBody class bindings to expose mass and inertia properties.
zfergus Aug 20, 2025
ea38e5d
Fix broad phase benchmark
zfergus Aug 24, 2025
f27fbe8
Update GIT_TAG for ipc_toolkit_tests_data and modify expected output …
zfergus Aug 24, 2025
7f75e25
Refactor broad phase collision detection methods
zfergus Aug 24, 2025
0c00276
Refactor nonlinear CCD methods to use NonlinearCCD class and simplify…
zfergus Aug 28, 2025
0f3bc00
Add RigidCandidates class for managing collision candidates and imple…
zfergus Aug 28, 2025
7470786
Merge branch 'main' into dynamics
zfergus Sep 1, 2025
a5674a6
Merge branch 'main' into dynamics
zfergus Sep 1, 2025
7c702d6
Merge branch 'main' into dynamics
zfergus Jan 27, 2026
6b834f5
Refactor math utils and update NonlinearCCD API
zfergus Jan 27, 2026
d647396
Fix NonlinearCCD parameter order
zfergus Jan 27, 2026
63b330c
Fix Clang-Tidy Errors
zfergus Jan 27, 2026
701318d
Add NOLINTNEXTLINE for identifier-naming
zfergus Jan 27, 2026
30c802f
Assert Q_hat size instead of torque size
zfergus Jan 27, 2026
ebf466f
Fix nonlinear CCD; update body force parameter names
zfergus Jan 28, 2026
7cb148b
Use Eigen::ConstRef for function parameters
zfergus Jan 28, 2026
52bdbfd
Start work on RigidCandidates
zfergus Feb 1, 2026
d29ec6a
Update normal hessians to vectorized 3rd-order tensor format
zfergus Feb 2, 2026
1c89c51
Remove invisible unicode
zfergus Feb 2, 2026
e7c63c3
Skip force and torque computations when zero
zfergus Feb 2, 2026
22fc7b1
Fix normal hessian calculations for vectorized order
zfergus Feb 3, 2026
860f714
Refactor tangent basis and rel velocity Jacobians and update tests
zfergus Feb 4, 2026
c1cbee6
Update TangentialPotential to match new layout for Jacobians
zfergus Feb 4, 2026
81d7b29
Update finite-diff package version to 1.0.4
zfergus Feb 4, 2026
7febecd
Add ground contact dynamics and related tests
zfergus Feb 4, 2026
486985b
Bind write_gltf and add Save button
zfergus Feb 4, 2026
ae11670
Merge branch 'main' into dynamics
zfergus Feb 7, 2026
c182fe8
Remove maybe_parallel_for from utils sources
zfergus Feb 7, 2026
41c8b71
Rigid dynamics: simulator API, fixes, and tests
zfergus Feb 7, 2026
0aa7eda
Merge branch 'main' into dynamics
zfergus Feb 9, 2026
5bb84f1
Add linearized rigid body collision to simulator
zfergus Feb 10, 2026
40ec7cd
Enhance rigid body dynamics and GLTF I/O support
zfergus Feb 18, 2026
29fdcb9
Improve robustness of rigid simulator
zfergus Feb 20, 2026
6a1b2c9
Use Eigen::Hyperplane for planes
zfergus Feb 21, 2026
1948283
Refactor rigid/affine dynamics API and potentials
zfergus Feb 21, 2026
72379e7
Merge branch 'main' into dynamics
zfergus Feb 21, 2026
122f4e7
Enable extra-semi warning and fix extra semicolons
zfergus Feb 21, 2026
07f211e
Bump ipc_toolkit tests data Git tag
zfergus Feb 21, 2026
73256f8
Include <memory> in read_gltf.hpp
zfergus Feb 21, 2026
2b20d22
Use Eigen::VectorXd for gradient in test
zfergus Feb 21, 2026
18a0e90
Expose Eigen system include dir and fix tests
zfergus Feb 21, 2026
bccae4e
Merge branch 'main' into dynamics
zfergus Feb 28, 2026
5d432b4
Merge branch 'main' into dynamics
zfergus Feb 28, 2026
0581aa9
Merge branch 'main' into dynamics
zfergus Mar 1, 2026
f08278a
Fix tests for ColMajor derivatives
zfergus Mar 1, 2026
34fe26e
Merge branch 'main' into dynamics
zfergus Mar 1, 2026
14503a6
Merge branch 'main' into dynamics
zfergus Mar 1, 2026
60f9b69
Merge branch 'main' into dynamics
zfergus Jul 4, 2026
314b361
Add optional glTF I/O for rigid-body scenes
zfergus Jul 5, 2026
5c009c1
Add rigid-body collision detection and BDF time integration
zfergus Jul 6, 2026
0c3f654
Restructure dynamics into a library/demo split with a polysolve solver
zfergus Jul 7, 2026
c679c61
Apply clang-format
zfergus Jul 7, 2026
4ad1617
Merge branch 'main' into dynamics
zfergus Jul 7, 2026
b521c8d
Fix CI: clang-tidy member naming and pin Windows to MSVC
zfergus Jul 7, 2026
ae95e91
Include demo and glTF I/O in the coverage build
zfergus Jul 7, 2026
088dcf6
Fix CI
zfergus Jul 7, 2026
be74bad
Fix debug tests and update polysolve
zfergus Jul 7, 2026
7c4defb
Set solver logger level to info; fix affine test
zfergus Jul 7, 2026
f7d5935
Update polysolve
zfergus Jul 7, 2026
52e82e2
Update clang-format-check and .gitattributes
zfergus Jul 7, 2026
d35d6d0
Merge remote-tracking branch 'origin/main' into dynamics
zfergus Jul 7, 2026
f52fac8
Merge branch 'main' into dynamics
zfergus Jul 7, 2026
aecc0c1
Complete dynamics port: friction, static/kinematic, 2D, codim
zfergus Jul 8, 2026
7cda910
Unify rotation derivatives and move AffinePose to ipc::affine::Pose
zfergus Jul 8, 2026
ece98a2
Add ToAffine parameterization and BodyPotentials aggregator
zfergus Jul 8, 2026
aaac74b
Unify RBD/ABD in the simulator via BodyPotentials + ToAffine; delete …
zfergus Jul 8, 2026
2e95f6e
Update demo README for the RBD/ABD unification
zfergus Jul 8, 2026
6973701
Applied clang-format
zfergus Jul 8, 2026
db2a71d
Fix clang-tidy error
zfergus Jul 8, 2026
0e47917
Use MSVC /W4 instead of /Wall to reduce warning noise
zfergus Jul 9, 2026
78cadbc
Fix MSVC build: use igl::PI instead of bare M_PI in demo tests
zfergus Jul 9, 2026
535c01b
Loosen affine rotation_vector unitary assert for ABD drift
zfergus Jul 9, 2026
55cc49e
Apply clang-format
zfergus Jul 9, 2026
b2044f9
Prevent nonunitary matrix from being passed to Pose::rotation_vector
zfergus Jul 9, 2026
64add5a
Fix clang-format pre-commit hook: add -i for in-place formatting
zfergus Jul 9, 2026
59f13d2
Update test_orthogonality_potential.cpp
zfergus Jul 9, 2026
5ce8b57
Silence MSVC warnings; fix Eigen SVD instantiation
zfergus Jul 9, 2026
f98c7c5
Remove MSVC external warning suppression
zfergus Jul 9, 2026
546626d
Fix bolt demo scene: fixture settings and contact area weighting
zfergus Jul 10, 2026
0928c0f
NonlinearCCD: delegate per-piece linear CCD to a pluggable NarrowPhas…
zfergus Jul 10, 2026
04a0551
Fix joint.py
zfergus Jul 10, 2026
ff54cd4
Merge branch 'main' into dynamics
zfergus Oct 24, 2026
01b6b85
Add per-contact rigid Hessian and dmin support
zfergus Oct 24, 2026
47755dd
Fix densities misaligned after plane pruning
zfergus Oct 24, 2026
b3488d9
Move rigid scene physics from glTF to Python
zfergus Oct 24, 2026
579bc12
Fix GCC and Windows CUDA CI failures
zfergus Oct 24, 2026
09d7a6c
Stop device-linking the demo static library
zfergus Oct 25, 2026
33195af
Log unsquared distance on barrier stiffness update
zfergus Oct 25, 2026
2082fba
Fix review findings in rigid and affine dynamics
zfergus Oct 25, 2026
dcba13e
Disable absolute gradient stop with velocity test
zfergus Oct 26, 2026
693a0d0
Lag friction with the κ the start state carries
zfergus Oct 26, 2026
0ed5a4d
Query rigid body pairs against LBVH leaves
zfergus Oct 27, 2026
ca9f825
Merge branch 'main' into dynamics
zfergus Oct 27, 2026
36fae3f
Merge remote-tracking branch 'origin/dynamics' into dynamics
zfergus Oct 27, 2026
24a3a12
Make friction lagging tolerance configurable
zfergus Oct 28, 2026
188b2a0
Drive kinematic bodies at their prescribed velocity
zfergus Oct 28, 2026
010b6c3
Add per-pair friction coefficients to the demo
zfergus Oct 28, 2026
14d78d1
Warm-start the kinematic AL with the reaction force
zfergus Oct 28, 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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These files should be ignored from GitHub's language statistics.
python/example.ipynb linguist-vendored
python/examples/*.ipynb linguist-vendored
notebooks/*.ipynb linguist-vendored
3 changes: 3 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ on:
- '.github/workflows/clang-format-check.yml'
- '.clang-format'
- 'src/**'
- 'demo/**'
- 'tests/src/**'
- 'python/src/**'
pull_request:
paths:
- '.github/workflows/clang-format-check.yml'
- '.clang-format'
- 'src/**'
- 'demo/**'
- 'tests/src/**'
- 'python/src/**'
jobs:
Expand All @@ -22,6 +24,7 @@ jobs:
matrix:
path:
- 'src'
- 'demo'
- 'tests/src'
- 'python/src'
steps:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,8 @@ jobs:
run: |
cmake --build build -j ${{ steps.cpu-cores.outputs.count }} && ccache --show-stats

# We raise CTest's default 1500 s per-test timeout: "ESP potential 2D
# finite differences" alone takes ~1000 s in Windows Debug, and running
# alongside the demo simulator tests pushes it past the default.
- name: Tests
run: cd build; ctest --verbose -j ${{ steps.cpu-cores.outputs.count }}
run: cd build; ctest --verbose --timeout 3600 -j ${{ steps.cpu-cores.outputs.count }}
3 changes: 3 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- '.github/workflows/coverage.yml'
- 'cmake/**'
- 'demo/**'
- 'src/**'
- 'tests/**'
- 'CMakeLists.txt'
Expand Down Expand Up @@ -65,6 +66,8 @@ jobs:
cd build
cmake .. \
-DIPC_TOOLKIT_BUILD_TESTS=ON \
-DIPC_TOOLKIT_BUILD_DEMO=ON \
-DIPC_TOOLKIT_WITH_GLTF=ON \
-DIPC_TOOLKIT_WITH_CODE_COVERAGE=ON \
-DSIMD_CXX_FLAGS=-march=x86-64-v3 \
-DCMAKE_BUILD_TYPE=Release
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -676,4 +676,5 @@ CMakeGraphVizOptions.cmake

.claude
graphify-out
__cmake_systeminformation
__cmake_systeminformation
simulator_test.glb
38 changes: 34 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,20 @@ if(IPC_TOOLKIT_TOPLEVEL_PROJECT)
endif()
endif()

# If this is not the top-level project, we don't build tests or Python bindings
# by default. This is useful for projects that use IPC Toolkit as a submodule.
option(IPC_TOOLKIT_BUILD_TESTS "Build unit-tests" ${IPC_TOOLKIT_TOPLEVEL_PROJECT})
option(IPC_TOOLKIT_BUILD_PYTHON "Build Python bindings" OFF)
# If this is not the top-level project, we don't build tests, Python bindings,
# or the demo simulator by default. This is useful for projects that use IPC
# Toolkit as a submodule.
option(IPC_TOOLKIT_BUILD_TESTS "Build unit-tests" ${IPC_TOOLKIT_TOPLEVEL_PROJECT})
option(IPC_TOOLKIT_BUILD_PYTHON "Build Python bindings" OFF)
option(IPC_TOOLKIT_BUILD_DEMO "Build the demo simulator" ${IPC_TOOLKIT_TOPLEVEL_PROJECT})

option(IPC_TOOLKIT_WITH_CUDA "Enable CUDA CCD" OFF)
option(IPC_TOOLKIT_WITH_SIMD "Enable SIMD" ON)
option(IPC_TOOLKIT_WITH_RATIONAL_INTERSECTION "Use rational edge-triangle intersection check" OFF)
option(IPC_TOOLKIT_WITH_ROBIN_MAP "Use Tessil's robin-map rather than std maps" ON)
option(IPC_TOOLKIT_WITH_ABSEIL "Use Abseil's hash functions" ON)
option(IPC_TOOLKIT_WITH_FILIB "Use filib for interval arithmetic" ON)
option(IPC_TOOLKIT_WITH_GLTF "Enable glTF I/O (tinygltf)" OFF)
option(IPC_TOOLKIT_WITH_INEXACT_CCD "Use the original inexact CCD method of IPC" OFF)
option(IPC_TOOLKIT_WITH_PROFILER "Enable performance profiler" OFF)
option(IPC_TOOLKIT_WITH_TRACY "Enable Tracy frame profiler" OFF)
Expand Down Expand Up @@ -293,6 +296,12 @@ include(tinyad)
# TODO: Make this a private dependency once we stop exposing TinyAD types in the public API.
target_link_libraries(ipc_toolkit PUBLIC TinyAD::TinyAD)

# TinyGLTF
if(IPC_TOOLKIT_WITH_GLTF)
include(tinygltf)
target_link_libraries(ipc_toolkit PRIVATE tinygltf::tinygltf)
endif()

# CCD
if(IPC_TOOLKIT_WITH_INEXACT_CCD)
# Etienne Vouga's CTCD Library for the floating point root finding algorithm
Expand Down Expand Up @@ -433,6 +442,16 @@ endif()
# Use C++17
target_compile_features(ipc_toolkit PUBLIC cxx_std_17)

################################################################################
# Demo simulator (application-side code: solver, problem glue, stepping loop)
################################################################################

# Added before the tests and Python bindings so both can optionally include
# the demo's tests and bindings.
if(IPC_TOOLKIT_BUILD_DEMO)
add_subdirectory(demo)
endif()

################################################################################
# Tests
################################################################################
Expand Down Expand Up @@ -460,6 +479,17 @@ if(IPC_TOOLKIT_WITH_CODE_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
--coverage
-fprofile-update=atomic
)
if(IPC_TOOLKIT_BUILD_DEMO)
target_compile_options(ipc_toolkit_demo PRIVATE
-g # generate debug info
--coverage # sets all required flags
-fprofile-update=atomic
)
target_link_options(ipc_toolkit_demo PUBLIC
--coverage
-fprofile-update=atomic
)
endif()
endif()

################################################################################
Expand Down
3 changes: 2 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
"cacheVariables": {
"IPC_TOOLKIT_BUILD_PYTHON": "ON",
"IPC_TOOLKIT_BUILD_TESTS": "OFF",
"IPC_TOOLKIT_WITH_CUDA": "OFF"
"IPC_TOOLKIT_WITH_CUDA": "ON",
"IPC_TOOLKIT_WITH_GLTF": "ON"
}
},
{
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ IPC Toolkit is a set of reusable functions to integrate Incremental Potential Co

### Limitations

This is not a full simulation library. As such, it does not include any physics or solvers. For a full simulation implementation, we recommend [PolyFEM](https://polyfem.github.io/) (a finite element library) or [Rigid IPC](https://github.com/ipc-sim/rigid-ipc) (rigid-body dynamics), both of which utilize the IPC Toolkit.
This is not a full simulation library. As such, it does not include any solvers. For a full simulation implementation, we recommend [PolyFEM](https://polyfem.github.io/) (a finite element library) or [Rigid IPC](https://github.com/ipc-sim/rigid-ipc) (rigid-body dynamics), both of which utilize the IPC Toolkit.

A small demo simulator ([`demo/`](demo)) shows how to assemble the toolkit's components (energies, time integration, and CCD) into a rigid/affine body simulator driven by [polysolve](https://github.com/polyfem/polysolve).

## Build

Expand Down
62 changes: 62 additions & 0 deletions cmake/recipes/polysolve.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# PolySolve (https://github.com/polyfem/polysolve)
# License: MIT
if(TARGET polysolve::polysolve)
return()
endif()

message(STATUS "Third-party: creating target 'polysolve::polysolve'")

# Pre-register shared dependencies so this project's pins win over polysolve's
# older ones (both recipe sets guard on the existing targets): finite-diff
# 1.0.4 vs 1.0.2 (the tests need fd::finite_jacobian_tensor), nlohmann/json
# 3.12 vs 3.11, and spdlog 1.17.0 vs 1.9.2.
include(finite_diff)
include(json)
include(spdlog)

include(CPM)
CPMAddPackage(
URI "gh:polyfem/polysolve#1b01e6cec13c6813ae48846d1f98654bbbf1402b"
OPTIONS
# Only the Eigen built-in linear solvers are needed for the demo simulator;
# disable the optional heavyweight backends and their dependency tails.
# (Accelerate also conflicts with Eigen's BLAS prototypes on recent macOS SDKs.)
"POLYSOLVE_WITH_ACCELERATE OFF"
"POLYSOLVE_WITH_AMGCL OFF"
"POLYSOLVE_WITH_CHOLMOD OFF"
"POLYSOLVE_WITH_HYPRE OFF"
"POLYSOLVE_WITH_MKL OFF"
"POLYSOLVE_WITH_PARDISO OFF"
"POLYSOLVE_WITH_SPECTRA OFF"
"POLYSOLVE_WITH_SPQR OFF"
"POLYSOLVE_WITH_SUPERLU OFF"
"POLYSOLVE_WITH_TESTS OFF"
"POLYSOLVE_WITH_UMFPACK OFF"
)

# polysolve always lists its cuSolver backend (CuSolverDN.cu) as a source, even
# with POLYSOLVE_WITH_CUSOLVER off. That is harmless until we enable the CUDA
# language for our own kernels: CMake then compiles the file with nvcc, under
# polysolve's directory-wide MSVC flags (/experimental:external, /FS, ...),
# which nvcc reads as extra input files and rejects on Windows. We never use
# that backend, so we keep the file out of the build.
set_source_files_properties(
"${polysolve_SOURCE_DIR}/src/polysolve/linear/CuSolverDN.cu"
TARGET_DIRECTORY polysolve_linear
PROPERTIES HEADER_FILE_ONLY ON)

# polysolve also hands consumers a bare /utf-8 on MSVC, which would reach nvcc
# in our CUDA tests the same way. We limit it to C++ sources; CUDA sources
# already get -Xcompiler=/utf-8 from ipc_toolkit.
get_target_property(_polysolve_options polysolve_linear INTERFACE_COMPILE_OPTIONS)
if(_polysolve_options)
list(TRANSFORM _polysolve_options
REPLACE "^/utf-8$" "$<$<COMPILE_LANGUAGE:CXX>:/utf-8>")
set_target_properties(polysolve_linear PROPERTIES
INTERFACE_COMPILE_OPTIONS "${_polysolve_options}")
endif()
unset(_polysolve_options)

# Folder name for IDE
set_target_properties(polysolve PROPERTIES FOLDER "ThirdParty")
set_target_properties(polysolve_linear PROPERTIES FOLDER "ThirdParty")
21 changes: 21 additions & 0 deletions cmake/recipes/tinygltf.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# TinyGLTF (https://github.com/syoyo/tinygltf)
# License: MIT
if(TARGET tinygltf::tinygltf)
return()
endif()

message(STATUS "Third-party: creating target 'tinygltf::tinygltf'")

include(CPM)
CPMAddPackage(
URI "gh:syoyo/tinygltf@2.9.6"
DOWNLOAD_ONLY TRUE
)

add_library(tinygltf)
add_library(tinygltf::tinygltf ALIAS tinygltf)
target_sources(tinygltf PRIVATE ${tinygltf_SOURCE_DIR}/tiny_gltf.cc)
target_include_directories(tinygltf INTERFACE
$<BUILD_INTERFACE:${tinygltf_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
52 changes: 52 additions & 0 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
################################################################################
# IPC Toolkit Demo Simulator
#
# Application-side code intentionally kept out of the core library: the
# incremental potential presented to the (polysolve) nonlinear solver and the
# time-stepping loop. The core library only provides the modular components
# (energies, time integrators, potentials, and CCD); this target is the living
# proof that they are easy to assemble into a simulator.
################################################################################

set(SOURCES
src/kinematic_driver.cpp
src/kinematic_driver.hpp
src/kinematics.cpp
src/kinematics.hpp
src/simulator.cpp
src/simulator.hpp
)

add_library(ipc_toolkit_demo ${SOURCES})
add_library(ipc::toolkit::demo ALIAS ipc_toolkit_demo)

target_include_directories(ipc_toolkit_demo PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/src")

# The demo depends on the core library; the core library must never depend on
# the demo (or on any solver).
target_link_libraries(ipc_toolkit_demo PUBLIC ipc::toolkit)

# polysolve (nonlinear solver with PolyFEM-grade Newton + line search).
# PUBLIC: the Simulator IS a polysolve::nonlinear::Problem.
include(polysolve)
target_link_libraries(ipc_toolkit_demo PUBLIC polysolve::polysolve)

target_compile_features(ipc_toolkit_demo PUBLIC cxx_std_17)

if(IPC_TOOLKIT_WITH_CUDA)
# The demo has no CUDA sources, but CMake still device-links it because it
# links the separably compiled core library. That bakes a resolved copy of
# the core's device code into libipc_toolkit_demo.a, and nvlink then fails to
# resolve the core's device functions when an executable (e.g. the tests)
# links both. We leave device linking to the final executable instead.
set_target_properties(ipc_toolkit_demo PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS OFF)
endif()

# Folder name for IDE
set_target_properties(ipc_toolkit_demo PROPERTIES FOLDER "DEMO")
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${SOURCES})

# NOTE: The demo's tests live in the unified ipc_toolkit_tests binary
# (tests/src/tests/demo/) and its Python bindings in the core ipctk module as
# the ipctk.demo submodule (demo/python/simulator.cpp); both are added by
# their respective parent targets when IPC_TOOLKIT_BUILD_DEMO is ON.
Loading
Loading