foamToEnsight.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Application
25  foamToEnsight
26 
27 Description
28  Translates OpenFOAM data to EnSight format.
29 
30  An Ensight part is created for the internalMesh and for each patch.
31 
32 Usage
33  - foamToEnsight [OPTION] \n
34  Translates OpenFOAM data to Ensight format
35 
36  \param -ascii \n
37  Write Ensight data in ASCII format instead of "C Binary"
38 
39  \param -patches patchList \n
40  Specify particular patches to write.
41  Specifying an empty list suppresses writing the internalMesh.
42 
43  \param -noPatches \n
44  Suppress writing any patches.
45 
46  \param -faceZones zoneList \n
47  Specify faceZones to write, with wildcards
48 
49  \param -cellZone zoneName \n
50  Specify single cellZone to write (not lagrangian)
51 
52 Note
53  Parallel support for cloud data is not supported
54  - writes to \a EnSight directory to avoid collisions with foamToEnsightParts
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #include "argList.H"
59 #include "timeSelector.H"
60 #include "IOobjectList.H"
61 #include "IOmanip.H"
62 #include "OFstream.H"
63 
64 #include "volFields.H"
65 
66 #include "labelIOField.H"
67 #include "scalarIOField.H"
68 #include "tensorIOField.H"
69 
70 #include "ensightMesh.H"
71 #include "ensightField.H"
72 
74 #include "ensightCloudField.H"
75 
76 #include "fvc.H"
77 
78 #include "cellSet.H"
79 #include "fvMeshSubset.H"
80 
81 using namespace Foam;
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 bool inFileNameList
86 (
87  const fileNameList& nameList,
88  const word& name
89 )
90 {
91  forAll(nameList, i)
92  {
93  if (nameList[i] == name)
94  {
95  return true;
96  }
97  }
98 
99  return false;
100 }
101 
102 
103 
104 int main(int argc, char *argv[])
105 {
107  #include "addRegionOption.H"
108 
110  (
111  "ascii",
112  "write in ASCII format instead of 'C Binary'"
113  );
115  (
116  "nodeValues",
117  "write values in nodes"
118  );
120  (
121  "noPatches",
122  "suppress writing any patches"
123  );
125  (
126  "patches",
127  "wordReList",
128  "specify particular patches to write - eg '(outlet \"inlet.*\")'. "
129  "An empty list suppresses writing the internalMesh."
130  );
132  (
133  "faceZones",
134  "wordReList",
135  "specify faceZones to write - eg '( slice \"mfp-.*\" )'."
136  );
138  (
139  "fields",
140  "wordReList",
141  "specify fields to export (all by default) - eg '( \"U.*\" )'."
142  );
144  (
145  "cellZone",
146  "word",
147  "specify cellZone to write"
148  );
149 
150  #include "setRootCase.H"
151 
152  // Check options
153  const bool binary = !args.optionFound("ascii");
154  const bool nodeValues = args.optionFound("nodeValues");
155 
156  #include "createTime.H"
157 
158  instantList Times = timeSelector::select0(runTime, args);
159 
160  #include "createNamedMesh.H"
161 
162  // Mesh instance (region0 gets filtered out)
163  fileName regionPrefix = "";
164 
166  {
167  regionPrefix = regionName;
168  }
169 
170  const label nVolFieldTypes = 10;
171  const word volFieldTypes[] =
172  {
173  volScalarField::typeName,
174  volVectorField::typeName,
175  volSphericalTensorField::typeName,
176  volSymmTensorField::typeName,
177  volTensorField::typeName,
178 
179  volScalarField::DimensionedInternalField::typeName,
180  volVectorField::DimensionedInternalField::typeName,
181  volSphericalTensorField::DimensionedInternalField::typeName,
182  volSymmTensorField::DimensionedInternalField::typeName,
183  volTensorField::DimensionedInternalField::typeName
184  };
185 
186  // Path to EnSight directory at case level only
187  // - For parallel cases, data only written from master
188  fileName ensightDir = args.rootPath()/args.globalCaseName()/"EnSight";
189 
190  if (Pstream::master())
191  {
192  if (isDir(ensightDir))
193  {
194  rmDir(ensightDir);
195  }
196 
197  mkDir(ensightDir);
198  }
199 
200  // Start of case file header output
201  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202 
203  const word prepend = args.globalCaseName() + '.';
204 
205  OFstream *ensightCaseFilePtr = NULL;
206  if (Pstream::master())
207  {
208  fileName caseFileName = prepend + "case";
209  Info<< nl << "write case: " << caseFileName.c_str() << endl;
210 
211  // the case file is always ASCII
212  ensightCaseFilePtr = new OFstream
213  (
214  ensightDir/caseFileName,
216  );
217 
218  *ensightCaseFilePtr
219  << "FORMAT" << nl
220  << "type: ensight gold" << nl << nl;
221  }
222 
223  OFstream& ensightCaseFile = *ensightCaseFilePtr;
224 
225  // Construct the EnSight mesh
226  const bool selectedPatches = args.optionFound("patches");
227  wordReList patchPatterns;
228  if (selectedPatches)
229  {
230  patchPatterns = wordReList(args.optionLookup("patches")());
231  }
232  const bool selectedZones = args.optionFound("faceZones");
233  wordReList zonePatterns;
234  if (selectedZones)
235  {
236  zonePatterns = wordReList(args.optionLookup("faceZones")());
237  }
238 
239  const bool selectedFields = args.optionFound("fields");
240  wordReList fieldPatterns;
241  if (selectedFields)
242  {
243  fieldPatterns = wordReList(args.optionLookup("fields")());
244  }
245 
246  word cellZoneName;
247  const bool doCellZone = args.optionReadIfPresent("cellZone", cellZoneName);
248 
249  fvMeshSubset meshSubsetter(mesh);
250  if (doCellZone)
251  {
252  Info<< "Converting cellZone " << cellZoneName
253  << " only (puts outside faces into patch "
254  << mesh.boundaryMesh()[0].name()
255  << ")" << endl;
256  const cellZone& cz = mesh.cellZones()[cellZoneName];
257  cellSet c0(mesh, "c0", labelHashSet(cz));
258  meshSubsetter.setLargeCellSubset(c0, 0);
259  }
260 
261  ensightMesh eMesh
262  (
263  (
264  meshSubsetter.hasSubMesh()
265  ? meshSubsetter.subMesh()
266  : meshSubsetter.baseMesh()
267  ),
268  args.optionFound("noPatches"),
269  selectedPatches,
270  patchPatterns,
271  selectedZones,
272  zonePatterns,
273  binary
274  );
275 
276  // Set Time to the last time before looking for the lagrangian objects
277  runTime.setTime(Times.last(), Times.size()-1);
278 
279  IOobjectList objects(mesh, runTime.timeName());
280 
281  #include "checkMeshMoving.H"
282 
283  if (meshMoving)
284  {
285  Info<< "Detected a moving mesh (multiple polyMesh/points files)."
286  << " Writing meshes for every timestep." << endl;
287  }
288 
289 
290  wordHashSet allCloudNames;
291  if (Pstream::master())
292  {
293  word geomFileName = prepend + "0000";
294 
295  // test pre check variable if there is a moving mesh
296  if (meshMoving)
297  {
298  geomFileName = prepend + "****";
299  }
300 
301  ensightCaseFile
302  << "GEOMETRY" << nl
303  << "model: 1 "
304  << (geomFileName + ".mesh").c_str() << nl;
305  }
306 
307  // Identify if lagrangian data exists at each time, and add clouds
308  // to the 'allCloudNames' hash set
309  forAll(Times, timeI)
310  {
311  runTime.setTime(Times[timeI], timeI);
312 
313  fileNameList cloudDirs = readDir
314  (
315  runTime.timePath()/regionPrefix/cloud::prefix,
317  );
318 
319  forAll(cloudDirs, cloudI)
320  {
321  IOobjectList cloudObjs
322  (
323  mesh,
324  runTime.timeName(),
325  cloud::prefix/cloudDirs[cloudI]
326  );
327 
328  IOobject* positionsPtr = cloudObjs.lookup(word("positions"));
329 
330  if (positionsPtr)
331  {
332  allCloudNames.insert(cloudDirs[cloudI]);
333  }
334  }
335  }
336 
337  HashTable<HashTable<word> > allCloudFields;
338  forAllConstIter(wordHashSet, allCloudNames, cloudIter)
339  {
340  // Add the name of the cloud(s) to the case file header
341  if (Pstream::master())
342  {
343  ensightCaseFile
344  << (
345  "measured: 1 "
346  + prepend
347  + "****."
348  + cloudIter.key()
349  ).c_str()
350  << nl;
351  }
352 
353  // Create a new hash table for each cloud
354  allCloudFields.insert(cloudIter.key(), HashTable<word>());
355 
356  // Identify the new cloud in the hash table
357  HashTable<HashTable<word> >::iterator newCloudIter =
358  allCloudFields.find(cloudIter.key());
359 
360  // Loop over all times to build list of fields and field types
361  // for each cloud
362  forAll(Times, timeI)
363  {
364  runTime.setTime(Times[timeI], timeI);
365 
366  IOobjectList cloudObjs
367  (
368  mesh,
369  runTime.timeName(),
370  cloud::prefix/cloudIter.key()
371  );
372 
373  forAllConstIter(IOobjectList, cloudObjs, fieldIter)
374  {
375  const IOobject obj = *fieldIter();
376 
377  if (obj.name() != "positions")
378  {
379  // Add field and field type
380  newCloudIter().insert
381  (
382  obj.name(),
383  obj.headerClassName()
384  );
385  }
386  }
387  }
388  }
389 
390  label nTimeSteps = 0;
391  forAll(Times, timeIndex)
392  {
393  nTimeSteps++;
394  runTime.setTime(Times[timeIndex], timeIndex);
395 
397  word timeFile = prepend + timeName;
398 
399  Info<< "Translating time = " << runTime.timeName() << nl;
400 
402  if (timeIndex != 0 && meshSubsetter.hasSubMesh())
403  {
404  Info<< "Converting cellZone " << cellZoneName
405  << " only (puts outside faces into patch "
406  << mesh.boundaryMesh()[0].name()
407  << ")" << endl;
408  const cellZone& cz = mesh.cellZones()[cellZoneName];
409  cellSet c0(mesh, "c0", labelHashSet(cz));
410  meshSubsetter.setLargeCellSubset(c0, 0);
411  }
412 
413 
414  if (meshState != polyMesh::UNCHANGED)
415  {
416  eMesh.correct();
417  }
418 
419  if (timeIndex == 0 || meshMoving)
420  {
421  eMesh.write
422  (
423  ensightDir,
424  prepend,
425  timeIndex,
426  meshMoving,
427  ensightCaseFile
428  );
429  }
430 
431 
432  // Start of field data output
433  // ~~~~~~~~~~~~~~~~~~~~~~~~~~
434 
435  if (timeIndex == 0 && Pstream::master())
436  {
437  ensightCaseFile<< nl << "VARIABLE" << nl;
438  }
439 
440 
441  // Cell field data output
442  // ~~~~~~~~~~~~~~~~~~~~~~
443 
444  for (label i=0; i<nVolFieldTypes; i++)
445  {
446  wordList fieldNames = objects.names(volFieldTypes[i]);
447 
448  forAll(fieldNames, j)
449  {
450  const word& fieldName = fieldNames[j];
451 
452  // Check if the field has to be exported
453  if (selectedFields)
454  {
455  if (!findStrings(fieldPatterns, fieldName))
456  {
457  continue;
458  }
459  }
460 
461  #include "checkData.H"
462 
463  if (!variableGood)
464  {
465  continue;
466  }
467 
469  (
470  fieldName,
471  mesh.time().timeName(),
472  mesh,
475  );
476 
477  if (volFieldTypes[i] == volScalarField::typeName)
478  {
480  ensightField<scalar>
481  (
482  volField(meshSubsetter, vf),
483  eMesh,
484  ensightDir,
485  prepend,
486  timeIndex,
487  binary,
488  nodeValues,
489  ensightCaseFile
490  );
491  }
492  else if (volFieldTypes[i] == volVectorField::typeName)
493  {
495  ensightField<vector>
496  (
497  volField(meshSubsetter, vf),
498  eMesh,
499  ensightDir,
500  prepend,
501  timeIndex,
502  binary,
503  nodeValues,
504  ensightCaseFile
505  );
506  }
507  else if (volFieldTypes[i] == volSphericalTensorField::typeName)
508  {
510  ensightField<sphericalTensor>
511  (
512  volField(meshSubsetter, vf),
513  eMesh,
514  ensightDir,
515  prepend,
516  timeIndex,
517  binary,
518  nodeValues,
519  ensightCaseFile
520  );
521  }
522  else if (volFieldTypes[i] == volSymmTensorField::typeName)
523  {
525  ensightField<symmTensor>
526  (
527  volField(meshSubsetter, vf),
528  eMesh,
529  ensightDir,
530  prepend,
531  timeIndex,
532  binary,
533  nodeValues,
534  ensightCaseFile
535  );
536  }
537  else if (volFieldTypes[i] == volTensorField::typeName)
538  {
540  ensightField<tensor>
541  (
542  volField(meshSubsetter, vf),
543  eMesh,
544  ensightDir,
545  prepend,
546  timeIndex,
547  binary,
548  nodeValues,
549  ensightCaseFile
550  );
551  }
552  // DimensionedFields
553  else if
554  (
555  volFieldTypes[i]
556  == volScalarField::DimensionedInternalField::typeName
557  )
558  {
560  (
561  fieldObject,
562  mesh
563  );
564  ensightField<scalar>
565  (
566  volField<scalar>(meshSubsetter, df),
567  eMesh,
568  ensightDir,
569  prepend,
570  timeIndex,
571  binary,
572  nodeValues,
573  ensightCaseFile
574  );
575  }
576  else if
577  (
578  volFieldTypes[i]
579  == volVectorField::DimensionedInternalField::typeName
580  )
581  {
583  (
584  fieldObject,
585  mesh
586  );
587  ensightField<vector>
588  (
589  volField<vector>(meshSubsetter, df),
590  eMesh,
591  ensightDir,
592  prepend,
593  timeIndex,
594  binary,
595  nodeValues,
596  ensightCaseFile
597  );
598  }
599  else if
600  (
601  volFieldTypes[i]
602  == volSphericalTensorField::DimensionedInternalField::typeName
603  )
604  {
606  (
607  fieldObject,
608  mesh
609  );
610  ensightField<sphericalTensor>
611  (
612  volField<sphericalTensor>(meshSubsetter, df),
613  eMesh,
614  ensightDir,
615  prepend,
616  timeIndex,
617  binary,
618  nodeValues,
619  ensightCaseFile
620  );
621  }
622  else if
623  (
624  volFieldTypes[i]
625  == volSymmTensorField::DimensionedInternalField::typeName
626  )
627  {
629  (
630  fieldObject,
631  mesh
632  );
633  ensightField<symmTensor>
634  (
635  volField<symmTensor>(meshSubsetter, df),
636  eMesh,
637  ensightDir,
638  prepend,
639  timeIndex,
640  binary,
641  nodeValues,
642  ensightCaseFile
643  );
644  }
645  else if
646  (
647  volFieldTypes[i]
648  == volTensorField::DimensionedInternalField::typeName
649  )
650  {
652  (
653  fieldObject,
654  mesh
655  );
656  ensightField<tensor>
657  (
658  volField<tensor>(meshSubsetter, df),
659  eMesh,
660  ensightDir,
661  prepend,
662  timeIndex,
663  binary,
664  nodeValues,
665  ensightCaseFile
666  );
667  }
668  }
669  }
670 
671 
672  // Cloud field data output
673  // ~~~~~~~~~~~~~~~~~~~~~~~
674 
675  forAllConstIter(HashTable<HashTable<word> >, allCloudFields, cloudIter)
676  {
677  const word& cloudName = cloudIter.key();
678 
679  fileNameList currentCloudDirs = readDir
680  (
681  runTime.timePath()/regionPrefix/cloud::prefix,
683  );
684 
685  bool cloudExists = inFileNameList(currentCloudDirs, cloudName);
687  (
688  mesh,
689  ensightDir,
690  timeFile,
691  cloudName,
692  cloudExists
693  );
694 
695  forAllConstIter(HashTable<word>, cloudIter(), fieldIter)
696  {
697  const word& fieldName = fieldIter.key();
698  const word& fieldType = fieldIter();
699 
701  (
702  fieldName,
703  mesh.time().timeName(),
705  mesh,
707  );
708 
709  bool fieldExists = fieldObject.headerOk();
710  if (fieldType == scalarIOField::typeName)
711  {
712  ensightCloudField<scalar>
713  (
714  fieldObject,
715  ensightDir,
716  prepend,
717  timeIndex,
718  cloudName,
719  ensightCaseFile,
720  fieldExists
721  );
722  }
723  else if (fieldType == vectorIOField::typeName)
724  {
725  ensightCloudField<vector>
726  (
727  fieldObject,
728  ensightDir,
729  prepend,
730  timeIndex,
731  cloudName,
732  ensightCaseFile,
733  fieldExists
734  );
735  }
736  else
737  {
738  Info<< "Unable to convert field type " << fieldType
739  << " for field " << fieldName << endl;
740  }
741  }
742  }
743  }
744 
745  #include "ensightCaseTail.H"
746 
747  if (Pstream::master())
748  {
749  delete ensightCaseFilePtr;
750  }
751 
752  Info<< "End\n" << endl;
753 
754  return 0;
755 }
756 
757 
758 // ************************************************************************* //
volFields.H
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::ensightMesh
Definition: ensightMesh.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::argList::addOption
static void addOption(const word &opt, const string &param="", const string &usage="")
Add to an option to validOptions with usage information.
Definition: argList.C:108
Foam::polyMesh::defaultRegion
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:306
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::fvMeshSubset
Post-processing mesh subset tool. Given the original mesh and the list of selected cells,...
Definition: fvMeshSubset.H:73
Foam::Field< Type >::typeName
static const char *const typeName
Definition: Field.H:94
fvMeshSubset.H
Foam::wordReList
List< wordRe > wordReList
A List of wordRe (word or regular expression)
Definition: wordReList.H:50
Foam::argList::addBoolOption
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
Definition: argList.C:98
tensorIOField.H
Foam::HashTable::insert
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
Definition: HashTableI.H:80
Foam::polyMesh::cellZones
const cellZoneMesh & cellZones() const
Return cell zone mesh.
Definition: polyMesh.H:469
Foam::IOobject::MUST_READ
@ MUST_READ
Definition: IOobject.H:108
IOobjectList.H
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:421
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
scalarIOField.H
Foam::HashSet
A HashTable with keys but without contents.
Definition: HashSet.H:59
ensightParticlePositions.H
Foam::argList::rootPath
const fileName & rootPath() const
Return root path.
Definition: argListI.H:36
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition: IOobject.H:118
Foam::cellZone
A subset of mesh cells.
Definition: cellZone.H:61
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
OFstream.H
checkData.H
Foam::fvMesh::readUpdate
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
Definition: fvMesh.C:498
Foam::IOobject::headerOk
bool headerOk()
Read and check header info.
Definition: IOobject.C:439
regionName
Foam::word regionName
Definition: createNamedDynamicFvMesh.H:1
Foam::IOstream::ASCII
@ ASCII
Definition: IOstream.H:88
ensightMesh.H
variableGood
bool variableGood
Definition: checkData.H:3
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::IOobject::headerClassName
const word & headerClassName() const
Return name of the class name read from header.
Definition: IOobject.H:279
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
argList.H
addRegionOption.H
IOmanip.H
Istream and Ostream manipulators taking arguments.
Foam::polyMesh::UNCHANGED
@ UNCHANGED
Definition: polyMesh.H:90
Foam::IOobject::name
const word & name() const
Return name.
Definition: IOobject.H:273
main
int main(int argc, char *argv[])
Definition: postCalc.C:54
ensightCloudField.H
timeIndex
label timeIndex
Definition: getTimeIndex.H:4
createNamedMesh.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::isDir
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
Definition: POSIX.C:615
Foam::cellSet
A collection of cell labels.
Definition: cellSet.H:48
Foam::HashTable::find
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
Foam::IOobjectList
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:50
meshMoving
bool meshMoving
Definition: checkMeshMoving.H:3
Foam::OFstream
Output to file stream.
Definition: OFstream.H:81
Foam::itoa
word itoa(const label n)
Foam::UPstream::master
static bool master(const label communicator=0)
Am I the master process.
Definition: UPstream.H:399
Foam::polyMesh::readUpdateState
readUpdateState
Enumeration defining the state of the mesh after a read update.
Definition: polyMesh.H:88
Foam::HashTable
An STL-conforming hash table.
Definition: HashTable.H:61
Foam::cloud::prefix
static const word prefix
The prefix to local: lagrangian.
Definition: cloud.H:71
setRootCase.H
Foam::findStrings
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
Definition: stringListOps.H:52
checkMeshMoving.H
Foam::timeSelector::addOptions
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
Definition: timeSelector.C:114
Foam::Time::timeName
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:741
Foam::fieldNames
wordList fieldNames(const IOobjectList &objects, const bool syncPar)
Get sorted names of fields of type. If syncPar and running in parallel.
Definition: ReadFields.C:36
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
ensightCaseTail.H
Foam::HashSet::insert
bool insert(const Key &key)
Insert a new entry.
Definition: HashSet.H:116
Foam::fileName::DIRECTORY
@ DIRECTORY
Definition: fileName.H:86
timeName
word timeName
Definition: getTimeIndex.H:3
timeSelector.H
createTime.H
cloudName
const word cloudName(propsDict.lookup("cloudName"))
Foam::argList::optionFound
bool optionFound(const word &opt) const
Return true if the named option is found.
Definition: argListI.H:108
Foam::ensightParticlePositions
void ensightParticlePositions(const polyMesh &mesh, const fileName &dataDir, const fileName &subDir, const word &cloudName, IOstream::streamFormat format)
fvc.H
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:243
ensightField.H
fieldObject
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
cellSet.H
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::readDir
fileNameList readDir(const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true)
Read a directory and return the entries as a string list.
Definition: POSIX.C:660
Foam::labelHashSet
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
Definition: HashSet.H:210
Foam::timeSelector::select0
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
Definition: timeSelector.C:253
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
args
Foam::argList args(argc, argv)
Foam::mkDir
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Definition: POSIX.C:419
volField
Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > volField(const Foam::fvMeshSubset &, const Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > &vf)
Wrapper to get hold of the field or the subsetted field.
Foam::argList::optionReadIfPresent
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
Definition: argListI.H:198
Foam::rmDir
bool rmDir(const fileName &)
Remove a dirctory and its contents.
Definition: POSIX.C:974
Foam::argList::globalCaseName
const fileName & globalCaseName() const
Return case name.
Definition: argListI.H:48
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
labelIOField.H
Foam::argList::optionLookup
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.
Definition: argListI.H:114