Changeset dfed1c for src/comm/comm_serial.hpp
- Timestamp:
- Nov 22, 2011, 9:22:10 PM (14 years ago)
- Children:
- facba0
- Parents:
- 66f24d
- File:
-
- 1 edited
-
src/comm/comm_serial.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/comm/comm_serial.hpp
r66f24d rdfed1c 15 15 16 16 #include "comm/comm.hpp" 17 #include "comm/domain_decomposition_serial.hpp" 17 18 18 19 namespace VMG 19 20 { 20 21 21 class MeshBase; 22 class Stencil; 22 class DomainDecomposition; 23 class Grid; 24 class Multigrid; 23 25 24 26 class CommSerial : public Comm 25 27 { 26 28 public: 27 CommSerial(BC boundary) : Comm(boundary) {Init();} 29 CommSerial(const Boundary& boundary) : 30 Comm(boundary, new DomainDecompositionSerial()) 31 { 32 InitCommSerial(); 33 } 28 34 35 Grid& GetCoarserGrid(Multigrid& multigrid); 29 36 Grid& GetFinerGrid(Multigrid& multigrid); 30 Grid& Get CoarserGrid(Multigrid& multigrid);37 Grid& GetGlobalCoarseGrid(Multigrid& multigrid); 31 38 32 void CommFromGhosts(Grid& mesh); 33 void CommToGhosts(Grid& mesh); 34 Grid* CommMergeGrids(Grid& oldgrid) {return &oldgrid;} 39 void CommFromGhosts(Grid& grid); 40 void CommToGhosts(Grid& grid); 41 void CommSubgrid(Grid& grid_old, Grid& grid_new); 42 void CommAddSubgrid(Grid& grid_old, Grid& grid_new); 35 43 36 vmg_float ComputeResidualNorm(Multigrid& sol, Multigrid& rhs); 44 void CommParticles(const Grid& grid, std::list<Particle::Particle>& particles); 45 void CommLCListGhosts(const Grid& grid, Particle::LinkedCellList& lc); 46 void CommAddPotential(std::list<Particle::Particle>& particles); 47 void CommAddPotential(Particle::LinkedCellList& lc); 37 48 38 vmg_float AllReduce(const vmg_float& value) {return value;} 49 vmg_float GlobalSum(const vmg_float& value) {return value;} 50 vmg_float GlobalSumRoot(const vmg_float& value) {return value;} 51 void GlobalSumArray(vmg_float* array, const vmg_int& size) {} 39 52 40 void PrintDefect(const Grid& sol, const Grid& rhs, const char* information); 41 void PrintGrid(const Grid& mesh, const char* information); 42 void PrintCorrectedGrid(const Grid& mesh, const char* information); 43 44 void PrintInnerGrid(const Grid& mesh, const char* information); 45 void PrintInnerCorrectedGrid(const Grid& mesh, const char* information); 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 PrintDefect(Grid& sol, Grid& rhs, const char* information); 59 void PrintGrid(Grid& grid, const char* information); 60 void PrintCorrectedGrid(Grid& grid, const char* information); 61 void PrintInnerGrid(Grid& grid, const char* information); 62 void PrintInnerCorrectedGrid(Grid& grid, const char* information); 46 63 47 64 void DebugPrintError(const Grid& sol, const char* information); 48 49 void DebugPrintGridStructure(Multigrid& grid);65 void DebugPrintErrorNorm(Grid& sol); 66 void DebugPrintGridStructure(Multigrid& multigrid); 50 67 51 68 private: 52 void Init ();69 void InitCommSerial(); 53 70 54 void CreateOutputDirectory();55 71 void OpenFileAndPrintHeader(std::ofstream& out, const Grid& mesh, const char* information, bool inner); 56 72 void PrintGridStructureLevel(Grid& grid, std::ofstream& out); 73 std::string CreateOutputDirectory(); 57 74 58 int output_count, error_norm_count, residual_count; 59 std::string defects_path_str; 75 int error_norm_count, residual_count; 60 76 61 77 std::map< const Grid*, Grid*> finer, coarser; 78 62 79 }; 63 80
Note:
See TracChangeset
for help on using the changeset viewer.
