Loading...
Searching...
No Matches
writeMeshChecks.H
Go to the documentation of this file.
7const Enum<writeChecksFormatType> writeChecksFormatTypeNames
8{
10 { writeChecksFormatType::dictionary, "dictionary" },
12};
13
15
16auto writeMeshChecks = [&](const fvMesh& mesh, const writeChecksFormatType fmt)
17{
18 // Early exit if 'none' option is set
20 {
21 return;
22 }
23
24 if (UPstream::master())
25 {
26 fileName path(mesh.time().globalPath()/"checkMesh");
27 if (mesh.name() != polyMesh::defaultRegion)
28 {
29 path += "_" + mesh.name();
30 }
31
32 OFstream os(path.ext(writeChecksFormatTypeNames[fmt]));
33
34 Info<< "Writing mesh data to " << os.name() << nl << endl;
35
36 switch (fmt)
37 {
39 {
40 IOdictionary data
41 (
42 IOobject
43 (
44 os.name(),
45 mesh,
46 IOobject::NO_READ
47 )
48 );
49
50 data.writeHeader(os);
51
52 mesh.data().meshDict().write(os, false);
53
54 IOobject::writeEndDivider(os);
55
56 break;
57 }
59 {
60 JSONformatter json(os);
61 json.writeDict(mesh.data().meshDict());
62
63 break;
64 }
65 default:
66 {
67 // Do nothing
68 }
69 }
70 }
71};
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
dynamicFvMesh & mesh
OBJstream os(runTime.globalPath()/outputName)
writeChecksFormatType
auto writeMeshChecks
writeChecksFormatType writeChecksFormat(writeChecksFormatType::none)
const Enum< writeChecksFormatType > writeChecksFormatTypeNames