source: src/grid/multigrid.hpp@ dfed1c

Last change on this file since dfed1c was dfed1c, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Major vmg update.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1136 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/**
2 * @file multigrid.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Apr 18 12:54:51 2011
5 *
6 * @brief VMG::Multigrid
7 *
8 */
9
10#ifndef MULTIGRID_HPP_
11#define MULTIGRID_HPP_
12
13#include <vector>
14
15#include "base/object.hpp"
16#include "grid/grid_properties.hpp"
17
18namespace VMG
19{
20
21class Comm;
22class Grid;
23class Index;
24class Interface;
25
26class Multigrid : public Object
27{
28public:
29 Multigrid(Comm* comm, const Interface* interface);
30
31 virtual ~Multigrid();
32
33 Grid& operator()() {return *grids[levelIndex];}
34 Grid& operator()(const int& level) {return *grids[levelMax-level];}
35
36 const Grid& operator()() const {return *grids[levelIndex];}
37 const Grid& operator()(const int& level) const {return *grids[levelMax-level];}
38
39 const int& Level() const {return levelCurrent;} ///< Current level
40 int LevelIndex() const {return levelMax-levelCurrent;} ///< Index of current level
41
42 const int& GlobalMaxLevel() const {return levelGlobalMax;}
43 const int& MaxLevel() const {return levelMax;} ///< Maximum level
44 const int& MinLevel() const {return levelMin;} ///< Minimum level
45 const int& NumLevels() const {return numLevels;} ///< Number of levels
46
47 void SetLevel(int level);
48
49 void ToCoarserLevel(); ///< Switch to next coarser level if possible
50 void ToFinerLevel(); ///< Switch to next finer level if possible
51
52 void ClearAll(); ///< Overwrites all grid points with zeros
53 void ClearAllCoarseLevels(); ///< Overwrites all grid points on all levels except the finest one with zeros
54
55 void SetCoarserDirichletValues();
56
57protected:
58
59 std::vector<Grid*> grids;
60
61 int levelGlobalMax, levelMin, levelMax;
62 int levelIndex, levelCurrent;
63 int numLevels;
64};
65
66}
67
68#endif /* MULTIGRID_HPP_ */
Note: See TracBrowser for help on using the repository browser.