00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _FRAMETL_POISSON_1D_TESTCASE_H
00011 #define _FRAMETL_POISSON_1D_TESTCASE_H
00012
00013 #include <utils/function.h>
00014 #include <functional.h>
00015 #include <aggregated_frame.h>
00016 #include <geometry/point.h>
00017
00018 using MathTL::Function;
00019 using MathTL::Point;
00020
00021
00022 namespace FrameTL
00023 {
00028 template<class VALUE = double>
00029 class Singularity1D_RHS_2
00030 : public Function<1, VALUE>
00031 {
00032 public:
00033 Singularity1D_RHS_2() {};
00034 virtual ~Singularity1D_RHS_2() {};
00035 VALUE value(const Point<1>& p,
00036 const unsigned int component = 0) const
00037 {
00038 return -sin(3.*M_PI*p[0])*9.*M_PI*M_PI - 4.;
00039 }
00040
00041 void vector_value(const Point<1> &p,
00042 Vector<VALUE>& values) const { ; }
00043 };
00044
00049 template<class VALUE = double>
00050 class Singularity1D_2
00051 : public Function<1, VALUE>
00052 {
00053 public:
00054 Singularity1D_2() {};
00055 virtual ~Singularity1D_2() {};
00056 VALUE value(const Point<1>& p,
00057 const unsigned int component = 0) const
00058 {
00059 if (0. <= p[0] && p[0] < 0.5)
00060 return -sin(3.*M_PI*p[0]) + 2.*p[0]*p[0];
00061
00062 if (0.5 <= p[0] && p[0] <= 1.0)
00063 return -sin(3.*M_PI*p[0]) + 2.*(1-p[0])*(1-p[0]);
00064
00065 return 0.;
00066
00067 }
00068
00069 void vector_value(const Point<1> &p,
00070 Vector<VALUE>& values) const { ; }
00071
00072 };
00073
00078 template<class VALUE = double>
00079 class Singularity1D_2_prime
00080 : public Function<1, VALUE>
00081 {
00082 public:
00083 Singularity1D_2_prime() {};
00084 virtual ~Singularity1D_2_prime() {};
00085 VALUE value(const Point<1>& p,
00086 const unsigned int component = 0) const
00087 {
00088
00089 if (0. <= p[0] && p[0] < 0.5)
00090 return -cos(3.*M_PI*p[0])*3*M_PI + 4.*p[0];
00091
00092 if (0.5 <= p[0] && p[0] <= 1.0)
00093 return -cos(3.*M_PI*p[0])*3*M_PI - 4.*(1-p[0]);
00094
00095 return 0.;
00096
00097 }
00098
00099 void vector_value(const Point<1> &p,
00100 Vector<VALUE>& values) const { ; }
00101
00102 };
00103
00104
00105
00106 }
00107
00108 #endif // _FRAMETL_POISSON_1D_TESTCASE_H