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 != NULL)
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A collection of several ensightPart elements.
A class for handling file names.
T optionRead(const word &opt) const
Read a value from the named option.
List of IOobjects with searching and retrieving facilities.
static const char *const typeName
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Specialized Ensight output with extra geometry file header.
void ensightParticlePositions(const polyMesh &mesh, const fileName &dataDir, const fileName &subDir, const word &cloudName, IOstream::streamFormat format)
const word cloudName(propsDict.lookup("cloudName"))
static void noParallel()
Remove the parallel options.
static string subDir(const label)
Consistent zero-padded numbers for subdirectories.
word format(conversionProperties.lookup("format"))
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
const fileName & rootPath() const
Return root path.
bool insert(const Key &key)
Insert a new entry.
HashTable< word > volumeFields
bool moving() const
Is mesh moving.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
HashTable< HashTable< word > > cloudFields
bool optionFound(const word &opt) const
Return true if the named option is found.
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.
const fileName & globalCaseName() const
Return case name.
An STL-conforming hash table.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
bool isAbsolute() const
Return true if file name is absolute.
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.
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.
const Time & time() const
Return the top-level database.
A HashTable to objects of type <T> with a label key.