00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _FRAMETL_SIMPLE_ELLIPTIC_EQUATION_PARALLEL_H
00011 #define _FRAMETL_SIMPLE_ELLIPTIC_EQUATION_PARALLEL_H
00012
00013 #include <aggregated_frame.h>
00014 #include <numerics/bvp.h>
00015 #include <adaptive/compression.h>
00016 #include <interval/i_index.h>
00017 #include <galerkin/infinite_preconditioner.h>
00018 #include <frame_support.h>
00019 #include <index1D.h>
00020
00021 using FrameTL::AggregatedFrame;
00022 using MathTL::EllipticBVP;
00023 using WaveletTL::CompressionStrategy;
00024 using WaveletTL::IntervalIndex;
00025 using WaveletTL::FullyDiagonalEnergyNormPreconditioner;
00026
00027 namespace FrameTL
00028 {
00029
00070 template <class IBASIS, unsigned int DIM>
00071 class SimpleEllipticEquation
00072
00073 : public FullyDiagonalEnergyNormPreconditioner<typename AggregatedFrame<IBASIS,DIM>::Index>
00074 {
00075 public:
00076
00085 SimpleEllipticEquation(const EllipticBVP<DIM>* ell_bvp,
00086 const AggregatedFrame<IBASIS,DIM>* frame,
00087 const int jmax);
00088
00089
00093 typedef AggregatedFrame<IBASIS,DIM> Frame;
00094
00099 typedef AggregatedFrame<IBASIS,DIM> WaveletBasis;
00100
00104 typedef typename Frame::Index Index;
00105
00109 const AggregatedFrame<IBASIS,DIM>& frame() const { return *frame_; }
00110
00114 const EllipticBVP<DIM>& get_bvp() const { return *ell_bvp_; }
00115
00120 const AggregatedFrame<IBASIS,DIM>& basis() const { return *frame_; }
00121
00125 static const int space_dimension = DIM;
00126
00130 static bool local_operator() { return true; }
00131
00135 double operator_order() const { return 1; }
00136
00140 double D(const typename AggregatedFrame<IBASIS,DIM>::Index& lambda) const;
00141
00145 void rescale(InfiniteVector<double, typename AggregatedFrame<IBASIS,DIM>::Index>& coeffs,
00146 const int n) const;
00147
00151 double a(const typename AggregatedFrame<IBASIS,DIM>::Index& lambda,
00152 const typename AggregatedFrame<IBASIS,DIM>::Index& nu) const;
00153
00157 double norm_A() const;
00158
00159
00166 double norm_Ainv() const { return normAinv; };
00167
00171 void set_norm_A(const double _normA) { normA = _normA; }
00172
00176 void set_Ainv(const double nAinv) { normAinv = nAinv; };
00177
00181 double s_star() const;
00182
00187 double alphak(const unsigned int k) const {
00188
00189 return 2.*norm_A();
00190 }
00191
00195 double f(const typename AggregatedFrame<IBASIS,DIM>::Index& lambda) const;
00196
00201 void RHS(const double eta, InfiniteVector<double,
00202 typename AggregatedFrame<IBASIS,DIM>::Index>& coeffs) const;
00203
00208 void RHS(const double eta, const int p,
00209 InfiniteVector<double,
00210 typename AggregatedFrame<IBASIS,DIM>::Index>& coeffs) const;
00211
00215 double F_norm_local(const int patch) const { return sqrt(fnorms_sqr_patch); }
00216
00220 void set_bvp(const EllipticBVP<DIM>*);
00221
00226 void add_level (const Index& lambda,
00227 InfiniteVector<double, Index>& w, const int j,
00228 const double factor,
00229 const int J,
00230 const CompressionStrategy strategy) const;
00231
00232 protected:
00233
00237 const EllipticBVP<DIM>* ell_bvp_;
00238
00242 const AggregatedFrame<IBASIS,DIM>* frame_;
00243
00244
00245
00246
00247 typedef std::map<Index1D<IBASIS>,double > Column1D;
00248 typedef std::map<Index1D<IBASIS>,Column1D> One_D_IntegralCache;
00249
00250 mutable One_D_IntegralCache one_d_integrals;
00251
00252
00253 private:
00254
00272 double integrate(const Index1D<IBASIS>& lambda,
00273 const Index1D<IBASIS>& mu,
00274 const int N_Gauss,
00275 const int dir,
00276 const typename CubeBasis<IBASIS,DIM>::Support* supp_lambda,
00277 const typename CubeBasis<IBASIS,DIM>::Support* supp_mu) const;
00278
00280 void compute_rhs();
00281
00283 void compute_diagonal();
00284
00286 const int jmax_;
00287
00289 Array1D<std::pair<typename AggregatedFrame<IBASIS,DIM>::Index, double> > fcoeffs_patch;
00290
00292 Array1D<double> stiff_diagonal;
00293
00295 double fnorm_sqr;
00296
00301 double fnorms_sqr_patch;
00302
00303
00304
00305
00306
00307 mutable double normA, normAinv;
00308 };
00309 }
00310
00311 #include <simple_elliptic_equation_parallel.cpp>
00312
00313 #endif