NOX  Development
Public Member Functions | List of all members
NOX::Abstract::PrePostOperator Class Reference

NOX's pure virtual class to allow users to insert user defined operations into nox's solvers (before and after the NOX::Solver::Generic::iterate() and NOX::Solver::Generic::solve() methods). This is an Observer from GoF design pattern book. More...

#include <NOX_Abstract_PrePostOperator.H>

Inheritance diagram for NOX::Abstract::PrePostOperator:
Inheritance graph
[legend]

Public Member Functions

 PrePostOperator ()
 Constructor.
 
 PrePostOperator (const NOX::Abstract::PrePostOperator &)
 Copy constructor.
 
virtual ~PrePostOperator ()
 Destructor.
 
virtual void runPreIterate (const NOX::Solver::Generic &solver)
 User defined method that will be executed at the start of a call to NOX::Solver::Generic::iterate().
 
virtual void runPostIterate (const NOX::Solver::Generic &solver)
 User defined method that will be executed at the end of a call to NOX::Solver::Generic::iterate().
 
virtual void runPreSolve (const NOX::Solver::Generic &solver)
 User defined method that will be executed at the start of a call to NOX::Solver::Generic::solve().
 
virtual void runPostSolve (const NOX::Solver::Generic &solver)
 User defined method that will be executed at the end of a call to NOX::Solver::Generic::solve().
 
virtual void runPreSolutionUpdate (const NOX::Abstract::Vector &update, const NOX::Solver::Generic &solver)
 User defined method that will be executed prior to the update of the solution vector during a call to NOX::Solver::Generic::step(). This is intended to allow users to adjust the direction before the solution update, typically based on knowledge of the problem formulation. The direction is const as we can't guarantee that changes to the direction won't violate assumptions of the solution algorithm. Users can change the update/direciton after a const cast, but NOX may not function as expected. Use at your own risk! More...
 
virtual void runPreLineSearch (const NOX::Solver::Generic &solver)
 User defined method that will be executed before a call to NOX::LineSearch::Generic::compute(). Only to be used in NOX::Solver::LineSearchBased!
 
virtual void runPostLineSearch (const NOX::Solver::Generic &solver)
 User defined method that will be executed after a call to NOX::LineSearch::Generic::compute(). Only to be used in NOX::Solver::LineSearchBased!
 

Detailed Description

NOX's pure virtual class to allow users to insert user defined operations into nox's solvers (before and after the NOX::Solver::Generic::iterate() and NOX::Solver::Generic::solve() methods). This is an Observer from GoF design pattern book.

The user should implement their own concrete implementation of this class and register it as a Teuchos::RCP<NOX::Abstract::PrePostoperator> in the "Solver Options" sublist.

To create and register a user defined pre/post operator:

  1. Create a pre/post operator that derives from NOX::Abstract::PrePostOperator. For example, the pre/post operator Foo might be defined as shown below.

    class Foo : public NOX::Abstract::PrePostOperator {
    // Insert class definition here
    }

  2. Create the appropriate entries in the parameter list, as follows.

    Teuchos::RCP<NOX::Abstract::PrePostOperator> foo = Teuchos::rcp(new Foo);
    params.sublist("Solver Options").set("User Defined Pre/Post Operator", foo);

Member Function Documentation

◆ runPreSolutionUpdate()

virtual void NOX::Abstract::PrePostOperator::runPreSolutionUpdate ( const NOX::Abstract::Vector update,
const NOX::Solver::Generic solver 
)
inlinevirtual

User defined method that will be executed prior to the update of the solution vector during a call to NOX::Solver::Generic::step(). This is intended to allow users to adjust the direction before the solution update, typically based on knowledge of the problem formulation. The direction is const as we can't guarantee that changes to the direction won't violate assumptions of the solution algorithm. Users can change the update/direciton after a const cast, but NOX may not function as expected. Use at your own risk!

Parameters
[in]update- the direction vector that will be used to update the solution. This will not
[in]solver- the nox solver

Reimplemented in NOX::PrePostOperatorVector.


The documentation for this class was generated from the following file: