source: src/mg.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.5 KB
Line 
1/**
2 * @file mg.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Mon Apr 18 13:01:13 2011
5 *
6 * @brief Header file for the VMG main class.
7 *
8 */
9
10#ifndef MG_HPP_
11#define MG_HPP_
12
13#include <map>
14
15#include "base/command_factory.hpp"
16#include "base/factory.hpp"
17
18namespace VMG
19{
20
21class Comm;
22class Discretization;
23class Grid;
24class Interface;
25class LevelOperator;
26class Multigrid;
27class Smoother;
28class Solver;
29class Stencil;
30class TempGrid;
31
32class MG
33{
34public:
35 static MG* Instance()
36 {
37 static MG mgs;
38 return &mgs;
39 }
40
41 static void SetInterface(Interface* interface, Comm* comm);
42
43 static VMG::Comm* GetComm();
44 static VMG::Discretization* GetDiscretization();
45 static VMG::Interface* GetInterface();
46 static VMG::LevelOperator* GetLevelOperator();
47 static VMG::Multigrid* GetRhs();
48 static VMG::Multigrid* GetSol();
49 static VMG::Smoother* GetSmoother();
50 static VMG::Solver* GetSolver();
51 static VMG::TempGrid* GetTempGrid();
52 static VMG::Grid* GetGlobalCoarseGrid();
53
54 static VMG::Factory& GetFactory();
55 static VMG::CommandFactory& GetCommands();
56
57 static void InitializeFromParticleConfigFile(const char* filename);
58
59 static void Solve();
60 static void Destroy();
61 static bool IsInitialized();
62
63 static void SetState(const int& key);
64
65private:
66 MG();
67 virtual ~MG();
68
69 void RegisterLibraryCommands();
70
71 vmg_float ComputeVectorNorm(const Multigrid& vec);
72
73 static VMG::CommandFactory command_factory;
74 std::map<int, VMG::Factory> factories;
75 int state;
76};
77
78}
79
80#endif
Note: See TracBrowser for help on using the repository browser.