diff --git a/src/backends/cuda/active_set_system/global_active_set_manager.cu b/src/backends/cuda/active_set_system/global_active_set_manager.cu index 26525460..1bf754ad 100644 --- a/src/backends/cuda/active_set_system/global_active_set_manager.cu +++ b/src/backends/cuda/active_set_system/global_active_set_manager.cu @@ -819,6 +819,11 @@ Float GlobalActiveSetManager::toi_threshold() const return m_impl.toi_threshold; } +Float GlobalActiveSetManager::alpha_lower_bound() const +{ + return m_impl.alpha_lower_bound; +} + GlobalActiveSetManager::NonPenetratePositionInfo::NonPenetratePositionInfo(Impl* impl, SizeT offset, SizeT count) noexcept @@ -855,6 +860,7 @@ void GlobalActiveSetManager::Impl::init(WorldVisitor& world) dt = config.find("dt")->view()[0]; decay_factor = config.find("contact/al-ipc/decay_factor")->view()[0]; toi_threshold = config.find("contact/al-ipc/toi_threshold")->view()[0]; + alpha_lower_bound = config.find("contact/al-ipc/alpha_lower_bound")->view()[0]; energy_enabled = true; } diff --git a/src/backends/cuda/active_set_system/global_active_set_manager.h b/src/backends/cuda/active_set_system/global_active_set_manager.h index 6868e676..437c1e02 100644 --- a/src/backends/cuda/active_set_system/global_active_set_manager.h +++ b/src/backends/cuda/active_set_system/global_active_set_manager.h @@ -108,6 +108,7 @@ class GlobalActiveSetManager final : public SimSystem Float decay_factor, dt; Float toi_threshold; + Float alpha_lower_bound; bool energy_enabled; bool should_discard_friction_candidates = false; @@ -168,6 +169,7 @@ class GlobalActiveSetManager final : public SimSystem //tex: $\Gamma$ Float decay_factor() const; Float toi_threshold() const; + Float alpha_lower_bound() const; bool is_enabled() const; protected: diff --git a/src/backends/cuda/engine/advance_al.cu b/src/backends/cuda/engine/advance_al.cu index f5e21806..367d44cc 100644 --- a/src/backends/cuda/engine/advance_al.cu +++ b/src/backends/cuda/engine/advance_al.cu @@ -410,7 +410,8 @@ void SimEngine::advance_AL() m_global_active_set_manager->update_active_set(); m_global_active_set_manager->post_ccd(); - m_global_active_set_manager->advance_non_penetrate_positions(alpha); + if(alpha > m_global_active_set_manager->alpha_lower_bound()) + m_global_active_set_manager->advance_non_penetrate_positions(alpha); } // Update alpha and beta for next iteration diff --git a/src/core/core/scene_default_config.cpp b/src/core/core/scene_default_config.cpp index 0d8d6711..2a6a211e 100644 --- a/src/core/core/scene_default_config.cpp +++ b/src/core/core/scene_default_config.cpp @@ -52,6 +52,7 @@ geometry::AttributeCollection default_scene_config() noexcept config.create("contact/al-ipc/mu_scale_fem", Float{5e7}); config.create("contact/al-ipc/mu_scale_abd", Float{1e5}); config.create("contact/al-ipc/toi_threshold", Float{0.1}); + config.create("contact/al-ipc/alpha_lower_bound", Float{1e-6}); config.create("contact/al-ipc/decay_factor", Float{0.3}); // adaptive contact tuning knobs.