From d4affb75c934852fe4a3a37223fe517fc46d855b Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 6 May 2020 21:23:07 -0500 Subject: [PATCH] rol/vector_adaptor_02: port to Trilinos 12.18.1 --- tests/rol/vector_adaptor_02.cc | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/rol/vector_adaptor_02.cc b/tests/rol/vector_adaptor_02.cc index 7d4c797595..382d65cc3b 100644 --- a/tests/rol/vector_adaptor_02.cc +++ b/tests/rol/vector_adaptor_02.cc @@ -87,12 +87,28 @@ test(const double x, const double y) Rol::VectorAdaptor x_rol(x_rcp); Teuchos::ParameterList parlist; - // Set parameters. - parlist.sublist("Secant").set("Use as Preconditioner", false); + +#if DEAL_II_TRILINOS_VERSION_GTE(12, 18, 0) + // Define algorithm in three intuitive and easy steps. + // + // For the future developer: if this ever fails again, copy the relevant + // changes out of packages/rol/example/rosenbrock/example_01.cpp found in + // the Trilinos git repository - the package documentation might be + // outdated. + ROL::Ptr> step = + ROL::makePtr>(parlist); + ROL::Ptr> status = + ROL::makePtr>(parlist); + ROL::Algorithm algo(step, status, false); +#else // Define algorithm. ROL::Algorithm algo("Line Search", parlist); +#endif + + // Set parameters. + parlist.sublist("Secant").set("Use as Preconditioner", false); - // Run Algorithm + // Run Algorithm. algo.run(x_rol, quad_objective, true, *outStream); Teuchos::RCP xg = x_rol.getVector(); -- 2.39.5