| 1 | /**
|
|---|
| 2 | * @file comm_serial.hpp
|
|---|
| 3 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 4 | * @date Mon Apr 18 12:28:29 2011
|
|---|
| 5 | *
|
|---|
| 6 | * @brief VMG::CommSerial
|
|---|
| 7 | *
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 | #ifndef COMM_SERIAL_HPP_
|
|---|
| 11 | #define COMM_SERIAL_HPP_
|
|---|
| 12 |
|
|---|
| 13 | #include <fstream>
|
|---|
| 14 | #include <map>
|
|---|
| 15 |
|
|---|
| 16 | #include "comm/comm.hpp"
|
|---|
| 17 | #include "comm/domain_decomposition_serial.hpp"
|
|---|
| 18 |
|
|---|
| 19 | namespace VMG
|
|---|
| 20 | {
|
|---|
| 21 |
|
|---|
| 22 | class DomainDecomposition;
|
|---|
| 23 | class Grid;
|
|---|
| 24 | class Multigrid;
|
|---|
| 25 |
|
|---|
| 26 | class CommSerial : public Comm
|
|---|
| 27 | {
|
|---|
| 28 | public:
|
|---|
| 29 | CommSerial(const Boundary& boundary) :
|
|---|
| 30 | Comm(boundary, new DomainDecompositionSerial())
|
|---|
| 31 | {
|
|---|
| 32 | InitCommSerial();
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | Grid& GetCoarserGrid(Multigrid& multigrid);
|
|---|
| 36 | Grid& GetFinerGrid(Multigrid& multigrid);
|
|---|
| 37 |
|
|---|
| 38 | void CommFromGhosts(Grid& grid);
|
|---|
| 39 | void CommToGhosts(Grid& grid);
|
|---|
| 40 | void CommSubgrid(Grid& grid_old, Grid& grid_new, const int& direction);
|
|---|
| 41 | void CommAddSubgrid(Grid& grid_old, Grid& grid_new, const int& direction);
|
|---|
| 42 |
|
|---|
| 43 | void CommToGhostsAsyncStart(Grid& grid);
|
|---|
| 44 | void CommToGhostsAsyncFinish(Grid& grid);
|
|---|
| 45 | void CommFromGhostsAsyncStart(Grid& grid);
|
|---|
| 46 | void CommFromGhostsAsyncFinish(Grid& grid);
|
|---|
| 47 |
|
|---|
| 48 | void CommParticles(const Grid& grid, std::list<Particle::Particle>& particles);
|
|---|
| 49 | void CommParticlesBack(std::list<Particle::Particle>& particles);
|
|---|
| 50 | void CommLCListToGhosts(Particle::LinkedCellList& lc);
|
|---|
| 51 | void CommLCListFromGhosts(const Grid& grid, Particle::LinkedCellList& lc);
|
|---|
| 52 |
|
|---|
| 53 | void PrintString(const char* format, ...);
|
|---|
| 54 | void PrintStringOnce(const char* format, ...);
|
|---|
| 55 | void PrintXML(const std::string& filename, const std::string& xml_data);
|
|---|
| 56 | void PrintXMLAll(const std::string& filename, const std::string& xml_data);
|
|---|
| 57 | void PrintAllSettings();
|
|---|
| 58 | void PrintGrid(Grid& grid, const char* information);
|
|---|
| 59 | void PrintDefect(Grid& sol, Grid& rhs, const char* information);
|
|---|
| 60 |
|
|---|
| 61 | void DebugPrintGridStructure(Multigrid& multigrid);
|
|---|
| 62 |
|
|---|
| 63 | void PostInit(Multigrid& sol, Multigrid& rhs) {}
|
|---|
| 64 |
|
|---|
| 65 | private:
|
|---|
| 66 | void InitCommSerial();
|
|---|
| 67 |
|
|---|
| 68 | void OpenFileAndPrintHeader(std::ofstream& out, const Grid& mesh, const char* information);
|
|---|
| 69 | void PrintGridStructureLevel(Grid& grid, std::ofstream& out);
|
|---|
| 70 | std::string CreateOutputDirectory();
|
|---|
| 71 |
|
|---|
| 72 | int error_norm_count, residual_count;
|
|---|
| 73 |
|
|---|
| 74 | std::map< const Grid*, Grid*> finer, coarser;
|
|---|
| 75 |
|
|---|
| 76 | };
|
|---|
| 77 |
|
|---|
| 78 | }
|
|---|
| 79 |
|
|---|
| 80 | #endif /* COMM_SERIAL_HPP_ */
|
|---|