Go to the documentation of this file.
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"
120 volFieldTypes.
insert(volScalarField::typeName);
121 volFieldTypes.
insert(volVectorField::typeName);
122 volFieldTypes.
insert(volSphericalTensorField::typeName);
123 volFieldTypes.
insert(volSymmTensorField::typeName);
124 volFieldTypes.
insert(volTensorField::typeName);
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();
292 if (fieldType == volScalarField::typeName)
294 ensightVolField<scalar>
305 else if (fieldType == volVectorField::typeName)
307 ensightVolField<vector>
318 else if (fieldType == volSphericalTensorField::typeName)
320 ensightVolField<sphericalTensor>
331 else if (fieldType == volSymmTensorField::typeName)
333 ensightVolField<symmTensor>
343 else if (fieldType == volTensorField::typeName)
345 ensightVolField<tensor>
367 runTime.timePath()/regionPrefix/
383 IOobject* positionPtr = cloudObjs.lookup(
word(
"positions"));
384 if (positionPtr != NULL)
404 const word& fieldName = fieldIter.key();
405 const word& fieldType = fieldIter();
420 ensightLagrangianField<scalar>
432 ensightLagrangianField<vector>
444 ensightLagrangianField<tensor>
A collection of several ensightPart elements.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
word format(conversionProperties.lookup("format"))
A class for handling words, derived from string.
A class for handling file names.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
static word defaultRegion
Return the default region name.
#define forAll(list, i)
Loop across all elements in list.
static const char *const typeName
bool moving() const
Is mesh moving.
static string mask()
The '*' mask appropriate for subDir.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool isAbsolute() const
Return true if file name is absolute.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
HashTable< HashTable< word > > cloudFields
A HashTable to objects of type <T> with a label key.
Ostream & endl(Ostream &os)
Add newline and flush stream.
HashTable< word > volumeFields
A HashTable with keys but without contents.
const fileName & rootPath() const
Return root path.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Ostream & flush(Ostream &os)
Flush stream.
Specialized Ensight output with extra geometry file header.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static label subDirWidth()
Return current width of subDir and mask.
Istream and Ostream manipulators taking arguments.
int main(int argc, char *argv[])
static string subDir(const label)
Consistent zero-padded numbers for subdirectories.
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
List of IOobjects with searching and retrieving facilities.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
An STL-conforming hash table.
static const word prefix
The prefix to local: lagrangian.
static instantList timeDirs
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
T optionRead(const word &opt) const
Read a value from the named option.
bool insert(const Key &key)
Insert a new entry.
const word cloudName(propsDict.lookup("cloudName"))
bool optionFound(const word &opt) const
Return true if the named option is found.
void ensightParticlePositions(const polyMesh &mesh, const fileName &dataDir, const fileName &subDir, const word &cloudName, IOstream::streamFormat format)
const Time & time() const
Return the top-level database.
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
static void noParallel()
Remove the parallel options.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
Foam::argList args(argc, argv)
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
const fileName & globalCaseName() const
Return case name.
Miscellaneous collection of functions and template related to Ensight data.
streamFormat
Enumeration for the format of data in the stream.