From b9f800e014508d093b100c86d3176606dadae7b2 Mon Sep 17 00:00:00 2001 From: Teseo Schneider Date: Fri, 29 Dec 2023 20:15:43 -0800 Subject: [PATCH 1/3] compute energy only if valid --- src/polysolve/nonlinear/line_search/LineSearch.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/polysolve/nonlinear/line_search/LineSearch.cpp b/src/polysolve/nonlinear/line_search/LineSearch.cpp index e3f9cb7..31a2ae7 100644 --- a/src/polysolve/nonlinear/line_search/LineSearch.cpp +++ b/src/polysolve/nonlinear/line_search/LineSearch.cpp @@ -210,11 +210,9 @@ namespace polysolve::nonlinear::line_search // Find step that does not result in nan or infinite energy while (step_size > current_min_step_size() && cur_iter < current_max_step_size_iter()) { - // Compute the new energy value without contacts - const double energy = objFunc.value(new_x); const bool is_step_valid = objFunc.is_step_valid(x, new_x); - if (!std::isfinite(energy) || !is_step_valid) + if (!is_step_valid || !std::isfinite(objFunc.value(new_x))) { step_size *= rate; new_x = x + step_size * delta_x; From 58acb9dea60c4f9ddbfd9898746252e92840e9d7 Mon Sep 17 00:00:00 2001 From: Teseo Schneider Date: Wed, 12 Jun 2024 15:45:54 -0700 Subject: [PATCH 2/3] accelerate default if present --- src/polysolve/linear/Solver.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/polysolve/linear/Solver.cpp b/src/polysolve/linear/Solver.cpp index b66949c..5c1959d 100644 --- a/src/polysolve/linear/Solver.cpp +++ b/src/polysolve/linear/Solver.cpp @@ -528,6 +528,9 @@ namespace polysolve::linear #ifdef POLYSOLVE_WITH_PARDISO return "Pardiso"; #else +#ifdef POLYSOLVE_WITH_ACCELERATE + return "Eigen::AccelerateLDLT"; +#else #ifdef POLYSOLVE_WITH_HYPRE return "Hypre"; #else From c9537da0ede74fd7b5686724c45f0a495d0d2756 Mon Sep 17 00:00:00 2001 From: teseoch Date: Wed, 17 Jul 2024 16:10:10 -0400 Subject: [PATCH 3/3] missing #endif --- src/polysolve/linear/Solver.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/polysolve/linear/Solver.cpp b/src/polysolve/linear/Solver.cpp index 5c1959d..25595be 100644 --- a/src/polysolve/linear/Solver.cpp +++ b/src/polysolve/linear/Solver.cpp @@ -536,6 +536,7 @@ namespace polysolve::linear #else return "Eigen::BiCGSTAB"; #endif +#endif #endif }