mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
GIT: Resolved conflicts arising from merge with develop branch
This commit is contained in:
@ -48,6 +48,13 @@ Usage
|
||||
Ignore the time index contained in the time file and use a
|
||||
simple indexing when creating the \c Ensight/data/######## files.
|
||||
|
||||
- \par -noLagrangian \n
|
||||
Suppress writing lagrangian positions and fields.
|
||||
|
||||
- \par -index \<start\>\n
|
||||
Ignore the time index contained in the time file and use a
|
||||
simple indexing when creating the \c Ensight/data/######## files.
|
||||
|
||||
- \par -noMesh
|
||||
Suppress writing the geometry. Can be useful for converting partial
|
||||
results for a static geometry.
|
||||
@ -83,8 +90,8 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
// enable -constant
|
||||
// probably don't need -withZero though, since the fields are vetted
|
||||
// Enable -constant
|
||||
// Probably don't need -withZero though, since the fields are vetted
|
||||
// afterwards anyhow
|
||||
timeSelector::addOptions(true, false);
|
||||
argList::noParallel();
|
||||
@ -101,6 +108,11 @@ int main(int argc, char *argv[])
|
||||
"and use simple indexing when creating the files"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"noLagrangian",
|
||||
"suppress writing lagrangian positions and fields"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"noMesh",
|
||||
"suppress writing the geometry. "
|
||||
@ -120,7 +132,7 @@ int main(int argc, char *argv[])
|
||||
"width of Ensight data subdir"
|
||||
);
|
||||
|
||||
// the volume field types that we handle
|
||||
// The volume field types that we handle
|
||||
wordHashSet volFieldTypes;
|
||||
volFieldTypes.insert(volScalarField::typeName);
|
||||
volFieldTypes.insert(volVectorField::typeName);
|
||||
@ -128,7 +140,7 @@ int main(int argc, char *argv[])
|
||||
volFieldTypes.insert(volSymmTensorField::typeName);
|
||||
volFieldTypes.insert(volTensorField::typeName);
|
||||
|
||||
// the lagrangian field types that we handle
|
||||
// The lagrangian field types that we handle
|
||||
wordHashSet cloudFieldTypes;
|
||||
cloudFieldTypes.insert(scalarIOField::typeName);
|
||||
cloudFieldTypes.insert(vectorIOField::typeName);
|
||||
@ -145,30 +157,32 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "createTime.H"
|
||||
|
||||
// get times list
|
||||
// Get times list
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
|
||||
// default to binary output, unless otherwise specified
|
||||
IOstream::streamFormat format = IOstream::BINARY;
|
||||
if (args.optionFound("ascii"))
|
||||
{
|
||||
format = IOstream::ASCII;
|
||||
}
|
||||
// Default to binary output, unless otherwise specified
|
||||
const IOstream::streamFormat format =
|
||||
(
|
||||
args.optionFound("ascii")
|
||||
? IOstream::ASCII
|
||||
: IOstream::BINARY
|
||||
);
|
||||
|
||||
// control for renumbering iterations
|
||||
// Control for renumbering iterations
|
||||
label indexingNumber = 0;
|
||||
bool optIndex = args.optionReadIfPresent("index", indexingNumber);
|
||||
const bool optIndex = args.optionReadIfPresent("index", indexingNumber);
|
||||
const bool noLagrangian = args.optionFound("noLagrangian");
|
||||
|
||||
// always write the geometry, unless the -noMesh option is specified
|
||||
// Always write the geometry, unless the -noMesh option is specified
|
||||
bool optNoMesh = args.optionFound("noMesh");
|
||||
|
||||
// adjust output width
|
||||
// Adjust output width
|
||||
if (args.optionFound("width"))
|
||||
{
|
||||
ensightFile::subDirWidth(args.optionRead<label>("width"));
|
||||
}
|
||||
|
||||
// define sub-directory name to use for Ensight data
|
||||
// Define sub-directory name to use for Ensight data
|
||||
fileName ensightDir = "Ensight";
|
||||
args.optionReadIfPresent("name", ensightDir);
|
||||
|
||||
@ -190,7 +204,7 @@ int main(int argc, char *argv[])
|
||||
<< " " << ensightDir << endl;
|
||||
}
|
||||
|
||||
// as per mkdir -p "Ensight/data"
|
||||
// As per mkdir -p "Ensight/data"
|
||||
mkDir(ensightDir);
|
||||
mkDir(dataDir);
|
||||
|
||||
@ -204,10 +218,15 @@ int main(int argc, char *argv[])
|
||||
regionPrefix = regionName;
|
||||
}
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
Info<< "Converting " << timeDirs.size() << " time steps" << endl;
|
||||
}
|
||||
|
||||
// Construct the list of ensight parts for the entire mesh
|
||||
ensightParts partsList(mesh);
|
||||
|
||||
// write summary information
|
||||
// Write summary information
|
||||
{
|
||||
OFstream partsInfoFile(ensightDir/"partsInfo");
|
||||
|
||||
@ -226,7 +245,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
// map times used
|
||||
// Map times used
|
||||
Map<scalar> timeIndices;
|
||||
|
||||
// TODO: Track the time indices used by the geometry
|
||||
@ -244,6 +263,9 @@ int main(int argc, char *argv[])
|
||||
cloudTimesUsed.insert(cloudIter.key(), DynamicList<label>());
|
||||
}
|
||||
|
||||
Info<< "Startup in "
|
||||
<< timer.cpuTimeIncrement() << " s, "
|
||||
<< mem.update().size() << " kB" << nl << endl;
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
@ -251,15 +273,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "getTimeIndex.H"
|
||||
|
||||
// remember the time index for the volume fields
|
||||
// Remember the time index for the volume fields
|
||||
fieldTimesUsed.append(timeIndex);
|
||||
|
||||
// the data/ITER subdirectory must exist
|
||||
// The data/ITER subdirectory must exist
|
||||
// Note that data/ITER is indeed a valid ensight::FileName
|
||||
const fileName subDir = ensightFile::subDir(timeIndex);
|
||||
mkDir(dataDir/subDir);
|
||||
|
||||
// place a timestamp in the directory for future reference
|
||||
// Place a timestamp in the directory for future reference
|
||||
{
|
||||
OFstream timeStamp(dataDir/subDir/"time");
|
||||
timeStamp
|
||||
@ -280,7 +302,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (hasMovingMesh)
|
||||
{
|
||||
// remember the time index for the geometry
|
||||
// Remember the time index for the geometry
|
||||
geometryTimesUsed.append(timeIndex);
|
||||
}
|
||||
|
||||
@ -294,7 +316,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "write volume field (" << flush;
|
||||
Info<< "Write volume field (" << flush;
|
||||
|
||||
forAllConstIter(HashTable<word>, volumeFields, fieldIter)
|
||||
{
|
||||
@ -376,19 +398,13 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
Info<< " )" << endl;
|
||||
|
||||
// check for clouds
|
||||
// Check for clouds
|
||||
forAllConstIter(HashTable<HashTable<word>>, cloudFields, cloudIter)
|
||||
{
|
||||
const word& cloudName = cloudIter.key();
|
||||
const fileName& cloudPrefix = regionPrefix/cloud::prefix;
|
||||
|
||||
if
|
||||
(
|
||||
!isDir
|
||||
(
|
||||
runTime.timePath()/regionPrefix/
|
||||
cloud::prefix/cloudName
|
||||
)
|
||||
)
|
||||
if (!isDir(runTime.timePath()/cloudPrefix/cloudName))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -397,28 +413,25 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
cloud::prefix/cloudName
|
||||
cloudPrefix/cloudName
|
||||
);
|
||||
|
||||
// check that the positions field is present for this time
|
||||
IOobject* positionPtr = cloudObjs.lookup(word("positions"));
|
||||
if (positionPtr != nullptr)
|
||||
{
|
||||
ensightParticlePositions
|
||||
(
|
||||
mesh,
|
||||
dataDir,
|
||||
subDir,
|
||||
cloudName,
|
||||
format
|
||||
);
|
||||
}
|
||||
else
|
||||
// Check that the positions field is present for this time
|
||||
if (!cloudObjs.found("positions"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Info<< "write " << cloudName << " (" << flush;
|
||||
Info<< "Write " << cloudName << " ( positions" << flush;
|
||||
|
||||
ensightParticlePositions
|
||||
(
|
||||
mesh,
|
||||
dataDir,
|
||||
subDir,
|
||||
cloudName,
|
||||
format
|
||||
);
|
||||
|
||||
forAllConstIter(HashTable<word>, cloudIter(), fieldIter)
|
||||
{
|
||||
@ -430,7 +443,7 @@ int main(int argc, char *argv[])
|
||||
if (!fieldObject)
|
||||
{
|
||||
Info<< "missing "
|
||||
<< runTime.timeName()/cloud::prefix/cloudName
|
||||
<< runTime.timeName()/cloudPrefix/cloudName
|
||||
/ fieldName
|
||||
<< endl;
|
||||
continue;
|
||||
@ -476,7 +489,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< " )" << endl;
|
||||
|
||||
// remember the time index
|
||||
// Remember the time index
|
||||
cloudTimesUsed[cloudName].append(timeIndex);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user