diff --git a/src/ipc/smooth_contact/distance/primitive_distance.hpp b/src/ipc/smooth_contact/distance/primitive_distance.hpp index 9debba70d..c34e0875d 100644 --- a/src/ipc/smooth_contact/distance/primitive_distance.hpp +++ b/src/ipc/smooth_contact/distance/primitive_distance.hpp @@ -212,6 +212,92 @@ template class PrimitiveDistance { } }; +// Explicit specialization declarations — prevent implicit instantiation of the +// inline primary template body in other translation units (MSVC requires this). +#ifndef IPC_TOOLKIT_DEBUG_AUTODIFF +template <> +std::tuple< + Eigen::Vector::DIM>, + Eigen::Matrix< + double, + PrimitiveDistance::DIM, + PrimitiveDistance::N_CORE_DOFS>, + std::array< + Eigen::Matrix< + double, + PrimitiveDistance::N_CORE_DOFS, + PrimitiveDistance::N_CORE_DOFS>, + PrimitiveDistance::DIM>> +PrimitiveDistance::compute_closest_direction_hessian( + const Eigen::Vector::N_CORE_DOFS>& + x, + EdgeEdgeDistanceType dtype); + +template <> +std::tuple< + Eigen::Vector::DIM>, + Eigen::Matrix< + double, + PrimitiveDistance::DIM, + PrimitiveDistance::N_CORE_DOFS>, + std::array< + Eigen::Matrix< + double, + PrimitiveDistance::N_CORE_DOFS, + PrimitiveDistance::N_CORE_DOFS>, + PrimitiveDistance::DIM>> +PrimitiveDistance::compute_closest_direction_hessian( + const Eigen::Vector::N_CORE_DOFS>& + x, + PointPointDistanceType dtype); + +template <> +std::tuple< + Eigen::Vector::DIM>, + Eigen::Matrix< + double, + PrimitiveDistance::DIM, + PrimitiveDistance::N_CORE_DOFS>, + std::array< + Eigen::Matrix< + double, + PrimitiveDistance::N_CORE_DOFS, + PrimitiveDistance::N_CORE_DOFS>, + PrimitiveDistance::DIM>> +PrimitiveDistance::compute_closest_direction_hessian( + const Eigen::Vector::N_CORE_DOFS>& + x, + PointPointDistanceType dtype); + +template <> +GradientType::N_CORE_DOFS + 1> +PrimitiveDistance::compute_mollifier_gradient( + const Eigen::Vector::N_CORE_DOFS>& + x, + double dist_sqr); + +template <> +GradientType::N_CORE_DOFS + 1> +PrimitiveDistance::compute_mollifier_gradient( + const Eigen::Vector::N_CORE_DOFS>& + x, + double dist_sqr); + +template <> +HessianType::N_CORE_DOFS + 1> +PrimitiveDistance::compute_mollifier_hessian( + const Eigen::Vector::N_CORE_DOFS>& + x, + double dist_sqr); + +template <> +HessianType::N_CORE_DOFS + 1> +PrimitiveDistance::compute_mollifier_hessian( + const Eigen::Vector::N_CORE_DOFS>& + x, + double dist_sqr); +#endif + } // namespace ipc #include "primitive_distance.tpp"