PlasCom2  1.0
XPACC Multi-physics simluation application
Report.H
Go to the documentation of this file.
1 #ifndef __REPORT_H__
2 #define __REPORT_H__
3 #include <string>
4 #include <vector>
5 #include <sstream>
6 
7 #include "PCPPTypes.H"
8 #include "Grid.H"
9 
10 namespace simulation {
11  namespace report {
12 
13  template<typename GridType>
14  std::string Grid(const GridType &inGrid)
15  {
16 
17  std::ostringstream Ostr;
18  const std::vector<size_t> &gridSizes(inGrid.GridSizes());
19  const std::vector<size_t> &partSizes(inGrid.PartitionSizes());
20  const std::vector<size_t> &bufferSizes(inGrid.BufferSizes());
21  const pcpp::IndexIntervalType &partitionInterval(inGrid.PartitionInterval());
22  const pcpp::IndexIntervalType &partitionBufferInterval(inGrid.PartitionBufferInterval());
23  const std::vector<simulation::grid::subregion> &subRegions(inGrid.SubRegions());
24 
25  size_t numPointsBuffer = inGrid.BufferSize();
26 
27  pcpp::CommunicatorType &gridComm(inGrid.Communicator());
28  int numPartitions = gridComm.NProc();
29  const std::vector<int> &cartCoords(gridComm.CartCoordinates());
30  const std::vector<int> &cartDims(gridComm.CartDimensions());
31  std::vector<int> cartNeighbors;
32  gridComm.CartNeighbors(cartNeighbors);
33 
34  Ostr << "Dimension: " << inGrid.Dimension() << std::endl
35  << "Number of points: (";
37  Ostr << ")" << std::endl
38  << "Buffer Sizes: (";
40  Ostr << ")" << std::endl
41  << "Total Points: " << numPointsBuffer << std::endl;
42  Ostr << "Number of partitions: " << numPartitions << std::endl
43  << "Partition Interval: ";
44  partitionInterval.PrettyPrint(Ostr);
45  Ostr << std::endl
46  << "Partition Buffer Interval: ";
47  partitionBufferInterval.PrettyPrint(Ostr);
48  Ostr << std::endl
49  << "Cartesian Topology Sizes: (";
50  pcpp::io::DumpContents(Ostr,cartDims,",");
51  Ostr << ")" << std::endl
52  << "Cartesian Coordinates: (";
53  pcpp::io::DumpContents(Ostr,cartCoords,",");
54  Ostr << ")" << std::endl
55  << "Cartesian Neighbors: (";
56  pcpp::io::DumpContents(Ostr,cartNeighbors,",");
57  Ostr << ")" << std::endl;
58  Ostr << "Number of subregions: " << subRegions.size() << std::endl;
59  std::vector<simulation::grid::subregion>::const_iterator subRegionIt =
60  subRegions.begin();
61  while(subRegionIt != subRegions.end()){
62  const simulation::grid::subregion &subRegion(*subRegionIt++);
63  Ostr << "... SubRegion: " << subRegion.regionName << " ..." << std::endl
64  << "Normal direction (points into domain): " << subRegion.normalDirection << std::endl
65  << "SubRegion Interval: ";
66  subRegion.regionInterval.PrettyPrint(Ostr);
67  Ostr << std::endl;
68  if(subRegion.regionPartitionInterval.NNodes() > 0){
69  Ostr << "SubRegion Partition Interval: ";
70  subRegion.regionPartitionInterval.PrettyPrint(Ostr);
71  Ostr << std::endl
72  << "SubRegion Buffer Interval: ";
74  Ostr << std::endl;
75  Ostr << "Number of points: " << subRegion.partitionBufferIndices.size() << std::endl;
76  }
77  }
78  return(Ostr.str());
79  };
80 
81  }
82 }
83 #endif
pcpp::IndexIntervalType regionInterval
Definition: Grid.H:39
pcpp::IndexIntervalType regionPartitionBufferInterval
Definition: Grid.H:41
void const size_t const size_t * gridSizes
Definition: EulerKernels.H:10
pcpp::IndexIntervalType regionPartitionInterval
Definition: Grid.H:40
size_t NNodes() const
Definition: IndexUtil.H:254
std::string regionName
Definition: Grid.H:37
std::vector< size_t > partitionBufferIndices
Definition: Grid.H:42
Main encapsulation of MPI.
Definition: COMM.H:62
std::string Grid(const GridType &inGrid)
Definition: Report.H:14
void DumpContents(std::ostream &Ostr, const ContainerType &c, std::string del="\)
Dump container contents.
Definition: AppTools.H:117
void const size_t const size_t * bufferSizes
Definition: MetricKernels.H:19
std::ostream & PrettyPrint(std::ostream &outStream) const
Definition: IndexUtil.C:6
Simple Block Structured Mesh object.
Definition: IndexUtil.H:21
void const size_t * numPointsBuffer
Definition: MetricKernels.H:19