Simbody  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimTK::ProjectOptions Class Reference

Options for the advanced project() methods. More...

#include <System.h>

Public Types

enum  Option {
  None = 0x0000,
  LocalOnly = 0x0001,
  DontThrow = 0x0002,
  UseInfinityNorm = 0x0004,
  ForceProjection = 0x0008,
  ForceFullNewton = 0x0010
}
 

Public Member Functions

 ProjectOptions ()
 Default constructor sets options to their default values. More...
 
 ProjectOptions (Real accuracy)
 This constructor allows the default accuracy to be overridden while leaving all other options at their default values. More...
 
 ProjectOptions (Option opt)
 This constructor creates default options except one setting one non-default Option. More...
 
ProjectOptionsclear ()
 Restore this object to its default-constructed state (no options selected, default accuracy and overshoot). More...
 
ProjectOptionssetRequiredAccuracy (Real accuracy)
 The norm of the constraint errors must be driven to below this value for a project() to be considered successful. More...
 
ProjectOptionssetOvershootFactor (Real overshoot)
 Project will attempt to reach accuracy*overshoot but settle for just accuracy. More...
 
ProjectOptionssetProjectionLimit (Real limit)
 Project will fail immediately if the initial norm is greater than the projection limit, with status FailureToConverge. More...
 
ProjectOptionsclearOption (Option opt)
 Remove a given option from the set. More...
 
ProjectOptionssetOption (Option opt)
 Set a particular option. More...
 
Real getRequiredAccuracy () const
 Return the current value for the required accuracy option. More...
 
Real getOvershootFactor () const
 Return the factor by which a project() method should try to do better than the required accuracy. More...
 
Real getProjectionLimit () const
 Return the maximum norm we're allowed to attempt to correct. More...
 
bool isOptionSet (Option opt) const
 
ProjectOptionsoperator|= (const ProjectOptions &opts)
 
ProjectOptionsoperator&= (const ProjectOptions &opts)
 
ProjectOptionsoperator-= (const ProjectOptions &opts)
 
ProjectOptionsoperator|= (Option opt)
 
ProjectOptionsoperator-= (Option opt)
 

Static Public Member Functions

static Real getDefaultRequiredAccuracy ()
 
static Real getDefaultOvershootFactor ()
 

Detailed Description

Options for the advanced project() methods.

The default is to require project() methods to reduce constraint errors to an RMS norm of 1e-4, while asking them to attempt 10X tighter accuracy if possible.

Member Enumeration Documentation

Enumerator
None 

Take all defaults.

LocalOnly 

This option says we expect the state to be close to a solution already and restricts projection to move downhill in the local vicinity.

This should be used during any continuous integration to prevent erroneous jumps in the state.

DontThrow 

Normally failure to meet the accuracy requirements throws an exception.

This will force the project() method to quietly return bad status instead.

UseInfinityNorm 

Use the stricter infinity (max absolute value) norm rather than the default RMS norm to determine when accuracy has been achieved.

ForceProjection 

Normally a project() method will return immediately after evaluating the norm if it is already at or below the required accuracy.

This option forces it to make at least one iteration.

ForceFullNewton 

A project() method is free to use an out-of-date Jacobian when solving the nonlinear system.

This option forces recalculation of the Jacobian at the start of each iteration.

Constructor & Destructor Documentation

SimTK::ProjectOptions::ProjectOptions ( )
inline

Default constructor sets options to their default values.

SimTK::ProjectOptions::ProjectOptions ( Real  accuracy)
inlineexplicit

This constructor allows the default accuracy to be overridden while leaving all other options at their default values.

If accuracy is nonpositive, the default accuracy will be used.

SimTK::ProjectOptions::ProjectOptions ( Option  opt)
inlineexplicit

This constructor creates default options except one setting one non-default Option.

You can add more with the setOption() method.

Member Function Documentation

ProjectOptions& SimTK::ProjectOptions::clear ( )
inline

Restore this object to its default-constructed state (no options selected, default accuracy and overshoot).

A reference to the newly-cleared object is returned.

ProjectOptions& SimTK::ProjectOptions::setRequiredAccuracy ( Real  accuracy)
inline

The norm of the constraint errors must be driven to below this value for a project() to be considered successful.

Normally an RMS norm is used but you can override that to use an infinity norm instead. If accuracy is nonpositive we'll use the default; see getDefaultRequiredAccuracy().

ProjectOptions& SimTK::ProjectOptions::setOvershootFactor ( Real  overshoot)
inline

Project will attempt to reach accuracy*overshoot but settle for just accuracy.

ProjectOptions& SimTK::ProjectOptions::setProjectionLimit ( Real  limit)
inline

Project will fail immediately if the initial norm is greater than the projection limit, with status FailureToConverge.

ProjectOptions& SimTK::ProjectOptions::clearOption ( Option  opt)
inline

Remove a given option from the set.

Nothing happens if the option wasn't already set.

ProjectOptions& SimTK::ProjectOptions::setOption ( Option  opt)
inline

Set a particular option.

Multiple calls are or'ed together.

Real SimTK::ProjectOptions::getRequiredAccuracy ( ) const
inline

Return the current value for the required accuracy option.

Real SimTK::ProjectOptions::getOvershootFactor ( ) const
inline

Return the factor by which a project() method should try to do better than the required accuracy.

Real SimTK::ProjectOptions::getProjectionLimit ( ) const
inline

Return the maximum norm we're allowed to attempt to correct.

bool SimTK::ProjectOptions::isOptionSet ( Option  opt) const
inline
static Real SimTK::ProjectOptions::getDefaultRequiredAccuracy ( )
inlinestatic
static Real SimTK::ProjectOptions::getDefaultOvershootFactor ( )
inlinestatic
ProjectOptions& SimTK::ProjectOptions::operator|= ( const ProjectOptions opts)
inline
ProjectOptions& SimTK::ProjectOptions::operator&= ( const ProjectOptions opts)
inline
ProjectOptions& SimTK::ProjectOptions::operator-= ( const ProjectOptions opts)
inline
ProjectOptions& SimTK::ProjectOptions::operator|= ( Option  opt)
inline
ProjectOptions& SimTK::ProjectOptions::operator-= ( Option  opt)
inline

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