writeMeshChecks.H
Go to the documentation of this file.
2 {
3  none,
5  JSON
6 };
7 const Enum<writeChecksFormatType> writeChecksFormatTypeNames
8 {
9  { writeChecksFormatType::none, "none" },
10  { writeChecksFormatType::dictionary, "dictionary" },
11  { writeChecksFormatType::JSON, "json" },
12 };
13 
15 
16 auto writeMeshChecks = [](const fvMesh& mesh, const writeChecksFormatType fmt)
17 {
18  if (UPstream::master())
19  {
20  switch (fmt)
21  {
23  {
24  OFstream os(mesh.time().globalPath()/"checkMesh.dict");
25 
26  IOdictionary data
27  (
28  IOobject
29  (
30  mesh.time().globalPath()/"checkMesh.dict",
31  mesh,
32  IOobject::NO_READ
33  )
34  );
35 
36  Info<< "Writing mesh data to " << os.name() << nl << endl;
37 
38  data.writeHeader(os);
39 
40  mesh.data().meshDict().write(os, false);
41 
42  IOobject::writeEndDivider(os);
43 
44  break;
45  }
47  {
48  OFstream os(mesh.time().globalPath()/"checkMesh.json");
49 
50  Info<< "Writing mesh data to " << os.name() << nl << endl;
51 
52  JSONformatter json(os);
53 
54  json.writeDict(mesh.data().meshDict());
55  break;
56  }
57  default:
58  {
59  // Do nothing
60  }
61  }
62  }
63 };
const Enum< writeChecksFormatType > writeChecksFormatTypeNames
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
dynamicFvMesh & mesh
writeChecksFormatType writeChecksFormat(writeChecksFormatType::none)
OBJstream os(runTime.globalPath()/outputName)
messageStream Info
Information stream (stdout output on master, null elsewhere)
writeChecksFormatType
auto writeMeshChecks