| 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 |
|
|---|
| 18 | namespace VMG
|
|---|
| 19 | {
|
|---|
| 20 |
|
|---|
| 21 | class Comm;
|
|---|
| 22 | class Discretization;
|
|---|
| 23 | class Grid;
|
|---|
| 24 | class Interface;
|
|---|
| 25 | class LevelOperator;
|
|---|
| 26 | class Multigrid;
|
|---|
| 27 | class Smoother;
|
|---|
| 28 | class Solver;
|
|---|
| 29 | class Stencil;
|
|---|
| 30 | class TempGrid;
|
|---|
| 31 |
|
|---|
| 32 | class MG
|
|---|
| 33 | {
|
|---|
| 34 | public:
|
|---|
| 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 |
|
|---|
| 65 | private:
|
|---|
| 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.