![]() |
00001 // Copyright (C) 2004 Andreas Mark and Andreas Nilsson. 00002 // Licensed under the GNU GPL Version 2. 00003 // 00004 // Modified by Anders Logg, 2004. 00005 00006 #ifndef __MULTIGRID_SOLVER_H 00007 #define __MULTIGRID_SOLVER_H 00008 00009 namespace dolfin 00010 { 00011 class MeshHierarchy; 00012 class Matrix; 00013 class Vector; 00014 00018 00019 class MultigridSolver { 00020 public: 00021 00022 static void solve(PDE& pde, Vector& x, MeshHierarchy& meshes); 00023 static void solve(PDE& pde, Vector& x, Mesh& mesh); 00024 static void solve(PDE& pde, Vector& x, Mesh& mesh, unsigned int refinements); 00025 00026 private: 00027 00028 typedef NewArray<Matrix> Matrices; 00029 typedef NewArray<Vector> Vectors; 00030 00037 static void mainIteration(PDE& poisson, Vector& x, const MeshHierarchy& meshes); 00038 00042 static void fullVCycle(Vector& x, const Vector& r_fine, const MeshHierarchy& meshes, 00043 const Matrices& A); 00044 00054 static void vCycle(Vector& x, const Vector& rhs, const MeshHierarchy& meshes, 00055 const Matrices& A, unsigned int level); 00056 00059 static void smooth(Vector& x, const Vector& rhs, unsigned int noSmooths, 00060 const Matrices& A, unsigned int level); 00061 00063 static void restrict(Vector& x, const MeshHierarchy& meshes, unsigned int level); 00064 00066 static void interpolate(Vector& x, const MeshHierarchy& meshes, unsigned int level); 00067 00068 }; 00069 00070 } 00071 00072 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.