Go to the documentation of this file.
146 #include "readFields.H"
147 #include "writeVolFields.H"
148 #include "writeDimFields.H"
149 #include "writePointFields.H"
150 #include "writeAreaFields.H"
154 #undef foamToEnsight_useTimeIndex
156 using namespace Foam;
160 int main(
int argc,
char *argv[])
164 "Translate OpenFOAM data to Ensight format with individual parts"
165 " for cellZones, unzoned cells and patches"
178 "Write in ASCII format instead of 'C Binary'"
184 "Starting index for consecutive number of Ensight data/ files."
185 " Ignore the time index contained in the uniform/time file."
192 "Sub-directory name for Ensight output (default: 'EnSight')"
197 "Suppress removal of existing EnSight output directory"
203 "Width of Ensight data subdir"
208 "Use zero-gradient cell values on patches"
214 "Force interpolation of values to nodes"
220 "Suppress writing any patches"
227 "Suppress writing the internal mesh"
232 "Suppress writing any cellZones"
237 "Suppress writing lagrangian positions and fields"
244 "Suppress conversion of pointFields, disable -nodeValues"
249 "Suppress writing the geometry."
250 " Can be useful for converting partial results for a static geometry"
263 "Write finite area fields",
271 "Specify single patch or multiple patches to write\n"
272 "Eg, 'inlet' or '(outlet \"inlet.*\")'"
278 "Exclude single or multiple patches from writing\n"
279 "Eg, 'outlet' or '( inlet \".*Wall\" )'"
286 "Specify single or multiple faceZones to write\n"
287 "Eg, 'cells' or '( slice \"mfp-.*\" )'."
293 "Specify single or multiple fields to write (all by default)\n"
294 "Eg, 'T' or '( \"U.*\" )'"
300 "Specify single or multiple cellZones to write\n"
301 "Eg, 'cells' or '( slice \"mfp-.*\" )'."
318 const bool doBoundary = !
args.
found(
"no-boundary");
319 const bool doInternal = !
args.
found(
"no-internal");
320 const bool doCellZones = !
args.
found(
"no-cellZones");
321 const bool doLagrangian = !
args.
found(
"no-lagrangian");
322 const bool doFiniteArea =
args.
found(
"finite-area");
323 const bool doPointValues = !
args.
found(
"no-point-data");
324 const bool nearCellValue =
args.
found(
"nearCellValue") && doBoundary;
327 label indexingNumber(0);
331 bool doGeometry = !
args.
found(
"no-mesh");
335 Info<<
"Using neighbouring cell value instead of patch value"
340 Info<<
"Point fields and interpolated point data"
341 <<
" disabled with the '-no-point-data' option"
351 caseOpts.nodeValues(doPointValues &&
args.
found(
"nodeValues"));
353 caseOpts.overwrite(!
args.
found(
"no-overwrite"));
408 if (!outputDir.isAbsolute())
420 #include "createMeshAccounting.H"
424 Info<<
"Converting " << timeDirs.size() <<
" time steps" <<
nl;
432 Info<<
"has moving mesh: ignoring '-no-mesh' option" <<
endl;
448 <<
timer.cpuTimeIncrement() <<
" s, "
457 #include "getTimeIndex.H"
489 ensCase.setTime(timeDirs[timei],
timeIndex);
492 ensFaCasePtr->setTime(timeDirs[timei],
timeIndex);
502 ensFaMeshPtr->expire();
503 ensFaMeshPtr->correct();
507 if ((timei == 0 || moving) && doGeometry)
517 if (ensFaCasePtr && ensFaMeshPtr)
529 objects.filterObjects
535 #include "convertVolumeFields.H"
538 #include "convertAreaFields.H"
541 #include "convertLagrangian.H"
545 <<
timer.cpuTimeIncrement() <<
" s, "
564 <<
timer.elapsedCpuTime() <<
" s, "
A class for handling words, derived from Foam::string.
A class for handling file names.
static word defaultRegion
T getOrDefault(const word &optName, const T &deflt) const
const wordRes & patchExclude() const noexcept
bool useInternalMesh() const noexcept
const wordRes & faceZoneSelection() const noexcept
static word timeName(const scalar t, const int precision=precision_)
static void addNote(const string ¬e)
static bool master(const label communicator=worldComm)
static void addOptionCompat(const word &optName, std::pair< const char *, int > compat)
bool readListIfPresent(const word &optName, List< T > &list) const
Ostream & endl(Ostream &os)
Starts timing CPU usage and return elapsed time from start.
virtual Ostream & write(const char c)
bool readIfPresent(const word &optName, T &val) const
A collection of functions for writing areaField content in ensight format.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
PtrList< ensightMesh > ensightMeshes(regionNames.size())
virtual readUpdateState readUpdate()
Combination-Reduction operation for a parallel run. The information from all nodes is collected on th...
word format(conversionProperties.get< word >("format"))
List< wordHashSet > availableRegionObjectNames(meshes.size())
Foam::PtrList< Foam::fvMesh > meshes(regionNames.size())
bool useCellZones() const noexcept
Istream and Ostream manipulators taking arguments.
static void setAdvanced(const word &optName, bool advanced=true)
OBJstream os(runTime.globalPath()/outputName)
A collection of functions for writing volField content in ensight format.
Memory usage information for the current process, and the system memory that is free.
List of IOobjects with searching and retrieving facilities.
const wordRes & patchSelection() const noexcept
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
@ ASCII
"ascii" (normal default)
PtrList< ensightFaMesh > ensightMeshesFa(regionNames.size())
static void addOptions(const bool constant=true, const bool withZero=false)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void setTime(const Time &t)
const wordRes & cellZoneSelection() const noexcept
Implements a timeout mechanism via sigalarm.
A List of wordRe with additional matching capabilities.
fileName globalPath() const
A collection of functions for writing clouds as ensight file content.
bool hasMovingMesh(false)
PtrList< ensightCase > ensightCases(regionNames.size())
List< T > getList(const label index) const
void print(Ostream &os) const
static instantList select0(Time &runTime, const argList &args)
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)
Header files for all the primitive types that Fields are instantiated for.
bool useBoundaryMesh() const noexcept
PtrList< ensightCase > ensightCasesFa(regionNames.size())
bool found(const word &optName) const