00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _FRAMETL_BIHARMONIC_EQUATION_H
00011 #define _FRAMETL_BIHARMONIC_EQUATION_H
00012
00013 #include <aggregated_frame.h>
00014 #include <numerics/bvp.h>
00015 #include <adaptive/compression.h>
00016
00017 #include <galerkin/infinite_preconditioner.h>
00018 #include<index1D.h>
00019 #include <frame_support.h>
00020
00021 using FrameTL::AggregatedFrame;
00022 using MathTL::EllipticBVP;
00023 using WaveletTL::CompressionStrategy;
00024 using WaveletTL::FullyDiagonalEnergyNormPreconditioner;
00025
00026 namespace FrameTL
00027 {
00058 template <class IBASIS, unsigned int DIM>
00059 class BiharmonicEquation
00060
00061 : public FullyDiagonalEnergyNormPreconditioner<typename AggregatedFrame<IBASIS,DIM>::Index>
00062 {
00063 public:
00064
00068 BiharmonicEquation(const BiharmonicBVP<DIM>* bih_bvp,
00069 const AggregatedFrame<IBASIS,DIM>* frame,
00070 const int jmax);
00071
00075 typedef AggregatedFrame<IBASIS,DIM> Frame;
00076
00081 typedef AggregatedFrame<IBASIS,DIM> WaveletBasis;
00082
00086 typedef typename Frame::Index Index;
00087
00091 const AggregatedFrame<IBASIS,DIM>& frame() const { return *frame_; }
00092
00096 const BiharmonicBVP<DIM>& get_bvp() const { return *bih_bvp_; }
00097
00098
00105 const AggregatedFrame<IBASIS,DIM>& basis() const { return *frame_; }
00106
00110 static const int space_dimension = DIM;
00111
00115 static bool local_operator() { return true; }
00116
00120 static double operator_order() { return 2; }
00121
00125 double D(const typename AggregatedFrame<IBASIS,DIM>::Index& lambda) const;
00126
00130 double a(const typename AggregatedFrame<IBASIS,DIM>::Index& lambda,
00131 const typename AggregatedFrame<IBASIS,DIM>::Index& nu) const;
00132
00136 double norm_A() const;
00137
00141 void set_norm_A(const double _normA) { normA = _normA; }
00142
00146 void set_Ainv(const double nAinv) { normAinv = nAinv; };
00147
00151 double s_star() const;
00152
00157 double alphak(const unsigned int k) const {
00158 cout << "works" << endl;
00159 return 2*norm_A();
00160 }
00161
00165 double f(const typename AggregatedFrame<IBASIS,DIM>::Index& lambda) const;
00166
00171 void RHS(const double eta, InfiniteVector<double,
00172 typename AggregatedFrame<IBASIS,DIM>::Index>& coeffs) const;
00173
00177 double F_norm() const { return sqrt(fnorm_sqr); }
00178
00182 void set_bvp(const BiharmonicBVP<DIM>*);
00183
00184
00185 protected:
00186
00190 const BiharmonicBVP<DIM>* bih_bvp_;
00191 const AggregatedFrame<IBASIS,DIM>* frame_;
00192 const int jmax_;
00193
00194
00195
00196
00197 typedef std::map<Index1D<IBASIS>,double > Column1D;
00198 typedef std::map<Index1D<IBASIS>,Column1D> One_D_IntegralCache;
00199
00204 mutable One_D_IntegralCache one_d_integrals;
00205
00206
00207
00208
00209
00210 private:
00211
00214 double integrate(const Index1D<IBASIS>& lambda,
00215 const Index1D<IBASIS>& mu,
00216 const FixedArray1D<Array1D<double>,DIM >& irregular_grid,
00217 const int N_Gauss, const int dir) const;
00218
00219
00220
00221 void compute_rhs(bool b);
00222
00223
00224 void compute_diagonal();
00225
00226
00227
00228 Array1D<std::pair<typename AggregatedFrame<IBASIS,DIM>::Index,double> > fcoeffs;
00229
00230
00231 InfiniteVector<double,typename AggregatedFrame<IBASIS,DIM>::Index> stiff_diagonal;
00232
00233
00234
00235 double fnorm_sqr;
00236
00237 mutable double normA, normAinv;
00238
00239 };
00240 }
00241
00242 #include <biharmonic_equation.cpp>
00243
00244 #endif