gmvOutput.H
Go to the documentation of this file.
1 for (label i=0; i < nTypes; i++)
2 {
3  wordList fieldNames = objects.names(fieldTypes[i]);
4 
5  if (fieldTypes[i] == "volScalarField")
6  {
7  gmvFile << "variable" << nl;
8  }
9 
10  forAll(fieldNames, j)
11  {
12  const word& fieldName = fieldNames[j];
13 
14  IOobject fieldObject
15  (
16  fieldName,
17  runTime.timeName(),
18  mesh,
19  IOobject::MUST_READ,
20  IOobject::NO_WRITE
21  );
22 
23  if (fieldTypes[i] == "volScalarField")
24  {
26  gmvFile << fieldName << " 0" << nl;
27  for (label indx=0;indx<mesh.nCells();indx++)
28  {
29  gmvFile << fld[indx] << " ";
30  }
31  gmvFile << nl;
32  }
33 
34  if (fieldTypes[i] == "volVectorField")
35  {
36  if (fieldName == vComp)
37  {
39  gmvFile << "velocity 0" << nl;
40  for (label indx=0;indx<mesh.nCells();indx++)
41  {
42  gmvFile << fld[indx].x() << " ";
43  }
44  for (label indx=0;indx<mesh.nCells();indx++)
45  {
46  gmvFile << fld[indx].y() << " ";
47  }
48  for (label indx=0;indx<mesh.nCells();indx++)
49  {
50  gmvFile << fld[indx].z() << " ";
51  }
52  gmvFile << nl;
53  }
54  }
55 
56  if (fieldTypes[i] == "surfaceScalarField")
57  {
58  // ...
59  }
60 
61  }
62 
63  if (fieldTypes[i] == cloud::prefix)
64  {
65  IOobject lagrangianHeader
66  (
67  "positions",
68  runTime.timeName(),
69  cloud::prefix,
70  mesh,
71  IOobject::NO_READ
72  );
73 
74  if (lagrangianHeader.headerOk())
75  {
76  Cloud<passiveParticle> particles(mesh);
77 
78  IOobjectList objects(mesh, runTime.timeName(), cloud::prefix);
79 
80  wordList lagrangianScalarNames = objects.names("scalarField");
81  wordList lagrangianVectorNames = objects.names("vectorField");
82 
83  if (particles.size())
84  {
85 # include "gmvOutputLagrangian.H"
86  }
87  }
88  }
89 
90  if (fieldTypes[i] == "volScalarField")
91  {
92  gmvFile << "endvars" << nl;
93  }
94 }
static List< word > lagrangianScalarNames
Definition: globalFoam.H:47
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dynamicFvMesh & mesh
static List< word > lagrangianVectorNames
Definition: globalFoam.H:48
List< word > wordList
A List of words.
Definition: fileName.H:54
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
#define forAll(list, i)
Definition: UList.H:420
static const char nl
Definition: Ostream.H:257
word vComp(conversionProperties.lookup("vector"))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
static List< word > fieldNames
Definition: globalFoam.H:46