00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef __INTERPOLANT_HPP
00032 #define __INTERPOLANT_HPP
00033
00034 #include "libecs.hpp"
00035
00036 namespace libecs
00037 {
00038
00039 class Interpolant
00040 {
00041 friend class libecs::Stepper;
00042
00043
00044 public:
00045
00046 class VariablePtrCompare
00047 {
00048 public:
00049 bool operator()( InterpolantCptr const aLhs,
00050 InterpolantCptr const aRhs ) const
00051 {
00052 return compare( aLhs->getVariable(), aRhs->getVariable() );
00053 }
00054
00055 bool operator()( InterpolantCptr const aLhs,
00056 VariableCptr const aRhs ) const
00057 {
00058 return compare( aLhs->getVariable(), aRhs );
00059 }
00060
00061 bool operator()( VariableCptr const aLhs,
00062 InterpolantCptr const aRhs ) const
00063 {
00064 return compare( aLhs, aRhs->getVariable() );
00065 }
00066
00067 private:
00068
00069
00070 inline static bool compare( VariableCptr const aLhs,
00071 VariableCptr const aRhs )
00072 {
00073 if( aLhs < aRhs )
00074 {
00075 return true;
00076 }
00077 else
00078 {
00079 return false;
00080 }
00081 }
00082
00083
00084 };
00085
00086
00087 ECELL_API Interpolant( VariablePtr const aVariable );
00088
00089 ECELL_API virtual ~Interpolant();
00090
00091 virtual
00092 const Real getVelocity( RealParam aTime ) const
00093 {
00094 return 0.0;
00095 }
00096
00097 virtual
00098 const Real getDifference( RealParam aTime, RealParam anInterval ) const
00099 {
00100 return 0.0;
00101 }
00102
00103 VariablePtr const getVariable() const
00104 {
00105 return theVariable;
00106 }
00107
00108 private:
00109
00110 VariablePtr const theVariable;
00111
00112 };
00113
00114
00115 DECLARE_VECTOR( InterpolantPtr, InterpolantVector );
00116
00117 }
00118
00119
00120
00121 #endif
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131