38. Application Solutions

Once the application object has the objective function, constraints, derivatives, and other features associated with it, a TAO solver can be applied to the application. For further information about how to create a TAO solver, see the previous chapter.

Once the TAO solver and TAO application object have been created and customized, they can be matched with one another using the routine

   TaoSetupApplicationSolver( TAO_APPLICATION, TAO_SOLVER); 
This routine will set up the TAO solver for the application. Different solvers may set up differently, but they typically create the work vectors and linear solvers needed to find a solution. These structures were not created during the creation of the solver because the size of the application was not known. After calling this routine the routine TaoAppGetTaoSolver() can be used to obtain the TAO solver object. If not called directly by the application, TaoSetupApplicationSolver() will be executed inside of the subroutine TaoSolveApplication().

The routine

   TaoGetGradientVec( TAO_SOLVER, Vec*); 
will set a pointer to a Vec to the vector object containing the gradient vector and the routine
   TaoGetVariableBoundVecs( TAO_SOLVER, Vec*, Vec*); 
will set the pointers to the lower and upper bounds on the variables -- if they exist. These vectors may be viewed at before, during, and after the solver is running.

Options for the application and solver can be be set from the command line using the routine

   TaoSetOptions( TAO_APPLICATION, TAO_SOLVER); 
This routine will call TaoSetupApplicationSolver() if it has not been called already. This command also provides information about runtime options when the user includes the -help option on the command line.

Once the application and solver have been set up, the solver can be called using the routine

   TaoSolveApplication( TAO_APPLICATION, TAO_SOLVER); 
This routine will call the TAO solver. If the routine TaoSetupApplicationSolver() has not already been called, this routine will call it.

After a solution has been found, the routine

   TaoCopyDualsOfVariableBounds( TAO_APPLICATION, Vec, Vec ); 
can compute the dual values of the variables bounds and copy them into the vectors passed into this routine.