mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
merge Mark's branch
This commit is contained in:
@ -39,6 +39,14 @@ Usage
|
||||
@param -zeroTime \n
|
||||
Include the often incomplete initial conditions.
|
||||
|
||||
@param -index \<start\>\n
|
||||
Ignore the time index contained in the time file and use a
|
||||
simple indexing when creating the @c Ensight/data/######## files.
|
||||
|
||||
@param -noMesh \n
|
||||
Suppress writing the geometry. Can be useful for converting partial
|
||||
results for a static geometry.
|
||||
|
||||
Note
|
||||
- no parallel data.
|
||||
- writes to @a Ensight directory to avoid collisions with foamToEnsight.
|
||||
@ -70,6 +78,8 @@ int main(int argc, char *argv[])
|
||||
timeSelector::addOptions(true, false);
|
||||
argList::noParallel();
|
||||
argList::validOptions.insert("ascii", "");
|
||||
argList::validOptions.insert("index", "start");
|
||||
argList::validOptions.insert("noMesh", "");
|
||||
|
||||
const word volFieldTypes[] =
|
||||
{
|
||||
@ -104,6 +114,18 @@ int main(int argc, char *argv[])
|
||||
format = IOstream::ASCII;
|
||||
}
|
||||
|
||||
// control for renumbering iterations
|
||||
bool optIndex = false;
|
||||
label indexingNumber = 0;
|
||||
if (args.options().found("index"))
|
||||
{
|
||||
optIndex = true;
|
||||
indexingNumber = readLabel(IStringStream(args.options()["index"])());
|
||||
}
|
||||
|
||||
// always write the geometry, unless the -noMesh option is specified
|
||||
bool optNoMesh = args.options().found("noMesh");
|
||||
|
||||
fileName ensightDir = args.rootPath()/args.globalCaseName()/"Ensight";
|
||||
fileName dataDir = ensightDir/"data";
|
||||
fileName caseFileName = "Ensight.case";
|
||||
@ -146,6 +168,13 @@ int main(int argc, char *argv[])
|
||||
# include "findFields.H"
|
||||
# include "validateFields.H"
|
||||
|
||||
if (hasMovingMesh && optNoMesh)
|
||||
{
|
||||
Info<< "mesh is moving: ignoring '-noMesh' option" << endl;
|
||||
optNoMesh = false;
|
||||
}
|
||||
|
||||
|
||||
// map times used
|
||||
Map<scalar> timeIndices;
|
||||
|
||||
@ -192,15 +221,18 @@ int main(int argc, char *argv[])
|
||||
partsList.recalculate(mesh);
|
||||
}
|
||||
|
||||
fileName geomDir;
|
||||
if (hasMovingMesh)
|
||||
if (!optNoMesh)
|
||||
{
|
||||
geomDir = dataDir/subDir;
|
||||
}
|
||||
fileName geomDir;
|
||||
if (hasMovingMesh)
|
||||
{
|
||||
geomDir = dataDir/subDir;
|
||||
}
|
||||
|
||||
ensightGeoFile geoFile(ensightDir/geomDir/geometryName, format);
|
||||
partsList.writeGeometry(geoFile);
|
||||
Info << nl;
|
||||
ensightGeoFile geoFile(ensightDir/geomDir/geometryName, format);
|
||||
partsList.writeGeometry(geoFile);
|
||||
Info<< nl;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "write volume field (" << flush;
|
||||
|
||||
@ -1,9 +1,13 @@
|
||||
// Read time index from */uniform/time,
|
||||
// but treat 0 and constant specially
|
||||
// Read time index from */uniform/time, but treat 0 and constant specially
|
||||
// or simply increment from the '-index' option if it was supplied
|
||||
|
||||
label timeIndex = 0;
|
||||
|
||||
if
|
||||
if (optIndex)
|
||||
{
|
||||
timeIndex = indexingNumber++;
|
||||
}
|
||||
else if
|
||||
(
|
||||
runTime.timeName() != "constant"
|
||||
&& runTime.timeName() != "0"
|
||||
@ -22,19 +26,8 @@
|
||||
|
||||
if (io.headerOk())
|
||||
{
|
||||
IOdictionary timeObject
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"time",
|
||||
runTime.timeName(),
|
||||
"uniform",
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
io.readOpt() = IOobject::MUST_READ;
|
||||
IOdictionary timeObject(io);
|
||||
|
||||
timeObject.lookup("index") >> timeIndex;
|
||||
}
|
||||
|
||||
@ -1,28 +1,18 @@
|
||||
{
|
||||
IOobject ioPoints
|
||||
IOobject io
|
||||
(
|
||||
"points",
|
||||
"points",
|
||||
runTime.timeName(),
|
||||
polyMesh::meshSubDir,
|
||||
mesh
|
||||
);
|
||||
|
||||
if (ioPoints.headerOk())
|
||||
|
||||
if (io.headerOk())
|
||||
{
|
||||
// Reading new points
|
||||
pointIOField newPoints
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
mesh.time().timeName(),
|
||||
polyMesh::meshSubDir,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
// Read new points
|
||||
io.readOpt() = IOobject::MUST_READ;
|
||||
pointIOField newPoints(io);
|
||||
|
||||
mesh.movePoints(newPoints);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,8 @@ forAllIter(HashTable<word>, volumeFields, fieldIter)
|
||||
const word& fieldName = fieldIter.key();
|
||||
const word& fieldType = fieldIter();
|
||||
|
||||
if (fieldName.size() > 2 && fieldName(fieldName.size() - 2, 2) != "_0")
|
||||
// ignore _0 fields
|
||||
if (fieldName.size() > 2 && fieldName(fieldName.size() - 2, 2) == "_0")
|
||||
{
|
||||
volumeFields.erase(fieldIter);
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
# create a plugin that adds a reader to the ParaView GUI
|
||||
# it is added in the file dialog when doing opens/saves.
|
||||
|
||||
@ -16,8 +15,8 @@ LINK_DIRECTORIES(
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
$ENV{FOAM_SRC}/OpenFOAM/lnInclude
|
||||
$ENV{FOAM_SRC}/finiteVolume/lnInclude
|
||||
$ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
|
||||
$ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
|
||||
${PROJECT_SOURCE_DIR}/../vtkPV3Foam
|
||||
)
|
||||
|
||||
@ -52,3 +51,4 @@ TARGET_LINK_LIBRARIES(
|
||||
finiteVolume
|
||||
vtkPV3Foam
|
||||
)
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -16,8 +16,12 @@ SET(PVFoamReader_LIBS
|
||||
vtkGraphics
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES($ENV{FOAM_SRC}/OpenFOAM/lnInclude $ENV{FOAM_SRC}/finiteVolume/lnInclude)
|
||||
INCLUDE_DIRECTORIES($ENV{ParaView_INST_DIR}/include ../vtkFoam/lnInclude)
|
||||
INCLUDE_DIRECTORIES(
|
||||
$ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
|
||||
$ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
|
||||
$ENV{ParaView_INST_DIR}/include
|
||||
../vtkFoam/lnInclude
|
||||
)
|
||||
ADD_DEFINITIONS(-D$ENV{WM_PRECISION_OPTION})
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@ -72,3 +76,4 @@ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PVFoamReader.pvsm.in
|
||||
${PROJECT_BINARY_DIR}/../${PROJECT_NAME}.pvsm @ONLY IMMEDIATE)
|
||||
|
||||
TARGET_LINK_LIBRARIES(${PROJECT_NAME} OpenFOAM finiteVolume vtkFoam)
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -94,7 +94,7 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/browser/lnInclude \
|
||||
-I$(FOAM_SRC)/lagrangian/basic/lnInclude
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
$(FV_LIBS) \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/sampling/lnInclude \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(FOAM_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/postProcessing/postCalc \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
Reference in New Issue
Block a user