| [fcf7f6] | 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 |
|
|---|
| [48b662] | 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 |
|
|---|
| [dfed1c] | 31 | #include <map>
|
|---|
| 32 |
|
|---|
| 33 | #include "base/command_factory.hpp"
|
|---|
| [48b662] | 34 | #include "base/factory.hpp"
|
|---|
| 35 |
|
|---|
| 36 | namespace VMG
|
|---|
| 37 | {
|
|---|
| 38 |
|
|---|
| 39 | class Comm;
|
|---|
| [b57b9b] | 40 | class Cycle;
|
|---|
| [48b662] | 41 | class Discretization;
|
|---|
| [dfed1c] | 42 | class Grid;
|
|---|
| [48b662] | 43 | class Interface;
|
|---|
| 44 | class LevelOperator;
|
|---|
| 45 | class Multigrid;
|
|---|
| 46 | class Smoother;
|
|---|
| 47 | class Solver;
|
|---|
| 48 | class Stencil;
|
|---|
| 49 | class TempGrid;
|
|---|
| 50 |
|
|---|
| 51 | class MG
|
|---|
| 52 | {
|
|---|
| 53 | public:
|
|---|
| 54 | static MG* Instance()
|
|---|
| 55 | {
|
|---|
| 56 | static MG mgs;
|
|---|
| 57 | return &mgs;
|
|---|
| 58 | }
|
|---|
| 59 |
|
|---|
| 60 | static VMG::Comm* GetComm();
|
|---|
| [b57b9b] | 61 | static VMG::Cycle* GetCycle();
|
|---|
| [48b662] | 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();
|
|---|
| [4571da] | 67 | static VMG::Grid& GetRhsMaxLevel();
|
|---|
| 68 | static VMG::Grid& GetSolMaxLevel();
|
|---|
| [48b662] | 69 | static VMG::Smoother* GetSmoother();
|
|---|
| 70 | static VMG::Solver* GetSolver();
|
|---|
| 71 | static VMG::TempGrid* GetTempGrid();
|
|---|
| 72 |
|
|---|
| 73 | static VMG::Factory& GetFactory();
|
|---|
| [dfed1c] | 74 | static VMG::CommandFactory& GetCommands();
|
|---|
| 75 |
|
|---|
| [894a5f] | 76 | static void PostInit();
|
|---|
| [48b662] | 77 | static void Solve();
|
|---|
| 78 | static void Destroy();
|
|---|
| 79 | static bool IsInitialized();
|
|---|
| 80 |
|
|---|
| [dfed1c] | 81 | static void SetState(const int& key);
|
|---|
| 82 |
|
|---|
| [48b662] | 83 | private:
|
|---|
| 84 | MG();
|
|---|
| 85 | virtual ~MG();
|
|---|
| 86 |
|
|---|
| 87 | void RegisterLibraryCommands();
|
|---|
| 88 |
|
|---|
| 89 | vmg_float ComputeVectorNorm(const Multigrid& vec);
|
|---|
| 90 |
|
|---|
| [dfed1c] | 91 | static VMG::CommandFactory command_factory;
|
|---|
| 92 | std::map<int, VMG::Factory> factories;
|
|---|
| 93 | int state;
|
|---|
| [48b662] | 94 | };
|
|---|
| 95 |
|
|---|
| 96 | }
|
|---|
| 97 |
|
|---|
| 98 | #endif
|
|---|