source: src/mg.hpp@ 8180d8

Last change on this file since 8180d8 was a72216, checked in by Olaf Lenz <olenz@…>, 13 years ago

Fixed permissions.

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

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 * vmg - a versatile multigrid solver
3 * Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
4 *
5 * vmg is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * vmg is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/**
20 * @file mg.hpp
21 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
22 * @date Mon Apr 18 13:01:13 2011
23 *
24 * @brief Header file for the VMG main class.
25 *
26 */
27
28#ifndef MG_HPP_
29#define MG_HPP_
30
31#include <map>
32
33#include "base/command_factory.hpp"
34#include "base/factory.hpp"
35
36namespace VMG
37{
38
39class Comm;
40class Cycle;
41class Discretization;
42class Grid;
43class Interface;
44class LevelOperator;
45class Multigrid;
46class Smoother;
47class Solver;
48class Stencil;
49class TempGrid;
50
51class MG
52{
53public:
54 static MG* Instance()
55 {
56 static MG mgs;
57 return &mgs;
58 }
59
60 static VMG::Comm* GetComm();
61 static VMG::Cycle* GetCycle();
62 static VMG::Discretization* GetDiscretization();
63 static VMG::Interface* GetInterface();
64 static VMG::LevelOperator* GetLevelOperator();
65 static VMG::Multigrid* GetRhs();
66 static VMG::Multigrid* GetSol();
67 static VMG::Grid& GetRhsMaxLevel();
68 static VMG::Grid& GetSolMaxLevel();
69 static VMG::Smoother* GetSmoother();
70 static VMG::Solver* GetSolver();
71 static VMG::TempGrid* GetTempGrid();
72
73 static VMG::Factory& GetFactory();
74 static VMG::CommandFactory& GetCommands();
75
76 static void PostInit();
77 static void Solve();
78 static void Destroy();
79 static bool IsInitialized();
80
81 static void SetState(const int& key);
82
83private:
84 MG();
85 virtual ~MG();
86
87 void RegisterLibraryCommands();
88
89 vmg_float ComputeVectorNorm(const Multigrid& vec);
90
91 static VMG::CommandFactory command_factory;
92 std::map<int, VMG::Factory> factories;
93 int state;
94};
95
96}
97
98#endif
Note: See TracBrowser for help on using the repository browser.