MathTL
numerics/corner_singularity.h
00001 // -*- c++ -*-
00002 
00003 // +--------------------------------------------------------------------+
00004 // | This file is part of MathTL - the Mathematical Template Library    |
00005 // |                                                                    |
00006 // | Copyright (c) 2002-2009                                            |
00007 // | Thorsten Raasch, Manuel Werner                                     |
00008 // +--------------------------------------------------------------------+
00009 
00010 #ifndef _MATHTL_CORNER_SINGULARITY_H
00011 #define _MATHTL_CORNER_SINGULARITY_H
00012 
00013 #include <geometry/point.h>
00014 #include <utils/function.h>
00015 
00016 namespace MathTL
00017 {
00036   class CornerSingularity
00037     : public Function<2>
00038   {
00039   public:
00045     CornerSingularity(const Point<2>& x0,
00046                       const double theta0,
00047                       const double omega,
00048                       const double r0 = 0.01,
00049                       const double r1 = 0.99);
00050 
00052     virtual ~CornerSingularity() {}
00053 
00055     double value(const Point<2>& x, const unsigned int component = 0) const;
00056 
00058     void vector_value(const Point<2>& p, Vector<double>& values) const;
00059     
00060   protected:
00062     Point<2> x0;
00063 
00065     double theta0;
00066 
00068     double omega;
00069 
00071     double r0, r1;
00072 
00074     double zeta(const double r) const;
00075   };
00076 
00082   class CornerSingularityRHS
00083     : public Function<2>
00084   {
00085   public:
00091     CornerSingularityRHS(const Point<2>& x0,
00092                          const double theta0,
00093                          const double omega,
00094                          const double r0 = 0.01,
00095                          const double r1 = 0.99);
00096     
00098     virtual ~CornerSingularityRHS() {}
00099 
00101     double value(const Point<2>& x, const unsigned int component = 0) const;
00102 
00104     void vector_value(const Point<2>& p, Vector<double>& values) const;
00105     
00106   protected:
00108     Point<2> x0;
00109 
00111     double theta0;
00112 
00114     double omega;
00115 
00117     double r0, r1;
00118 
00120     double zeta(const double r) const;
00121 
00123     double zeta_prime(const double r) const;
00124 
00126     double zeta_primeprime(const double r) const;
00127   };
00128 
00134   class CornerSingularityGradient
00135     : public Function<2>
00136   {
00137   public:
00143     CornerSingularityGradient(const Point<2>& x0,
00144                               const double theta0,
00145                               const double omega,
00146                               const double r0 = 0.01,
00147                               const double r1 = 0.99);
00148     
00150     virtual ~CornerSingularityGradient() {}
00151 
00153     double value(const Point<2>& x, const unsigned int component = 0) const;
00154 
00156     void vector_value(const Point<2>& p, Vector<double>& values) const;
00157     
00158   protected:
00160     Point<2> x0;
00161 
00163     double theta0;
00164 
00166     double omega;
00167 
00169     double r0, r1;
00170 
00172     double zeta(const double r) const;
00173 
00175     double zeta_prime(const double r) const;
00176 
00177   };
00178 
00194   class CornerTimeSingularity
00195     : public Function<2>
00196   {
00197   public:
00203     CornerTimeSingularity(const Point<2>& x0,
00204                           const double theta0,
00205                           const double omega);
00206 
00208     virtual ~CornerTimeSingularity() {}
00209 
00211     double value(const Point<2>& x, const unsigned int component = 0) const;
00212 
00214     void vector_value(const Point<2>& p, Vector<double>& values) const;
00215     
00216   protected:
00218     Point<2> x0;
00219 
00221     double theta0;
00222 
00224     double omega;
00225   };
00226 
00230   class CornerTimeSingularityRHS
00231     : public Function<2>
00232   {
00233   public:
00239     CornerTimeSingularityRHS(const Point<2>& x0,
00240                              const double theta0,
00241                              const double omega);
00242 
00244     virtual ~CornerTimeSingularityRHS() {}
00245 
00247     double value(const Point<2>& x, const unsigned int component = 0) const;
00248 
00250     void vector_value(const Point<2>& p, Vector<double>& values) const;
00251     
00252   protected:
00254     Point<2> x0;
00255 
00257     double theta0;
00258 
00260     double omega;
00261   };
00262 
00266   class CornerTimeSingularityRHSt
00267     : public Function<2>
00268   {
00269   public:
00275     CornerTimeSingularityRHSt(const Point<2>& x0,
00276                               const double theta0,
00277                               const double omega);
00278 
00280     virtual ~CornerTimeSingularityRHSt() {}
00281     
00283     double value(const Point<2>& x, const unsigned int component = 0) const;
00284     
00286     void vector_value(const Point<2>& p, Vector<double>& values) const;
00287     
00288   protected:
00290     Point<2> x0;
00291 
00293     double theta0;
00294 
00296     double omega;
00297   };
00298 
00299 }
00300 
00301 // implementations of inline functions
00302 #include "numerics/corner_singularity.cpp"
00303 
00304 #endif
 All Classes Functions Variables Typedefs Enumerations