Skip to content
Snippets Groups Projects
Commit 275681c0 authored by Elias Pipping's avatar Elias Pipping
Browse files

Fix quadraticipoptsolvertest and libhsl check

The quadratic ipopt solver can use a variety of linear solvers. The
ipopt library itself does not contain a single one; they are dlopen'ed
at run-time.

The wrapper class in this module takes MA27 from libhsl to be the
default solver. This is also the default solver in ipopt, so that
setting linear_solver to MA27 has the same effect as not setting it at
all. Setting it to the empty string appears to have the same effect but
triggers a warning.

libhsl (which is installed under the name libcoinhsl by default even
though dlopen requires it to be called libhsl) is not available under a
permissive license but free for researchers.

Even though the quadratic ipopt solver class itself could be used with
other linear solvers (from mumps or pardiso) in theory (I haven't
checked), the test will only run with libhsl for now. Unless both ipopt
and libhsl are found, the test will now be skipped.
parent 8d654835
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -18,7 +18,7 @@ find_library(IPOPT_LIBRARY ...@@ -18,7 +18,7 @@ find_library(IPOPT_LIBRARY
# If you want to want to use other linear solver # If you want to want to use other linear solver
find_library(HSL_LIBRARY find_library(HSL_LIBRARY
NAMES coinhsl NAMES hsl
PATH_SUFFIXES "lib" PATH_SUFFIXES "lib"
) )
......
...@@ -15,7 +15,7 @@ set(OTHER_TESTS ...@@ -15,7 +15,7 @@ set(OTHER_TESTS
set(TESTS_IPOPT mmgtest quadraticipoptsolvertest) set(TESTS_IPOPT mmgtest quadraticipoptsolvertest)
if(HAVE_IPOPT) if(HAVE_IPOPT AND HSL_LIBRARY)
list(APPEND GRID_BASED_TESTS ${TESTS_IPOPT}) list(APPEND GRID_BASED_TESTS ${TESTS_IPOPT})
endif() endif()
...@@ -30,7 +30,7 @@ foreach(_test ${TESTS}) ...@@ -30,7 +30,7 @@ foreach(_test ${TESTS})
dune_add_test(SOURCES ${_test}.cc) dune_add_test(SOURCES ${_test}.cc)
endforeach() endforeach()
if(HAVE_IPOPT) if(HAVE_IPOPT AND HSL_LIBRARY)
foreach(_test ${TESTS_IPOPT}) foreach(_test ${TESTS_IPOPT})
add_dune_ipopt_flags(${_test}) add_dune_ipopt_flags(${_test})
endforeach() endforeach()
......
...@@ -47,7 +47,7 @@ void solveObstacleProblemByQuadraticIPOptSolver(const GridType& grid, const Matr ...@@ -47,7 +47,7 @@ void solveObstacleProblemByQuadraticIPOptSolver(const GridType& grid, const Matr
} }
// create solver // create solver
Solver solver(mat,x,rhs, NumProc::REDUCED,""); Solver solver(mat,x,rhs, NumProc::REDUCED);
solver.ignoreNodes_ = &ignore; solver.ignoreNodes_ = &ignore;
solver.obstacles_ = &boxConstraints; solver.obstacles_ = &boxConstraints;
// solve problem // solve problem
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment