mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: getting foamToTecplot working again
- updated code to use current API level 142. - ThirdParty build of tecio now uses CMake.
This commit is contained in:
@ -43,7 +43,6 @@ Usage
|
||||
information as a single argument.
|
||||
|
||||
- \par -cellSet \<name\>
|
||||
|
||||
- \par -faceSet \<name\>
|
||||
Restrict conversion to the cellSet, faceSet.
|
||||
|
||||
@ -81,16 +80,11 @@ Usage
|
||||
#include "passiveParticleCloud.H"
|
||||
#include "faceSet.H"
|
||||
#include "stringListOps.H"
|
||||
#include "wordRe.H"
|
||||
#include "wordReList.H"
|
||||
|
||||
#include "meshSubsetHelper.H"
|
||||
#include "readFields.H"
|
||||
#include "tecplotWriter.H"
|
||||
|
||||
#include "TECIO.h"
|
||||
|
||||
// Note: needs to be after TECIO to prevent Foam::Time conflicting with
|
||||
// Xlib Time.
|
||||
#include "fvCFD.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -243,22 +237,22 @@ int main(int argc, char *argv[])
|
||||
|
||||
word cellSetName;
|
||||
word faceSetName;
|
||||
string vtkName = runTime.caseName();
|
||||
string pltName = runTime.caseName();
|
||||
|
||||
if (args.optionReadIfPresent("cellSet", cellSetName))
|
||||
{
|
||||
vtkName = cellSetName;
|
||||
pltName = cellSetName;
|
||||
}
|
||||
else if (Pstream::parRun())
|
||||
{
|
||||
// Strip off leading casename, leaving just processor_DDD ending.
|
||||
vtkName = runTime.caseName();
|
||||
pltName = runTime.caseName();
|
||||
|
||||
string::size_type i = vtkName.rfind("processor");
|
||||
string::size_type i = pltName.rfind("processor");
|
||||
|
||||
if (i != string::npos)
|
||||
{
|
||||
vtkName = vtkName.substr(i);
|
||||
pltName = pltName.substr(i);
|
||||
}
|
||||
}
|
||||
args.optionReadIfPresent("faceSet", faceSetName);
|
||||
@ -269,9 +263,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
// TecplotData/ directory in the case
|
||||
fileName fvPath(runTime.path()/"Tecplot360");
|
||||
// Directory of mesh (region0 gets filtered out)
|
||||
fileName regionPrefix = "";
|
||||
|
||||
// Directory of mesh (region0 gets filtered out)
|
||||
fileName regionPrefix;
|
||||
if (regionName != polyMesh::defaultRegion)
|
||||
{
|
||||
fvPath = fvPath/regionName;
|
||||
@ -293,7 +287,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Deleting old VTK files in " << fvPath << nl << endl;
|
||||
Info<< "Deleting old tecplot files in " << fvPath << nl << endl;
|
||||
|
||||
rmDir(fvPath);
|
||||
}
|
||||
@ -317,13 +311,13 @@ int main(int argc, char *argv[])
|
||||
polyMesh::readUpdateState meshState = myMesh.readUpdate();
|
||||
const fvMesh& mesh = myMesh.mesh();
|
||||
|
||||
INTEGER4 nFaceNodes = 0;
|
||||
// TotalNumFaceNodes
|
||||
int32_t nFaceNodes = 0;
|
||||
forAll(mesh.faces(), facei)
|
||||
{
|
||||
nFaceNodes += mesh.faces()[facei].size();
|
||||
}
|
||||
|
||||
|
||||
// Read all fields on the new mesh
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -463,23 +457,23 @@ int main(int argc, char *argv[])
|
||||
// ~~~~~~~~~~~~~~~
|
||||
|
||||
string varNames;
|
||||
DynamicList<INTEGER4> varLocation;
|
||||
DynamicList<int32_t> varLocation;
|
||||
|
||||
string cellVarNames;
|
||||
DynamicList<INTEGER4> cellVarLocation;
|
||||
DynamicList<int32_t> cellVarLocation;
|
||||
|
||||
// volFields
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
vsf,
|
||||
ValueLocation_CellCentered,
|
||||
tecplotWriter::CELL_CENTERED,
|
||||
varNames,
|
||||
varLocation
|
||||
);
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
vsf,
|
||||
ValueLocation_CellCentered,
|
||||
tecplotWriter::CELL_CENTERED,
|
||||
cellVarNames,
|
||||
cellVarLocation
|
||||
);
|
||||
@ -487,14 +481,14 @@ int main(int argc, char *argv[])
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
vvf,
|
||||
ValueLocation_CellCentered,
|
||||
tecplotWriter::CELL_CENTERED,
|
||||
varNames,
|
||||
varLocation
|
||||
);
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
vvf,
|
||||
ValueLocation_CellCentered,
|
||||
tecplotWriter::CELL_CENTERED,
|
||||
cellVarNames,
|
||||
cellVarLocation
|
||||
);
|
||||
@ -502,14 +496,14 @@ int main(int argc, char *argv[])
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
vSpheretf,
|
||||
ValueLocation_CellCentered,
|
||||
tecplotWriter::CELL_CENTERED,
|
||||
varNames,
|
||||
varLocation
|
||||
);
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
vSpheretf,
|
||||
ValueLocation_CellCentered,
|
||||
tecplotWriter::CELL_CENTERED,
|
||||
cellVarNames,
|
||||
cellVarLocation
|
||||
);
|
||||
@ -517,14 +511,14 @@ int main(int argc, char *argv[])
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
vSymmtf,
|
||||
ValueLocation_CellCentered,
|
||||
tecplotWriter::CELL_CENTERED,
|
||||
varNames,
|
||||
varLocation
|
||||
);
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
vSymmtf,
|
||||
ValueLocation_CellCentered,
|
||||
tecplotWriter::CELL_CENTERED,
|
||||
cellVarNames,
|
||||
cellVarLocation
|
||||
);
|
||||
@ -532,25 +526,24 @@ int main(int argc, char *argv[])
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
vtf,
|
||||
ValueLocation_CellCentered,
|
||||
tecplotWriter::CELL_CENTERED,
|
||||
varNames,
|
||||
varLocation
|
||||
);
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
vtf,
|
||||
ValueLocation_CellCentered,
|
||||
tecplotWriter::CELL_CENTERED,
|
||||
cellVarNames,
|
||||
cellVarLocation
|
||||
);
|
||||
|
||||
|
||||
|
||||
// pointFields
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
psf,
|
||||
ValueLocation_Nodal,
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
varNames,
|
||||
varLocation
|
||||
);
|
||||
@ -558,44 +551,45 @@ int main(int argc, char *argv[])
|
||||
tecplotWriter::getTecplotNames
|
||||
(
|
||||
pvf,
|
||||
ValueLocation_Nodal,
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
varNames,
|
||||
varLocation
|
||||
);
|
||||
|
||||
// strandID (= piece id. Gets incremented for every piece of geometry
|
||||
// that is output)
|
||||
INTEGER4 strandID = 1;
|
||||
|
||||
// strandID (= piece id).
|
||||
// Gets incremented for every piece of geometry that is output.
|
||||
int32_t strandID = 1;
|
||||
|
||||
if (meshState != polyMesh::UNCHANGED)
|
||||
{
|
||||
if (doWriteInternal)
|
||||
{
|
||||
// Output mesh and fields
|
||||
fileName vtkFileName
|
||||
fileName pltFileName
|
||||
(
|
||||
fvPath/vtkName
|
||||
fvPath/pltName
|
||||
+ "_"
|
||||
+ timeDesc
|
||||
+ ".plt"
|
||||
);
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
|
||||
string allVarNames = string("X Y Z ") + varNames;
|
||||
DynamicList<INTEGER4> allVarLocation;
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
const string allVarNames = tecplotWriter::XYZ + " " + varNames;
|
||||
DynamicList<int32_t> allVarLocation
|
||||
{
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
tecplotWriter::NODE_CENTERED
|
||||
};
|
||||
allVarLocation.append(varLocation);
|
||||
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
writer.writeInit
|
||||
(
|
||||
runTime.caseName(),
|
||||
allVarNames,
|
||||
vtkFileName,
|
||||
DataFileType_Full
|
||||
pltFileName,
|
||||
tecplotWriter::FILETYPE_FULL
|
||||
);
|
||||
|
||||
writer.writePolyhedralZone
|
||||
@ -607,41 +601,18 @@ int main(int argc, char *argv[])
|
||||
nFaceNodes
|
||||
);
|
||||
|
||||
// Write coordinates
|
||||
writer.writeField(mesh.points().component(0)());
|
||||
writer.writeField(mesh.points().component(1)());
|
||||
writer.writeField(mesh.points().component(2)());
|
||||
// Coordinates
|
||||
writer.writeField(mesh.points());
|
||||
|
||||
// Write all fields
|
||||
forAll(vsf, i)
|
||||
{
|
||||
writer.writeField(vsf[i]);
|
||||
}
|
||||
forAll(vvf, i)
|
||||
{
|
||||
writer.writeField(vvf[i]);
|
||||
}
|
||||
forAll(vSpheretf, i)
|
||||
{
|
||||
writer.writeField(vSpheretf[i]);
|
||||
}
|
||||
forAll(vSymmtf, i)
|
||||
{
|
||||
writer.writeField(vSymmtf[i]);
|
||||
}
|
||||
forAll(vtf, i)
|
||||
{
|
||||
writer.writeField(vtf[i]);
|
||||
}
|
||||
writer.writeFields(vsf);
|
||||
writer.writeFields(vvf);
|
||||
writer.writeFields(vSpheretf);
|
||||
writer.writeFields(vSymmtf);
|
||||
writer.writeFields(vtf);
|
||||
|
||||
forAll(psf, i)
|
||||
{
|
||||
writer.writeField(psf[i]);
|
||||
}
|
||||
forAll(pvf, i)
|
||||
{
|
||||
writer.writeField(pvf[i]);
|
||||
}
|
||||
writer.writeFields(psf);
|
||||
writer.writeFields(pvf);
|
||||
|
||||
writer.writeConnectivity(mesh);
|
||||
writer.writeEnd();
|
||||
@ -654,22 +625,22 @@ int main(int argc, char *argv[])
|
||||
if (timeI == 0)
|
||||
{
|
||||
// Output static mesh only
|
||||
fileName vtkFileName
|
||||
fileName pltFileName
|
||||
(
|
||||
fvPath/vtkName
|
||||
fvPath/pltName
|
||||
+ "_grid_"
|
||||
+ timeDesc
|
||||
+ ".plt"
|
||||
);
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
writer.writeInit
|
||||
(
|
||||
runTime.caseName(),
|
||||
"X Y Z",
|
||||
vtkFileName,
|
||||
DataFileType_Grid
|
||||
tecplotWriter::XYZ,
|
||||
pltFileName,
|
||||
tecplotWriter::FILETYPE_GRID
|
||||
);
|
||||
|
||||
writer.writePolyhedralZone
|
||||
@ -677,36 +648,33 @@ int main(int argc, char *argv[])
|
||||
mesh.name(), // regionName
|
||||
strandID, // strandID
|
||||
mesh,
|
||||
List<INTEGER4>(3, ValueLocation_Nodal),
|
||||
List<int32_t>(3, tecplotWriter::NODE_CENTERED),
|
||||
nFaceNodes
|
||||
);
|
||||
|
||||
// Write coordinates
|
||||
writer.writeField(mesh.points().component(0)());
|
||||
writer.writeField(mesh.points().component(1)());
|
||||
writer.writeField(mesh.points().component(2)());
|
||||
|
||||
// Coordinates
|
||||
writer.writeField(mesh.points());
|
||||
writer.writeConnectivity(mesh);
|
||||
writer.writeEnd();
|
||||
}
|
||||
|
||||
// Output solution file
|
||||
fileName vtkFileName
|
||||
fileName pltFileName
|
||||
(
|
||||
fvPath/vtkName
|
||||
fvPath/pltName
|
||||
+ "_"
|
||||
+ timeDesc
|
||||
+ ".plt"
|
||||
);
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
writer.writeInit
|
||||
(
|
||||
runTime.caseName(),
|
||||
varNames,
|
||||
vtkFileName,
|
||||
DataFileType_Solution
|
||||
pltFileName,
|
||||
tecplotWriter::FILETYPE_SOLUTION
|
||||
);
|
||||
|
||||
writer.writePolyhedralZone
|
||||
@ -719,35 +687,15 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// Write all fields
|
||||
forAll(vsf, i)
|
||||
{
|
||||
writer.writeField(vsf[i]);
|
||||
}
|
||||
forAll(vvf, i)
|
||||
{
|
||||
writer.writeField(vvf[i]);
|
||||
}
|
||||
forAll(vSpheretf, i)
|
||||
{
|
||||
writer.writeField(vSpheretf[i]);
|
||||
}
|
||||
forAll(vSymmtf, i)
|
||||
{
|
||||
writer.writeField(vSymmtf[i]);
|
||||
}
|
||||
forAll(vtf, i)
|
||||
{
|
||||
writer.writeField(vtf[i]);
|
||||
}
|
||||
writer.writeFields(vsf);
|
||||
writer.writeFields(vvf);
|
||||
writer.writeFields(vSpheretf);
|
||||
writer.writeFields(vSymmtf);
|
||||
writer.writeFields(vtf);
|
||||
|
||||
writer.writeFields(psf);
|
||||
writer.writeFields(pvf);
|
||||
|
||||
forAll(psf, i)
|
||||
{
|
||||
writer.writeField(psf[i]);
|
||||
}
|
||||
forAll(pvf, i)
|
||||
{
|
||||
writer.writeField(pvf[i]);
|
||||
}
|
||||
writer.writeEnd();
|
||||
}
|
||||
}
|
||||
@ -765,11 +713,11 @@ int main(int argc, char *argv[])
|
||||
labelList faceLabels(faceSet(mesh, faceSetName).toc());
|
||||
|
||||
// Filename as if patch with same name.
|
||||
mkDir(fvPath/setName);
|
||||
mkDir(fvPath/faceSetName);
|
||||
|
||||
fileName patchFileName
|
||||
(
|
||||
fvPath/setName/setName
|
||||
fvPath/faceSetName/faceSetName
|
||||
+ "_"
|
||||
+ timeDesc
|
||||
+ ".plt"
|
||||
@ -777,21 +725,23 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< " FaceSet : " << patchFileName << endl;
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
|
||||
string allVarNames = string("X Y Z ") + cellVarNames;
|
||||
DynamicList<INTEGER4> allVarLocation;
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
const string allVarNames = tecplotWriter::XYZ + " " + cellVarNames;
|
||||
DynamicList<int32_t> allVarLocation
|
||||
{
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
tecplotWriter::NODE_CENTERED
|
||||
};
|
||||
allVarLocation.append(cellVarLocation);
|
||||
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
writer.writeInit
|
||||
(
|
||||
runTime.caseName(),
|
||||
cellVarNames,
|
||||
patchFileName,
|
||||
DataFileType_Full
|
||||
tecplotWriter::FILETYPE_FULL
|
||||
);
|
||||
|
||||
const indirectPrimitivePatch ipp
|
||||
@ -802,16 +752,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
writer.writePolygonalZone
|
||||
(
|
||||
setName,
|
||||
faceSetName,
|
||||
strandID++,
|
||||
ipp,
|
||||
allVarLocation
|
||||
);
|
||||
|
||||
// Write coordinates
|
||||
writer.writeField(ipp.localPoints().component(0)());
|
||||
writer.writeField(ipp.localPoints().component(1)());
|
||||
writer.writeField(ipp.localPoints().component(2)());
|
||||
// Coordinates
|
||||
writer.writeField(ipp.localPoints());
|
||||
|
||||
// Write all volfields
|
||||
forAll(vsf, i)
|
||||
@ -822,7 +770,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
linearInterpolate(vsf[i])(),
|
||||
faceLabels
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vvf, i)
|
||||
@ -833,7 +781,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
linearInterpolate(vvf[i])(),
|
||||
faceLabels
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vSpheretf, i)
|
||||
@ -844,7 +792,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
linearInterpolate(vSpheretf[i])(),
|
||||
faceLabels
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vSymmtf, i)
|
||||
@ -855,7 +803,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
linearInterpolate(vSymmtf[i])(),
|
||||
faceLabels
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vtf, i)
|
||||
@ -866,7 +814,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
linearInterpolate(vtf[i])(),
|
||||
faceLabels
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
writer.writeConnectivity(ipp);
|
||||
@ -908,33 +856,37 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< " Combined patches : " << patchFileName << endl;
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
|
||||
string allVarNames = string("X Y Z ") + varNames;
|
||||
DynamicList<INTEGER4> allVarLocation;
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
const string allVarNames = tecplotWriter::XYZ + " " + varNames;
|
||||
DynamicList<int32_t> allVarLocation
|
||||
{
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
tecplotWriter::NODE_CENTERED
|
||||
};
|
||||
allVarLocation.append(varLocation);
|
||||
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
writer.writeInit
|
||||
(
|
||||
runTime.caseName(),
|
||||
allVarNames,
|
||||
patchFileName,
|
||||
DataFileType_Full
|
||||
tecplotWriter::FILETYPE_FULL
|
||||
);
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchID = patchIDs[i];
|
||||
const polyPatch& pp = patches[patchID];
|
||||
//INTEGER4 strandID = 1 + i;
|
||||
// int32_t strandID = 1 + i;
|
||||
|
||||
if (pp.size() > 0)
|
||||
{
|
||||
Info<< " Writing patch " << patchID << "\t" << pp.name()
|
||||
<< "\tstrand:" << strandID << nl << endl;
|
||||
Info<< " Writing patch " << patchID
|
||||
<< tab << pp.name()
|
||||
<< tab << "strand:" << strandID
|
||||
<< nl << endl;
|
||||
|
||||
const indirectPrimitivePatch ipp
|
||||
(
|
||||
@ -950,10 +902,8 @@ int main(int argc, char *argv[])
|
||||
allVarLocation
|
||||
);
|
||||
|
||||
// Write coordinates
|
||||
writer.writeField(ipp.localPoints().component(0)());
|
||||
writer.writeField(ipp.localPoints().component(1)());
|
||||
writer.writeField(ipp.localPoints().component(2)());
|
||||
// Coordinates
|
||||
writer.writeField(ipp.localPoints());
|
||||
|
||||
// Write all fields
|
||||
forAll(vsf, i)
|
||||
@ -965,7 +915,7 @@ int main(int argc, char *argv[])
|
||||
nearCellValue,
|
||||
vsf[i],
|
||||
patchID
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vvf, i)
|
||||
@ -977,7 +927,7 @@ int main(int argc, char *argv[])
|
||||
nearCellValue,
|
||||
vvf[i],
|
||||
patchID
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vSpheretf, i)
|
||||
@ -989,7 +939,7 @@ int main(int argc, char *argv[])
|
||||
nearCellValue,
|
||||
vSpheretf[i],
|
||||
patchID
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vSymmtf, i)
|
||||
@ -1001,7 +951,7 @@ int main(int argc, char *argv[])
|
||||
nearCellValue,
|
||||
vSymmtf[i],
|
||||
patchID
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vtf, i)
|
||||
@ -1013,7 +963,7 @@ int main(int argc, char *argv[])
|
||||
nearCellValue,
|
||||
vtf[i],
|
||||
patchID
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -1021,14 +971,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
psf[i].boundaryField()[patchID].patchInternalField()()
|
||||
psf[i].boundaryField()[patchID].patchInternalField()
|
||||
);
|
||||
}
|
||||
forAll(pvf, i)
|
||||
{
|
||||
writer.writeField
|
||||
(
|
||||
pvf[i].boundaryField()[patchID].patchInternalField()()
|
||||
pvf[i].boundaryField()[patchID].patchInternalField()
|
||||
);
|
||||
}
|
||||
|
||||
@ -1037,7 +987,7 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
Info<< " Skipping zero sized patch " << patchID
|
||||
<< "\t" << pp.name()
|
||||
<< tab << pp.name()
|
||||
<< nl << endl;
|
||||
}
|
||||
}
|
||||
@ -1054,7 +1004,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
const faceZoneMesh& zones = mesh.faceZones();
|
||||
|
||||
if (doFaceZones && zones.size() > 0)
|
||||
if (doFaceZones && !zones.empty())
|
||||
{
|
||||
mkDir(fvPath/"faceZoneMesh");
|
||||
|
||||
@ -1079,21 +1029,23 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< " FaceZone : " << patchFileName << endl;
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
|
||||
string allVarNames = string("X Y Z ") + cellVarNames;
|
||||
DynamicList<INTEGER4> allVarLocation;
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
const string allVarNames = tecplotWriter::XYZ + " " + cellVarNames;
|
||||
DynamicList<int32_t> allVarLocation
|
||||
{
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
tecplotWriter::NODE_CENTERED
|
||||
};
|
||||
allVarLocation.append(cellVarLocation);
|
||||
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
writer.writeInit
|
||||
(
|
||||
runTime.caseName(),
|
||||
allVarNames,
|
||||
patchFileName,
|
||||
DataFileType_Full
|
||||
tecplotWriter::FILETYPE_FULL
|
||||
);
|
||||
|
||||
forAll(zones, zoneI)
|
||||
@ -1116,10 +1068,8 @@ int main(int argc, char *argv[])
|
||||
allVarLocation
|
||||
);
|
||||
|
||||
// Write coordinates
|
||||
writer.writeField(ipp.localPoints().component(0)());
|
||||
writer.writeField(ipp.localPoints().component(1)());
|
||||
writer.writeField(ipp.localPoints().component(2)());
|
||||
// Coordinates
|
||||
writer.writeField(ipp.localPoints());
|
||||
|
||||
// Write all volfields
|
||||
forAll(vsf, i)
|
||||
@ -1130,7 +1080,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
linearInterpolate(vsf[i])(),
|
||||
pp
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vvf, i)
|
||||
@ -1141,7 +1091,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
linearInterpolate(vvf[i])(),
|
||||
pp
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vSpheretf, i)
|
||||
@ -1152,7 +1102,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
linearInterpolate(vSpheretf[i])(),
|
||||
pp
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vSymmtf, i)
|
||||
@ -1163,7 +1113,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
linearInterpolate(vSymmtf[i])(),
|
||||
pp
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
forAll(vtf, i)
|
||||
@ -1174,7 +1124,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
linearInterpolate(vtf[i])(),
|
||||
pp
|
||||
)()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -1183,16 +1133,16 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
Info<< " Skipping zero sized faceZone " << zoneI
|
||||
<< "\t" << pp.name()
|
||||
<< tab << pp.name()
|
||||
<< nl << endl;
|
||||
}
|
||||
}
|
||||
|
||||
writer.writeEnd();
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
//
|
||||
// Write lagrangian data
|
||||
@ -1283,16 +1233,18 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
string allVarNames = string("X Y Z");
|
||||
DynamicList<INTEGER4> allVarLocation;
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
allVarLocation.append(ValueLocation_Nodal);
|
||||
string allVarNames = tecplotWriter::XYZ;
|
||||
DynamicList<int32_t> allVarLocation
|
||||
{
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
tecplotWriter::NODE_CENTERED
|
||||
};
|
||||
|
||||
tecplotWriter::getTecplotNames<label>
|
||||
(
|
||||
labelNames,
|
||||
ValueLocation_Nodal,
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
allVarNames,
|
||||
allVarLocation
|
||||
);
|
||||
@ -1300,7 +1252,7 @@ int main(int argc, char *argv[])
|
||||
tecplotWriter::getTecplotNames<scalar>
|
||||
(
|
||||
scalarNames,
|
||||
ValueLocation_Nodal,
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
allVarNames,
|
||||
allVarLocation
|
||||
);
|
||||
@ -1308,20 +1260,19 @@ int main(int argc, char *argv[])
|
||||
tecplotWriter::getTecplotNames<vector>
|
||||
(
|
||||
vectorNames,
|
||||
ValueLocation_Nodal,
|
||||
tecplotWriter::NODE_CENTERED,
|
||||
allVarNames,
|
||||
allVarLocation
|
||||
);
|
||||
|
||||
|
||||
tecplotWriter writer(runTime);
|
||||
|
||||
writer.writeInit
|
||||
(
|
||||
runTime.caseName(),
|
||||
allVarNames,
|
||||
lagrFileName,
|
||||
DataFileType_Full
|
||||
tecplotWriter::FILETYPE_FULL
|
||||
);
|
||||
|
||||
writer.writeOrderedZone
|
||||
@ -1332,19 +1283,19 @@ int main(int argc, char *argv[])
|
||||
allVarLocation
|
||||
);
|
||||
|
||||
// Write coordinates
|
||||
writer.writeField(positions.component(0)());
|
||||
writer.writeField(positions.component(1)());
|
||||
writer.writeField(positions.component(2)());
|
||||
// Coordinates
|
||||
writer.writeField(positions);
|
||||
|
||||
// labelFields
|
||||
forAll(labelNames, i)
|
||||
{
|
||||
const word& fieldName = labelNames[i];
|
||||
|
||||
IOField<label> fld
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
labelNames[i],
|
||||
fieldName,
|
||||
mesh.time().timeName(),
|
||||
cloud::prefix/cloudDirs[cloudI],
|
||||
mesh,
|
||||
@ -1354,21 +1305,19 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
);
|
||||
|
||||
scalarField sfld(fld.size());
|
||||
forAll(fld, j)
|
||||
{
|
||||
sfld[j] = scalar(fld[j]);
|
||||
}
|
||||
writer.writeField(sfld);
|
||||
writer.writeField(fld);
|
||||
}
|
||||
|
||||
// scalarFields
|
||||
forAll(scalarNames, i)
|
||||
{
|
||||
const word& fieldName = scalarNames[i];
|
||||
|
||||
IOField<scalar> fld
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
scalarNames[i],
|
||||
fieldName,
|
||||
mesh.time().timeName(),
|
||||
cloud::prefix/cloudDirs[cloudI],
|
||||
mesh,
|
||||
@ -1377,16 +1326,20 @@ int main(int argc, char *argv[])
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
writer.writeField(fld);
|
||||
}
|
||||
|
||||
// vectorFields
|
||||
forAll(vectorNames, i)
|
||||
{
|
||||
const word& fieldName = vectorNames[i];
|
||||
|
||||
IOField<vector> fld
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
vectorNames[i],
|
||||
fieldName,
|
||||
mesh.time().timeName(),
|
||||
cloud::prefix/cloudDirs[cloudI],
|
||||
mesh,
|
||||
@ -1395,6 +1348,7 @@ int main(int argc, char *argv[])
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
writer.writeField(fld);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user