79 int main(
int argc,
char *argv[])
89 "write in ASCII format instead of 'C Binary'" 95 "ignore the time index contained in the uniform/time file " 96 "and use simple indexing when creating the files" 101 "suppress writing the geometry. " 102 "Can be useful for converting partial results for a static geometry" 108 "define sub-directory name to use for Ensight data " 109 "(default: \"Ensight\")" 115 "width of Ensight data subdir" 132 const char* geometryName =
"geometry";
148 label indexingNumber = 0;
169 fileName dataDir = ensightDir/
"data";
170 fileName caseFileName =
"Ensight.case";
176 if (
isDir(ensightDir))
178 Info<<
"Warning: re-using existing directory" << nl
179 <<
" " << ensightDir <<
endl;
199 OFstream partsInfoFile(ensightDir/
"partsInfo");
202 <<
"// summary of ensight parts" << nl <<
nl;
203 partsList.writeSummary(partsInfoFile);
211 Info<<
"mesh is moving: ignoring '-noMesh' option" <<
endl;
234 runTime.setTime(timeDirs[timeI], timeI);
236 #include "getTimeIndex.H" 243 mkDir(dataDir/subDir);
247 OFstream timeStamp(dataDir/subDir/
"time");
249 <<
"# timestep time" << nl
250 << subDir.c_str() <<
" " << runTime.timeName() <<
nl;
253 #include "moveMesh.H" 259 partsList.recalculate(
mesh);
267 geomDir = dataDir/subDir;
271 partsList.writeGeometry(geoFile);
280 const word& fieldName = fieldIter.key();
281 const word& fieldType = fieldIter();
294 ensightVolField<scalar>
307 ensightVolField<vector>
320 ensightVolField<sphericalTensor>
333 ensightVolField<symmTensor>
345 ensightVolField<tensor>
361 const word& cloudName = cloudIter.key();
367 runTime.timePath()/regionPrefix/
383 IOobject* positionPtr = cloudObjs.lookup(
word(
"positions"));
384 if (positionPtr !=
nullptr)
400 Info<<
"write " << cloudName <<
" (" <<
flush;
404 const word& fieldName = fieldIter.key();
405 const word& fieldType = fieldIter();
407 IOobject *fieldObject = cloudObjs.lookup(fieldName);
420 ensightLagrangianField<scalar>
432 ensightLagrangianField<vector>
444 ensightLagrangianField<tensor>
A HashTable with keys but without contents.
#define forAll(list, i)
Loop across all elements in list.
A collection of several ensightPart elements.
A class for handling file names.
List of IOobjects with searching and retrieving facilities.
bool moving() const
Is mesh moving.
const fileName & globalCaseName() const
Return case name.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
static const char *const typeName
const fileName & rootPath() const
Return root path.
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
Specialised Ensight output with extra geometry file header.
void ensightParticlePositions(const polyMesh &mesh, const fileName &dataDir, const fileName &subDir, const word &cloudName, IOstream::streamFormat format)
static void noParallel()
Remove the parallel options.
static string subDir(const label)
Consistent zero-padded numbers for subdirectories.
word format(conversionProperties.lookup("format"))
const Time & time() const
Return the top-level database.
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
bool insert(const Key &key)
Insert a new entry.
HashTable< word > volumeFields
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
HashTable< HashTable< word > > cloudFields
T optionRead(const word &opt) const
Read a value from the named option.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
bool isAbsolute() const
Return true if file name is absolute.
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
A class for handling words, derived from string.
Miscellaneous collection of functions and template related to Ensight data.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
streamFormat
Enumeration for the format of data in the stream.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
static string mask()
The '*' mask appropriate for subDir.
An STL-conforming hash table.
Istream and Ostream manipulators taking arguments.
static const word prefix
The prefix to local: lagrangian.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Ostream & flush(Ostream &os)
Flush stream.
const word cloudName(propsDict.lookup("cloudName"))
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
Foam::argList args(argc, argv)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static label subDirWidth()
Return current width of subDir and mask.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
A HashTable to objects of type <T> with a label key.