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.
name() <<
nl;
253 #include "moveMesh.H"
255 if (timeI == 0 || mesh.moving())
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>
367 runTime.timePath()/regionPrefix/
383 IOobject* positionPtr = cloudObjs.lookup(
word(
"positions"));
384 if (positionPtr !=
nullptr)
404 const word& fieldName = fieldIter.key();
405 const word& fieldType = fieldIter();
420 ensightLagrangianField<scalar>
432 ensightLagrangianField<vector>
444 ensightLagrangianField<tensor>
Istream and Ostream manipulators taking arguments.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
static const char *const typeName
A HashTable with keys but without contents.
bool insert(const Key &key)
Insert a new entry.
An STL-conforming hash table.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
List of IOobjects with searching and retrieving facilities.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
streamFormat
Enumeration for the format of data in the stream.
A HashTable to objects of type <T> with a label key.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
const fileName & globalCaseName() const
Return case name.
T optionRead(const word &opt) const
Read a value from the named option.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
static void noParallel()
Remove the parallel options.
const fileName & rootPath() const
Return root path.
static const word prefix
The prefix to local: lagrangian.
static label subDirWidth()
Return current width of subDir and mask.
static string subDir(const label)
Consistent zero-padded numbers for subdirectories.
static string mask()
The '*' mask appropriate for subDir.
Specialised Ensight output with extra geometry file header.
A collection of several ensightPart elements.
A class for handling file names.
bool isAbsolute() const
Return true if file name is absolute.
word name() const
Return file name (part beyond last /)
static word defaultRegion
Return the default region name.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
A class for handling words, derived from string.
Miscellaneous collection of functions and template related to Ensight data.
int main(int argc, char *argv[])
HashTable< HashTable< word > > cloudFields
HashTable< word > volumeFields
IOobject fieldObject(fieldNames[var2field[nVar]], runTime.name(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE)
static instantList timeDirs
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const word & regionName(const solver ®ion)
void ensightParticlePositions(const polyMesh &mesh, const fileName &dataDir, const fileName &subDir, const word &cloudName, IOstream::streamFormat format)
bool isDir(const fileName &, const bool followLink=true)
Does the name exist as a directory in the file system?
Ostream & flush(Ostream &os)
Flush stream.
word format(conversionProperties.lookup("format"))
Foam::argList args(argc, argv)
const word cloudName(propsDict.lookup("cloudName"))