#include <pcinvfunc.h>
Public Member Functions | |
InvCapPress (Function1D &P, double a, double b, double smax, unsigned N, double Tol) | |
virtual double | operator() (double P, unsigned cmp) const |
virtual | ~InvCapPress () |
Private Attributes | |
Function1D & | _P |
double | _a |
double | _b |
double | _Pmax |
double | _smax |
unsigned | _N |
double | _Tol |
OPointer< BSInverse > | PInv |
OPointer< BSInverse > | PInvL |
OPointer< FInterpolate > | PInvInt |
Definition at line 10 of file pcinvfunc.h.
InvCapPress::InvCapPress | ( | Function1D & | P, | |
double | a, | |||
double | b, | |||
double | smax, | |||
unsigned | N, | |||
double | Tol | |||
) |
Definition at line 3 of file pcinvfunc.cpp.
00004 :_P(P) 00005 { 00006 _a=a; 00007 _b=b; 00008 assert(_a < _b); 00009 _N=N; 00010 _Tol=Tol; 00011 _smax=smax; 00012 _Pmax=_P(_smax); 00013 // build appropriate bisection inverse and its linear interpolate for p on [0,Pmax] 00014 PInv = new BSInverse(_P,_smax,_b,_Tol); 00015 PInvInt = new FInterpolate((*PInv),0.0,_Pmax,_N); 00016 // build bisection inverse for p on (Pmax,infty) 00017 PInvL = new BSInverse(_P,_a,_smax,_Tol); 00018 }
InvCapPress::~InvCapPress | ( | ) | [virtual] |
Definition at line 29 of file pcinvfunc.cpp.
double InvCapPress::operator() | ( | double | P, | |
unsigned | cmp = 0 | |||
) | const [virtual] |
Implements Function1D.
Definition at line 20 of file pcinvfunc.cpp.
00021 { 00022 assert(isInDomain(P,cmp)); 00023 // use interpolation if P <= Pmax 00024 if (P <= _Pmax) return (*PInvInt)(P,cmp); 00025 // use bisection of P > Pmax 00026 return (*PInvL)(P,cmp); 00027 }
double InvCapPress::_a [private] |
Definition at line 17 of file pcinvfunc.h.
double InvCapPress::_b [private] |
Definition at line 17 of file pcinvfunc.h.
unsigned InvCapPress::_N [private] |
Definition at line 21 of file pcinvfunc.h.
Function1D& InvCapPress::_P [private] |
Definition at line 13 of file pcinvfunc.h.
double InvCapPress::_Pmax [private] |
Definition at line 18 of file pcinvfunc.h.
double InvCapPress::_smax [private] |
Definition at line 20 of file pcinvfunc.h.
double InvCapPress::_Tol [private] |
Definition at line 22 of file pcinvfunc.h.
OPointer<BSInverse> InvCapPress::PInv [private] |
Definition at line 24 of file pcinvfunc.h.
OPointer<FInterpolate> InvCapPress::PInvInt [private] |
Definition at line 29 of file pcinvfunc.h.
OPointer<BSInverse> InvCapPress::PInvL [private] |
Definition at line 24 of file pcinvfunc.h.