SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt > Class Template Reference

Base class for one-property rootfinding. More...

#include <solver.h>

Inheritance diagram for SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >:

Inheritance graph
[legend]
Collaboration diagram for SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void setLowerBound (const VaryProp &lowerbound)
virtual void setUpperBound (const VaryProp &upperbound)
void setTarget (const OtherProp &op)
 Set the target property.
void setMainProp (const MainProp &mp)
 Set the 'fixed' parameter in the root finding.
SteamCalculator solve (OtherProp maxerror, VaryProp tol)
 Peform the iterations.

Protected Member Functions

 SolverBase (const MainProp &mp, const OtherProp &op)
 Create the solver and assign fixed and target properties.
virtual ~SolverBase ()
virtual void setVaryProp (const VaryProp &vp)=0
OtherProp getError_vp (const VaryProp &vp)

Protected Attributes

OtherProp op
MainProp mp
SteamCalculator S
VaryProp lowerbound
VaryProp upperbound


Detailed Description

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
class SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >

Base class for one-property rootfinding.

Parameters:
MainProp fixed value
OtherProp target value
VaryProp value which is varied unti OtherProp has desired value
Note that dimensionally some properties are equivalent, for example specific internal energy and specific enthalpy. In these cases you need to use the OtherPropAlt template parameter to specify which one you want. Values of this parameter are defined in common.h, such as SOLVE_ENTHALPY and SOLVE_IENERGY, etc.

See SteamProperty


Constructor & Destructor Documentation

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::SolverBase ( const MainProp &  mp,
const OtherProp &  op 
) [inline, protected]

Create the solver and assign fixed and target properties.

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
virtual SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::~SolverBase (  )  [inline, protected, virtual]


Member Function Documentation

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
virtual void SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::setLowerBound ( const VaryProp &  lowerbound  )  [inline, virtual]

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
virtual void SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::setUpperBound ( const VaryProp &  upperbound  )  [inline, virtual]

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
void SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::setTarget ( const OtherProp &  op  )  [inline]

Set the target property.

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
void SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::setMainProp ( const MainProp &  mp  )  [inline]

Set the 'fixed' parameter in the root finding.

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
SteamCalculator SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::solve ( OtherProp  maxerror,
VaryProp  tol 
) [inline]

Peform the iterations.

Parameters:
maxerror Seek value of OtherProp to within this maximum error
tol Stop iterating when steps of VaryProp are less than this
Returns:
SteamCalculator containing state of steam with the desired conditions of (MainProp,OtherProp)

Referenced by B13Curve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve().

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
virtual void SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::setVaryProp ( const VaryProp &  vp  )  [protected, pure virtual]

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
OtherProp SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::getError_vp ( const VaryProp &  vp  )  [inline, protected]


Member Data Documentation

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
OtherProp SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::op [protected]

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
MainProp SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::mp [protected]

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
SteamCalculator SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::S [protected]

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
VaryProp SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::lowerbound [protected]

template<class MainProp, class OtherProp, class VaryProp, int MainPropAlt, int OtherPropAlt, int VaryPropAlt>
VaryProp SolverBase< MainProp, OtherProp, VaryProp, MainPropAlt, OtherPropAlt, VaryPropAlt >::upperbound [protected]


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

Generated on Tue Feb 10 18:37:37 2009 for freesteam by  doxygen 1.5.6