diracrighthandside.h

Go to the documentation of this file.
00001 #ifndef __DiracRightHandSide_h
00002 #define __DiracRightHandSide_h
00003 
00004 #include  <vector>
00005 #include  "application.h"
00006 #include  "vertex.h"
00007 
00008 /**********************************************************/
00009 
00010 namespace Gascoigne
00011 {
00012   class DiracRightHandSide : public virtual Application
00013   {
00014     private:
00015 
00016     protected:
00017       std::vector<Vertex2d>  _v2d;
00018       std::vector<Vertex3d>  _v3d;
00019       
00020       std::vector<int>  _comps;
00021     
00022     public:
00023       DiracRightHandSide() { }
00024       virtual ~DiracRightHandSide() { }
00025 
00026       virtual void BasicInit(const std::vector<Vertex2d>& v2d, const std::vector<int>& comps) {
00027         _v2d=v2d;
00028         _comps=comps;
00029       }
00030       virtual void BasicInit(const std::vector<Vertex3d>& v3d, const std::vector<int>& comps) {
00031         _v3d=v3d;
00032         _comps=comps;
00033       }
00034   
00035       virtual const std::vector<Vertex2d>& GetPoints2d() const {
00036         return _v2d;
00037       }
00038       virtual const std::vector<Vertex3d>& GetPoints3d() const {
00039         return _v3d;
00040       }
00041   
00042       virtual const std::vector<int>& GetComps() const {
00043         return _comps;
00044       }
00045 
00046       virtual double operator()(int i, const Vertex2d& v) const {
00047         std::cerr << "\"DiracRightHandSide::operator()\" not written!" << std::endl;
00048         abort();
00049       }
00050       virtual double operator()(int i, const Vertex3d& v) const {
00051         std::cerr << "\"DiracRightHandSide::operator()\" not written!" << std::endl;
00052         abort();
00053       }
00054 
00055       virtual void operator()(int i, VectorIterator b, const TestFunction& N, const Vertex2d& v) const {
00056         b[_comps[i]] += N.m()* (*this)(i,v);
00057       }
00058       virtual void operator()(int i, VectorIterator b, const TestFunction& N, const Vertex3d& v) const {
00059         b[_comps[i]] += N.m()* (*this)(i,v);
00060       }
00061   };
00062 
00063   typedef DiracRightHandSide DiracInitialCondition;
00064 
00065 /**********************************************************/
00066 
00067 }
00068 
00069 #endif

Generated on Thu Sep 14 10:34:36 2006 for Gascoigne by  doxygen 1.4.7