00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _FRAMETL_SIMPLE_BIHARMONIC_EQUATION_H
00011 #define _FRAMETL_SIMPLE_BIHARMONIC_EQUATION_H
00012
00013 #include <aggregated_frame.h>
00014 #include <functional.h>
00015 #include <adaptive/compression.h>
00016 #include <galerkin/infinite_preconditioner.h>
00017 #include <index1D.h>
00018 #include <frame_support.h>
00019
00020 using FrameTL::AggregatedFrame;
00021 using WaveletTL::CompressionStrategy;
00022 using WaveletTL::FullyDiagonalEnergyNormPreconditioner;
00023
00024 namespace FrameTL
00025 {
00026
00027
00066 template <class IBASIS, unsigned int DIM>
00067 class SimpleBiharmonicEquation
00068
00069 : public FullyDiagonalEnergyNormPreconditioner<typename AggregatedFrame<IBASIS,DIM>::Index>
00070 {
00071 public:
00072
00081 SimpleBiharmonicEquation(const Functional<IBASIS,DIM>* rhs,
00082 const AggregatedFrame<IBASIS,DIM>* frame,
00083 const int jmax);
00084
00088 typedef AggregatedFrame<IBASIS,DIM> Frame;
00089
00094 typedef AggregatedFrame<IBASIS,DIM> WaveletBasis;
00095
00096
00100 typedef typename Frame::Index Index;
00101
00105 const AggregatedFrame<IBASIS,DIM>& frame() const { return *frame_; }
00106
00110 const Functional<IBASIS,DIM>& get_rhs() const { return *rhs_; }
00111
00116 const AggregatedFrame<IBASIS,DIM>& basis() const { return *frame_; }
00117
00121 static const int space_dimension = DIM;
00122
00126 static bool local_operator() { return true; }
00127
00131 static double operator_order() { return 2; }
00132
00136 double D(const typename AggregatedFrame<IBASIS,DIM>::Index& lambda) const;
00137
00141 double a(const typename AggregatedFrame<IBASIS,DIM>::Index& lambda,
00142 const typename AggregatedFrame<IBASIS,DIM>::Index& nu) const;
00143
00147 double norm_A() const;
00148
00152 void set_norm_A(const double _normA) { normA = _normA; }
00153
00160 void set_Ainv(const double nAinv) { normAinv = nAinv; };
00161
00165 double s_star() const;
00166
00171 double alphak(const unsigned int k) const {
00172 cout << "works" << endl;
00173 return 2*norm_A();
00174 }
00175
00179 double f(const typename AggregatedFrame<IBASIS,DIM>::Index& lambda) const;
00180
00185 void RHS(const double eta, InfiniteVector<double,
00186 typename AggregatedFrame<IBASIS,DIM>::Index>& coeffs) const;
00187
00192 void RHS(const double eta, const int p,
00193 InfiniteVector<double,
00194 typename AggregatedFrame<IBASIS,DIM>::Index>& coeffs) const;
00195
00199 double F_norm() const { return sqrt(fnorm_sqr); }
00200
00201
00202 protected:
00203
00205 const Functional<IBASIS,DIM>* rhs_;
00206
00208 const AggregatedFrame<IBASIS,DIM>* frame_;
00209
00211 const int jmax_;
00212
00213
00214
00215
00216 typedef std::map<Index1D<IBASIS>,double > Column1D;
00217 typedef std::map<Index1D<IBASIS>,Column1D> One_D_IntegralCache;
00218
00219 mutable One_D_IntegralCache one_d_integrals;
00220
00221
00222 private:
00223
00239 double integrate(const Index1D<IBASIS>& lambda,
00240 const Index1D<IBASIS>& mu,
00241 const FixedArray1D<Array1D<double>,DIM >& irregular_grid,
00242 const int N_Gauss, const int dir) const;
00243
00244
00246 void compute_rhs();
00247
00249 void compute_diagonal();
00250
00251
00253 Array1D<std::pair<typename AggregatedFrame<IBASIS,DIM>::Index,double> > fcoeffs;
00254
00256 Array1D<Array1D<std::pair<typename AggregatedFrame<IBASIS,DIM>::Index,double> > > fcoeffs_patch;
00257
00259 Array1D<double> stiff_diagonal;
00260
00262 double fnorm_sqr;
00263
00268 Array1D<double> fnorms_sqr_patch;
00269
00270
00271
00272
00273
00274 mutable double normA, normAinv;
00275
00276 };
00277 }
00278
00279 #include <simple_biharmonic_equation.cpp>
00280
00281 #endif // _FRAMETL_SIMPLE_BIHARMONIC_EQUATION_H