MoochoPack::MoochoThyraSolver Class Reference

MOOCHO NLP Solver class for models represented through Thyra::ModelEvaluator. More...

#include <MoochoPack_MoochoThyraSolver.hpp>

Inheritance diagram for MoochoPack::MoochoThyraSolver:

[legend]
List of all members.

Public types

enum  ESolveMode { SOLVE_MODE_FORWARD, SOLVE_MODE_OPTIMIZE }
  More...

Constructors/initialization.

 MoochoThyraSolver (const std::string &paramsXmlFileName="", const std::string &extraParamsXmlString="", const std::string &paramsUsedXmlOutFileName="", const std::string &paramsXmlFileNameOption="moocho-thyra-params-file", const std::string &extraParamsXmlStringOption="extra-moocho-thyra-params", const std::string &paramsUsedXmlOutFileNameOption="moocho-thyra-params-used-file")
 Construct with default settings.
 ~MoochoThyraSolver ()
 
 STANDARD_MEMBER_COMPOSITION_MEMBERS (std::string, paramsXmlFileName)
 The name an XML file that will be read to get XML parameters (if not "").
 STANDARD_MEMBER_COMPOSITION_MEMBERS (std::string, extraParamsXmlString)
 An XML string that will be used to update the parameters (if not "").
 STANDARD_MEMBER_COMPOSITION_MEMBERS (std::string, paramsUsedXmlOutFileName)
 The name of an XML file that will be written (if not "") for the parameters actually used.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (std::string, paramsXmlFileNameOption)
 The name of the option that will be added the the commandline processor that will set paramsXmlFileName() .
 STANDARD_MEMBER_COMPOSITION_MEMBERS (std::string, extraParamsXmlStringOption)
 The name of the option that will be added the the commandline processor that will set extraParamsXmlString() .
 STANDARD_MEMBER_COMPOSITION_MEMBERS (std::string, paramsUsedXmlOutFileNameOption)
 The name of the option that will be added the the commandline processor that will set paramsUsedXmlOutFileName() .
 STANDARD_NONCONST_COMPOSITION_MEMBERS (Thyra::MultiVectorFileIOBase< value_type >, stateVectorIO)
 MultiVectorFileIOBase object used to read and write state vectors to and from files.
 STANDARD_NONCONST_COMPOSITION_MEMBERS (Thyra::MultiVectorFileIOBase< value_type >, parameterVectorIO)
 MultiVectorFileIOBase object used to read and write parameter vectors to and from files.
void setupCLP (Teuchos::CommandLineProcessor *clp)
 Sets up the commandline for reading in the parameter list for this object (minus the options for MoochoSolver).
void readParameters (std::ostream *out)
 Force the parameters to be read from a file or from the commandline arguments.

Overridden from ParameterListAcceptor

void setParameterList (RCP< Teuchos::ParameterList > const &paramList)
 
RCP< Teuchos::ParameterListgetParameterList ()
 
RCP< Teuchos::ParameterListunsetParameterList ()
 
RCP< const Teuchos::ParameterListgetParameterList () const
 
RCP< const Teuchos::ParameterListgetValidParameters () const
 

Misc Access/Setup

void setSolveMode (const ESolveMode solveMode)
 
ESolveMode getSolveMode () const
 
MoochoSolvergetSolver ()
 
const MoochoSolvergetSolver () const
 

Model specification, setup, solve, and solution extraction.

void setModel (const RCP< Thyra::ModelEvaluator< value_type > > &origModel, const int p_idx=0, const int g_idx=0)
 
const RCP< Thyra::ModelEvaluator<
value_type > > 
getOrigModel () const
 
const RCP< Thyra::ModelEvaluator<
value_type > > 
getOuterModel () const
 
void readInitialGuess (std::ostream *out=NULL)
 
void setInitialGuess (const RCP< const Thyra::ModelEvaluatorBase::InArgs< value_type > > &initialGuess)
 
void setInitialGuess (const Thyra::ModelEvaluatorBase::InArgs< value_type > &initialGuess)
 
MoochoSolver::ESolutionStatus solve ()
 
const Thyra::ModelEvaluatorBase::InArgs<
value_type > & 
getFinalPoint () const
 Return the final point.
void writeFinalSolution (std::ostream *out=NULL) const
 Write the final solution to a file specified by the parameter list option ???.
void writeParamsFile (const std::string &outputXmlFileName="") const
 Write the parameters list for a this object to a file after the parameters are read in order to show defaults and create a new list for input the next time.

Public Types

 SOLVE_MODE_FORWARD
 Do a forward solve for the states only.
 SOLVE_MODE_OPTIMIZE
 Solve an optimization problem for states and parameters.
 NLP_TYPE_FIRST_ORDER
 NLP_TYPE_DIRECT
enum  ENLPType { NLP_TYPE_FIRST_ORDER, NLP_TYPE_DIRECT }

Private Types

typedef value_type Scalar

Private Attributes

MoochoSolver solver_
RCP< Thyra::ModelEvaluator<
value_type > > 
origModel_
int p_idx_
int g_idx_
Thyra::ParameterDrivenMultiVectorInput<
value_type
x_reader_
Thyra::ParameterDrivenMultiVectorInput<
value_type
p_reader_
Thyra::ParameterDrivenMultiVectorInput<
value_type
p_l_reader_
Thyra::ParameterDrivenMultiVectorInput<
value_type
p_u_reader_
RCP< Teuchos::ParameterListparamList_
RCP< Thyra::DefaultNominalBoundsOverrideModelEvaluator<
value_type > > 
nominalModel_
RCP< Thyra::DefaultFinalPointCaptureModelEvaluator<
value_type > > 
finalPointModel_
RCP< Thyra::ModelEvaluator<
value_type > > 
outerModel_
ESolveMode solveMode_
ENLPType nlpType_
bool nonlinearlyElimiateStates_
bool use_finite_diff_for_obj_
bool use_finite_diff_for_con_
double fwd_newton_tol_
int fwd_newton_max_iters_
bool fwd_newton_dampening_
int fwd_newton_max_ls_iters_
bool useInvObjFunc_
bool useParameterLumping_
std::string outputFileTag_
bool showModelEvaluatorTrace_
std::string stateSoluFileBase_
std::string paramSoluFileBase_

Detailed Description

MOOCHO NLP Solver class for models represented through Thyra::ModelEvaluator.

The parameters this class accepts are shown below in different format:

Human readable format (with documentation) for valid parameters accepted by this class

Human readable format (without documentation) for valid parameters accepted by this class

XML format for valid parameters accepted by this class

ToDo: Finish documetation!

Definition at line 70 of file MoochoPack_MoochoThyraSolver.hpp.


Member Typedef Documentation

typedef value_type MoochoPack::MoochoThyraSolver::Scalar [private]

Definition at line 304 of file MoochoPack_MoochoThyraSolver.hpp.


Member Enumeration Documentation

enum MoochoPack::MoochoThyraSolver::ESolveMode

Enumerator:
SOLVE_MODE_FORWARD  Do a forward solve for the states only.
SOLVE_MODE_OPTIMIZE  Solve an optimization problem for states and parameters.

Definition at line 79 of file MoochoPack_MoochoThyraSolver.hpp.

enum MoochoPack::MoochoThyraSolver::ENLPType

Enumerator:
NLP_TYPE_FIRST_ORDER 
NLP_TYPE_DIRECT 

Definition at line 300 of file MoochoPack_MoochoThyraSolver.hpp.


Constructor & Destructor Documentation

MoochoPack::MoochoThyraSolver::MoochoThyraSolver ( const std::string &  paramsXmlFileName = "",
const std::string &  extraParamsXmlString = "",
const std::string &  paramsUsedXmlOutFileName = "",
const std::string &  paramsXmlFileNameOption = "moocho-thyra-params-file",
const std::string &  extraParamsXmlStringOption = "extra-moocho-thyra-params",
const std::string &  paramsUsedXmlOutFileNameOption = "moocho-thyra-params-used-file" 
)

Construct with default settings.

Warning! Do not change the defaults by passing then into this constructor. Instead, use the member functions to set them after *this is constructed. This will help to avoid problems with updates to the ordering of the arguments.

Definition at line 168 of file MoochoPack_MoochoThyraSolver.cpp.

MoochoPack::MoochoThyraSolver::~MoochoThyraSolver (  ) 

Definition at line 201 of file MoochoPack_MoochoThyraSolver.cpp.


Member Function Documentation

MoochoPack::MoochoThyraSolver::STANDARD_MEMBER_COMPOSITION_MEMBERS ( std::string  ,
paramsXmlFileName   
)

The name an XML file that will be read to get XML parameters (if not "").

MoochoPack::MoochoThyraSolver::STANDARD_MEMBER_COMPOSITION_MEMBERS ( std::string  ,
extraParamsXmlString   
)

An XML string that will be used to update the parameters (if not "").

MoochoPack::MoochoThyraSolver::STANDARD_MEMBER_COMPOSITION_MEMBERS ( std::string  ,
paramsUsedXmlOutFileName   
)

The name of an XML file that will be written (if not "") for the parameters actually used.

MoochoPack::MoochoThyraSolver::STANDARD_MEMBER_COMPOSITION_MEMBERS ( std::string  ,
paramsXmlFileNameOption   
)

The name of the option that will be added the the commandline processor that will set paramsXmlFileName() .

MoochoPack::MoochoThyraSolver::STANDARD_MEMBER_COMPOSITION_MEMBERS ( std::string  ,
extraParamsXmlStringOption   
)

The name of the option that will be added the the commandline processor that will set extraParamsXmlString() .

MoochoPack::MoochoThyraSolver::STANDARD_MEMBER_COMPOSITION_MEMBERS ( std::string  ,
paramsUsedXmlOutFileNameOption   
)

The name of the option that will be added the the commandline processor that will set paramsUsedXmlOutFileName() .

MoochoPack::MoochoThyraSolver::STANDARD_NONCONST_COMPOSITION_MEMBERS ( Thyra::MultiVectorFileIOBase< value_type ,
stateVectorIO   
)

MultiVectorFileIOBase object used to read and write state vectors to and from files.

The default implementation used is Thyra::DefaultSpmdMultiVectorFileIO. See Thyra::DefaultSpmdMultiVectorFileIO::DefaultSpmdMultiVectorFileIO() for the default conditions of such an object.

MoochoPack::MoochoThyraSolver::STANDARD_NONCONST_COMPOSITION_MEMBERS ( Thyra::MultiVectorFileIOBase< value_type ,
parameterVectorIO   
)

MultiVectorFileIOBase object used to read and write parameter vectors to and from files.

The default implementation used is Thyra::DefaultSpmdMultiVectorFileIO. See Thyra::DefaultSpmdMultiVectorFileIO::DefaultSpmdMultiVectorFileIO() for the default conditions.

ToDo: You may need to change this to set different the MultiVectorFileIOBase objects for each parameter subvector for each index l=0...Np-1!

void MoochoPack::MoochoThyraSolver::setupCLP ( Teuchos::CommandLineProcessor clp  ) 

Sets up the commandline for reading in the parameter list for this object (minus the options for MoochoSolver).

The commandline arguments --moocho-thyra-params-file and --moocho-thyra-extra-params will be added to *clp that will allow the parameters to be read from a file or from the commandline itself in XML format.

Definition at line 204 of file MoochoPack_MoochoThyraSolver.cpp.

void MoochoPack::MoochoThyraSolver::readParameters ( std::ostream *  out  ) 

Force the parameters to be read from a file or from the commandline arguments.

If no parameter XML file name or parameters XML string was specified on the commandline, then this function will exist immediately and do nothing.

If an XML file name or XML parameter list string was specified on the commandline.

If this->getParameterList().get()==0 before this function is called then

Postconditions:

Definition at line 224 of file MoochoPack_MoochoThyraSolver.cpp.

void MoochoPack::MoochoThyraSolver::setParameterList ( RCP< Teuchos::ParameterList > const &  paramList  )  [virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 260 of file MoochoPack_MoochoThyraSolver.cpp.

Teuchos::RCP< Teuchos::ParameterList > MoochoPack::MoochoThyraSolver::getParameterList (  )  [virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 316 of file MoochoPack_MoochoThyraSolver.cpp.

Teuchos::RCP< Teuchos::ParameterList > MoochoPack::MoochoThyraSolver::unsetParameterList (  )  [virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 322 of file MoochoPack_MoochoThyraSolver.cpp.

Teuchos::RCP< const Teuchos::ParameterList > MoochoPack::MoochoThyraSolver::getParameterList (  )  const [virtual]

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 330 of file MoochoPack_MoochoThyraSolver.cpp.

Teuchos::RCP< const Teuchos::ParameterList > MoochoPack::MoochoThyraSolver::getValidParameters (  )  const [virtual]

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 336 of file MoochoPack_MoochoThyraSolver.cpp.

void MoochoPack::MoochoThyraSolver::setSolveMode ( const ESolveMode  solveMode  ) 

Definition at line 477 of file MoochoPack_MoochoThyraSolver.cpp.

MoochoThyraSolver::ESolveMode MoochoPack::MoochoThyraSolver::getSolveMode (  )  const

Definition at line 483 of file MoochoPack_MoochoThyraSolver.cpp.

MoochoSolver & MoochoPack::MoochoThyraSolver::getSolver (  ) 

Definition at line 488 of file MoochoPack_MoochoThyraSolver.cpp.

const MoochoSolver & MoochoPack::MoochoThyraSolver::getSolver (  )  const

Definition at line 493 of file MoochoPack_MoochoThyraSolver.cpp.

void MoochoPack::MoochoThyraSolver::setModel ( const RCP< Thyra::ModelEvaluator< value_type > > &  origModel,
const int  p_idx = 0,
const int  g_idx = 0 
)

Definition at line 500 of file MoochoPack_MoochoThyraSolver.cpp.

const Teuchos::RCP< Thyra::ModelEvaluator< value_type > > MoochoPack::MoochoThyraSolver::getOrigModel (  )  const

Definition at line 687 of file MoochoPack_MoochoThyraSolver.cpp.

const Teuchos::RCP< Thyra::ModelEvaluator< value_type > > MoochoPack::MoochoThyraSolver::getOuterModel (  )  const

Definition at line 693 of file MoochoPack_MoochoThyraSolver.cpp.

void MoochoPack::MoochoThyraSolver::readInitialGuess ( std::ostream *  out = NULL  ) 

Definition at line 698 of file MoochoPack_MoochoThyraSolver.cpp.

void MoochoPack::MoochoThyraSolver::setInitialGuess ( const RCP< const Thyra::ModelEvaluatorBase::InArgs< value_type > > &  initialGuess  ) 

Definition at line 764 of file MoochoPack_MoochoThyraSolver.cpp.

void MoochoPack::MoochoThyraSolver::setInitialGuess ( const Thyra::ModelEvaluatorBase::InArgs< value_type > &  initialGuess  ) 

Definition at line 771 of file MoochoPack_MoochoThyraSolver.cpp.

MoochoSolver::ESolutionStatus MoochoPack::MoochoThyraSolver::solve (  ) 

Definition at line 780 of file MoochoPack_MoochoThyraSolver.cpp.

const Thyra::ModelEvaluatorBase::InArgs< value_type > & MoochoPack::MoochoThyraSolver::getFinalPoint (  )  const

Return the final point.

Definition at line 808 of file MoochoPack_MoochoThyraSolver.cpp.

void MoochoPack::MoochoThyraSolver::writeFinalSolution ( std::ostream *  out = NULL  )  const

Write the final solution to a file specified by the parameter list option ???.

Definition at line 813 of file MoochoPack_MoochoThyraSolver.cpp.

void MoochoPack::MoochoThyraSolver::writeParamsFile ( const std::string &  outputXmlFileName = ""  )  const

Write the parameters list for a this object to a file after the parameters are read in order to show defaults and create a new list for input the next time.

If outputXmlFileName!="" then the parameter list with be written to the file outputXmlFileName in XML format. If outputXmlFileName=="", but this->paramsUsedXmlOutFileNameOption()!="" then the parameter list will be written to the file this->paramsUsedXmlOutFileNameOption(). If both outputXmlFileName=="" and this->paramsUsedXmlOutFileNameOption()=="" then no file is written.

Definition at line 841 of file MoochoPack_MoochoThyraSolver.cpp.


Member Data Documentation

MoochoSolver MoochoPack::MoochoThyraSolver::solver_ [private]

Definition at line 306 of file MoochoPack_MoochoThyraSolver.hpp.

RCP<Thyra::ModelEvaluator<value_type> > MoochoPack::MoochoThyraSolver::origModel_ [private]

Definition at line 308 of file MoochoPack_MoochoThyraSolver.hpp.

int MoochoPack::MoochoThyraSolver::p_idx_ [private]

Definition at line 309 of file MoochoPack_MoochoThyraSolver.hpp.

int MoochoPack::MoochoThyraSolver::g_idx_ [private]

Definition at line 310 of file MoochoPack_MoochoThyraSolver.hpp.

Thyra::ParameterDrivenMultiVectorInput<value_type> MoochoPack::MoochoThyraSolver::x_reader_ [mutable, private]

Definition at line 312 of file MoochoPack_MoochoThyraSolver.hpp.

Thyra::ParameterDrivenMultiVectorInput<value_type> MoochoPack::MoochoThyraSolver::p_reader_ [mutable, private]

Definition at line 313 of file MoochoPack_MoochoThyraSolver.hpp.

Thyra::ParameterDrivenMultiVectorInput<value_type> MoochoPack::MoochoThyraSolver::p_l_reader_ [mutable, private]

Definition at line 314 of file MoochoPack_MoochoThyraSolver.hpp.

Thyra::ParameterDrivenMultiVectorInput<value_type> MoochoPack::MoochoThyraSolver::p_u_reader_ [mutable, private]

Definition at line 315 of file MoochoPack_MoochoThyraSolver.hpp.

RCP<Teuchos::ParameterList> MoochoPack::MoochoThyraSolver::paramList_ [private]

Definition at line 317 of file MoochoPack_MoochoThyraSolver.hpp.

RCP<Thyra::DefaultNominalBoundsOverrideModelEvaluator<value_type> > MoochoPack::MoochoThyraSolver::nominalModel_ [private]

Definition at line 320 of file MoochoPack_MoochoThyraSolver.hpp.

RCP<Thyra::DefaultFinalPointCaptureModelEvaluator<value_type> > MoochoPack::MoochoThyraSolver::finalPointModel_ [private]

Definition at line 323 of file MoochoPack_MoochoThyraSolver.hpp.

RCP<Thyra::ModelEvaluator<value_type> > MoochoPack::MoochoThyraSolver::outerModel_ [private]

Definition at line 325 of file MoochoPack_MoochoThyraSolver.hpp.

ESolveMode MoochoPack::MoochoThyraSolver::solveMode_ [private]

Definition at line 327 of file MoochoPack_MoochoThyraSolver.hpp.

ENLPType MoochoPack::MoochoThyraSolver::nlpType_ [private]

Definition at line 328 of file MoochoPack_MoochoThyraSolver.hpp.

bool MoochoPack::MoochoThyraSolver::nonlinearlyElimiateStates_ [private]

Definition at line 329 of file MoochoPack_MoochoThyraSolver.hpp.

bool MoochoPack::MoochoThyraSolver::use_finite_diff_for_obj_ [private]

Definition at line 330 of file MoochoPack_MoochoThyraSolver.hpp.

bool MoochoPack::MoochoThyraSolver::use_finite_diff_for_con_ [private]

Definition at line 331 of file MoochoPack_MoochoThyraSolver.hpp.

double MoochoPack::MoochoThyraSolver::fwd_newton_tol_ [private]

Definition at line 332 of file MoochoPack_MoochoThyraSolver.hpp.

int MoochoPack::MoochoThyraSolver::fwd_newton_max_iters_ [private]

Definition at line 333 of file MoochoPack_MoochoThyraSolver.hpp.

bool MoochoPack::MoochoThyraSolver::fwd_newton_dampening_ [private]

Definition at line 334 of file MoochoPack_MoochoThyraSolver.hpp.

int MoochoPack::MoochoThyraSolver::fwd_newton_max_ls_iters_ [private]

Definition at line 335 of file MoochoPack_MoochoThyraSolver.hpp.

bool MoochoPack::MoochoThyraSolver::useInvObjFunc_ [private]

Definition at line 336 of file MoochoPack_MoochoThyraSolver.hpp.

bool MoochoPack::MoochoThyraSolver::useParameterLumping_ [private]

Definition at line 337 of file MoochoPack_MoochoThyraSolver.hpp.

std::string MoochoPack::MoochoThyraSolver::outputFileTag_ [private]

Definition at line 338 of file MoochoPack_MoochoThyraSolver.hpp.

bool MoochoPack::MoochoThyraSolver::showModelEvaluatorTrace_ [private]

Definition at line 339 of file MoochoPack_MoochoThyraSolver.hpp.

std::string MoochoPack::MoochoThyraSolver::stateSoluFileBase_ [private]

Definition at line 340 of file MoochoPack_MoochoThyraSolver.hpp.

std::string MoochoPack::MoochoThyraSolver::paramSoluFileBase_ [private]

Definition at line 341 of file MoochoPack_MoochoThyraSolver.hpp.


The documentation for this class was generated from the following files:
Generated on Tue Oct 20 12:54:19 2009 for MOOCHO (Single Doxygen Collection) by doxygen 1.4.7