Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
9fcf7ce
potential with quadrature aligned to the point
fsichetti Nov 19, 2025
bbe886a
fix AD
fsichetti Nov 20, 2025
d000087
updated with denis's code
fsichetti Nov 20, 2025
9aa1548
separated high order classes
fsichetti Nov 24, 2025
863f788
symmetric potential
fsichetti Nov 25, 2025
6c546ce
various corrections and added outputs for testing
fsichetti Nov 26, 2025
2b18ecb
new version
fsichetti Nov 30, 2025
8f85248
added HO collision params class, and separated HO collisions from smooth
fsichetti Dec 2, 2025
7f81c80
forgot to use parameters quadrature order to collision class
fsichetti Dec 2, 2025
eae6ff7
removed unnecessary line
fsichetti Dec 3, 2025
2f3fd74
EE2 contact pair distance, disabled two tests
fsichetti Dec 3, 2025
dab4ef6
sliding window on both edges
fsichetti Dec 3, 2025
96870b5
fix (normalize by window width)
fsichetti Dec 6, 2025
cf4fcf0
changes to support high-order EV and VV collisions in 2D
fsichetti Dec 15, 2025
9e9e821
new potential (not fully symmetric yet)
fsichetti Dec 16, 2025
ff661a0
symmetrized - need to check vertex weights
fsichetti Dec 16, 2025
9017dea
gauss lobatto quadrature, removed spurious vertex terms
fsichetti Dec 18, 2025
6ebb0d9
quadrature window
fsichetti Dec 19, 2025
f529f75
several fixes
fsichetti Dec 22, 2025
4ec5cb7
completely separated high order contact from smooth contact
fsichetti Dec 25, 2025
8dbd632
added offset contact
fsichetti Dec 27, 2025
e772c78
offset fixes
fsichetti Dec 28, 2025
8247516
bug fixes + added vertex evaluation only + removed unused code
fsichetti Jan 2, 2026
13303a4
3d primitives
Huangzizhou Jan 6, 2026
eea170e
edge-face adjacency
Huangzizhou Jan 6, 2026
cd253bd
3d collision template
Huangzizhou Jan 6, 2026
ebb7c3c
helper function for adjacency
Huangzizhou Jan 6, 2026
2d7dcdc
3d collision builder
Huangzizhou Jan 6, 2026
60afab0
alternating sum potential 2D
fsichetti Jan 7, 2026
3bb0403
fix codim 2d edge
Huangzizhou Jan 8, 2026
a10174e
real-flat potential
Huangzizhou Jan 10, 2026
791332c
python binding
Huangzizhou Jan 10, 2026
1b0c1b5
more exact type classification
Huangzizhou Jan 10, 2026
c2e2ffb
cancellation
Huangzizhou Jan 10, 2026
b601d35
formatting
Huangzizhou Jan 10, 2026
c6ab0a0
fix compile
Huangzizhou Jan 11, 2026
33b319a
line-line closest uvs
Huangzizhou Jan 11, 2026
3729997
skipping integration on obstacle
fsichetti Jan 11, 2026
d1959ba
skip_obstacles for offset, changed barrier for offset, high-order int…
fsichetti Jan 13, 2026
b7b8e8c
move templated functions to header
Huangzizhou Jan 13, 2026
78c618b
check parallel edges
Huangzizhou Jan 13, 2026
e68c2cb
quadrature potential
Huangzizhou Jan 13, 2026
2beb0ff
fixes and added edge length scaling to offset potential
fsichetti Jan 13, 2026
0f5cce5
gradient of P(q)
Huangzizhou Jan 13, 2026
73938c0
Merge remote-tracking branch 'origin/main'
Huangzizhou Jan 13, 2026
9e87e36
put back deleted function
Huangzizhou Jan 13, 2026
cd5d83e
test for grad
Huangzizhou Jan 13, 2026
16468fb
test for grad
Huangzizhou Jan 14, 2026
a743c57
gradient verified
Huangzizhou Jan 14, 2026
a8f819b
weighting by rest pose area in 2D (offset and high_order)
fsichetti Jan 14, 2026
4cfd489
bug fix in 2d and added some tests
fsichetti Jan 14, 2026
83ac98f
Integrate 3d quadrature to HighOrderContactPotential
Huangzizhou Jan 15, 2026
024ed16
Merge remote-tracking branch 'origin/main'
Huangzizhou Jan 15, 2026
2b69272
typed hash
Huangzizhou Jan 16, 2026
87175a9
half edge-edge mollifier
Huangzizhou Jan 16, 2026
9f8a1a2
candidate name
Huangzizhou Jan 16, 2026
b2ff513
log barrier
Huangzizhou Jan 18, 2026
47e2b1c
remove unused code
Huangzizhou Jan 18, 2026
c4a3302
small change
Huangzizhou Jan 18, 2026
33ccd58
move template function to header
Huangzizhou Jan 18, 2026
caca67c
half edge-edge mollifier
Huangzizhou Jan 18, 2026
84debc8
log barrier
Huangzizhou Jan 18, 2026
8b045ff
fixed 3d unit test
Huangzizhou Jan 20, 2026
652c6af
fix collision builders
fsichetti Jan 21, 2026
d07ae22
fix compile on linux
Huangzizhou Jan 22, 2026
8339c0c
more tests
Huangzizhou Jan 22, 2026
0f6e0c7
Merge remote-tracking branch 'origin/main'
Huangzizhou Jan 22, 2026
a6ed7a2
more tests
Huangzizhou Jan 22, 2026
9581ca2
test meshes
Huangzizhou Jan 22, 2026
a788e9d
advanced Hessian
Huangzizhou Jan 22, 2026
83f38fa
advanced Hessian
Huangzizhou Jan 22, 2026
24df222
fix failed test in debug
Huangzizhou Jan 22, 2026
8b9b9e2
test limit
Huangzizhou Jan 22, 2026
a0ad925
fix unit test
Huangzizhou Jan 25, 2026
27a1c8f
more efficient edge-edge potential and unit tests
Huangzizhou Jan 26, 2026
3b1e420
added cancellation for 2D
fsichetti Jan 26, 2026
51819cc
Merge remote-tracking branch 'myfork/main'
fsichetti Jan 26, 2026
60d040a
added tests for 2D. hessian is not perfect, try to remove AD
fsichetti Jan 26, 2026
d92efc3
tidy up 2d code, removed some old code
fsichetti Jan 27, 2026
40bc413
removed autodiff for 2D, cleaned up code, added some tests. hessian s…
fsichetti Jan 28, 2026
36f5954
some changes to tests
fsichetti Jan 30, 2026
7162932
watertight check
Huangzizhou Feb 1, 2026
70b625d
pass erleben test
Huangzizhou Feb 1, 2026
a692eae
Merge branch 'main' of github.com:fsichetti/ipc-toolkit
Huangzizhou Feb 1, 2026
0d228ff
removed unused function
fsichetti Feb 2, 2026
29dbee5
Remove const shared_ptr<T>& parameters
fsichetti Feb 3, 2026
6cd9c2d
refactoring of shared pointers according to main branch
fsichetti Feb 3, 2026
ccebb49
refactoring vector classes
fsichetti Feb 3, 2026
e70297e
Merge remote-tracking branch 'origin/main' into ogc-merge-branch
fsichetti Feb 3, 2026
b002de2
merge
fsichetti Feb 3, 2026
f5ccccd
temporarily removed some defective tests
fsichetti Feb 4, 2026
5fddf61
changed thresholds
fsichetti Feb 9, 2026
c016b96
removed old offset tests and new codim offset tests
fsichetti Feb 9, 2026
cdefe04
exact distance type computation with geogram
fsichetti Feb 12, 2026
302439a
fix
fsichetti Feb 13, 2026
3d9bf50
cleaner point_triangle_distance_type, and tighter checks for zero pot…
fsichetti Feb 13, 2026
05f0175
added custom filters for point-primitive distances; still need to do …
fsichetti Feb 16, 2026
d2d56b7
added all filters and tests
fsichetti Feb 17, 2026
af18c0b
added back the parallel threshold to fix stability issues, and fix co…
fsichetti Feb 17, 2026
08781bc
added filter for thresholded parallel check
fsichetti Feb 17, 2026
ddf6e93
removed special case for parallel edges, but test is failing
fsichetti Feb 19, 2026
e300a77
fix
fsichetti Feb 19, 2026
7664359
tiny change
fsichetti Feb 19, 2026
44a65dc
remove unnecessary header
fsichetti Feb 19, 2026
c80bdac
truncate uv
Huangzizhou Feb 20, 2026
860d8c6
buggy scene
Huangzizhou Feb 20, 2026
8f9372f
remove problematic test
Huangzizhou Feb 22, 2026
b9f7fab
change log level
Huangzizhou Feb 22, 2026
59299d1
fix assertion false
Huangzizhou Feb 22, 2026
72708d8
HighOrderCollisionDict wrapper
Huangzizhou Feb 26, 2026
03b1dfe
get rid of pointers
Huangzizhou Feb 26, 2026
f44a543
std array instead of vector
Huangzizhou Feb 26, 2026
ed75734
use .data() to get array address
Huangzizhou Feb 26, 2026
d0f48a4
refactor to use dense vectors for local derivatives
Huangzizhou Feb 27, 2026
d50a246
benchmark for pointers
Huangzizhou Feb 27, 2026
e190b3a
Merge branch 'predicates_only'
fsichetti Mar 2, 2026
8632fb3
missing braces on linux
fsichetti Mar 2, 2026
245ef8d
parallel quadrature build
fsichetti Mar 2, 2026
1acb1a1
remove unused test
Huangzizhou Mar 3, 2026
fe5fcfd
local hessian matrix
Huangzizhou Mar 3, 2026
8f4e288
Revert "local hessian matrix"
Huangzizhou Mar 3, 2026
f44cf16
psd projection
Huangzizhou Mar 3, 2026
7532439
clean gradient
Huangzizhou Mar 3, 2026
86fa801
parallelize evaluation on faces
fsichetti Mar 3, 2026
87b0b35
Merge remote-tracking branch 'origin/main'
Huangzizhou Mar 4, 2026
f2aca91
merge commit
Huangzizhou Mar 4, 2026
9413d72
follow ipc code
Huangzizhou Mar 4, 2026
d27cae9
refactor to reduce per-collision memory
Huangzizhou Mar 4, 2026
8330bb6
avoid duplicated distance check
Huangzizhou Mar 4, 2026
b85aed9
use vector for local storage instead of unordered maps
fsichetti Mar 4, 2026
f3ff995
Merge remote-tracking branch 'origin/main'
Huangzizhou Mar 4, 2026
a0121d2
rename and clean code
Huangzizhou Mar 4, 2026
5d9b906
revert accidental commit
Huangzizhou Mar 4, 2026
d6957cf
unique_ptr
Huangzizhou Mar 5, 2026
9fe48c4
avoid unnecessary matrices
Huangzizhou Mar 5, 2026
813cf11
unit test for collision pair count
Huangzizhou Mar 5, 2026
fd7877d
skip obstacles and removed unused parts of the code
fsichetti Mar 7, 2026
bdb326e
fix for linux
fsichetti Mar 9, 2026
92ad854
fix failed test
Huangzizhou Mar 9, 2026
3ee2042
Merge remote-tracking branch 'origin/main'
Huangzizhou Mar 9, 2026
5ca173a
respect skip_obstacles setting
fsichetti Mar 9, 2026
121fca1
Merge branch 'skip-obstacles'
fsichetti Mar 9, 2026
32ecdf5
fixed a bug and reverted exact parallel check to thresholded check; w…
fsichetti Mar 10, 2026
ce0f5b6
count collision pairs before cancellation
Huangzizhou Mar 13, 2026
3036d83
test "Number of Pairs" on armadillo-rollers/327.ply
Huangzizhou Mar 14, 2026
e3e32f7
print edge quadrature point distribution
Huangzizhou Mar 14, 2026
91aba99
explicitly check eigen vectorization
Huangzizhou Mar 14, 2026
a266c62
option to skip building face collisions
Huangzizhou Mar 14, 2026
75b3e0f
normalization of weights
Huangzizhou Mar 15, 2026
b7a7181
use fixed-size Eigen types for mol_grad in hessian()
Huangzizhou Mar 16, 2026
3e7753c
make weight normalization optional, default on
Huangzizhou Mar 16, 2026
ace4eaf
unit test skip_face_collisions for both true and false
Huangzizhou Mar 16, 2026
ff455e9
avoid big matrix copy in build_collisions_at_face_center()
Huangzizhou Mar 16, 2026
0ffa9b2
avoid duplicated distance_type compute
Huangzizhou Mar 17, 2026
d7b08c9
separate dhat for EE points
fsichetti Mar 17, 2026
53ca141
changes to parameters class
fsichetti Mar 20, 2026
5a3e783
export ee eval count
fsichetti Mar 20, 2026
ad9423f
avoid logging strange distance number
Huangzizhou Mar 20, 2026
963bdf8
Add edge_collision_counts() to HighOrderCollisions
Huangzizhou Mar 21, 2026
6c689d5
refactor tests, codim 2d test
Huangzizhou Mar 21, 2026
46876e2
Merge origin/safety-mode: new parameter API + edge eval count export
Huangzizhou Mar 21, 2026
1eaa00c
high order face quadrature test
fsichetti Mar 22, 2026
8b07f86
friction for new contact
Huangzizhou Mar 23, 2026
5a7d0c7
higher order quadrature, hardcoded weight factor for testing, removed…
fsichetti Mar 23, 2026
958bfab
temporary hardcoded flag to skip obstacles on OGC
fsichetti Mar 23, 2026
ec53447
Merge branch 'face-quadrature'
fsichetti Mar 23, 2026
f3c9a71
high order face quadrature with vertices
fsichetti Mar 24, 2026
5a25bd4
tests updated
fsichetti Mar 24, 2026
1b3805d
skipping obstacle-obstacle collisions
fsichetti Mar 25, 2026
d17bcee
high order collisions friction
Huangzizhou Mar 27, 2026
6ea0242
more test
Huangzizhou Mar 28, 2026
b2d49cb
friction unit test
Huangzizhou Mar 29, 2026
c812718
fix friction
Huangzizhou Mar 29, 2026
0bf2a3e
fix gradient jump for parallel edges
Huangzizhou Apr 2, 2026
172178c
Remove debug logging from high_order_contact_potential
Huangzizhou Apr 2, 2026
f2e054a
expose skip_obstacles flag for OGC and fix a test
fsichetti Apr 2, 2026
f5cdf7b
externally sourcing triangle quadrature
fsichetti Apr 6, 2026
aba129d
skip quadrature on vertices when face quadrature (which includes vert…
fsichetti Apr 7, 2026
994488c
high order contact friction
Huangzizhou Apr 10, 2026
28cee52
deprecate compute_active_minimum_distance
Huangzizhou Apr 10, 2026
bcdb739
more extensive unit tests
Huangzizhou Apr 10, 2026
512f457
profiling utils
Huangzizhou Apr 11, 2026
e259302
skip empty dict
Huangzizhou Apr 11, 2026
2524bca
warnings / errors for some quadrature orders
fsichetti Apr 13, 2026
c02cc43
generic barrier for the new potential
fsichetti Apr 15, 2026
0e0f900
profiling
Huangzizhou Apr 16, 2026
e331de5
2D high order potential refactor
fsichetti Apr 18, 2026
512de6b
fix
fsichetti Apr 18, 2026
cc6b726
added inv power barrier to barriers
fsichetti Apr 18, 2026
8413a00
Merge branch '2d-refactor'
fsichetti Apr 18, 2026
787667a
high mollifier order for high barrier order
Huangzizhou Apr 18, 2026
ea42fc3
remove r and alpha from HighOrderContactParameters
Huangzizhou Apr 19, 2026
73e296e
removed ad-hoc 2D offset contact implementation
fsichetti Apr 19, 2026
f8d737e
2D offset potential update and HO fix. Note: 2D OGC and HO potentials…
fsichetti Apr 19, 2026
844490f
psd projection when normalize_weight=true
Huangzizhou Apr 20, 2026
62b1594
1D quadrature fix
fsichetti Apr 21, 2026
b31f38c
OGC fix (from e67f802 on main branch)
fsichetti Apr 21, 2026
7abd6f0
ogc reimplementation
fsichetti Apr 22, 2026
1db44f3
fix and add param
fsichetti Apr 22, 2026
117d12d
2D fix and add area weighting param
fsichetti Apr 22, 2026
3cb3d34
Merge branch 'ogc-impl'
fsichetti Apr 22, 2026
a23ca46
init_pck
fsichetti Apr 23, 2026
75c64cd
Merge remote-tracking branch 'myfork/main'
fsichetti Apr 23, 2026
8e70462
option to switch to legacy edge_edge_distance_type()
Huangzizhou Apr 23, 2026
9453f6d
full legacy version distance type
Huangzizhou Apr 23, 2026
c4b0a03
OGC coefficient fix
fsichetti Apr 26, 2026
e6cdf1a
Merge branch 'main' of github.com:fsichetti/ipc-toolkit
fsichetti Apr 26, 2026
ab11799
adaptive dhat WIP
fsichetti May 4, 2026
3852e48
test: bump Face Quadrature Hessian FD step from 1e-12 to 1e-6
Huangzizhou May 4, 2026
8d940f9
fix(adaptive-dhat): smooth eps across closest-point dtype boundaries
Huangzizhou May 4, 2026
817d4d0
test: loosen Convergent Quadrature gradient tolerance to 1e-5
Huangzizhou May 4, 2026
01897ea
adaptive-dhat: restore clamping in eps for closest-point dtype
Huangzizhou May 4, 2026
5b5e491
adaptive-dhat: C1 smooth saturation for closest-point parameter
Huangzizhou May 4, 2026
1d0d858
test
fsichetti May 4, 2026
ab722a2
add mesh
fsichetti May 4, 2026
c46cfb3
adaptive-dhat: 3D smoothing, dtype invariant, and AD-helper cleanup
Huangzizhou May 4, 2026
59b1c8b
added near/far barrier
fsichetti May 4, 2026
2c06b0e
barrier split (buggy)
fsichetti May 4, 2026
c28f1dd
fix unit test for use_near_far
Huangzizhou May 4, 2026
812ec4e
adaptive dhat computation
fsichetti May 4, 2026
6e6f161
updated test that did not make sense
fsichetti May 4, 2026
60b6725
Merge remote-tracking branch 'origin/adaptive-dhat'
Huangzizhou May 5, 2026
b9c1acf
added tests and finished adding adaptive dhat to the new near/far spl…
fsichetti May 5, 2026
0a0dbc3
removed defective new test
fsichetti May 5, 2026
ea84cc7
minor improvements done while debugging
fsichetti May 6, 2026
5c52138
bugfix
fsichetti May 6, 2026
838b857
some ogc 3D fixes
fsichetti May 6, 2026
7707c3a
near far bugfix
fsichetti May 8, 2026
d673c9d
bugfix
fsichetti May 9, 2026
2393376
Merge remote-tracking branch 'origin/main' into main
fsichetti Jul 28, 2026
33a729e
Support building without geogram; unify parallel threshold; fix EE pa…
fsichetti Jul 29, 2026
e7f298a
Merge remote-tracking branch 'origin/main' into upstream-merge
fsichetti Aug 13, 2026
5f301a2
fix clang format
fsichetti Aug 13, 2026
67bb3d7
Make high_order_contact compile on MSVC
danielepanozzo Aug 16, 2026
1612533
arbitrary point evaluation machinery (ported from a local branch)
fsichetti Aug 19, 2026
42e32a7
added combined evaluation of value, gradient and hessian (2~3x speedup)
fsichetti Aug 19, 2026
8028b77
clang-format fixes
fsichetti Aug 19, 2026
feaf16f
Remove ogc_collisions OGC-replication mode from high_order_contact
fsichetti Sep 1, 2026
a16b48d
Fix clang-format include ordering in high_order_contact
fsichetti Sep 1, 2026
3a76d75
2D version
fsichetti Sep 2, 2026
dfbad2a
Merge remote-tracking branch 'upstream/main' into upstream-merge
fsichetti Sep 3, 2026
5501bd5
Merge remote-tracking branch 'wildmeshing/upstream-merge' into upstre…
fsichetti Sep 3, 2026
b730568
Fix stale non-templated Barrier usages and edge_edge_distance_type re…
fsichetti Sep 3, 2026
742f5f5
Rename high_order_contact -> esp and smooth_contact -> gcp
fsichetti Sep 3, 2026
d00d05b
Rename arbitrary_point_potential -> arbitrary_point_esp
fsichetti Sep 3, 2026
7754082
clang-format fixes
fsichetti Sep 4, 2026
caf393c
Merge remote-tracking branch 'origin/main' into upstream-merge
fsichetti Sep 9, 2026
7ae94a1
Fix CI failures: Windows macros, Abseil leak, and geogram on MSVC
fsichetti Sep 9, 2026
f7e4c29
clang-tidy: add braces around single-statement bodies
fsichetti Sep 9, 2026
38240f2
clang-tidy: follow the project's identifier naming conventions
fsichetti Sep 9, 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
32 changes: 32 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ option(IPC_TOOLKIT_WITH_ABSEIL "Use Abseil's hash functions"
option(IPC_TOOLKIT_WITH_FILIB "Use filib for interval arithmetic" ON)
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_GEOGRAM "Use geogram for predicates / expansion types" ON)
option(IPC_TOOLKIT_WITH_TRACY "Enable Tracy frame profiler" OFF)
option(IPC_TOOLKIT_WITH_MESHFEM_SPARSE "Use MeshFEMSparse for block-accelerated assembly" ON)

Expand Down Expand Up @@ -302,6 +303,12 @@ if(IPC_TOOLKIT_WITH_FILIB)
target_link_libraries(ipc_toolkit PUBLIC filib::filib)
endif()

# Geogram
if(IPC_TOOLKIT_WITH_GEOGRAM)
include(geogram)
target_link_libraries(ipc_toolkit PUBLIC geogram::geogram)
endif()

# Block-accelerated Hessian assembly
if(IPC_TOOLKIT_WITH_MESHFEM_SPARSE)
include(meshfem_sparse)
Expand Down Expand Up @@ -408,6 +415,25 @@ endif()
# Use C++17
target_compile_features(ipc_toolkit PUBLIC cxx_std_17)

################################################################################
# CUDA
################################################################################

# CUDA support
if(IPC_TOOLKIT_WITH_CUDA)
# If CMAKE_CUDA_ARCHITECTURES was not specified, set it to native.
if(DEFINED CMAKE_CUDA_ARCHITECTURES)
message(STATUS "CMAKE_CUDA_ARCHITECTURES was specified, skipping auto-detection")
else()
message(STATUS "CMAKE_CUDA_ARCHITECTURES was not specified, set it to native")
set(CMAKE_CUDA_ARCHITECTURES "native")
endif()
message(STATUS "Targeting CUDA_ARCHITECTURES \"${CMAKE_CUDA_ARCHITECTURES}\"")

# Enable CUDA support
enable_language(CUDA)
endif()

################################################################################
# Tests
################################################################################
Expand All @@ -417,6 +443,12 @@ if(IPC_TOOLKIT_BUILD_TESTS)
include(CTest)
enable_testing()
add_subdirectory(tests)
if(IPC_TOOLKIT_WITH_ROBIN_MAP)
target_link_libraries(ipc_toolkit_tests PRIVATE tsl::robin_map)
endif()
if(IPC_TOOLKIT_WITH_ABSEIL)
target_link_libraries(ipc_toolkit_tests PRIVATE absl::hash)
endif()
endif()

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion cmake/recipes/eigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(TARGET Eigen3::Eigen)
endif()

option(EIGEN_WITH_MKL "Use Eigen with MKL" OFF)
option(EIGEN_DONT_VECTORIZE "Disable Eigen vectorization" OFF)
option(EIGEN_DONT_VECTORIZE "Disable Eigen vectorization" ON)

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

Expand Down
24 changes: 24 additions & 0 deletions cmake/recipes/geogram.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# finite-diff (https://github.com/BrunoLevy/geogram)
# License: BSD 3-Clause License
if(TARGET geogram::geogram)
return()
endif()

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

include(CPM)
CPMAddPackage(
URI "gh:BrunoLevy/geogram@1.10.1"
OPTIONS
"GEOGRAM_WITH_GRAPHICS OFF"
"GEOGRAM_WITH_LEGACY_NUMERICS OFF"
"GEOGRAM_WITH_HLBFGS OFF"
"GEOGRAM_WITH_TETGEN OFF"
"GEOGRAM_WITH_TRIANGLE OFF"
"GEOGRAM_WITH_LUA OFF"
"GEOGRAM_LIB_ONLY ON"
)

if(NOT TARGET geogram::geogram AND TARGET geogram)
add_library(geogram::geogram ALIAS geogram)
endif()
8 changes: 4 additions & 4 deletions docs/source/about/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ Bug Fixes |:bug:|
Python |:snake:|
~~~~~~~~~~~~~~~~

- 💥 **[Breaking]** Rename the ``SmoothPotential`` class to ``SmoothContactPotential`` to match the C++ name (`#247 <https://github.com/ipc-sim/ipc-toolkit/pull/247>`_).
- 💥 **[Breaking]** Rename the ``GCPPotential`` class to ``GCPPotential`` to match the C++ name (`#247 <https://github.com/ipc-sim/ipc-toolkit/pull/247>`_).
- Fill gaps that made the GCP and convergent-formulation tutorials impossible to follow from Python (`#247 <https://github.com/ipc-sim/ipc-toolkit/pull/247>`_):

- Add ``SmoothCollisions.compute_adaptive_dhat``. Without it, adaptive dhat was unreachable even though ``build()`` accepts ``use_adaptive_dhat=True`` and requires this to be called first.
- Add the ``SmoothContactParameters.adaptive_dhat_ratio`` property.
- Add ``GCPCollisions.compute_adaptive_dhat``. Without it, adaptive dhat was unreachable even though ``build()`` accepts ``use_adaptive_dhat=True`` and requires this to be called first.
- Add the ``GCPParameters.adaptive_dhat_ratio`` property.
- Add the ``BarrierPotential.stiffness`` and ``.use_physical_barrier`` properties, mirroring the C++ setters.

- Validate preconditions in the bindings instead of relying on the C++ ``assert``\ s, which are compiled out under ``NDEBUG`` and would let a release build silently accept a bad value (`#247 <https://github.com/ipc-sim/ipc-toolkit/pull/247>`_). ``BarrierPotential`` now raises ``ValueError`` for a non-positive or NaN ``dhat``/``stiffness`` and for a null barrier.
Expand Down Expand Up @@ -209,7 +209,7 @@ Documentation
Refactor
~~~~~~~~

- Replace the duplicate squared-distance implementations in ``ipc/smooth_contact/distance/`` (``point_point_sqr_distance``, ``point_line_sqr_distance``, ``line_line_sqr_distance``, ``edge_edge_sqr_distance``, ``point_plane_sqr_distance``, ``point_triangle_sqr_distance``) with the now-templated functions from ``ipc/distance/``.
- Replace the duplicate squared-distance implementations in ``ipc/gcp/distance/`` (``point_point_sqr_distance``, ``point_line_sqr_distance``, ``line_line_sqr_distance``, ``edge_edge_sqr_distance``, ``point_plane_sqr_distance``, ``point_triangle_sqr_distance``) with the now-templated functions from ``ipc/distance/``.

Miscellaneous
~~~~~~~~~~~~~
Expand Down
20 changes: 10 additions & 10 deletions docs/source/tutorials/gcp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,17 @@ GCP is implemented as separate collision and potential classes. A basic example
double beta_n = 0.0; // exterior direction constraint offset
int r = 2; // barrier exponent (dimension - 1)

ipc::SmoothContactParameters params(dhat, alpha_t, beta_t, alpha_n, beta_n, r);
ipc::GCPParameters params(dhat, alpha_t, beta_t, alpha_n, beta_n, r);

// Build collision set
bool use_adaptive_dhat = true;
ipc::SmoothCollisions collisions;
ipc::GCPCollisions collisions;
if (use_adaptive_dhat)
collisions.compute_adaptive_dhat(collision_mesh, vertices, params);
collisions.build(collision_mesh, vertices, params, use_adaptive_dhat);

// Compute potential
ipc::SmoothContactPotential barrier_potential(params);
ipc::GCPPotential barrier_potential(params);
double b = barrier_potential(collisions, collision_mesh, vertices);

// Compute gradient
Expand All @@ -331,17 +331,17 @@ GCP is implemented as separate collision and potential classes. A basic example
beta_n = 0.0 # exterior direction constraint offset
r = 2 # barrier exponent (dimension - 1)

params = ipctk.SmoothContactParameters(dhat, alpha_t, beta_t, alpha_n, beta_n, r)
params = ipctk.GCPParameters(dhat, alpha_t, beta_t, alpha_n, beta_n, r)

# Build collision set
use_adaptive_dhat = True
collisions = ipctk.SmoothCollisions()
collisions = ipctk.GCPCollisions()
if use_adaptive_dhat:
collisions.compute_adaptive_dhat(collision_mesh, vertices, params)
collisions.build(collision_mesh, vertices, params, use_adaptive_dhat)

# Compute potential
barrier_potential = ipctk.SmoothContactPotential(params)
barrier_potential = ipctk.GCPPotential(params)
b = barrier_potential(collisions, collision_mesh, vertices)

# Compute gradient
Expand All @@ -351,15 +351,15 @@ GCP is implemented as separate collision and potential classes. A basic example
hess = barrier_potential.hessian(collisions, collision_mesh, vertices)

.. important::
If ``use_adaptive_dhat`` is true, make sure to call ``SmoothCollisions::compute_adaptive_dhat()`` **before** ``SmoothCollisions::build()``. Adaptive :math:`\hat{d}` computes per-element barrier extents based on the rest configuration to guarantee zero potential (and zero forces) in the undeformed state.
If ``use_adaptive_dhat`` is true, make sure to call ``GCPCollisions::compute_adaptive_dhat()`` **before** ``GCPCollisions::build()``. Adaptive :math:`\hat{d}` computes per-element barrier extents based on the rest configuration to guarantee zero potential (and zero forces) in the undeformed state.

.. note::
Unlike ``NormalCollisions`` in IPC, ``SmoothCollisions`` must be rebuilt whenever vertex positions change, because the interaction set depends on the current geometry (normals, tangents, and distances).
Unlike ``NormalCollisions`` in IPC, ``GCPCollisions`` must be rebuilt whenever vertex positions change, because the interaction set depends on the current geometry (normals, tangents, and distances).

Parameter Choices
-----------------

The ``SmoothContactParameters`` structure contains the following parameters:
The ``GCPParameters`` structure contains the following parameters:

.. list-table::
:header-rows: 1
Expand Down Expand Up @@ -392,7 +392,7 @@ As :math:`\alpha + \beta` decreases, the support of the Heaviside function shrin

Additional internal parameters that may affect behavior:

- **Adaptive dhat ratio** (default ``0.5``): Controls the ratio :math:`\epsilon(x) / d_c(x, f_0)` in the adaptive barrier localization. Set it via ``SmoothContactParameters::set_adaptive_dhat_ratio()`` in C++ or the ``SmoothContactParameters.adaptive_dhat_ratio`` property in Python.
- **Adaptive dhat ratio** (default ``0.5``): Controls the ratio :math:`\epsilon(x) / d_c(x, f_0)` in the adaptive barrier localization. Set it via ``GCPParameters::set_adaptive_dhat_ratio()`` in C++ or the ``GCPParameters.adaptive_dhat_ratio`` property in Python.
- **Element measure** :math:`L`: For vertices, this is set to the average edge length around the vertex; for edges, to the edge length; for faces, :math:`L` is not needed. This determines the strength of the potential for low-dimensional contact (edge–edge, edge–vertex, vertex–vertex).

Friction
Expand Down
1 change: 1 addition & 0 deletions python/src/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ PYBIND11_MODULE(ipctk, m)
define_smooth_mu(m);

define_smooth_potential(m);
define_esp_potential(m);

// geometry
define_angle(m);
Expand Down
11 changes: 6 additions & 5 deletions python/src/candidates/candidates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void define_candidates(py::module_& m)
"build",
py::overload_cast<
const CollisionMesh&, Eigen::ConstRef<Eigen::MatrixXd>,
const double, BroadPhase*>(&Candidates::build),
const double, BroadPhase*, const bool>(&Candidates::build),
R"ipc_Qu8mg5v7(
Initialize the set of discrete collision detection candidates.

Expand All @@ -23,13 +23,13 @@ void define_candidates(py::module_& m)
broad_phase: Broad phase to use.
)ipc_Qu8mg5v7",
"mesh"_a, "vertices"_a, "inflation_radius"_a = 0,
"broad_phase"_a = nullptr)
"broad_phase"_a = nullptr, "all_types"_a = false)
.def(
"build",
py::overload_cast<
const CollisionMesh&, Eigen::ConstRef<Eigen::MatrixXd>,
Eigen::ConstRef<Eigen::MatrixXd>, const double, BroadPhase*>(
&Candidates::build),
Eigen::ConstRef<Eigen::MatrixXd>, const double, BroadPhase*,
const bool>(&Candidates::build),
R"ipc_Qu8mg5v7(
Initialize the set of continuous collision detection candidates.

Expand All @@ -44,7 +44,8 @@ void define_candidates(py::module_& m)
broad_phase: Broad phase to use.
)ipc_Qu8mg5v7",
"mesh"_a, "vertices_t0"_a, "vertices_t1"_a,
"inflation_radius"_a = 0, "broad_phase"_a = nullptr)
"inflation_radius"_a = 0, "broad_phase"_a = nullptr,
"all_types"_a = false)
.def("__len__", &Candidates::size)
.def("empty", &Candidates::empty)
.def("clear", &Candidates::clear)
Expand Down
3 changes: 1 addition & 2 deletions python/src/collision_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ struct PairHash {
}
};

using MapCanCollide =
std::unordered_map<std::pair<size_t, size_t>, bool, PairHash>;
using MapCanCollide = unordered_map<std::pair<size_t, size_t>, bool, PairHash>;

CollisionFilter
make_sparse_filter(MapCanCollide explicit_values, bool default_value)
Expand Down
Loading