source: src/comm/comm_serial.hpp@ 6f05224

Last change on this file since 6f05224 was f003a9, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Refactored vmg in order to separate the core library and the particle simulation part properly.

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

  • Property mode set to 100644
File size: 1.9 KB
Line 
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
19namespace VMG
20{
21
22class DomainDecomposition;
23class Grid;
24class Multigrid;
25
26class CommSerial : public Comm
27{
28public:
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 PrintString(const char* format, ...);
49 void PrintStringOnce(const char* format, ...);
50 void PrintXML(const std::string& filename, const std::string& xml_data);
51 void PrintXMLAll(const std::string& filename, const std::string& xml_data);
52 void PrintAllSettings();
53 void PrintGrid(Grid& grid, const char* information);
54 void PrintDefect(Grid& sol, Grid& rhs, const char* information);
55
56 void DebugPrintGridStructure(Multigrid& multigrid);
57
58 void PostInit(Multigrid& sol, Multigrid& rhs) {}
59
60private:
61 void InitCommSerial();
62
63 void OpenFileAndPrintHeader(std::ofstream& out, const Grid& mesh, const char* information);
64 void PrintGridStructureLevel(Grid& grid, std::ofstream& out);
65 std::string CreateOutputDirectory();
66
67 int error_norm_count, residual_count;
68
69 std::map< const Grid*, Grid*> finer, coarser;
70
71};
72
73}
74
75#endif /* COMM_SERIAL_HPP_ */
Note: See TracBrowser for help on using the repository browser.