]> https://gitweb.dealii.org/ - dealii.git/commitdiff
rol/vector_adaptor_02: port to Trilinos 12.18.1 10055/head
authorMatthias Maier <tamiko@43-1.org>
Thu, 7 May 2020 02:23:07 +0000 (21:23 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 7 May 2020 02:23:07 +0000 (21:23 -0500)
tests/rol/vector_adaptor_02.cc

index 7d4c7975957b0ffe68200bea4b7f8385fa864e54..382d65cc3b33800804c0142478383b4d1448f4eb 100644 (file)
@@ -87,12 +87,28 @@ test(const double x, const double y)
   Rol::VectorAdaptor<VectorType> 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<ROL::Step<RealT>> step =
+    ROL::makePtr<ROL::LineSearchStep<RealT>>(parlist);
+  ROL::Ptr<ROL::StatusTest<RealT>> status =
+    ROL::makePtr<ROL::StatusTest<RealT>>(parlist);
+  ROL::Algorithm<RealT> algo(step, status, false);
+#else
   // Define algorithm.
   ROL::Algorithm<RealT> 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<const VectorType> xg = x_rol.getVector();

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.