PlasCom2  1.0
XPACC Multi-physics simluation application
PCPPReport.H
Go to the documentation of this file.
1 #ifndef __PCPP_REPORT_H__
2 #define __PCPP_REPORT_H__
3 
4 #include "PCPPIO.H"
5 #include "PCPPCommUtil.H"
6 
7 namespace pcpp {
8  namespace report {
9 
10  void SimFileInfo(std::ostream &outStream,
11  const pcpp::io::simfileinfo &simFileInfo);
12 
13  void CartesianSetup(std::ostream &outStream,
14  const std::vector<int> &cartCoords,
15  const std::vector<int> &cartDims);
16 
17  void CartesianSetup(std::ostream &outStream,pcpp::ParallelTopologyInfoType &inTopo);
18 
19  void Configuration(std::ostream &outStream,
20  const fixtures::ConfigurationType &inConfig);
21 
22  template<typename BufferDataType>
23  void StructuredBufferContents(std::ostream &outStream,
24  const BufferDataType *dataBuffer,
25  const pcpp::IndexIntervalType &bufferExtent)
26  {
27  size_t numX = bufferExtent[0].second - bufferExtent[0].first + 1;
28  size_t numY = bufferExtent[1].second - bufferExtent[1].first + 1;
29  size_t numZ = bufferExtent[2].second - bufferExtent[2].first + 1;
30  for(size_t k = bufferExtent[2].first;k <= bufferExtent[2].second;k++){
31  size_t kIndex = k - bufferExtent[2].first;
32  for(size_t j = bufferExtent[1].first;j <= bufferExtent[1].second;j++){
33  size_t jIndex = j - bufferExtent[1].first;
34  for(size_t i = bufferExtent[0].first;i <= bufferExtent[0].second;i++){
35  size_t iIndex = i - bufferExtent[0].first;
36  size_t bufferIndex = kIndex*numX*numZ + jIndex*numX + iIndex;
37  outStream << "Buffer(" << i << "," << j << "," << k << ") = "
38  << dataBuffer[bufferIndex] << std::endl;
39  }
40  }
41  }
42  };
43 
44  template<typename BufferDataType>
45  void StructuredSubBufferContents(std::ostream &outStream,
46  const BufferDataType *dataBuffer,
47  const pcpp::IndexIntervalType &bufferExtent,
48  const pcpp::IndexIntervalType &regionExtent)
49  {
50  size_t numX = bufferExtent[0].second - bufferExtent[0].first + 1;
51  size_t numY = bufferExtent[1].second - bufferExtent[1].first + 1;
52  size_t numZ = bufferExtent[2].second - bufferExtent[2].first + 1;
53  for(size_t k = regionExtent[2].first;k <= regionExtent[2].second;k++){
54  size_t kIndex = k - bufferExtent[2].first;
55  for(size_t j = regionExtent[1].first;j <= regionExtent[1].second;j++){
56  size_t jIndex = j - bufferExtent[1].first;
57  for(size_t i = regionExtent[0].first;i <= regionExtent[0].second;i++){
58  size_t iIndex = i - bufferExtent[0].first;
59  size_t bufferIndex = kIndex*numX*numZ + jIndex*numX + iIndex;
60  outStream << "Buffer(" << i << "," << j << "," << k << ") = "
61  << dataBuffer[bufferIndex] << std::endl;
62  }
63  }
64  }
65  };
66 
67  };
68 };
69 
70 #endif
void SimFileInfo(std::ostream &outStream, const pcpp::io::simfileinfo &simFileInfo)
Definition: PCPPReport.C:6
void StructuredBufferContents(std::ostream &outStream, const BufferDataType *dataBuffer, const pcpp::IndexIntervalType &bufferExtent)
Definition: PCPPReport.H:23
void CartesianSetup(std::ostream &outStream, const std::vector< int > &cartCoords, const std::vector< int > &cartDims)
Definition: PCPPReport.C:199
void Configuration(std::ostream &outStream, const fixtures::ConfigurationType &inConfig)
Definition: PCPPReport.C:186
void StructuredSubBufferContents(std::ostream &outStream, const BufferDataType *dataBuffer, const pcpp::IndexIntervalType &bufferExtent, const pcpp::IndexIntervalType &regionExtent)
Definition: PCPPReport.H:45
Simple Block Structured Mesh object.
Definition: IndexUtil.H:21