Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

app-bholger/gfem/karniadakis.h
Go to the documentation of this file.
00001 #pragma once
00002 #include "basics/typedefs.hh"
00003 #include "polyCoeff.h"
00004 #include <memory>
00005 #include "stdio.h"
00006 #include "assert.h"
00007 #include "algorithm"
00008 #include <vector>
00009 
00010 namespace concepts {
00011 
00012 class KarniadakisCoeffs {
00013 private:
00014   KarniadakisCoeffs();
00015   ~KarniadakisCoeffs();
00016 
00017   KarniadakisCoeffs& operator=(const KarniadakisCoeffs& other);
00018 
00019 public:
00020   KarniadakisCoeffs(const KarniadakisCoeffs& other);
00021   KarniadakisCoeffs(const KarniadakisCoeffs& other, int nper);
00022 
00023   static KarniadakisCoeffs& getInstance() {
00024     return g_instance; 
00025   }
00026 
00027   void reinit(int n);
00028 
00029   int size() const {
00030     return kcoeffs.size();
00031   }
00032 
00036   const PolyCoeff& getCoeffs(int i) const {
00037     return *kcoeffs[i];
00038   }
00039 
00043   const PolyCoeff& getCoeffsD(int i) const {
00044     return *kcoeffsD[i];
00045   }
00046 
00047   const PolyCoeff& getCoeffs(int i, int i_diff) const {
00048     if(i_diff == 1)
00049       return getCoeffs(i);
00050     return getCoeffsD(i);
00051   }
00052 
00053   static const int SELMAC = 0;
00054 
00058   const PolyCoeff& getCoeffs(int i, int i_diff, int i_comp, int i_sel) const {
00059     assert(i < size()); 
00060     if(i_diff == SELMAC && i_comp == i_sel) 
00061       return getCoeffsD(i);
00062     return getCoeffs(i);
00063 
00064   }
00065 
00069   const PolyCoeff& getJacobiCoeffs(int i) const {
00070     return *pJacobi[i];
00071   }
00072 
00073 
00074 private:
00075   static KarniadakisCoeffs g_instance;
00076   std::vector<PolyCoeff*> kcoeffs;
00077   std::vector<PolyCoeff*> kcoeffsD;
00078   std::vector<PolyCoeff*> pJacobi;
00079 };
00080 
00081 } // namespace

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)