diff --git a/a00041_source.html b/a00041_source.html index 2d3cf84..ddb553d 100644 --- a/a00041_source.html +++ b/a00041_source.html @@ -360,64 +360,66 @@
342  for (unsigned int i = 0; i < dim; i++)
343  file << cells[dim - (i + 1)] << " ";
344  file << "\" Format=\"HDF\">\n"
-
345  << " " << fileName + ".stoch.h5" << ":/stochastic\n"
-
346  << " </DataItem>\n"
-
347  << " </Attribute>\n"
-
348  << " </Grid>\n";
-
349  } else if (dim == 4) {
-
350  file << " <Grid Name=\"GridTime\" GridType=\"Collection\""
-
351  << " CollectionType=\"Temporal\">\n";
-
352  for (unsigned int j = 0; j < cells[dim - 1]; j++) {
-
353  file << " <Grid Name=\"StructuredGrid\">\n"
-
354  << " <Time Value=\"" << j << "\"/>\n"
-
355  << " <Topology TopologyType=\"3DRectMesh\" NumberOfElements=\"";
-
356  for (unsigned int i = 0; i < dim - 1; i++)
-
357  file << cells[dim - (i + 2)] << " ";
-
358  file << "\"/>\n"
-
359  << " <Geometry GeometryType=\"origin_dxdydz\">\n"
-
360  << " <DataItem Dimensions=\"3\">\n"
-
361  << " 0. 0. 0.\n"
-
362  << " </DataItem>\n"
-
363  << " <DataItem Dimensions=\"3\">\n"
-
364  << " ";
-
365  for (unsigned int i = 0; i < dim - 1; i++)
-
366  file << extensions[i] / cells[i] << " ";
-
367  file << "\n"
-
368  << " </DataItem>\n"
-
369  << " </Geometry>\n"
-
370  << " <Attribute Name=\"" << fileName << "\" Center=\"Cell\">\n"
-
371  << " <DataItem ItemType=\"HyperSlab\" Dimensions=\"";
-
372  for (unsigned int i = 0; i < dim - 1; i++)
-
373  file << cells[dim - (i + 2)] << " ";
-
374  file << "1\">\n"
-
375  << " <DataItem Dimensions=\"3 4\">\n"
-
376  << " " << j << " 0 0 0\n"
-
377  << " 1 1 1 1\n"
-
378  << " 1 ";
-
379  for (unsigned int i = 0; i < dim - 1; i++)
-
380  file << cells[dim - (i + 2)] << " ";
-
381  file << "\n"
-
382  << " </DataItem>\n"
-
383  << " <DataItem Dimensions=\"";
-
384  for (unsigned int i = 0; i < dim; i++)
-
385  file << cells[dim - (i + 1)] << " ";
-
386  file << "\" Format=\"HDF\">\n"
-
387  << " " << fileName + ".stoch.h5" << ":/stochastic\n"
-
388  << " </DataItem>\n"
-
389  << " </DataItem>\n"
-
390  << " </Attribute>\n"
-
391  << " </Grid>\n";
-
392  }
-
393  file << " </Grid>\n";
-
394  }
-
395 
-
396  file << " </Domain>\n"
-
397  << "</Xdmf>" << std::endl;
-
398 
-
399  return true;
-
400 }
-
401 
-
402 } // namespace parafields
+
345  << " " << fileName + ".stoch.h5"
+
346  << ":/stochastic\n"
+
347  << " </DataItem>\n"
+
348  << " </Attribute>\n"
+
349  << " </Grid>\n";
+
350  } else if (dim == 4) {
+
351  file << " <Grid Name=\"GridTime\" GridType=\"Collection\""
+
352  << " CollectionType=\"Temporal\">\n";
+
353  for (unsigned int j = 0; j < cells[dim - 1]; j++) {
+
354  file << " <Grid Name=\"StructuredGrid\">\n"
+
355  << " <Time Value=\"" << j << "\"/>\n"
+
356  << " <Topology TopologyType=\"3DRectMesh\" NumberOfElements=\"";
+
357  for (unsigned int i = 0; i < dim - 1; i++)
+
358  file << cells[dim - (i + 2)] << " ";
+
359  file << "\"/>\n"
+
360  << " <Geometry GeometryType=\"origin_dxdydz\">\n"
+
361  << " <DataItem Dimensions=\"3\">\n"
+
362  << " 0. 0. 0.\n"
+
363  << " </DataItem>\n"
+
364  << " <DataItem Dimensions=\"3\">\n"
+
365  << " ";
+
366  for (unsigned int i = 0; i < dim - 1; i++)
+
367  file << extensions[i] / cells[i] << " ";
+
368  file << "\n"
+
369  << " </DataItem>\n"
+
370  << " </Geometry>\n"
+
371  << " <Attribute Name=\"" << fileName << "\" Center=\"Cell\">\n"
+
372  << " <DataItem ItemType=\"HyperSlab\" Dimensions=\"";
+
373  for (unsigned int i = 0; i < dim - 1; i++)
+
374  file << cells[dim - (i + 2)] << " ";
+
375  file << "1\">\n"
+
376  << " <DataItem Dimensions=\"3 4\">\n"
+
377  << " " << j << " 0 0 0\n"
+
378  << " 1 1 1 1\n"
+
379  << " 1 ";
+
380  for (unsigned int i = 0; i < dim - 1; i++)
+
381  file << cells[dim - (i + 2)] << " ";
+
382  file << "\n"
+
383  << " </DataItem>\n"
+
384  << " <DataItem Dimensions=\"";
+
385  for (unsigned int i = 0; i < dim; i++)
+
386  file << cells[dim - (i + 1)] << " ";
+
387  file << "\" Format=\"HDF\">\n"
+
388  << " " << fileName + ".stoch.h5"
+
389  << ":/stochastic\n"
+
390  << " </DataItem>\n"
+
391  << " </DataItem>\n"
+
392  << " </Attribute>\n"
+
393  << " </Grid>\n";
+
394  }
+
395  file << " </Grid>\n";
+
396  }
+
397 
+
398  file << " </Domain>\n"
+
399  << "</Xdmf>" << std::endl;
+
400 
+
401  return true;
+
402 }
+
403 
+
404 } // namespace parafields
parafields
Definition: cpprngbackend.hh:5
parafields::fileExists
bool fileExists(const std::string &filename)
Check if file exists.
Definition: io.hh:21
parafields::writeToXDMF
bool writeToXDMF(const std::array< unsigned int, dim > &cells, const std::array< RF, dim > &extensions, const std::string &fileName)
Write accompanying XDMF file for HDF5 file.
Definition: io.hh:306