Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
cd build
ctest --verbose -j ${{ steps.cpu-cores.outputs.count }}
lcov --directory . --capture --output-file coverage.info --ignore-errors inconsistent,format,gcov,mismatch
lcov --remove coverage.info --ignore-errors unused '/usr/*' "$HOME/.cache/*" "*tests/*" --output-file coverage.info
lcov --remove coverage.info --ignore-errors unused,inconsistent '/usr/*' "$HOME/.cache/*" "*tests/*" --output-file coverage.info

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v7
Expand Down
11 changes: 11 additions & 0 deletions cmake/recipes/finite_diff.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,16 @@ message(STATUS "Third-party: creating target 'finitediff::finitediff'")
include(CPM)
CPMAddPackage("gh:zfergus/finite-diff@1.0.4")

# ipc_toolkit compiles with EIGEN_DONT_VECTORIZE=1 when SIMD is enabled, which
# changes how Eigen aligns and allocates matrices. finite-diff takes matrices
# that our lambdas allocate and then reshapes and frees them inside its own
# library code. If the two sides disagree about alignment, the library either
# trips Eigen's "data is not aligned" assert (Debug) or frees a pointer that
# was never allocated with Eigen's aligned allocator (Release). We make the
# define PUBLIC so both sides always agree, the same way we do for MeshFEMSparse.
if(IPC_TOOLKIT_WITH_SIMD)
target_compile_definitions(finitediff_finitediff PUBLIC EIGEN_DONT_VECTORIZE=1)
endif()

# Folder name for IDE
set_target_properties(finitediff_finitediff PROPERTIES FOLDER "ThirdParty")
2 changes: 1 addition & 1 deletion cmake/recipes/scalable_ccd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message(STATUS "Third-party: creating target 'scalable_ccd::scalable_ccd'")

include(CPM)
CPMAddPackage(
URI "gh:continuous-collision-detection/scalable-ccd#ccf4bc19aba432b9d5abdd41ae55d15ea166a0a5"
URI "gh:continuous-collision-detection/scalable-ccd#049d8af986c9cc115e013df7c8af791c2a513dcc"
OPTIONS "SCALABLE_CCD_WITH_CUDA ${IPC_TOOLKIT_WITH_CUDA}"
)

Expand Down
17 changes: 12 additions & 5 deletions src/ipc/gcp/collisions/gcp_collision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,19 @@ double GCPCollisionTemplate<PrimitiveA, PrimitiveB>::compute_distance(

template <typename PrimitiveA, typename PrimitiveB>
auto GCPCollisionTemplate<PrimitiveA, PrimitiveB>::core_vertex_ids() const
-> std::array<index_t, N_CORE_DOFS>
-> std::array<index_t, N_CORE_POINTS>
{
std::array<index_t, N_CORE_DOFS> vids {};
auto ids = get_core_indices();
for (int i = 0; i < N_CORE_DOFS; i++) {
vids[i] = m_vertex_ids[ids[i]];
// m_vertex_ids has one entry per vertex, so we cannot index it with the
// DOF indices from get_core_indices(). Those run up to ELEMENT_SIZE and
// read past the end of the vector. Instead, we map each core point to its
// vertex slot: the core points are the first vertices of each primitive.
std::array<index_t, N_CORE_POINTS> vids {};
for (int i = 0; i < PrimitiveA::N_CORE_POINTS; i++) {
vids[i] = m_vertex_ids[i];
}
for (int i = 0; i < PrimitiveB::N_CORE_POINTS; i++) {
vids[PrimitiveA::N_CORE_POINTS + i] =
m_vertex_ids[primitive_a->n_vertices() + i];
}
return vids;
}
Expand Down
5 changes: 4 additions & 1 deletion src/ipc/gcp/collisions/gcp_collision.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ class GCPCollisionTemplate : public GCPCollision {
CollisionType type() const override;

Eigen::Vector<int, N_CORE_DOFS> get_core_indices() const;
std::array<index_t, N_CORE_DOFS> core_vertex_ids() const;
/// @brief Get the mesh vertex ids of the core points.
/// @return One vertex id per core point: the core points of primitive A
/// followed by those of primitive B.
std::array<index_t, N_CORE_POINTS> core_vertex_ids() const;

int num_vertices() const override
{
Expand Down
Loading