source: src/comm/comm_serial.hpp@ b51c3b

Last change on this file since b51c3b was 716da7, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Fix energy calculation.

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

  • Property mode set to 100644
File size: 2.1 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 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
65private:
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_ */
Note: See TracBrowser for help on using the repository browser.