93 if (nameList[i] == name)
104 int main(
int argc,
char *argv[])
112 "write in ASCII format instead of 'C Binary'" 117 "write values in nodes" 122 "suppress writing any patches" 128 "specify particular patches to write - eg '(outlet \"inlet.*\")'. " 129 "An empty list suppresses writing the internalMesh." 135 "specify faceZones to write - eg '( slice \"mfp-.*\" )'." 141 "specify fields to export (all by default) - eg '( \"U.*\" )'." 147 "specify cellZone to write" 170 const label nVolFieldTypes = 5;
171 const word volFieldTypes[] =
177 volTensorField::typeName
186 if (
isDir(ensightDir))
199 OFstream *ensightCaseFilePtr =
nullptr;
202 fileName caseFileName = prepend +
"case";
203 Info<<
nl <<
"write case: " << caseFileName.c_str() <<
endl;
208 ensightDir/caseFileName,
214 <<
"type: ensight gold" <<
nl <<
nl;
217 OFstream& ensightCaseFile = *ensightCaseFilePtr;
246 Info<<
"Converting cellZone " << cellZoneName
247 <<
" only (puts outside faces into patch " 252 meshSubsetter.setLargeCellSubset(c0, 0);
258 meshSubsetter.hasSubMesh()
259 ? meshSubsetter.subMesh()
260 : meshSubsetter.baseMesh()
279 Info<<
"Detected a moving mesh (multiple polyMesh/points files)." 280 <<
" Writing meshes for every timestep." <<
endl;
287 word geomFileName = prepend +
"0000";
292 geomFileName = prepend +
"****";
298 << (geomFileName +
".mesh").c_str() <<
nl;
322 IOobject* positionsPtr = cloudObjs.lookup(
word(
"positions"));
326 allCloudNames.
insert(cloudDirs[cloudI]);
352 allCloudFields.
find(cloudIter.key());
371 if (obj.
name() !=
"positions")
384 label nTimeSteps = 0;
396 if (timeIndex != 0 && meshSubsetter.hasSubMesh())
398 Info<<
"Converting cellZone " << cellZoneName
399 <<
" only (puts outside faces into patch " 404 meshSubsetter.setLargeCellSubset(c0, 0);
431 ensightCaseFile<<
nl <<
"VARIABLE" <<
nl;
438 for (
label i=0; i<nVolFieldTypes; i++)
444 const word& fieldName = fieldNames[j];
504 ensightField<sphericalTensor>
519 ensightField<symmTensor>
531 else if (volFieldTypes[i] == volTensorField::typeName)
555 const word& cloudName = cloudIter.key();
563 bool cloudExists = inFileNameList(currentCloudDirs, cloudName);
575 const word& fieldName = fieldIter.key();
576 const word& fieldType = fieldIter();
593 ensightCloudField<scalar>
606 ensightCloudField<vector>
619 Info<<
"Unable to convert field type " << fieldType
620 <<
" for field " << fieldName <<
endl;
630 delete ensightCaseFilePtr;
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
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.
const word & name() const
Return name.
bool typeHeaderOk(const bool checkType=true)
Read header (uses typeFilePath to find file) and check header.
A class for handling file names.
List of IOobjects with searching and retrieving facilities.
const fileName & globalCaseName() const
Return case name.
const meshCellZones & cellZones() const
Return cell zones.
fileName timePath() const
Return current time path.
static const char *const typeName
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const fileName & rootPath() const
Return root path.
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.
void size(const label)
Override size to be inconsistent with allocated storage.
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.
static bool master(const label communicator=0)
Am I the master process.
void ensightParticlePositions(const polyMesh &mesh, const fileName &dataDir, const fileName &subDir, const word &cloudName, IOstream::streamFormat format)
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
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.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
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.
static void addOption(const word &opt, const string ¶m="", const string &usage="")
Add to an option to validOptions with usage information.
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
An STL-conforming hash table.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
bool rmDir(const fileName &)
Remove a directory and its contents.
Istream and Ostream manipulators taking arguments.
static const word prefix
The prefix to local: lagrangian.
Post-processing mesh subset tool. Given the original mesh and the list of selected cells...
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.
A collection of cell labels.
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.
List< wordRe > wordReList
A List of wordRe (word or regular expression)
readUpdateState
Enumeration defining the state of the mesh after a read update.
T & last()
Return the last element of the list.
Foam::argList args(argc, argv)
const word & headerClassName() const
Return name of the class name read from header.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A primitive field of type <T> with automated input and output.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.