There are four steps to calling the solver.

// Construct an object that derives from the abstract Group object. Here // we call it the ExampleGroup. It should contain the initial guess. ExampleGroup grp;

- The NOX::StatusTest::MaxIters test is used to control the maximum number of iterations that the nonlinear solver is allowed to take.

- The NOX::StatusTest::NormF test checks the size of . This check can be done based on relative or absolute norms, scaled by , and more. See the description for more details.

These and other status tests can be combined using the NOX::StatusTest::Combo object. It takes an arbitrary number of status tests and either AND's or OR's them together.

Finally, the user can create their own status tests, so long as they derive from NOX::StatusTest::Generic.

Here is some sample code.

// Set up the status tests NOX::StatusTest::NormF statusTestA(grp, 1.0e-4); NOX::StatusTest::MaxIters statusTestB(20); NOX::StatusTest::Combo statusTestsCombo(NOX::StatusTest::Combo::OR, statusTestA, statusTestB);

// Create the list of solver parameters NOX::Parameter::List solverParameters; // Set the solver (this is the default) solverParameters.setParameter("Nonlinear Solver", "Line Search Based"); // Create the line search parameters sublist NOX::Parameter::List& lineSearchParameters = solverParameters.sublist("Line Search"); // Set the line search method lineSearchParameters.setParameter("Method","More'-Thuente");

For a full list of parameters; see NOX Parameter Reference Page.

// Create the solver NOX::Solver::Manager solver(grp, statusTestsCombo, solverParameters); // Solve the nonlinear system NOX::StatusTest::StatusType status = solver.solve(); // Print the answer cout << "\n" << "-- Parameter List From Solver --" << "\n"; solver.getParameterList().print(cout); // Get the answer grp = solver.getSolutionGroup(); // Print the answer cout << "\n" << "-- Final Solution From Solver --" << "\n"; grp.print();

Generated on Thu Sep 18 12:43:29 2008 for NOX by 1.3.9.1