diff --git a/dune/solvers/solvers/quadraticipopt.hh b/dune/solvers/solvers/quadraticipopt.hh index 4159f2b16a2460f36a1fd14932c989266c652374..44ce6ac7e031bab08f67c33443797bac993df410 100644 --- a/dune/solvers/solvers/quadraticipopt.hh +++ b/dune/solvers/solvers/quadraticipopt.hh @@ -527,9 +527,12 @@ public: /** \brief Constructor for a linear problem */ QuadraticIPOptSolver (const MatrixType& hessian, VectorType& x, - const VectorType& rhs, NumProc::VerbosityMode verbosity=NumProc::FULL) + const VectorType& rhs, + NumProc::VerbosityMode verbosity=NumProc::FULL, + std::string linearSolverType = "ma27") : IterativeSolver<VectorType>(1e-8, 100, verbosity), - hessian_(&hessian), rhs_(&rhs), obstacles_(NULL) + hessian_(&hessian), rhs_(&rhs), obstacles_(NULL), + linearSolverType_(linearSolverType) { this->x_ = &x; } @@ -556,6 +559,8 @@ public: std::vector<BoxConstraint<field_type,blocksize> >* obstacles_; + //! The type of the linear solver to be used within IpOpt, default is ma27 + std::string linearSolverType_; }; template <class MatrixType, class VectorType> @@ -575,6 +580,7 @@ void QuadraticIPOptSolver<MatrixType,VectorType>::solve() app->Options()->SetNumericValue("tol", this->tolerance_); app->Options()->SetIntegerValue("max_iter", this->maxIterations_); app->Options()->SetStringValue("mu_strategy", "adaptive"); + app->Options()->SetStringValue("linear_solver",linearSolverType_); app->Options()->SetStringValue("output_file", "ipopt.out"); app->Options()->SetStringValue("hessian_constant", "yes"); switch (this->verbosity_) {