Function1D Class Reference

#include <sfunctions.h>

Inheritance diagram for Function1D:
Inheritance graph
[legend]
Collaboration diagram for Function1D:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Function1D (unsigned n_components=1)
virtual double operator() (double dd, unsigned cmp=0) const =0
virtual bool isInDomain (double dd, unsigned component=0) const
virtual double getMaxNorm (double a, double b) const
virtual double operator() (const VecDouble &p, unsigned int component=0) const
virtual bool isInDomain (const VecDouble &p, unsigned component=0) const
virtual void getMinMaxValues (double a, double b, double &min, double &max) const
virtual ~Function1D ()
void plot (std::ostream &out, double a, double b, unsigned nPoints, unsigned cmp=0)
void evaluate (VecDouble &v)

Detailed Description

Definition at line 58 of file sfunctions.h.


Constructor & Destructor Documentation

Function1D::Function1D ( unsigned  n_components = 1  )  [inline]

Definition at line 61 of file sfunctions.h.

virtual Function1D::~Function1D (  )  [inline, virtual]

Definition at line 93 of file sfunctions.h.

00094     {
00095 
00096     }


Member Function Documentation

void Function1D::evaluate ( VecDouble v  )  [inline]

Definition at line 108 of file sfunctions.h.

00109     {
00110       for (unsigned i=0;i<v.size();i++)
00111       {
00112         v(i)=this->operator()(v(i));
00113       }
00114 
00115     }

virtual double Function1D::getMaxNorm ( double  a,
double  b 
) const [inline, virtual]

Reimplemented in DFChaventMobility.

Definition at line 67 of file sfunctions.h.

00068   {
00069     double min,max;
00070     getMinMaxValues(a,b,min,max);
00071     return std::max(fabs(min),fabs(max));
00072   }

virtual void Function1D::getMinMaxValues ( double  a,
double  b,
double &  min,
double &  max 
) const [inline, virtual]

Reimplemented in DFBucleyLeverettGravityMob, DFChaventMobility, DFLinearMobilityProduct, FBucleyLeverettGravityMob, FChaventMobility, FDFractionalLinearMobility, and FLinear.

Definition at line 86 of file sfunctions.h.

00087     {
00088       min=max=NAN;
00089       throw new Exception("Function1D::getMinMaxValues(%g,%g) = Warning: Invalid Base Method called\n",a,b);
00090       return;
00091     }

virtual bool Function1D::isInDomain ( const VecDouble p,
unsigned  component = 0 
) const [inline, virtual]

Reimplemented from GeneralFunctionInterface.

Definition at line 79 of file sfunctions.h.

00080   {
00081     return this->isInDomain(p(0),component);
00082   }

virtual bool Function1D::isInDomain ( double  dd,
unsigned  component = 0 
) const [inline, virtual]

Reimplemented in FInterpolate.

Definition at line 64 of file sfunctions.h.

00064 {return true;}

virtual double Function1D::operator() ( const VecDouble p,
unsigned int  component = 0 
) const [inline, virtual]

Implements GeneralFunctionInterface.

Definition at line 74 of file sfunctions.h.

00075     {
00076       return (*this)(p(0),component);
00077     }

virtual double Function1D::operator() ( double  dd,
unsigned  cmp = 0 
) const [pure virtual]
void Function1D::plot ( std::ostream &  out,
double  a,
double  b,
unsigned  nPoints,
unsigned  cmp = 0 
) [inline]

Definition at line 98 of file sfunctions.h.

00099     {
00100       assert(a<b);
00101       double dx = (b-a)/nPoints;
00102       double x=a;
00103       for (unsigned i=0;i<nPoints;i++,x+=dx)
00104       {
00105         out << x << " " << (*this)(x,cmp) << std::endl;
00106       }
00107     }


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Sun Apr 8 23:13:09 2012 for CO2INJECTION by  doxygen 1.6.3