00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef FILE_SPEEDFUNCTIONS_BASECLASS_HXX
00021
00022
00023 #include "../errors.cxx"
00024 #include <stdio.h>
00025
00026
00027 namespace Multivac
00028 {
00029
00030
00032
00034
00036
00041 template <class T>
00042 class CSpeedFunction
00043 {
00044
00045
00046
00047
00048
00049
00050 protected:
00051
00053 Matrix<T> Values;
00054
00056 bool dependence_position;
00058 bool dependence_time;
00060 bool dependence_normal;
00062 bool dependence_curvature;
00063
00064
00065
00066
00067
00068
00069 public:
00070
00071 CSpeedFunction() throw();
00072
00073 virtual ~CSpeedFunction() throw();
00074
00075
00076
00077
00078
00079
00080 public:
00081
00082 bool IsPositionDependent() const;
00083 bool IsTimeDependent() const;
00084 bool IsNormalDependent() const;
00085 bool IsCurvatureDependent() const;
00086
00087 virtual void Init(CMesh<T>& Mesh) = 0;
00088
00089 Matrix<T>& GetValues();
00090 virtual T operator() (T x, T y, T time) const = 0;
00091 virtual T operator() (T x, T y, T time,
00092 T nx, T ny, T curvature) const = 0;
00093
00094 virtual T GetMaxF1(T Xmin, T Xmax, T Ymin, T Ymax, T norm2) const = 0;
00095 virtual T GetMaxF2(T Xmin, T Xmax, T Ymin, T Ymax, T norm2) const = 0;
00096
00097 virtual T operator() (int i, int j) const;
00098
00099 virtual T GetDerivatives(T x, T y, T nx, T ny, T t,
00100 T& dFdp, T& dFdx, T& dFdy,
00101 T& dFdnx, T& dFdny) const = 0;
00102 virtual T Get2ndDerivatives(T x, T y, T nx, T ny, T t,
00103 T& dFdpdp, T& dFdpdx, T& dFdpdy,
00104 T& dFdpdnx, T& dFdpdny,
00105 T& dFdxdx, T& dFdxdy,
00106 T& dFdxdnx, T& dFdxdny,
00107 T& dFdydy, T& dFdydnx,
00108 T& dFdydny, T& dFdnxdnx,
00109 T& dFdnxdny, T& dFdnydny) const = 0;
00110
00111 virtual void Save(string FFile) const;
00112
00113 };
00114
00115
00116 }
00117
00118
00119 #define FILE_MESHES_BASECLASS_HXX
00120 #endif