GIT: Initial state after latest Foundation merge

This commit is contained in:
Andrew Heather
2016-09-20 14:49:08 +01:00
4571 changed files with 115696 additions and 74609 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -83,9 +83,9 @@ int main(int argc, char *argv[])
// Writing number of faces
label nFaces = mesh.nFaces();
forAll(mesh.boundary(), patchI)
forAll(mesh.boundary(), patchi)
{
nFaces += mesh.boundary()[patchI].size();
nFaces += mesh.boundary()[patchi].size();
}
fluentDataFile

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,22 +45,22 @@ void writeFluentField
Ostream& stream
)
{
const scalarField& phiInternal = phi.internalField();
const scalarField& phiInternal = phi;
// Writing cells
stream
<< "(300 ("
<< fluentFieldIdentifier << " " // Field identifier
<< "1 " // Zone ID: (cells=1, internal faces=2,
// patch faces=patchI+10)
// patch faces=patchi+10)
<< "1 " // Number of components (scalar=1, vector=3)
<< "0 0 " // Unused
<< "1 " << phiInternal.size() // Start and end of list
<< ")(" << endl;
forAll(phiInternal, cellI)
forAll(phiInternal, celli)
{
stream << phiInternal[cellI] << endl;
stream << phiInternal[celli] << endl;
}
stream
@ -69,23 +69,23 @@ void writeFluentField
label nWrittenFaces = phiInternal.size();
// Writing boundary faces
forAll(phi.boundaryField(), patchI)
forAll(phi.boundaryField(), patchi)
{
if (isType<emptyFvPatchScalarField>(phi.boundaryField()[patchI]))
if (isType<emptyFvPatchScalarField>(phi.boundaryField()[patchi]))
{
// Form empty patch field repeat the internal field to
// allow for the node interpolation in Fluent
const scalarField& phiInternal = phi.internalField();
const scalarField& phiInternal = phi;
// Get reference to internal cells
const labelList emptyFaceCells =
phi.boundaryField()[patchI].patch().patch().faceCells();
phi.boundaryField()[patchi].patch().patch().faceCells();
// Writing cells for empty patch
stream
<< "(300 ("
<< fluentFieldIdentifier << " " // Field identifier
<< patchI + 10 << " " // Zone ID: patchI+10
<< patchi + 10 << " " // Zone ID: patchi+10
<< "1 " // Number of components (scalar=1, vector=3)
<< "0 0 " // Unused
<< nWrittenFaces + 1 << " "
@ -94,9 +94,9 @@ void writeFluentField
nWrittenFaces += emptyFaceCells.size();
forAll(emptyFaceCells, faceI)
forAll(emptyFaceCells, facei)
{
stream << phiInternal[emptyFaceCells[faceI]] << endl;
stream << phiInternal[emptyFaceCells[facei]] << endl;
}
stream
@ -107,13 +107,13 @@ void writeFluentField
// Regular patch
label nWrittenFaces = phiInternal.size();
const scalarField& patchPhi = phi.boundaryField()[patchI];
const scalarField& patchPhi = phi.boundaryField()[patchi];
// Write header
stream
<< "(300 ("
<< fluentFieldIdentifier << " " // Field identifier
<< patchI + 10 << " " // Zone ID: patchI+10
<< patchi + 10 << " " // Zone ID: patchi+10
<< "1 " // Number of components (scalar=1, vector=3)
<< "0 0 " // Unused
<< nWrittenFaces + 1 << " " << nWrittenFaces + patchPhi.size()
@ -122,9 +122,9 @@ void writeFluentField
nWrittenFaces += patchPhi.size();
forAll(patchPhi, faceI)
forAll(patchPhi, facei)
{
stream << patchPhi[faceI] << endl;
stream << patchPhi[facei] << endl;
}
stream

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,25 +44,25 @@ void writeFluentField
Ostream& stream
)
{
const vectorField& phiInternal = phi.internalField();
const vectorField& phiInternal = phi;
// Writing cells
stream
<< "(300 ("
<< fluentFieldIdentifier << " " // Field identifier
<< "1 " // Zone ID: (cells=1, internal faces=2,
// patch faces=patchI+10)
// patch faces=patchi+10)
<< "3 " // Number of components (scalar=1, vector=3)
<< "0 0 " // Unused
<< "1 " << phiInternal.size() // Start and end of list
<< ")(" << endl;
forAll(phiInternal, cellI)
forAll(phiInternal, celli)
{
stream
<< phiInternal[cellI].x() << " "
<< phiInternal[cellI].y() << " "
<< phiInternal[cellI].z() << " "
<< phiInternal[celli].x() << " "
<< phiInternal[celli].y() << " "
<< phiInternal[celli].z() << " "
<< endl;
}
@ -72,15 +72,15 @@ void writeFluentField
label nWrittenFaces = phiInternal.size();
// Writing boundary faces
forAll(phi.boundaryField(), patchI)
forAll(phi.boundaryField(), patchi)
{
const vectorField& patchPhi = phi.boundaryField()[patchI];
const vectorField& patchPhi = phi.boundaryField()[patchi];
// Write header
stream
<< "(300 ("
<< fluentFieldIdentifier << " " // Field identifier
<< patchI + 10 << " " // Zone ID: patchI+10
<< patchi + 10 << " " // Zone ID: patchi+10
<< "3 " // Number of components (scalar=1, vector=3)
<< "0 0 " // Unused
<< nWrittenFaces + 1 << " " << nWrittenFaces + patchPhi.size()
@ -89,12 +89,12 @@ void writeFluentField
nWrittenFaces += patchPhi.size();
forAll(patchPhi, faceI)
forAll(patchPhi, facei)
{
stream
<< patchPhi[faceI].x() << " "
<< patchPhi[faceI].y() << " "
<< patchPhi[faceI].z() << " "
<< patchPhi[facei].x() << " "
<< patchPhi[facei].y() << " "
<< patchPhi[facei].z() << " "
<< endl;
}

View File

@ -1,5 +1,4 @@
EXE_INC = \
/* -DFULLDEBUG -g -O0 */ \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
@ -8,10 +7,8 @@ EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-ldynamicMesh \
-lfileFormats \
-lsampling \
-lgenericPatchFields \
-llagrangian

View File

@ -217,7 +217,7 @@ bool writePatchField
(
const Field<Type>& pf,
const label patchi,
const label ensightPatchI,
const label ensightPatchi,
const faceSets& boundaryFaceSet,
const ensightMesh::nFacePrimitives& nfp,
ensightStream& ensightFile
@ -227,7 +227,7 @@ bool writePatchField
{
if (Pstream::master())
{
ensightFile.writePartHeader(ensightPatchI);
ensightFile.writePartHeader(ensightPatchi);
}
writeField
@ -281,7 +281,7 @@ void writePatchField
const HashTable<ensightMesh::nFacePrimitives>&
nPatchPrims = eMesh.nPatchPrims();
label ensightPatchI = eMesh.patchPartOffset();
label ensightPatchi = eMesh.patchPartOffset();
label patchi = -1;
@ -292,7 +292,7 @@ void writePatchField
patchi = i;
break;
}
ensightPatchI++;
ensightPatchi++;
}
@ -300,7 +300,7 @@ void writePatchField
word timeFile = prepend + itoa(timeIndex);
ensightStream* ensightFilePtr = NULL;
ensightStream* ensightFilePtr = nullptr;
if (Pstream::master())
{
if (timeIndex == 0)
@ -349,7 +349,7 @@ void writePatchField
(
pf,
patchi,
ensightPatchI,
ensightPatchi,
boundaryFaceSets[patchi],
nPatchPrims.find(patchName)(),
ensightFile
@ -363,7 +363,7 @@ void writePatchField
(
Field<Type>(),
-1,
ensightPatchI,
ensightPatchi,
nullFaceSets,
nPatchPrims.find(patchName)(),
ensightFile
@ -414,7 +414,7 @@ void ensightField
const labelList& hexes = meshCellSets.hexes;
const labelList& polys = meshCellSets.polys;
ensightStream* ensightFilePtr = NULL;
ensightStream* ensightFilePtr = nullptr;
if (Pstream::master())
{
// set the filename of the ensight file
@ -502,7 +502,7 @@ void ensightField
);
}
label ensightPatchI = eMesh.patchPartOffset();
label ensightPatchi = eMesh.patchPartOffset();
forAll(allPatchNames, patchi)
{
@ -518,14 +518,14 @@ void ensightField
(
vf.boundaryField()[patchi],
patchi,
ensightPatchI,
ensightPatchi,
boundaryFaceSets[patchi],
nPatchPrims.find(patchName)(),
ensightFile
)
)
{
ensightPatchI++;
ensightPatchi++;
}
}
}
@ -566,20 +566,20 @@ void ensightField
label j = 0;
forAll(fz, i)
{
label faceI = fz[i];
if (mesh.isInternalFace(faceI))
label facei = fz[i];
if (mesh.isInternalFace(facei))
{
values[j] = sf[faceI];
values[j] = sf[facei];
++j;
}
else
{
if (eMesh.faceToBeIncluded(faceI))
if (eMesh.faceToBeIncluded(facei))
{
label patchI = mesh.boundaryMesh().whichPatch(faceI);
const polyPatch& pp = mesh.boundaryMesh()[patchI];
label patchFaceI = pp.whichFace(faceI);
Type value = sf.boundaryField()[patchI][patchFaceI];
label patchi = mesh.boundaryMesh().whichPatch(facei);
const polyPatch& pp = mesh.boundaryMesh()[patchi];
label patchFacei = pp.whichFace(facei);
Type value = sf.boundaryField()[patchi][patchFacei];
values[j] = value;
++j;
}
@ -592,14 +592,14 @@ void ensightField
(
values,
zoneID,
ensightPatchI,
ensightPatchi,
faceZoneFaceSets[zoneID],
nFaceZonePrims.find(faceZoneName)(),
ensightFile
)
)
{
ensightPatchI++;
ensightPatchi++;
}
}
}
@ -632,7 +632,7 @@ void ensightPointField
const wordHashSet& faceZoneNames = eMesh.faceZoneNames();
ensightStream* ensightFilePtr = NULL;
ensightStream* ensightFilePtr = nullptr;
if (Pstream::master())
{
// set the filename of the ensight file
@ -687,13 +687,13 @@ void ensightPointField
writeField
(
"coordinates",
Field<Type>(pf.internalField(), eMesh.uniquePointMap()),
Field<Type>(pf.primitiveField(), eMesh.uniquePointMap()),
ensightFile
);
}
label ensightPatchI = eMesh.patchPartOffset();
label ensightPatchi = eMesh.patchPartOffset();
forAll(allPatchNames, patchi)
{
@ -724,17 +724,17 @@ void ensightPointField
if (Pstream::master())
{
ensightFile.writePartHeader(ensightPatchI);
ensightFile.writePartHeader(ensightPatchi);
}
writeField
(
"coordinates",
Field<Type>(pf.internalField(), uniqueMeshPointLabels),
Field<Type>(pf.primitiveField(), uniqueMeshPointLabels),
ensightFile
);
ensightPatchI++;
ensightPatchi++;
}
}
}
@ -768,7 +768,7 @@ void ensightPointField
if (Pstream::master())
{
ensightFile.writePartHeader(ensightPatchI);
ensightFile.writePartHeader(ensightPatchi);
}
writeField
@ -776,13 +776,13 @@ void ensightPointField
"coordinates",
Field<Type>
(
pf.internalField(),
pf.primitiveField(),
uniqueMeshPointLabels
),
ensightFile
);
ensightPatchI++;
ensightPatchi++;
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -131,34 +131,34 @@ void Foam::ensightMesh::correct()
label nHexes = 0;
label nPolys = 0;
forAll(cellShapes, cellI)
forAll(cellShapes, celli)
{
const cellShape& cellShape = cellShapes[cellI];
const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model();
if (cellModel == tet)
{
tets[nTets++] = cellI;
tets[nTets++] = celli;
}
else if (cellModel == pyr)
{
pyrs[nPyrs++] = cellI;
pyrs[nPyrs++] = celli;
}
else if (cellModel == prism)
{
prisms[nPrisms++] = cellI;
prisms[nPrisms++] = celli;
}
else if (cellModel == wedge)
{
wedges[nWedges++] = cellI;
wedges[nWedges++] = celli;
}
else if (cellModel == hex)
{
hexes[nHexes++] = cellI;
hexes[nHexes++] = celli;
}
else
{
polys[nPolys++] = cellI;
polys[nPolys++] = celli;
}
}
@ -213,21 +213,21 @@ void Foam::ensightMesh::correct()
label nQuads = 0;
label nPolys = 0;
forAll(p, faceI)
forAll(p, facei)
{
const face& f = p[faceI];
const face& f = p[facei];
if (f.size() == 3)
{
tris[nTris++] = faceI;
tris[nTris++] = facei;
}
else if (f.size() == 4)
{
quads[nQuads++] = faceI;
quads[nQuads++] = facei;
}
else
{
polys[nPolys++] = faceI;
polys[nPolys++] = facei;
}
}
@ -286,19 +286,19 @@ void Foam::ensightMesh::correct()
1
);
forAll(mesh_.boundaryMesh(), patchI)
forAll(mesh_.boundaryMesh(), patchi)
{
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
const polyPatch& pp = mesh_.boundaryMesh()[patchi];
if
(
isA<processorPolyPatch>(pp)
&& !refCast<const processorPolyPatch>(pp).owner()
)
{
label bFaceI = pp.start()-mesh_.nInternalFaces();
label bFacei = pp.start()-mesh_.nInternalFaces();
forAll(pp, i)
{
boundaryFaceToBeIncluded_[bFaceI++] = 0;
boundaryFaceToBeIncluded_[bFacei++] = 0;
}
}
}
@ -329,12 +329,12 @@ void Foam::ensightMesh::correct()
forAll(fz, i)
{
label faceI = fz[i];
label facei = fz[i];
// Avoid counting faces on processor boundaries twice
if (faceToBeIncluded(faceI))
if (faceToBeIncluded(facei))
{
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
if (f.size() == 3)
{
@ -427,17 +427,17 @@ Foam::ensightMesh::~ensightMesh()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::ensightMesh::faceToBeIncluded(const label faceI) const
bool Foam::ensightMesh::faceToBeIncluded(const label facei) const
{
bool res = false;
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
res = true;
}
else
{
res = boundaryFaceToBeIncluded_[faceI-mesh_.nInternalFaces()];
res = boundaryFaceToBeIncluded_[facei-mesh_.nInternalFaces()];
}
return res;
@ -531,9 +531,9 @@ void Foam::ensightMesh::writePrims
List<int> temp(cellPoints.size());
forAll(cellPoints, pointI)
forAll(cellPoints, pointi)
{
temp[pointI] = cellPoints[pointI] + 1;
temp[pointi] = cellPoints[pointi] + 1;
}
ensightGeometryFile.write(temp);
}
@ -550,9 +550,9 @@ void Foam::ensightMesh::writePrims
{
const cellShape& cellPoints = cellShapes[i];
forAll(cellPoints, pointI)
forAll(cellPoints, pointi)
{
temp[n] = cellPoints[pointI] + 1;
temp[n] = cellPoints[pointi] + 1;
n++;
}
}
@ -588,9 +588,9 @@ void Foam::ensightMesh::writePolysNPointsPerFace
{
const labelList& cf = cellFaces[polys[i]];
forAll(cf, faceI)
forAll(cf, facei)
{
ensightGeometryFile.write(faces[cf[faceI]].size());
ensightGeometryFile.write(faces[cf[facei]].size());
}
}
}
@ -609,9 +609,9 @@ void Foam::ensightMesh::writePolysPoints
{
const labelList& cf = cellFaces[polys[i]];
forAll(cf, faceI)
forAll(cf, facei)
{
const label faceId = cf[faceI];
const label faceId = cf[facei];
const face& f = faces[faceId]; // points of face (in global points)
const label np = f.size();
bool reverseOrder = false;
@ -641,15 +641,15 @@ void Foam::ensightMesh::writePolysPoints
// EnSight prefers to have all the faces of an nfaced cell
// oriented in the same way.
List<int> temp(np);
forAll(f, pointI)
forAll(f, pointi)
{
if (reverseOrder)
{
temp[np-1-pointI] = f[pointI] + 1;
temp[np-1-pointi] = f[pointi] + 1;
}
else
{
temp[pointI] = f[pointI] + 1;
temp[pointi] = f[pointi] + 1;
}
}
ensightGeometryFile.write(temp);
@ -835,9 +835,9 @@ void Foam::ensightMesh::writeFacePrims
const face& patchFace = patchFaces[i];
List<int> temp(patchFace.size());
forAll(patchFace, pointI)
forAll(patchFace, pointi)
{
temp[pointI] = patchFace[pointI] + 1;
temp[pointi] = patchFace[pointi] + 1;
}
ensightGeometryFile.write(temp);
@ -1043,7 +1043,7 @@ void Foam::ensightMesh::write
// set the filename of the ensight file
fileName ensightGeometryFileName = timeFile + "mesh";
ensightStream* ensightGeometryFilePtr = NULL;
ensightStream* ensightGeometryFilePtr = nullptr;
if (Pstream::master())
{
if (binary_)
@ -1138,7 +1138,7 @@ void Foam::ensightMesh::write
}
label ensightPatchI = patchPartOffset_;
label ensightPatchi = patchPartOffset_;
forAll(allPatchNames_, patchi)
{
@ -1178,7 +1178,7 @@ void Foam::ensightMesh::write
writeAllPoints
(
ensightPatchI++,
ensightPatchi++,
patchName,
uniquePoints,
globalPointsPtr().size(),
@ -1253,9 +1253,9 @@ void Foam::ensightMesh::write
// a better way of doing this?
label nMasterFaces = 0;
forAll(fz, faceI)
forAll(fz, facei)
{
if (faceToBeIncluded(fz[faceI]))
if (faceToBeIncluded(fz[facei]))
{
++nMasterFaces;
}
@ -1266,11 +1266,11 @@ void Foam::ensightMesh::write
label currentFace = 0;
forAll(fz, faceI)
forAll(fz, facei)
{
if (faceToBeIncluded(fz[faceI]))
if (faceToBeIncluded(fz[facei]))
{
faceZoneMasterFaces[currentFace] = faceZoneFaces[faceI];
faceZoneMasterFaces[currentFace] = faceZoneFaces[facei];
++currentFace;
}
}
@ -1283,7 +1283,7 @@ void Foam::ensightMesh::write
writeAllPoints
(
ensightPatchI++,
ensightPatchi++,
faceZoneName,
uniquePoints,
globalPointsPtr().size(),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -361,7 +361,7 @@ public:
//- When exporting faceZones, check if a given face has to be included
// or not (i.e. faces on processor boundaries)
bool faceToBeIncluded(const label faceI) const;
bool faceToBeIncluded(const label facei) const;
//- Helper to cause barrier. Necessary on Quadrics.
static void barrier();

View File

@ -33,24 +33,24 @@ Description
An Ensight part is created for the internalMesh and for each patch.
Usage
- foamToEnsight [OPTION] \n
Translates OpenFOAM data to Ensight format
\b foamToEnsight [OPTION]
\param -ascii \n
Write Ensight data in ASCII format instead of "C Binary"
Options:
- \par -ascii
Write Ensight data in ASCII format instead of "C Binary"
\param -patches patchList \n
Specify particular patches to write.
Specifying an empty list suppresses writing the internalMesh.
- \par -patches patchList
Specify particular patches to write.
Specifying an empty list suppresses writing the internalMesh.
\param -noPatches \n
Suppress writing any patches.
- \par -noPatches
Suppress writing any patches.
\param -faceZones zoneList \n
Specify faceZones to write, with wildcards
- \par -faceZones zoneList
Specify faceZones to write, with wildcards
\param -cellZone zoneName \n
Specify single cellZone to write (not lagrangian)
- \par -cellZone zoneName
Specify single cellZone to write (not lagrangian)
Note
Parallel support for cloud data is not supported
@ -212,7 +212,7 @@ int main(int argc, char *argv[])
const word prepend = args.globalCaseName() + '.';
OFstream *ensightCaseFilePtr = NULL;
OFstream *ensightCaseFilePtr = nullptr;
if (Pstream::master())
{
fileName caseFileName = prepend + "case";

View File

@ -32,28 +32,28 @@ Description
An Ensight part is created for each cellZone and patch.
Usage
- foamToEnsightParts [OPTION] \n
Translates OpenFOAM data to Ensight format
\b foamToEnsightParts [OPTION]
\param -ascii \n
Write Ensight data in ASCII format instead of "C Binary"
Options:
- \par -ascii
Write Ensight data in ASCII format instead of "C Binary"
\param -name \<subdir\>\n
define sub-directory name to use for Ensight data (default: "Ensight")
- \par -name \<subdir\>
Define sub-directory name to use for Ensight data (default: "Ensight")
\param -noZero \n
Exclude the often incomplete initial conditions.
- \par -noZero
Exclude 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.
- \par -index \<start\>
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.
- \par -noMesh
Suppress writing the geometry. Can be useful for converting partial
results for a static geometry.
\param -width \<n\>\n
width of Ensight data subdir
- \par -width \<n\>
Width of Ensight data subdir
Note
- no parallel data.
@ -402,7 +402,7 @@ int main(int argc, char *argv[])
// check that the positions field is present for this time
IOobject* positionPtr = cloudObjs.lookup(word("positions"));
if (positionPtr != NULL)
if (positionPtr != nullptr)
{
ensightParticlePositions
(

View File

@ -8,7 +8,7 @@ if [ ! -d ${WM_THIRD_PARTY_DIR}/tecio ]
then
echo "Did not find tecio in ${WM_THIRD_PARTY_DIR}. Not building foamToTecplot360."
else
wmake
wmake $targetType
fi
#------------------------------------------------------------------------------

View File

@ -8,8 +8,7 @@ EXE_INC = \
EXE_LIBS = \
-llagrangian \
-lfiniteVolume \
-ldynamicMesh \
-ldynamicMesh \
-lgenericPatchFields \
-lmeshTools \
-L$(FOAM_EXT_LIBBIN) -ltecio

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,44 +31,45 @@ Description
Tecplot binary file format writer.
Usage
\b foamToTecplot360 [OPTION]
- foamToTecplot360 [OPTION]
Options:
- \par -fields \<names\>
Convert selected fields only. For example,
\verbatim
-fields '( p T U )'
\endverbatim
The quoting is required to avoid shell expansions and to pass the
information as a single argument.
\param -fields \<names\>\n
Convert selected fields only. For example,
\verbatim
-fields '( p T U )'
\endverbatim
The quoting is required to avoid shell expansions and to pass the
information as a single argument.
- \par -cellSet \<name\>
\param -cellSet \<name\>\n
\param -faceSet \<name\>\n
Restrict conversion to the cellSet, faceSet.
- \par -faceSet \<name\>
Restrict conversion to the cellSet, faceSet.
\param -nearCellValue \n
Output cell value on patches instead of patch value itself
- \par -nearCellValue
Output cell value on patches instead of patch value itself
\param -noInternal \n
Do not generate file for mesh, only for patches
- \par -noInternal
Do not generate file for mesh, only for patches
\param -noPointValues \n
No pointFields
- \par -noPointValues
No pointFields
\param -noFaceZones \n
No faceZones
- \par -noFaceZones
No faceZones
\param -excludePatches \<patchNames\>\n
Specify patches (wildcards) to exclude. For example,
\verbatim
-excludePatches '( inlet_1 inlet_2 "proc.*")'
\endverbatim
The quoting is required to avoid shell expansions and to pass the
information as a single argument. The double quotes denote a regular
expression.
- \par -excludePatches \<patchNames\>
Specify patches (wildcards) to exclude. For example,
\verbatim
-excludePatches '( inlet_1 inlet_2 "proc.*")'
\endverbatim
The quoting is required to avoid shell expansions and to pass the
information as a single argument. The double quotes denote a regular
expression.
\param -useTimeName \n
use the time index in the VTK file name instead of the time index
- \par -useTimeName
use the time index in the VTK file name instead of the time index
\*---------------------------------------------------------------------------*/
@ -132,9 +133,9 @@ labelList getSelectedPatches
Info<< "Combining patches:" << endl;
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if
(
@ -142,18 +143,18 @@ labelList getSelectedPatches
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
)
{
Info<< " discarding empty/processor patch " << patchI
Info<< " discarding empty/processor patch " << patchi
<< " " << pp.name() << endl;
}
else if (findStrings(excludePatches, pp.name()))
{
Info<< " excluding patch " << patchI
Info<< " excluding patch " << patchi
<< " " << pp.name() << endl;
}
else
{
patchIDs.append(patchI);
Info<< " patch " << patchI << " " << pp.name() << endl;
patchIDs.append(patchi);
Info<< " patch " << patchi << " " << pp.name() << endl;
}
}
return patchIDs.shrink();
@ -327,9 +328,9 @@ int main(int argc, char *argv[])
const fvMesh& mesh = vMesh.mesh();
INTEGER4 nFaceNodes = 0;
forAll(mesh.faces(), faceI)
forAll(mesh.faces(), facei)
{
nFaceNodes += mesh.faces()[faceI].size();
nFaceNodes += mesh.faces()[facei].size();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -111,8 +111,8 @@ Pout<< "zoneName:" << zoneName
INTEGER4 *PassiveVarArray = NULL;
INTEGER4 *VarShareArray = NULL;
INTEGER4 *PassiveVarArray = nullptr;
INTEGER4 *VarShareArray = nullptr;
INTEGER4 ShrConn = 0;
INTEGER4 NumBConns = 0; /* No Boundary Connections */
@ -191,8 +191,8 @@ Pout<< "zoneName:" << zoneName
<< endl;
INTEGER4 *PassiveVarArray = NULL;
INTEGER4 *VarShareArray = NULL;
INTEGER4 *PassiveVarArray = nullptr;
INTEGER4 *VarShareArray = nullptr;
INTEGER4 ShrConn = 0;
INTEGER4 NumBConns = 0; /* No Boundary Connections */
@ -273,8 +273,8 @@ Pout<< "zoneName:" << zoneName
<< endl;
INTEGER4 *PassiveVarArray = NULL;
INTEGER4 *VarShareArray = NULL;
INTEGER4 *PassiveVarArray = nullptr;
INTEGER4 *VarShareArray = nullptr;
INTEGER4 ShrConn = 0;
@ -318,25 +318,25 @@ void Foam::tecplotWriter::writeConnectivity(const fvMesh& mesh) const
{
List<INTEGER4> FaceNodeCounts(mesh.nFaces());
forAll(mesh.faces(), faceI)
forAll(mesh.faces(), facei)
{
const face& f = mesh.faces()[faceI];
FaceNodeCounts[faceI] = INTEGER4(f.size());
const face& f = mesh.faces()[facei];
FaceNodeCounts[facei] = INTEGER4(f.size());
}
INTEGER4 nFaceNodes = 0;
forAll(mesh.faces(), faceI)
forAll(mesh.faces(), facei)
{
nFaceNodes += mesh.faces()[faceI].size();
nFaceNodes += mesh.faces()[facei].size();
}
List<INTEGER4> FaceNodes(nFaceNodes);
label nodeI = 0;
forAll(mesh.faces(), faceI)
forAll(mesh.faces(), facei)
{
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
forAll(f, fp)
{
FaceNodes[nodeI++] = INTEGER4(f[fp]+1);
@ -345,24 +345,24 @@ void Foam::tecplotWriter::writeConnectivity(const fvMesh& mesh) const
List<INTEGER4> FaceLeftElems(mesh.nFaces());
forAll(mesh.faceOwner(), faceI)
forAll(mesh.faceOwner(), facei)
{
FaceLeftElems[faceI] = mesh.faceOwner()[faceI]+1;
FaceLeftElems[facei] = mesh.faceOwner()[facei]+1;
}
List<INTEGER4> FaceRightElems(mesh.nFaces());
forAll(mesh.faceNeighbour(), faceI)
forAll(mesh.faceNeighbour(), facei)
{
FaceRightElems[faceI] = mesh.faceNeighbour()[faceI]+1;
FaceRightElems[facei] = mesh.faceNeighbour()[facei]+1;
}
for
(
label faceI = mesh.nInternalFaces();
faceI < mesh.nFaces();
faceI++
label facei = mesh.nInternalFaces();
facei < mesh.nFaces();
facei++
)
{
FaceRightElems[faceI] = 0;
FaceRightElems[facei] = 0;
}
if
@ -373,9 +373,9 @@ void Foam::tecplotWriter::writeConnectivity(const fvMesh& mesh) const
FaceNodes.begin(), /* The face nodes array */
FaceLeftElems.begin(), /* The left elements array */
FaceRightElems.begin(), /* The right elements array */
NULL, /* No boundary connection counts */
NULL, /* No boundary connection elements */
NULL /* No boundary connection zones */
nullptr, /* No boundary connection counts */
nullptr, /* No boundary connection elements */
nullptr /* No boundary connection zones */
)
)
{
@ -487,9 +487,9 @@ void Foam::tecplotWriter::writeConnectivity
FaceNodes.begin(), /* The face nodes array */
FaceLeftElems.begin(), /* The left elements array */
FaceRightElems.begin(), /* The right elements array */
NULL, /* No boundary connection counts */
NULL, /* No boundary connection elements */
NULL /* No boundary connection zones */
nullptr, /* No boundary connection counts */
nullptr, /* No boundary connection elements */
nullptr /* No boundary connection zones */
)
)
{

View File

@ -124,7 +124,7 @@ public:
(
const bool nearCellValue,
const GeometricField<Type, fvPatchField, volMesh>& vfld,
const label patchI
const label patchi
) const;
//- Get mixed field: fvsPatchField for boundary faces and

View File

@ -69,16 +69,16 @@ Foam::tmp<Field<Type>> Foam::tecplotWriter::getPatchField
(
const bool nearCellValue,
const GeometricField<Type, fvPatchField, volMesh>& vfld,
const label patchI
const label patchi
) const
{
if (nearCellValue)
{
return vfld.boundaryField()[patchI].patchInternalField();
return vfld.boundaryField()[patchi].patchInternalField();
}
else
{
return vfld.boundaryField()[patchI];
return vfld.boundaryField()[patchi];
}
}
@ -97,18 +97,18 @@ Foam::tmp<Field<Type>> Foam::tecplotWriter::getFaceField
forAll(faceLabels, i)
{
label faceI = faceLabels[i];
label facei = faceLabels[i];
label patchI = patches.whichPatch(faceI);
label patchi = patches.whichPatch(facei);
if (patchI == -1)
if (patchi == -1)
{
fld[i] = sfld[faceI];
fld[i] = sfld[facei];
}
else
{
label localFaceI = faceI - patches[patchI].start();
fld[i] = sfld.boundaryField()[patchI][localFaceI];
label localFacei = facei - patches[patchi].start();
fld[i] = sfld.boundaryField()[patchi][localFacei];
}
}

View File

@ -94,36 +94,36 @@ void ReadAndMapFields
)
);
Field<Type>& fld = tetFields[i].internalField();
Field<Type>& fld = tetFields[i].primitiveFieldRef();
// Map from read field. Set unmapped entries to nullValue.
fld.setSize(map.size(), nullValue);
forAll(map, pointI)
forAll(map, pointi)
{
label index = map[pointI];
label index = map[pointi];
if (index > 0)
{
label cellI = index-1;
fld[pointI] = readField[cellI];
label celli = index-1;
fld[pointi] = readField[celli];
}
else if (index < 0)
{
label faceI = -index-1;
label bFaceI = faceI - mesh.nInternalFaces();
if (bFaceI >= 0)
label facei = -index-1;
label bFacei = facei - mesh.nInternalFaces();
if (bFacei >= 0)
{
label patchI = mesh.boundaryMesh().patchID()[bFaceI];
label localFaceI = mesh.boundaryMesh()[patchI].whichFace
label patchi = mesh.boundaryMesh().patchID()[bFacei];
label localFacei = mesh.boundaryMesh()[patchi].whichFace
(
faceI
facei
);
fld[pointI] = readField.boundaryField()[patchI][localFaceI];
fld[pointi] = readField.boundaryField()[patchi][localFacei];
}
//else
//{
// FatalErrorInFunction
// << "Face " << faceI << " from index " << index
// << "Face " << facei << " from index " << index
// << " is not a boundary face." << abort(FatalError);
//}
@ -131,8 +131,8 @@ void ReadAndMapFields
//else
//{
// WarningInFunction
// << "Point " << pointI << " at "
// << tetDualMesh.points()[pointI]
// << "Point " << pointi << " at "
// << tetDualMesh.points()[pointi]
// << " has no dual correspondence." << endl;
//}
}
@ -203,9 +203,9 @@ int main(int argc, char *argv[])
label nCells = 0;
label nPatchFaces = 0;
label nUnmapped = 0;
forAll(pointDualAddressing, pointI)
forAll(pointDualAddressing, pointi)
{
label index = pointDualAddressing[pointI];
label index = pointDualAddressing[pointi];
if (index > 0)
{
@ -217,11 +217,11 @@ int main(int argc, char *argv[])
}
else
{
label faceI = -index-1;
if (faceI < mesh.nInternalFaces())
label facei = -index-1;
if (facei < mesh.nInternalFaces())
{
FatalErrorInFunction
<< "Face " << faceI << " from index " << index
<< "Face " << facei << " from index " << index
<< " is not a boundary face."
<< " nInternalFaces:" << mesh.nInternalFaces()
<< exit(FatalError);

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
wmake $targetType foamToVTK
wmake $targetType
#------------------------------------------------------------------------------

View File

@ -1,15 +1,3 @@
surfaceMeshWriter.C
foamToVTK.C
internalWriter.C
lagrangianWriter.C
patchWriter.C
writeFuns.C
writeFaceSet.C
writePointSet.C
writeSurfFields.C
vtkMesh.C
vtkTopo.C
EXE = $(FOAM_APPBIN)/foamToVTK

View File

@ -1,13 +1,12 @@
EXE_INC = \
-IfoamToVTK/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfoamToVTK \
-ldynamicMesh \
-llagrangian \
-lgenericPatchFields \
-lmeshTools
-lgenericPatchFields

View File

@ -30,73 +30,74 @@ Group
Description
Legacy VTK file format writer.
- handles volScalar, volVector, pointScalar, pointVector, surfaceScalar
- Handles volFields, pointFields, surfaceScalarField, surfaceVectorField
fields.
- mesh topo changes.
- both ascii and binary.
- single time step writing.
- write subset only.
- automatic decomposition of cells; polygons on boundary undecomposed since
- Mesh topo changes.
- Both ascii and binary.
- Single time step writing.
- Write subset only.
- Automatic decomposition of cells; polygons on boundary undecomposed since
handled by vtk.
Usage
\b foamToVTK [OPTION]
- foamToVTK [OPTION]
Options:
- \par -ascii
Write VTK data in ASCII format instead of binary.
\param -ascii \n
Write VTK data in ASCII format instead of binary.
- \par -mesh \<name\>
Use a different mesh name (instead of -region)
\param -mesh \<name\>\n
Use a different mesh name (instead of -region)
- \par -fields \<fields\>
Convert selected fields only. For example,
\verbatim
-fields "( p T U )"
\endverbatim
The quoting is required to avoid shell expansions and to pass the
information as a single argument.
\param -fields \<fields\>\n
Convert selected fields only. For example,
\verbatim
-fields "( p T U )"
\endverbatim
The quoting is required to avoid shell expansions and to pass the
information as a single argument.
- \par -surfaceFields
Write surfaceScalarFields (e.g., phi)
\param -surfaceFields \n
Write surfaceScalarFields (e.g., phi)
- \par -cellSet \<name\>
- \par -faceSet \<name\>
\param -cellSet \<name\>\n
\param -faceSet \<name\>\n
\param -pointSet \<name\>\n
Restrict conversion to the cellSet, faceSet or pointSet.
- \par -pointSet \<name\>
Restrict conversion to the cellSet, faceSet or pointSet.
\param -nearCellValue \n
Output cell value on patches instead of patch value itself
- \par -nearCellValue
Output cell value on patches instead of patch value itself
\param -noInternal \n
Do not generate file for mesh, only for patches
- \par -noInternal
Do not generate file for mesh, only for patches
\param -noPointValues \n
No pointFields
- \par -noPointValues
No pointFields
\param -noFaceZones \n
No faceZones
- \par -noFaceZones
No faceZones
\param -noLinks \n
(in parallel) do not link processor files to master
- \par -noLinks
(in parallel) do not link processor files to master
\param poly \n
write polyhedral cells without tet/pyramid decomposition
- \par poly
write polyhedral cells without tet/pyramid decomposition
\param -allPatches \n
Combine all patches into a single file
- \par -allPatches
Combine all patches into a single file
\param -excludePatches \<patchNames\>\n
Specify patches (wildcards) to exclude. For example,
\verbatim
-excludePatches '( inlet_1 inlet_2 "proc.*")'
\endverbatim
The quoting is required to avoid shell expansions and to pass the
information as a single argument. The double quotes denote a regular
expression.
- \par -excludePatches \<patchNames\>
Specify patches (wildcards) to exclude. For example,
\verbatim
-excludePatches '( inlet_1 inlet_2 "proc.*")'
\endverbatim
The quoting is required to avoid shell expansions and to pass the
information as a single argument. The double quotes denote a regular
expression.
\param -useTimeName \n
use the time index in the VTK file name instead of the time index
- \par -useTimeName
use the time index in the VTK file name instead of the time index
Note
mesh subset is handled by vtkMesh. Slight inconsistency in
@ -108,7 +109,7 @@ Note
whole-mesh values onto the subset patch.
Note
new file format: \n
\par new file format:
no automatic timestep recognition.
However can have .pvd file format which refers to time simulation
if XML *.vtu files are available:
@ -168,7 +169,7 @@ Note
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class GeoField>
void print(const char* msg, Ostream& os, const PtrList<GeoField>& flds)
void print(const char* msg, Ostream& os, const PtrList<const GeoField>& flds)
{
if (flds.size())
{
@ -195,35 +196,35 @@ void print(Ostream& os, const wordList& flds)
labelList getSelectedPatches
(
const polyBoundaryMesh& patches,
const List<wordRe>& excludePatches //HashSet<word>& excludePatches
const List<wordRe>& excludePatches
)
{
DynamicList<label> patchIDs(patches.size());
Info<< "Combining patches:" << endl;
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if
(
isType<emptyPolyPatch>(pp)
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
)
{
Info<< " discarding empty/processor patch " << patchI
Info<< " discarding empty/processor patch " << patchi
<< " " << pp.name() << endl;
}
else if (findStrings(excludePatches, pp.name()))
{
Info<< " excluding patch " << patchI
Info<< " excluding patch " << patchi
<< " " << pp.name() << endl;
}
else
{
patchIDs.append(patchI);
Info<< " patch " << patchI << " " << pp.name() << endl;
patchIDs.append(patchi);
Info<< " patch " << patchi << " " << pp.name() << endl;
}
}
return patchIDs.shrink();
@ -406,6 +407,7 @@ int main(int argc, char *argv[])
// VTK/ directory in the case
fileName fvPath(runTime.path()/"VTK");
// Directory of mesh (region0 gets filtered out)
fileName regionPrefix = "";
@ -569,11 +571,11 @@ int main(int argc, char *argv[])
// Construct the vol fields (on the original mesh if subsetted)
PtrList<volScalarField> vsf;
PtrList<volVectorField> vvf;
PtrList<volSphericalTensorField> vSpheretf;
PtrList<volSymmTensorField> vSymmtf;
PtrList<volTensorField> vtf;
PtrList<const volScalarField> vsf;
PtrList<const volVectorField> vvf;
PtrList<const volSphericalTensorField> vSpheretf;
PtrList<const volSymmTensorField> vSymmtf;
PtrList<const volTensorField> vtf;
if (!specifiedFields || selectedFields.size())
{
@ -672,11 +674,11 @@ int main(int argc, char *argv[])
<< " (\"-noPointValues\" (at your option)\n";
}
PtrList<pointScalarField> psf;
PtrList<pointVectorField> pvf;
PtrList<pointSphericalTensorField> pSpheretf;
PtrList<pointSymmTensorField> pSymmtf;
PtrList<pointTensorField> ptf;
PtrList<const pointScalarField> psf;
PtrList<const pointVectorField> pvf;
PtrList<const pointSphericalTensorField> pSpheretf;
PtrList<const pointSymmTensorField> pSymmtf;
PtrList<const pointTensorField> ptf;
if (!noPointValues && !(specifiedFields && selectedFields.empty()))
{
@ -820,7 +822,7 @@ int main(int argc, char *argv[])
if (args.optionFound("surfaceFields"))
{
PtrList<surfaceScalarField> ssf;
PtrList<const surfaceScalarField> ssf;
readFields
(
vMesh,
@ -831,7 +833,7 @@ int main(int argc, char *argv[])
);
print(" surfScalarFields :", Info, ssf);
PtrList<surfaceVectorField> svf;
PtrList<const surfaceVectorField> svf;
readFields
(
vMesh,
@ -853,8 +855,9 @@ int main(int argc, char *argv[])
forAll(ssf, i)
{
svf.set(sz+i, ssf[i]*n);
svf[sz+i].rename(ssf[i].name());
surfaceVectorField* ssfiPtr = (ssf[i]*n).ptr();
ssfiPtr->rename(ssf[i].name());
svf.set(sz+i, ssfiPtr);
}
ssf.clear();
@ -963,9 +966,9 @@ int main(int argc, char *argv[])
}
else
{
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (!findStrings(excludePatches, pp.name()))
{
@ -998,7 +1001,7 @@ int main(int argc, char *argv[])
binary,
nearCellValue,
patchFileName,
labelList(1, patchI)
labelList(1, patchi)
);
if (!isA<emptyPolyPatch>(pp))
@ -1063,7 +1066,7 @@ int main(int argc, char *argv[])
if (doFaceZones)
{
PtrList<surfaceScalarField> ssf;
PtrList<const surfaceScalarField> ssf;
readFields
(
vMesh,
@ -1074,7 +1077,7 @@ int main(int argc, char *argv[])
);
print(" surfScalarFields :", Info, ssf);
PtrList<surfaceVectorField> svf;
PtrList<const surfaceVectorField> svf;
readFields
(
vMesh,

View File

@ -0,0 +1,14 @@
surfaceMeshWriter.C
internalWriter.C
lagrangianWriter.C
patchWriter.C
writeFuns.C
writeFaceSet.C
writePointSet.C
writeSurfFields.C
vtkMesh.C
vtkTopo.C
writeVTK/writeVTK.C
LIB = $(FOAM_LIBBIN)/libfoamToVTK

View File

@ -0,0 +1,10 @@
EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \
-ldynamicMesh \
-llagrangian \
-lgenericPatchFields

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -80,18 +80,18 @@ Foam::internalWriter::internalWriter
// Count total number of vertices referenced.
label nFaceVerts = 0;
forAll(vtkVertLabels, cellI)
forAll(vtkVertLabels, celli)
{
nFaceVerts += vtkVertLabels[cellI].size() + 1;
nFaceVerts += vtkVertLabels[celli].size() + 1;
}
os_ << "CELLS " << vtkVertLabels.size() << ' ' << nFaceVerts << std::endl;
DynamicList<label> vertLabels(nFaceVerts);
forAll(vtkVertLabels, cellI)
forAll(vtkVertLabels, celli)
{
const labelList& vtkVerts = vtkVertLabels[cellI];
const labelList& vtkVerts = vtkVertLabels[celli];
vertLabels.append(vtkVerts.size());
@ -133,28 +133,28 @@ void Foam::internalWriter::writeCellIDs()
{
const labelList& cMap = vMesh_.subsetter().cellMap();
forAll(mesh.cells(), cellI)
forAll(mesh.cells(), celli)
{
cellId[labelI++] = cMap[cellI];
cellId[labelI++] = cMap[celli];
}
forAll(superCells, superCellI)
forAll(superCells, superCelli)
{
label origCellI = cMap[superCells[superCellI]];
label origCelli = cMap[superCells[superCelli]];
cellId[labelI++] = origCellI;
cellId[labelI++] = origCelli;
}
}
else
{
forAll(mesh.cells(), cellI)
forAll(mesh.cells(), celli)
{
cellId[labelI++] = cellI;
cellId[labelI++] = celli;
}
forAll(superCells, superCellI)
forAll(superCells, superCelli)
{
label origCellI = superCells[superCellI];
label origCelli = superCells[superCelli];
cellId[labelI++] = origCellI;
cellId[labelI++] = origCelli;
}
}

View File

@ -91,7 +91,7 @@ public:
template<class Type, template<class> class PatchField, class GeoMesh>
void write
(
const PtrList<GeometricField<Type, PatchField, GeoMesh>>&
const UPtrList<const GeometricField<Type, PatchField, GeoMesh>>&
);
//- Write generic internal fields
@ -106,7 +106,7 @@ public:
void write
(
const volPointInterpolation&,
const PtrList<GeometricField<Type, fvPatchField, volMesh>>&
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>&
);
//- Interpolate and internal fields

View File

@ -31,7 +31,7 @@ License
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::internalWriter::write
(
const PtrList<GeometricField<Type, PatchField, GeoMesh>>& flds
const UPtrList<const GeometricField<Type, PatchField, GeoMesh>>& flds
)
{
forAll(flds, i)
@ -58,7 +58,7 @@ template<class Type>
void Foam::internalWriter::write
(
const volPointInterpolation& pInterp,
const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>& flds
)
{
forAll(flds, i)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -70,9 +70,9 @@ Foam::patchWriter::patchWriter
nPoints_ += pp.nPoints();
nFaces_ += pp.size();
forAll(pp, faceI)
forAll(pp, facei)
{
nFaceVerts += pp[faceI].size() + 1;
nFaceVerts += pp[facei].size() + 1;
}
}
@ -98,9 +98,9 @@ Foam::patchWriter::patchWriter
{
const polyPatch& pp = patches[patchIDs_[i]];
forAll(pp, faceI)
forAll(pp, facei)
{
const face& f = pp.localFaces()[faceI];
const face& f = pp.localFaces()[facei];
vertLabels.append(f.size());
writeFuns::insert(f + offset, vertLabels);
@ -123,13 +123,13 @@ void Foam::patchWriter::writePatchIDs()
forAll(patchIDs_, i)
{
label patchI = patchIDs_[i];
label patchi = patchIDs_[i];
const polyPatch& pp = mesh.boundaryMesh()[patchI];
const polyPatch& pp = mesh.boundaryMesh()[patchi];
if (!isA<emptyPolyPatch>(pp))
{
writeFuns::insert(scalarField(pp.size(), patchI), fField);
writeFuns::insert(scalarField(pp.size(), patchi), fField);
}
}
writeFuns::write(os_, binary_, fField);

View File

@ -114,14 +114,17 @@ public:
template<class Type>
void write
(
const PtrList<GeometricField<Type, fvPatchField, volMesh>>&
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>&
);
//- Write pointFields
template<class Type>
void write
(
const PtrList<GeometricField<Type, pointPatchField, pointMesh>>&
const UPtrList
<
const GeometricField<Type, pointPatchField, pointMesh>
>&
);
//- Interpolate and write volFields
@ -129,7 +132,7 @@ public:
void write
(
const PrimitivePatchInterpolation<primitivePatch>&,
const PtrList<GeometricField<Type, fvPatchField, volMesh>>&
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>&
);
};

View File

@ -31,12 +31,12 @@ License
template<class Type>
void Foam::patchWriter::write
(
const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>& flds
)
{
forAll(flds, fieldI)
forAll(flds, fieldi)
{
const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldI];
const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldi];
os_ << fld.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '
@ -46,9 +46,9 @@ void Foam::patchWriter::write
forAll(patchIDs_, j)
{
label patchI = patchIDs_[j];
label patchi = patchIDs_[j];
const fvPatchField<Type>& pfld = fld.boundaryField()[patchI];
const fvPatchField<Type>& pfld = fld.boundaryField()[patchi];
if (nearCellValue_)
{
@ -67,13 +67,13 @@ void Foam::patchWriter::write
template<class Type>
void Foam::patchWriter::write
(
const PtrList<GeometricField<Type, pointPatchField, pointMesh>>& flds
const UPtrList<const GeometricField<Type, pointPatchField, pointMesh>>& flds
)
{
forAll(flds, fieldI)
forAll(flds, fieldi)
{
const GeometricField<Type, pointPatchField, pointMesh>& fld =
flds[fieldI];
flds[fieldi];
os_ << fld.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '
@ -83,9 +83,9 @@ void Foam::patchWriter::write
forAll(patchIDs_, j)
{
label patchI = patchIDs_[j];
label patchi = patchIDs_[j];
const pointPatchField<Type>& pfld = fld.boundaryField()[patchI];
const pointPatchField<Type>& pfld = fld.boundaryField()[patchi];
writeFuns::insert(pfld.patchInternalField()(), fField);
}
@ -98,12 +98,12 @@ template<class Type>
void Foam::patchWriter::write
(
const PrimitivePatchInterpolation<primitivePatch>& pInter,
const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>& flds
)
{
forAll(flds, fieldI)
forAll(flds, fieldi)
{
const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldI];
const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldi];
os_ << fld.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '
@ -113,9 +113,9 @@ void Foam::patchWriter::write
forAll(patchIDs_, j)
{
label patchI = patchIDs_[j];
label patchi = patchIDs_[j];
const fvPatchField<Type>& pfld = fld.boundaryField()[patchI];
const fvPatchField<Type>& pfld = fld.boundaryField()[patchi];
if (nearCellValue_)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,7 +40,7 @@ void readFields
const typename GeoField::Mesh& mesh,
const IOobjectList& objects,
const HashSet<word>& selectedFields,
PtrList<GeoField>& fields
PtrList<const GeoField>& fields
)
{
// Search list of objects for volScalarFields
@ -64,7 +64,7 @@ void readFields
*iter(),
mesh
)
)
).ptr()
);
nFields++;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,7 +52,7 @@ void readFields
const typename GeoField::Mesh& mesh,
const IOobjectList& objects,
const HashSet<word>& selectedFields,
PtrList<GeoField>& fields
PtrList<const GeoField>& fields
);
} // End namespace Foam

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,9 +49,9 @@ Foam::surfaceMeshWriter::surfaceMeshWriter
// Write topology
label nFaceVerts = 0;
forAll(pp, faceI)
forAll(pp, facei)
{
nFaceVerts += pp[faceI].size() + 1;
nFaceVerts += pp[facei].size() + 1;
}
os_ << "POINTS " << pp.nPoints() << " float" << std::endl;
@ -65,9 +65,9 @@ Foam::surfaceMeshWriter::surfaceMeshWriter
DynamicList<label> vertLabels(nFaceVerts);
forAll(pp, faceI)
forAll(pp, facei)
{
const face& f = pp.localFaces()[faceI];
const face& f = pp.localFaces()[facei];
vertLabels.append(f.size());
writeFuns::insert(f, vertLabels);

View File

@ -99,7 +99,10 @@ public:
template<class Type>
void write
(
const PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>&
const UPtrList
<
const GeometricField<Type, fvsPatchField, surfaceMesh>
>&
);
};

View File

@ -41,18 +41,18 @@ Foam::tmp<Field<Type>> Foam::surfaceMeshWriter::getFaceField
forAll(pp_.addressing(), i)
{
label faceI = pp_.addressing()[i];
label facei = pp_.addressing()[i];
label patchI = patches.whichPatch(faceI);
label patchi = patches.whichPatch(facei);
if (patchI == -1)
if (patchi == -1)
{
fld[i] = sfld[faceI];
fld[i] = sfld[facei];
}
else
{
label localFaceI = faceI - patches[patchI].start();
fld[i] = sfld.boundaryField()[patchI][localFaceI];
label localFacei = facei - patches[patchi].start();
fld[i] = sfld.boundaryField()[patchi][localFacei];
}
}
@ -63,13 +63,16 @@ Foam::tmp<Field<Type>> Foam::surfaceMeshWriter::getFaceField
template<class Type>
void Foam::surfaceMeshWriter::write
(
const PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>& sflds
const UPtrList
<
const GeometricField<Type, fvsPatchField, surfaceMesh>
>& sflds
)
{
forAll(sflds, fieldI)
forAll(sflds, fieldi)
{
const GeometricField<Type, fvsPatchField, surfaceMesh>& fld =
sflds[fieldI];
sflds[fieldi];
os_ << fld.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,9 +71,9 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
// and cells
if (decomposePoly)
{
forAll(cellShapes, cellI)
forAll(cellShapes, celli)
{
const cellModel& model = cellShapes[cellI].model();
const cellModel& model = cellShapes[celli].model();
if
(
@ -85,11 +85,11 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
&& model != tetWedge
)
{
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
forAll(cFaces, cFaceI)
forAll(cFaces, cFacei)
{
const face& f = mesh_.faces()[cFaces[cFaceI]];
const face& f = mesh_.faces()[cFaces[cFacei]];
label nQuads = 0;
label nTris = 0;
@ -120,26 +120,26 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
cellTypes_.setSize(cellShapes.size() + nAddCells);
// Set counters for additional points and additional cells
label addPointI = 0, addCellI = 0;
label addPointi = 0, addCelli = 0;
forAll(cellShapes, cellI)
forAll(cellShapes, celli)
{
const cellShape& cellShape = cellShapes[cellI];
const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model();
labelList& vtkVerts = vertLabels_[cellI];
labelList& vtkVerts = vertLabels_[celli];
if (cellModel == tet)
{
vtkVerts = cellShape;
cellTypes_[cellI] = VTK_TETRA;
cellTypes_[celli] = VTK_TETRA;
}
else if (cellModel == pyr)
{
vtkVerts = cellShape;
cellTypes_[cellI] = VTK_PYRAMID;
cellTypes_[celli] = VTK_PYRAMID;
}
else if (cellModel == prism)
{
@ -150,20 +150,20 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
Foam::Swap(vtkVerts[1], vtkVerts[2]);
Foam::Swap(vtkVerts[4], vtkVerts[5]);
cellTypes_[cellI] = VTK_WEDGE;
cellTypes_[celli] = VTK_WEDGE;
}
else if (cellModel == tetWedge)
else if (cellModel == tetWedge && decomposePoly)
{
// Treat as squeezed prism
// Treat as squeezed prism (VTK_WEDGE)
vtkVerts.setSize(6);
vtkVerts[0] = cellShape[0];
vtkVerts[1] = cellShape[2];
vtkVerts[2] = cellShape[1];
vtkVerts[3] = cellShape[3];
vtkVerts[4] = cellShape[4];
vtkVerts[5] = cellShape[4];
vtkVerts[5] = cellShape[3];
cellTypes_[cellI] = VTK_WEDGE;
cellTypes_[celli] = VTK_WEDGE;
}
else if (cellModel == wedge)
{
@ -178,32 +178,32 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
vtkVerts[6] = cellShape[5];
vtkVerts[7] = cellShape[6];
cellTypes_[cellI] = VTK_HEXAHEDRON;
cellTypes_[celli] = VTK_HEXAHEDRON;
}
else if (cellModel == hex)
{
vtkVerts = cellShape;
cellTypes_[cellI] = VTK_HEXAHEDRON;
cellTypes_[celli] = VTK_HEXAHEDRON;
}
else if (decomposePoly)
{
// Polyhedral cell. Decompose into tets + pyramids.
// Mapping from additional point to cell
addPointCellLabels_[addPointI] = cellI;
addPointCellLabels_[addPointi] = celli;
// The new vertex from the cell-centre
const label newVertexLabel = mesh_.nPoints() + addPointI;
const label newVertexLabel = mesh_.nPoints() + addPointi;
// Whether to insert cell in place of original or not.
bool substituteCell = true;
const labelList& cFaces = mesh_.cells()[cellI];
forAll(cFaces, cFaceI)
const labelList& cFaces = mesh_.cells()[celli];
forAll(cFaces, cFacei)
{
const face& f = mesh_.faces()[cFaces[cFaceI]];
const bool isOwner = (owner[cFaces[cFaceI]] == cellI);
const face& f = mesh_.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFacei]] == celli);
// Number of triangles and quads in decomposition
label nTris = 0;
@ -219,20 +219,20 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
forAll(quadFcs, quadI)
{
label thisCellI;
label thisCelli;
if (substituteCell)
{
thisCellI = cellI;
thisCelli = celli;
substituteCell = false;
}
else
{
thisCellI = mesh_.nCells() + addCellI;
superCells_[addCellI++] = cellI;
thisCelli = mesh_.nCells() + addCelli;
superCells_[addCelli++] = celli;
}
labelList& addVtkVerts = vertLabels_[thisCellI];
labelList& addVtkVerts = vertLabels_[thisCelli];
addVtkVerts.setSize(5);
@ -261,26 +261,26 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
}
addVtkVerts[4] = newVertexLabel;
cellTypes_[thisCellI] = VTK_PYRAMID;
cellTypes_[thisCelli] = VTK_PYRAMID;
}
forAll(triFcs, triI)
{
label thisCellI;
label thisCelli;
if (substituteCell)
{
thisCellI = cellI;
thisCelli = celli;
substituteCell = false;
}
else
{
thisCellI = mesh_.nCells() + addCellI;
superCells_[addCellI++] = cellI;
thisCelli = mesh_.nCells() + addCelli;
superCells_[addCelli++] = celli;
}
labelList& addVtkVerts = vertLabels_[thisCellI];
labelList& addVtkVerts = vertLabels_[thisCelli];
const face& tri = triFcs[triI];
@ -301,26 +301,26 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
}
addVtkVerts[3] = newVertexLabel;
cellTypes_[thisCellI] = VTK_TETRA;
cellTypes_[thisCelli] = VTK_TETRA;
}
}
addPointI++;
addPointi++;
}
else
{
// Polyhedral cell - not decomposed
cellTypes_[cellI] = VTK_POLYHEDRON;
cellTypes_[celli] = VTK_POLYHEDRON;
const labelList& cFaces = mesh_.cells()[cellI];
const labelList& cFaces = mesh_.cells()[celli];
// space for the number of faces and size of each face
label nData = 1 + cFaces.size();
// count total number of face points
forAll(cFaces, cFaceI)
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const face& f = mesh.faces()[cFaces[cFacei]];
nData += f.size(); // space for the face labels
}
@ -330,10 +330,10 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
vtkVerts[nData++] = cFaces.size();
// build face stream
forAll(cFaces, cFaceI)
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const bool isOwner = (owner[cFaces[cFaceI]] == cellI);
const face& f = mesh.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFacei]] == celli);
// number of labels for this face
vtkVerts[nData++] = f.size();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,13 +61,13 @@ void Foam::writeFaceSet
faceList setFaces(set.size());
labelList setFaceLabels(set.size());
label setFaceI = 0;
label setFacei = 0;
forAllConstIter(faceSet, set, iter)
{
setFaceLabels[setFaceI] = iter.key();
setFaces[setFaceI] = faces[iter.key()];
setFaceI++;
setFaceLabels[setFacei] = iter.key();
setFaces[setFacei] = faces[iter.key()];
setFacei++;
}
primitiveFacePatch fp(setFaces, vMesh.mesh().points());
@ -85,18 +85,18 @@ void Foam::writeFaceSet
label nFaceVerts = 0;
forAll(fp.localFaces(), faceI)
forAll(fp.localFaces(), facei)
{
nFaceVerts += fp.localFaces()[faceI].size() + 1;
nFaceVerts += fp.localFaces()[facei].size() + 1;
}
ostr<< "POLYGONS " << fp.size() << ' ' << nFaceVerts << std::endl;
DynamicList<label> vertLabels(nFaceVerts);
forAll(fp.localFaces(), faceI)
forAll(fp.localFaces(), facei)
{
const face& f = fp.localFaces()[faceI];
const face& f = fp.localFaces()[facei];
vertLabels.append(f.size());

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -80,13 +80,13 @@ void Foam::writeFuns::write
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nValues);
insert(vvf, fField);
insert(vvf.primitiveField(), fField);
forAll(superCells, superCellI)
forAll(superCells, superCelli)
{
label origCellI = superCells[superCellI];
label origCelli = superCells[superCelli];
insert(vvf[origCellI], fField);
insert(vvf[origCelli], fField);
}
write(os, binary, fField);
}
@ -117,9 +117,9 @@ void Foam::writeFuns::write
forAll(addPointCellLabels, api)
{
label origCellI = addPointCellLabels[api];
label origCelli = addPointCellLabels[api];
insert(interpolatePointToCell(pvf, origCellI), fField);
insert(interpolatePointToCell(pvf, origCelli), fField);
}
write(os, binary, fField);
}
@ -151,9 +151,9 @@ void Foam::writeFuns::write
forAll(addPointCellLabels, api)
{
label origCellI = addPointCellLabels[api];
label origCelli = addPointCellLabels[api];
insert(vvf[origCellI], fField);
insert(vvf[origCelli], fField);
}
write(os, binary, fField);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,19 +30,14 @@ License
#include "emptyFvsPatchFields.H"
#include "fvsPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
void writeSurfFields
void Foam::writeSurfFields
(
const bool binary,
const vtkMesh& vMesh,
const fileName& fileName,
const PtrList<surfaceVectorField>& surfVectorFields
const UPtrList<const surfaceVectorField>& surfVectorFields
)
{
const fvMesh& mesh = vMesh.mesh();
@ -64,9 +59,9 @@ void writeSurfFields
DynamicList<floatScalar> pField(3*mesh.nFaces());
for (label faceI = 0; faceI < mesh.nFaces(); faceI++)
for (label facei = 0; facei < mesh.nFaces(); facei++)
{
writeFuns::insert(fc[faceI], pField);
writeFuns::insert(fc[facei], pField);
}
writeFuns::write(str, binary, pField);
@ -75,25 +70,25 @@ void writeSurfFields
<< "FIELD attributes " << surfVectorFields.size() << std::endl;
// surfVectorFields
forAll(surfVectorFields, fieldI)
forAll(surfVectorFields, fieldi)
{
const surfaceVectorField& svf = surfVectorFields[fieldI];
const surfaceVectorField& svf = surfVectorFields[fieldi];
str << svf.name() << " 3 "
<< mesh.nFaces() << " float" << std::endl;
DynamicList<floatScalar> fField(3*mesh.nFaces());
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{
writeFuns::insert(svf[faceI], fField);
writeFuns::insert(svf[facei], fField);
}
forAll(svf.boundaryField(), patchI)
forAll(svf.boundaryField(), patchi)
{
const fvsPatchVectorField& pf = svf.boundaryField()[patchI];
const fvsPatchVectorField& pf = svf.boundaryField()[patchi];
const fvPatch& pp = mesh.boundary()[patchI];
const fvPatch& pp = mesh.boundary()[patchi];
if (isA<emptyFvsPatchVectorField>(pf))
{
@ -117,8 +112,4 @@ void writeSurfFields
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,7 +50,7 @@ void writeSurfFields
const bool binary,
const vtkMesh& vMesh,
const fileName& fileName,
const PtrList<surfaceVectorField>& surfVectorFields
const UPtrList<const surfaceVectorField>& surfVectorFields
);
} // End namespace Foam

View File

@ -0,0 +1,81 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// So we get a decent warning if we have multiple functionObject entries
// with the same name.
#inputMode error;
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.5;
deltaT 0.005;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
functions
{
writeVTK
{
type writeVTK;
// Where to load it from
libs ("libfoamToVTK.so");
// When to write:
// timeStep (with optional writeInterval)
// writeTime (with optional writeInterval)
// adjustableTime
// runTime
// clockTime
// cpuTime
writeControl writeTime;
// Write every writeInterval (only valid for timeStemp, writeTime)
writeInterval 1;
// Interval of time (valid for adjustableTime, runTime, clockTime,
// cpuTime)
writeInterval 1;
// Objects to write
objectNames ();
}
}
// ************************************************************************* //

View File

@ -0,0 +1,156 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "writeVTK.H"
#include "dictionary.H"
#include "Time.H"
#include "vtkMesh.H"
#include "internalWriter.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
defineTypeNameAndDebug(writeVTK, 0);
addToRunTimeSelectionTable(functionObject, writeVTK, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::writeVTK::writeVTK
(
const word& name,
const Time& runTime,
const dictionary& dict
)
:
fvMeshFunctionObject(name, runTime, dict),
objectNames_()
{
read(dict);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::writeVTK::~writeVTK()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::writeVTK::read(const dictionary& dict)
{
dict.lookup("objects") >> objectNames_;
return true;
}
bool Foam::functionObjects::writeVTK::execute()
{
return true;
}
bool Foam::functionObjects::writeVTK::write()
{
Info<< type() << " " << name() << " output:" << nl;
Info<< "Time: " << time_.timeName() << endl;
word timeDesc = time_.timeName();
// VTK/ directory in the case
fileName fvPath(time_.path()/"VTK");
mkDir(fvPath);
string vtkName = time_.caseName();
if (Pstream::parRun())
{
// Strip off leading casename, leaving just processor_DDD ending.
string::size_type i = vtkName.rfind("processor");
if (i != string::npos)
{
vtkName = vtkName.substr(i);
}
}
// Create file and write header
fileName vtkFileName
(
fvPath/vtkName
+ "_"
+ timeDesc
+ ".vtk"
);
Info<< " Internal : " << vtkFileName << endl;
vtkMesh vMesh(const_cast<fvMesh&>(mesh_));
// Write mesh
internalWriter writer(vMesh, false, vtkFileName);
UPtrList<const volScalarField> vsf(lookupFields<volScalarField>());
UPtrList<const volVectorField> vvf(lookupFields<volVectorField>());
UPtrList<const volSphericalTensorField> vsptf
(
lookupFields<volSphericalTensorField>()
);
UPtrList<const volSymmTensorField> vstf(lookupFields<volSymmTensorField>());
UPtrList<const volTensorField> vtf(lookupFields<volTensorField>());
// Write header for cellID and volFields
writeFuns::writeCellDataHeader
(
writer.os(),
vMesh.nFieldCells(),
1 + vsf.size() + vvf.size() + vsptf.size() + vstf.size() + vtf.size()
);
// Write cellID field
writer.writeCellIDs();
// Write volFields
writer.write(vsf);
writer.write(vvf);
writer.write(vsptf);
writer.write(vstf);
writer.write(vtf);
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,179 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::functionObjects::writeVTK
Group
grpUtilitiesFunctionObjects
Description
This functionObject writes objects registered to the database in VTK format
using the foamToVTK library.
Currently only the writing of the cell-values of volFields is supported but
support for other field types, patch fields, Lagrangian data etc. will be
added.
Example of function object specification:
\verbatim
writeVTK1
{
type writeVTK;
libs ("libutilityFunctionObjects.so");
...
objectNames (obj1 obj2);
}
\endverbatim
Usage
\table
Property | Description | Required | Default value
type | type name: writeVTK | yes |
objectNames | objects to write | yes |
\endtable
See also
Foam::functionObjects::fvMeshFunctionObject
Foam::functionObjects::timeControl
Example of function object specification to calculate Lambda2:
\verbatim
Lambda2_1
{
type Lambda2;
functionObjectLibs ("libutilityFunctionObjects.so");
...
}
\endverbatim
\heading Function object usage
\table
Property | Description | Required | Default value
type | Type name: Lambda2 | yes |
UName | Name of velocity field | no | U
resultName | Name of Lambda2 field | no | <function name>
log | Log to standard output | no | yes
\endtable
SourceFiles
writeVTK.C
IOwriteVTK.H
\*---------------------------------------------------------------------------*/
#ifndef functionObjects_writeVTK_H
#define functionObjects_writeVTK_H
#include "fvMeshFunctionObject.H"
#include "wordReList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
/*---------------------------------------------------------------------------*\
Class writeVTK Declaration
\*---------------------------------------------------------------------------*/
class writeVTK
:
public fvMeshFunctionObject
{
// Private data
//- Names of objects
wordReList objectNames_;
//- Result name
word resultName_;
//- Switch to send output to Info as well as to file
Switch log_;
// Private Member Functions
template<class GeoField>
UPtrList<const GeoField> lookupFields() const;
//- Disallow default bitwise copy construct
writeVTK(const writeVTK&);
//- Disallow default bitwise assignment
void operator=(const writeVTK&);
public:
//- Runtime type information
TypeName("writeVTK");
// Constructors
//- Construct from Time and dictionary
writeVTK
(
const word& name,
const Time& t,
const dictionary&
);
//- Destructor
virtual ~writeVTK();
// Member Functions
//- Read the writeVTK data
virtual bool read(const dictionary&);
//- Execute, currently does nothing
virtual bool execute();
//- Write the writeVTK
virtual bool write();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "writeVTKTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,61 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "writeVTK.H"
#include "objectRegistry.H"
#include "DynamicList.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class GeoField>
Foam::UPtrList<const GeoField>
Foam::functionObjects::writeVTK::lookupFields() const
{
DynamicList<word> allNames(obr_.toc().size());
forAll(objectNames_, i)
{
wordList names(obr_.names<GeoField>(objectNames_[i]));
if (names.size())
{
allNames.append(names);
}
}
UPtrList<const GeoField> fields(allNames.size());
forAll(allNames, i)
{
const GeoField& field = obr_.lookupObject<GeoField>(allNames[i]);
Info<< " Writing " << GeoField::typeName
<< " field " << field.name() << endl;
fields.set(i, &field);
}
return fields;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -209,14 +209,14 @@ int main(int argc, char *argv[])
sFields[i]->correctBoundaryConditions();
sFields[i]->write();
delete sFields[i];
sFields[i] = NULL;
sFields[i] = nullptr;
}
else if (vFields[i])
{
vFields[i]->correctBoundaryConditions();
vFields[i]->write();
delete vFields[i];
vFields[i] = NULL;
vFields[i] = nullptr;
}
}

View File

@ -1,3 +0,0 @@
foamCalcApp.C
EXE = $(FOAM_APPBIN)/foamCalc

View File

@ -1,10 +0,0 @@
EXE_INC = \
-I$(LIB_SRC)/postProcessing/foamCalcFunctions/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lgenericPatchFields \
-lfoamCalcFunctions \
-lfiniteVolume \
-lmeshTools

View File

@ -1,101 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
foamCalc
Group
grpPostProcessingUtilities
Description
Generic wrapper for calculating a quantity at each time.
Split into four phases:
1. Intialise
2. Pre-time calculation loop
3. Calculation loop
4. Post-calculation loop
\*---------------------------------------------------------------------------*/
#include "timeSelector.H"
#include "calcType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
Foam::timeSelector::addOptions();
#include "addRegionOption.H"
Foam::argList::addBoolOption
(
"noWrite",
"suppress writing results"
);
#include "addDictOption.H"
if (argc < 2)
{
FatalError
<< "No utility has been supplied" << nl
<< exit(FatalError);
}
const word utilityName = argv[1];
Foam::autoPtr<Foam::calcType> utility
(
calcType::New(utilityName)
);
utility().tryInit();
#include "setRootCase.H"
#include "createTime.H"
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
#include "createNamedMesh.H"
utility().tryPreCalc(args, runTime, mesh);
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
Foam::Info<< "Time = " << runTime.timeName() << Foam::endl;
mesh.readUpdate();
utility().tryCalc(args, runTime, mesh);
Foam::Info<< Foam::endl;
}
utility().tryPostCalc(args, runTime, mesh);
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -5,7 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory
export WM_CONTINUE_ON_ERROR=true
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#
@ -42,19 +41,25 @@ canBuildPlugin()
# -----------------------------------------------------------------------------
case "$ParaView_VERSION" in
3*)
if canBuildPlugin
then
(
# ensure CMake gets the correct C/C++ compilers
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$PV_PLUGIN_PATH" ] || {
echo "$0 : PV_PLUGIN_PATH not valid - it is unset"
exit 1
}
# Ensure CMake gets the correct C/C++ compilers
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
wmake $targetType vtkPV3Readers
PV3blockMeshReader/Allwmake $*
PV3FoamReader/Allwmake $*
)
PV3blockMeshReader/Allwmake $targetType $*
PV3FoamReader/Allwmake $targetType $*
else
echo "ERROR: ParaView not found in $ParaView_DIR"
fi
;;
*)
@ -65,4 +70,5 @@ case "$ParaView_VERSION" in
;;
esac
#------------------------------------------------------------------------------

View File

@ -2,20 +2,23 @@
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
then
wmake $targetType vtkPV3Foam
(
cd PV3FoamReader
mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
cd Make/$WM_OPTIONS
cmake ../..
make
)
if [ "$targetType" != "objects" ]
then
(
cd PV3FoamReader
mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
cd Make/$WM_OPTIONS
cmake ../..
make
)
fi
fi
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,10 +58,10 @@ vtkPV3FoamReader::vtkPV3FoamReader()
SetNumberOfInputPorts(0);
FileName = NULL;
foamData_ = NULL;
FileName = nullptr;
foamData_ = nullptr;
output0_ = NULL;
output0_ = nullptr;
#ifdef VTKPV3FOAM_DUALPORT
// Add second output for the Lagrangian
@ -217,7 +217,7 @@ int vtkPV3FoamReader::RequestInformation
// delete foamData and flag it as fatal error
delete foamData_;
foamData_ = NULL;
foamData_ = nullptr;
return 0;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,7 +30,6 @@ InClass
#define vtkOpenFOAMTupleRemap_H
// OpenFOAM includes
#include "StaticAssert.H"
#include "Swap.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,17 +38,6 @@ template<class Type>
inline void vtkOpenFOAMTupleRemap(float vec[]);
// a symmTensor specialization to remap OpenFOAM -> ParaView naming order
// Qt/Core/pqScalarBarRepresentation.cxx defines this order
// { "XX", "YY", "ZZ", "XY", "YZ", "XZ" }
// in pqScalarBarRepresentation::getDefaultComponentLabel()
// whereas OpenFOAM uses this order
// { XX, XY, XZ, YY, YZ, ZZ }
//
// for extra safety, assert that symmTensor indeed has 6 components
StaticAssert(Foam::symmTensor::nComponents == 6);
// Template specialization for symmTensor
template<>
inline void vtkOpenFOAMTupleRemap<Foam::symmTensor>(float vec[])

View File

@ -86,7 +86,7 @@ void Foam::vtkPV3Foam::reduceMemory()
if (!reader_->GetCacheMesh())
{
delete meshPtr_;
meshPtr_ = NULL;
meshPtr_ = nullptr;
}
}
@ -226,8 +226,8 @@ Foam::vtkPV3Foam::vtkPV3Foam
)
:
reader_(reader),
dbPtr_(NULL),
meshPtr_(NULL),
dbPtr_(nullptr),
meshPtr_(nullptr),
meshRegion_(polyMesh::defaultRegion),
meshDir_(polyMesh::meshSubDir),
timeIndex_(-1),
@ -347,7 +347,7 @@ void Foam::vtkPV3Foam::updateInfo()
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::updateInfo"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] timeIndex="
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] timeIndex="
<< timeIndex_ << endl;
}
@ -426,7 +426,7 @@ void Foam::vtkPV3Foam::updateFoamMesh()
if (!reader_->GetCacheMesh())
{
delete meshPtr_;
meshPtr_ = NULL;
meshPtr_ = nullptr;
}
// Check to see if the OpenFOAM mesh has been created
@ -551,7 +551,7 @@ void Foam::vtkPV3Foam::CleanUp()
double* Foam::vtkPV3Foam::findTimes(int& nTimeSteps)
{
int nTimes = 0;
double* tsteps = NULL;
double* tsteps = nullptr;
if (dbPtr_.valid())
{
@ -636,10 +636,10 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
// always remove old actors first
forAll(patchTextActorsPtrs_, patchI)
forAll(patchTextActorsPtrs_, patchi)
{
renderer->RemoveViewProp(patchTextActorsPtrs_[patchI]);
patchTextActorsPtrs_[patchI]->Delete();
renderer->RemoveViewProp(patchTextActorsPtrs_[patchi]);
patchTextActorsPtrs_[patchi]->Delete();
}
patchTextActorsPtrs_.clear();
@ -669,9 +669,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
// Loop through all patches to determine zones, and centre of each zone
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
const polyPatch& pp = pbMesh[patchI];
const polyPatch& pp = pbMesh[patchi];
// Only include the patch if it is selected
if (!selectedPatches.found(pp.name()))
@ -703,27 +703,27 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
// Do topological analysis of patch, find disconnected regions
patchZones pZones(pp, featEdge);
nZones[patchI] = pZones.nZones();
nZones[patchi] = pZones.nZones();
labelList zoneNFaces(pZones.nZones(), 0);
// Create storage for additional zone centres
forAll(zoneNFaces, zoneI)
{
zoneCentre[patchI].append(Zero);
zoneCentre[patchi].append(Zero);
}
// Do averaging per individual zone
forAll(pp, faceI)
forAll(pp, facei)
{
label zoneI = pZones[faceI];
zoneCentre[patchI][zoneI] += pp[faceI].centre(pp.points());
label zoneI = pZones[facei];
zoneCentre[patchi][zoneI] += pp[facei].centre(pp.points());
zoneNFaces[zoneI]++;
}
forAll(zoneCentre[patchI], zoneI)
forAll(zoneCentre[patchi], zoneI)
{
zoneCentre[patchI][zoneI] /= zoneNFaces[zoneI];
zoneCentre[patchi][zoneI] /= zoneNFaces[zoneI];
}
}
@ -734,9 +734,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
label displayZoneI = 0;
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
displayZoneI += min(MAXPATCHZONES, nZones[patchI]);
displayZoneI += min(MAXPATCHZONES, nZones[patchi]);
}
if (debug)
@ -756,18 +756,18 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
// Actor index
displayZoneI = 0;
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
const polyPatch& pp = pbMesh[patchI];
const polyPatch& pp = pbMesh[patchi];
label globalZoneI = 0;
// Only selected patches will have a non-zero number of zones
label nDisplayZones = min(MAXPATCHZONES, nZones[patchI]);
label nDisplayZones = min(MAXPATCHZONES, nZones[patchi]);
label increment = 1;
if (nZones[patchI] >= MAXPATCHZONES)
if (nZones[patchi] >= MAXPATCHZONES)
{
increment = nZones[patchI]/MAXPATCHZONES;
increment = nZones[patchi]/MAXPATCHZONES;
}
for (label i = 0; i < nDisplayZones; i++)
@ -775,7 +775,7 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
if (debug)
{
Info<< "patch name = " << pp.name() << nl
<< "anchor = " << zoneCentre[patchI][globalZoneI] << nl
<< "anchor = " << zoneCentre[patchi][globalZoneI] << nl
<< "globalZoneI = " << globalZoneI << endl;
}
@ -798,9 +798,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
txt->GetPositionCoordinate()->SetValue
(
zoneCentre[patchI][globalZoneI].x(),
zoneCentre[patchI][globalZoneI].y(),
zoneCentre[patchI][globalZoneI].z()
zoneCentre[patchi][globalZoneI].x(),
zoneCentre[patchi][globalZoneI].y(),
zoneCentre[patchi][globalZoneI].z()
);
// Add text to each renderer

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,9 +74,9 @@ void Foam::vtkPV3Foam::convertFaceField
// for interior faces: average owner/neighbour
// for boundary faces: owner
forAll(faceLabels, faceI)
forAll(faceLabels, facei)
{
const label faceNo = faceLabels[faceI];
const label faceNo = faceLabels[facei];
if (faceNo < nInternalFaces)
{
Type t = 0.5*(tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]]);
@ -96,7 +96,7 @@ void Foam::vtkPV3Foam::convertFaceField
}
vtkOpenFOAMTupleRemap<Type>(vec);
cellData->InsertTuple(faceI, vec);
cellData->InsertTuple(facei, vec);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -190,7 +190,7 @@ void Foam::vtkPV3Foam::convertMeshPatches
<< patchName << endl;
}
vtkPolyData* vtkmesh = NULL;
vtkPolyData* vtkmesh = nullptr;
if (patchIds.size() == 1)
{
vtkmesh = patchVTKMesh(patchName, patches[patchIds.begin().key()]);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,7 +45,7 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
const word& cloudName
)
{
vtkPolyData* vtkmesh = NULL;
vtkPolyData* vtkmesh = nullptr;
if (debug)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -55,10 +55,10 @@ vtkPolyData* Foam::vtkPV3Foam::faceSetVTKMesh
const faceList& meshFaces = mesh.faces();
faceList patchFaces(fSet.size());
label faceI = 0;
label facei = 0;
forAllConstIter(faceSet, fSet, iter)
{
patchFaces[faceI++] = meshFaces[iter.key()];
patchFaces[facei++] = meshFaces[iter.key()];
}
primitiveFacePatch p(patchFaces, mesh.points());
@ -83,9 +83,9 @@ vtkPolyData* Foam::vtkPV3Foam::faceSetVTKMesh
vtkCellArray* vtkcells = vtkCellArray::New();
vtkcells->Allocate(faces.size());
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
vtkIdType nodeIds[f.size()];
forAll(f, fp)

View File

@ -83,9 +83,9 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
Info<< "... scanning for polyhedra" << endl;
}
forAll(cellShapes, cellI)
forAll(cellShapes, celli)
{
const cellModel& model = cellShapes[cellI].model();
const cellModel& model = cellShapes[celli].model();
if
(
@ -97,11 +97,11 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
&& model != tetWedge
)
{
const cell& cFaces = mesh.cells()[cellI];
const cell& cFaces = mesh.cells()[celli];
forAll(cFaces, cFaceI)
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const face& f = mesh.faces()[cFaces[cFacei]];
label nQuads = 0;
label nTris = 0;
@ -158,7 +158,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
vtkmesh->Allocate(mesh.nCells() + nAddCells);
// Set counters for additional points and additional cells
label addPointI = 0, addCellI = 0;
label addPointi = 0, addCelli = 0;
// Create storage for points - needed for mapping from OpenFOAM to VTK
// data types - max 'order' = hex = 8 points
@ -168,12 +168,12 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
// [numFace0Pts, id1, id2, id3, numFace1Pts, id1, id2, id3, ...]
DynamicList<vtkIdType> faceStream(256);
forAll(cellShapes, cellI)
forAll(cellShapes, celli)
{
const cellShape& cellShape = cellShapes[cellI];
const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model();
superCells[addCellI++] = cellI;
superCells[addCelli++] = celli;
if (cellModel == tet)
{
@ -219,7 +219,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
nodeIds
);
}
else if (cellModel == tetWedge)
else if (cellModel == tetWedge && !reader_->GetUseVTKPolyhedron())
{
// Treat as squeezed prism (VTK_WEDGE)
@ -273,16 +273,16 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
else if (reader_->GetUseVTKPolyhedron())
{
// Polyhedral cell - use VTK_POLYHEDRON
const labelList& cFaces = mesh.cells()[cellI];
const labelList& cFaces = mesh.cells()[celli];
#ifdef HAS_VTK_POLYHEDRON
vtkIdType nFaces = cFaces.size();
vtkIdType nLabels = nFaces;
// count size for face stream
forAll(cFaces, cFaceI)
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const face& f = mesh.faces()[cFaces[cFacei]];
nLabels += f.size();
}
@ -292,10 +292,10 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
faceStream.clear();
faceStream.reserve(nLabels + nFaces);
forAll(cFaces, cFaceI)
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const bool isOwner = (owner[cFaces[cFaceI]] == cellI);
const face& f = mesh.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFacei]] == celli);
const label nFacePoints = f.size();
// number of labels for this face
@ -327,9 +327,9 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
// establish unique node ids used
HashSet<vtkIdType, Hash<label>> hashUniqId(2*256);
forAll(cFaces, cFaceI)
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const face& f = mesh.faces()[cFaces[cFacei]];
forAll(f, fp)
{
@ -353,20 +353,20 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
// Polyhedral cell. Decompose into tets + prisms.
// Mapping from additional point to cell
addPointCellLabels[addPointI] = cellI;
addPointCellLabels[addPointi] = celli;
// The new vertex from the cell-centre
const label newVertexLabel = mesh.nPoints() + addPointI;
vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[cellI]);
const label newVertexLabel = mesh.nPoints() + addPointi;
vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[celli]);
// Whether to insert cell in place of original or not.
bool substituteCell = true;
const labelList& cFaces = mesh.cells()[cellI];
forAll(cFaces, cFaceI)
const labelList& cFaces = mesh.cells()[celli];
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const bool isOwner = (owner[cFaces[cFaceI]] == cellI);
const face& f = mesh.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFacei]] == celli);
// Number of triangles and quads in decomposition
label nTris = 0;
@ -388,7 +388,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
}
else
{
superCells[addCellI++] = cellI;
superCells[addCelli++] = celli;
}
const face& quad = quadFcs[quadI];
@ -431,7 +431,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
}
else
{
superCells[addCellI++] = cellI;
superCells[addCelli++] = celli;
}
const face& tri = triFcs[triI];
@ -460,7 +460,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
}
}
addPointI++;
addPointi++;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,9 +54,9 @@ vtkPolyData* Foam::vtkPV3Foam::pointZoneVTKMesh
vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate(pointLabels.size());
forAll(pointLabels, pointI)
forAll(pointLabels, pointi)
{
vtkInsertNextOpenFOAMPoint(vtkpoints, meshPoints[pointLabels[pointI]]);
vtkInsertNextOpenFOAMPoint(vtkpoints, meshPoints[pointLabels[pointi]]);
}
vtkmesh->SetPoints(vtkpoints);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -152,7 +152,7 @@ void Foam::vtkPV3Foam::convertPointFields
// Extract the field on the zone
Field<Type> fld
(
ptf.internalField(),
ptf.primitiveField(),
mesh.faceZones()[zoneId]().meshPoints()
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,9 +71,9 @@ vtkPolyData* Foam::vtkPV3Foam::patchVTKMesh
vtkCellArray* vtkcells = vtkCellArray::New();
vtkcells->Allocate(faces.size());
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
vtkIdType nodeIds[f.size()];
forAll(f, fp)

View File

@ -228,7 +228,7 @@ void Foam::vtkPV3Foam::updateInfoPatches
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::updateInfoPatches"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
@ -295,9 +295,9 @@ void Foam::vtkPV3Foam::updateInfoPatches
if (!reader_->GetShowGroupsOnly())
{
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (pp.size())
{
@ -344,12 +344,12 @@ void Foam::vtkPV3Foam::updateInfoPatches
wordList names(patchEntries.size());
labelList sizes(patchEntries.size());
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
const dictionary& patchDict = patchEntries[patchI].dict();
const dictionary& patchDict = patchEntries[patchi].dict();
sizes[patchI] = readLabel(patchDict.lookup("nFaces"));
names[patchI] = patchEntries[patchI].keyword();
sizes[patchi] = readLabel(patchDict.lookup("nFaces"));
names[patchi] = patchEntries[patchi].keyword();
}
@ -358,9 +358,9 @@ void Foam::vtkPV3Foam::updateInfoPatches
HashTable<labelList, word> groups(patchEntries.size());
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
const dictionary& patchDict = patchEntries[patchI].dict();
const dictionary& patchDict = patchEntries[patchi].dict();
wordList groupNames;
patchDict.readIfPresent("inGroups", groupNames);
@ -373,11 +373,11 @@ void Foam::vtkPV3Foam::updateInfoPatches
);
if (iter != groups.end())
{
iter().append(patchI);
iter().append(patchi);
}
else
{
groups.insert(groupNames[groupI], labelList(1, patchI));
groups.insert(groupNames[groupI], labelList(1, patchi));
}
}
}
@ -432,14 +432,14 @@ void Foam::vtkPV3Foam::updateInfoPatches
if (!reader_->GetShowGroupsOnly())
{
forAll(names, patchI)
forAll(names, patchi)
{
// Valid patch if nFace > 0 - add patch to GUI list
if (sizes[patchI])
if (sizes[patchi])
{
arraySelection->AddArray
(
(names[patchI] + " - patch").c_str()
(names[patchi] + " - patch").c_str()
);
++nPatches;
@ -476,7 +476,7 @@ void Foam::vtkPV3Foam::updateInfoZones
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::updateInfoZones"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
wordList namesLst;

View File

@ -41,7 +41,7 @@ void Foam::vtkPV3Foam::updateInfoFields
{
Info<< "<beg> Foam::vtkPV3Foam::updateInfoFields <"
<< meshType::Mesh::typeName
<< "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]"
<< "> [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]"
<< endl;
}

View File

@ -2,20 +2,23 @@
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
set -x
if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
then
wmake $targetType vtkPV3blockMesh
(
cd PV3blockMeshReader
mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
cd Make/$WM_OPTIONS
cmake ../..
make
)
if [ "$targetType" != "objects" ]
then
(
cd PV3blockMeshReader
mkdir -p Make/$WM_OPTIONS > /dev/null 2>&1
cd Make/$WM_OPTIONS
cmake ../..
make
)
fi
fi
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -56,8 +56,8 @@ vtkPV3blockMeshReader::vtkPV3blockMeshReader()
SetNumberOfInputPorts(0);
FileName = NULL;
foamData_ = NULL;
FileName = nullptr;
foamData_ = nullptr;
ShowPointNumbers = 1;
UpdateGUI = 0;
@ -165,7 +165,7 @@ int vtkPV3blockMeshReader::RequestInformation
//
// // delete foamData and flag it as fatal error
// delete foamData_;
// foamData_ = NULL;
// foamData_ = nullptr;
// return 0;
// }

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,7 +66,7 @@ void Foam::vtkPV3blockMesh::updateInfoBlocks
if (debug)
{
Info<< "<beg> Foam::vtkPV3blockMesh::updateInfoBlocks"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
@ -109,7 +109,7 @@ void Foam::vtkPV3blockMesh::updateInfoEdges
if (debug)
{
Info<< "<beg> Foam::vtkPV3blockMesh::updateInfoEdges"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
@ -150,8 +150,8 @@ Foam::vtkPV3blockMesh::vtkPV3blockMesh
)
:
reader_(reader),
dbPtr_(NULL),
meshPtr_(NULL),
dbPtr_(nullptr),
meshPtr_(nullptr),
meshRegion_(polyMesh::defaultRegion),
meshDir_(polyMesh::meshSubDir),
arrayRangeBlocks_("block"),
@ -252,9 +252,9 @@ Foam::vtkPV3blockMesh::~vtkPV3blockMesh()
// Hmm. pointNumberTextActors are not getting removed
//
forAll(pointNumberTextActorsPtrs_, pointI)
forAll(pointNumberTextActorsPtrs_, pointi)
{
pointNumberTextActorsPtrs_[pointI]->Delete();
pointNumberTextActorsPtrs_[pointi]->Delete();
}
pointNumberTextActorsPtrs_.clear();
@ -269,7 +269,7 @@ void Foam::vtkPV3blockMesh::updateInfo()
if (debug)
{
Info<< "<beg> Foam::vtkPV3blockMesh::updateInfo"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] " << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] " << endl;
}
resetCounters();
@ -420,10 +420,10 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
{
// always remove old actors first
forAll(pointNumberTextActorsPtrs_, pointI)
forAll(pointNumberTextActorsPtrs_, pointi)
{
renderer->RemoveViewProp(pointNumberTextActorsPtrs_[pointI]);
pointNumberTextActorsPtrs_[pointI]->Delete();
renderer->RemoveViewProp(pointNumberTextActorsPtrs_[pointi]);
pointNumberTextActorsPtrs_[pointi]->Delete();
}
pointNumberTextActorsPtrs_.clear();
@ -433,11 +433,11 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
const scalar scaleFactor = meshPtr_->scaleFactor();
pointNumberTextActorsPtrs_.setSize(cornerPts.size());
forAll(cornerPts, pointI)
forAll(cornerPts, pointi)
{
vtkTextActor* txt = vtkTextActor::New();
txt->SetInput(Foam::name(pointI).c_str());
txt->SetInput(Foam::name(pointi).c_str());
// Set text properties
vtkTextProperty* tprop = txt->GetTextProperty();
@ -454,9 +454,9 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
txt->GetPositionCoordinate()->SetValue
(
cornerPts[pointI].x()*scaleFactor,
cornerPts[pointI].y()*scaleFactor,
cornerPts[pointI].z()*scaleFactor
cornerPts[pointi].x()*scaleFactor,
cornerPts[pointi].y()*scaleFactor,
cornerPts[pointi].z()*scaleFactor
);
// Add text to each renderer
@ -464,7 +464,7 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
// Maintain a list of text labels added so that they can be
// removed later
pointNumberTextActorsPtrs_[pointI] = txt;
pointNumberTextActorsPtrs_[pointi] = txt;
}
}
}

View File

@ -5,7 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory
export WM_CONTINUE_ON_ERROR=true
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
#
@ -42,23 +41,29 @@ canBuildPlugin()
# -----------------------------------------------------------------------------
case "$ParaView_VERSION" in
4* | 5*)
if canBuildPlugin
then
(
[ -n "$PV_PLUGIN_PATH" ] || {
echo "$0 : PV_PLUGIN_PATH not valid - it is unset"
exit 1
}
# ensure CMake gets the correct C/C++ compilers
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
wmake $targetType vtkPVReaders
PVblockMeshReader/Allwmake $*
PVFoamReader/Allwmake $*
PVblockMeshReader/Allwmake $targetType $*
PVFoamReader/Allwmake $targetType $*
# dummy directory to trigger proper 'wclean all' behaviour
# Dummy directory to trigger proper 'wclean all' behaviour
# - the Allwclean will otherwise not be used
mkdir -p Make
)
else
echo "ERROR: ParaView not found in $ParaView_DIR"
fi
;;
*)
@ -69,4 +74,5 @@ case "$ParaView_VERSION" in
;;
esac
#------------------------------------------------------------------------------

View File

@ -2,7 +2,6 @@
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# Source the wmake functions
@ -16,19 +15,23 @@ set -x
if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
then
wmake $targetType vtkPVFoam
sourceDir=$PWD/PVFoamReader
# Where are any generated files stored?
findObjectDir $sourceDir
(
mkdir -p $objectsDir \
&& cd $objectsDir \
&& cmake $sourceDir \
&& make
) || {
echo
echo "WARNING: incomplete build of ParaView OpenFOAM plugin"
}
if [ "$targetType" != "objects" ]
then
sourceDir=$PWD/PVFoamReader
# Where are any generated files stored?
findObjectDir $sourceDir
(
mkdir -p $objectsDir \
&& cd $objectsDir \
&& cmake $sourceDir \
&& make
) || {
echo
echo "WARNING: incomplete build of ParaView OpenFOAM plugin"
}
fi
fi
#------------------------------------------------------------------------------

View File

@ -1,4 +1,4 @@
# create a plugin that adds a reader to the ParaView GUI
# Create a plugin that adds a reader to the ParaView GUI
# it is added in the file dialog when doing opens/saves.
# The qrc file is processed by Qt's resource compiler (rcc)
@ -61,7 +61,7 @@ IF(("${PARAVIEW_VERSION_MAJOR}" LESS 5) AND ("${PARAVIEW_VERSION_MINOR}" LESS 4)
SERVER_MANAGER_SOURCES vtkPVFoamReader.cxx
GUI_INTERFACES ${IFACES}
GUI_SOURCES pqPVFoamReaderPanel.cxx
${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
GUI_RESOURCE_FILES PVFoamReader.xml
)
ELSE()
@ -71,7 +71,7 @@ ELSE()
SERVER_MANAGER_SOURCES vtkPVFoamReader.cxx
GUI_INTERFACES ${IFACES}
GUI_SOURCES pqPVFoamReaderPanel.cxx
${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
)
ENDIF()

View File

@ -58,10 +58,10 @@ vtkPVFoamReader::vtkPVFoamReader()
SetNumberOfInputPorts(0);
FileName = NULL;
foamData_ = NULL;
FileName = nullptr;
foamData_ = nullptr;
output0_ = NULL;
output0_ = nullptr;
#ifdef VTKPVFOAM_DUALPORT
// Add second output for the Lagrangian
@ -217,7 +217,7 @@ int vtkPVFoamReader::RequestInformation
// delete foamData and flag it as fatal error
delete foamData_;
foamData_ = NULL;
foamData_ = nullptr;
return 0;
}

View File

@ -9,8 +9,7 @@ EXE_INC = \
-I../PVFoamReader
LIB_LIBS = \
-lmeshTools \
-lfiniteVolume \
-ldynamicMesh \
-ldynamicMesh \
-lgenericPatchFields \
-llagrangian \

View File

@ -30,7 +30,6 @@ InClass
#define vtkOpenFOAMTupleRemap_H
// OpenFOAM includes
#include "StaticAssert.H"
#include "Swap.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,17 +38,6 @@ template<class Type>
inline void vtkOpenFOAMTupleRemap(float vec[]);
// a symmTensor specialization to remap OpenFOAM -> ParaView naming order
// Qt/Core/pqScalarBarRepresentation.cxx defines this order
// { "XX", "YY", "ZZ", "XY", "YZ", "XZ" }
// in pqScalarBarRepresentation::getDefaultComponentLabel()
// whereas OpenFOAM uses this order
// { XX, XY, XZ, YY, YZ, ZZ }
//
// for extra safety, assert that symmTensor indeed has 6 components
StaticAssert(Foam::symmTensor::nComponents == 6);
// Template specialization for symmTensor
template<>
inline void vtkOpenFOAMTupleRemap<Foam::symmTensor>(float vec[])

View File

@ -86,7 +86,7 @@ void Foam::vtkPVFoam::reduceMemory()
if (!reader_->GetCacheMesh())
{
delete meshPtr_;
meshPtr_ = NULL;
meshPtr_ = nullptr;
}
}
@ -226,8 +226,8 @@ Foam::vtkPVFoam::vtkPVFoam
)
:
reader_(reader),
dbPtr_(NULL),
meshPtr_(NULL),
dbPtr_(nullptr),
meshPtr_(nullptr),
meshRegion_(polyMesh::defaultRegion),
meshDir_(polyMesh::meshSubDir),
timeIndex_(-1),
@ -347,7 +347,7 @@ void Foam::vtkPVFoam::updateInfo()
if (debug)
{
Info<< "<beg> Foam::vtkPVFoam::updateInfo"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] timeIndex="
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] timeIndex="
<< timeIndex_ << endl;
}
@ -426,7 +426,7 @@ void Foam::vtkPVFoam::updateFoamMesh()
if (!reader_->GetCacheMesh())
{
delete meshPtr_;
meshPtr_ = NULL;
meshPtr_ = nullptr;
}
// Check to see if the OpenFOAM mesh has been created
@ -551,7 +551,7 @@ void Foam::vtkPVFoam::CleanUp()
double* Foam::vtkPVFoam::findTimes(int& nTimeSteps)
{
int nTimes = 0;
double* tsteps = NULL;
double* tsteps = nullptr;
if (dbPtr_.valid())
{
@ -640,10 +640,10 @@ void Foam::vtkPVFoam::renderPatchNames
// always remove old actors first
forAll(patchTextActorsPtrs_, patchI)
forAll(patchTextActorsPtrs_, patchi)
{
renderer->RemoveViewProp(patchTextActorsPtrs_[patchI]);
patchTextActorsPtrs_[patchI]->Delete();
renderer->RemoveViewProp(patchTextActorsPtrs_[patchi]);
patchTextActorsPtrs_[patchi]->Delete();
}
patchTextActorsPtrs_.clear();
@ -673,9 +673,9 @@ void Foam::vtkPVFoam::renderPatchNames
// Loop through all patches to determine zones, and centre of each zone
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
const polyPatch& pp = pbMesh[patchI];
const polyPatch& pp = pbMesh[patchi];
// Only include the patch if it is selected
if (!selectedPatches.found(pp.name()))
@ -707,27 +707,27 @@ void Foam::vtkPVFoam::renderPatchNames
// Do topological analysis of patch, find disconnected regions
patchZones pZones(pp, featEdge);
nZones[patchI] = pZones.nZones();
nZones[patchi] = pZones.nZones();
labelList zoneNFaces(pZones.nZones(), 0);
// Create storage for additional zone centres
forAll(zoneNFaces, zoneI)
{
zoneCentre[patchI].append(Zero);
zoneCentre[patchi].append(Zero);
}
// Do averaging per individual zone
forAll(pp, faceI)
forAll(pp, facei)
{
label zoneI = pZones[faceI];
zoneCentre[patchI][zoneI] += pp[faceI].centre(pp.points());
label zoneI = pZones[facei];
zoneCentre[patchi][zoneI] += pp[facei].centre(pp.points());
zoneNFaces[zoneI]++;
}
forAll(zoneCentre[patchI], zoneI)
forAll(zoneCentre[patchi], zoneI)
{
zoneCentre[patchI][zoneI] /= zoneNFaces[zoneI];
zoneCentre[patchi][zoneI] /= zoneNFaces[zoneI];
}
}
@ -738,9 +738,9 @@ void Foam::vtkPVFoam::renderPatchNames
label displayZoneI = 0;
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
displayZoneI += min(MAXPATCHZONES, nZones[patchI]);
displayZoneI += min(MAXPATCHZONES, nZones[patchi]);
}
if (debug)
@ -760,18 +760,18 @@ void Foam::vtkPVFoam::renderPatchNames
// Actor index
displayZoneI = 0;
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
const polyPatch& pp = pbMesh[patchI];
const polyPatch& pp = pbMesh[patchi];
label globalZoneI = 0;
// Only selected patches will have a non-zero number of zones
label nDisplayZones = min(MAXPATCHZONES, nZones[patchI]);
label nDisplayZones = min(MAXPATCHZONES, nZones[patchi]);
label increment = 1;
if (nZones[patchI] >= MAXPATCHZONES)
if (nZones[patchi] >= MAXPATCHZONES)
{
increment = nZones[patchI]/MAXPATCHZONES;
increment = nZones[patchi]/MAXPATCHZONES;
}
for (label i = 0; i < nDisplayZones; i++)
@ -779,7 +779,7 @@ void Foam::vtkPVFoam::renderPatchNames
if (debug)
{
Info<< "patch name = " << pp.name() << nl
<< "anchor = " << zoneCentre[patchI][globalZoneI] << nl
<< "anchor = " << zoneCentre[patchi][globalZoneI] << nl
<< "globalZoneI = " << globalZoneI << endl;
}
@ -802,9 +802,9 @@ void Foam::vtkPVFoam::renderPatchNames
txt->GetPositionCoordinate()->SetValue
(
zoneCentre[patchI][globalZoneI].x(),
zoneCentre[patchI][globalZoneI].y(),
zoneCentre[patchI][globalZoneI].z()
zoneCentre[patchi][globalZoneI].x(),
zoneCentre[patchi][globalZoneI].y(),
zoneCentre[patchi][globalZoneI].z()
);
// Add text to each renderer

View File

@ -74,9 +74,9 @@ void Foam::vtkPVFoam::convertFaceField
// for interior faces: average owner/neighbour
// for boundary faces: owner
forAll(faceLabels, faceI)
forAll(faceLabels, facei)
{
const label faceNo = faceLabels[faceI];
const label faceNo = faceLabels[facei];
if (faceNo < nInternalFaces)
{
Type t = 0.5*(tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]]);
@ -96,7 +96,7 @@ void Foam::vtkPVFoam::convertFaceField
}
vtkOpenFOAMTupleRemap<Type>(vec);
cellData->InsertTuple(faceI, vec);
cellData->InsertTuple(facei, vec);
}

View File

@ -188,7 +188,7 @@ void Foam::vtkPVFoam::convertMeshPatches
<< patchName << endl;
}
vtkPolyData* vtkmesh = NULL;
vtkPolyData* vtkmesh = nullptr;
if (patchIds.size() == 1)
{
vtkmesh = patchVTKMesh(patchName, patches[patchIds.begin().key()]);

View File

@ -45,7 +45,7 @@ vtkPolyData* Foam::vtkPVFoam::lagrangianVTKMesh
const word& cloudName
)
{
vtkPolyData* vtkmesh = NULL;
vtkPolyData* vtkmesh = nullptr;
if (debug)
{

View File

@ -55,10 +55,10 @@ vtkPolyData* Foam::vtkPVFoam::faceSetVTKMesh
const faceList& meshFaces = mesh.faces();
faceList patchFaces(fSet.size());
label faceI = 0;
label facei = 0;
forAllConstIter(faceSet, fSet, iter)
{
patchFaces[faceI++] = meshFaces[iter.key()];
patchFaces[facei++] = meshFaces[iter.key()];
}
primitiveFacePatch p(patchFaces, mesh.points());
@ -83,9 +83,9 @@ vtkPolyData* Foam::vtkPVFoam::faceSetVTKMesh
vtkCellArray* vtkcells = vtkCellArray::New();
vtkcells->Allocate(faces.size());
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
vtkIdType nodeIds[f.size()];
forAll(f, fp)

View File

@ -83,9 +83,9 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
Info<< "... scanning for polyhedra" << endl;
}
forAll(cellShapes, cellI)
forAll(cellShapes, celli)
{
const cellModel& model = cellShapes[cellI].model();
const cellModel& model = cellShapes[celli].model();
if
(
@ -97,11 +97,11 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
&& model != tetWedge
)
{
const cell& cFaces = mesh.cells()[cellI];
const cell& cFaces = mesh.cells()[celli];
forAll(cFaces, cFaceI)
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const face& f = mesh.faces()[cFaces[cFacei]];
label nQuads = 0;
label nTris = 0;
@ -158,7 +158,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
vtkmesh->Allocate(mesh.nCells() + nAddCells);
// Set counters for additional points and additional cells
label addPointI = 0, addCellI = 0;
label addPointi = 0, addCelli = 0;
// Create storage for points - needed for mapping from OpenFOAM to VTK
// data types - max 'order' = hex = 8 points
@ -168,12 +168,12 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
// [numFace0Pts, id1, id2, id3, numFace1Pts, id1, id2, id3, ...]
DynamicList<vtkIdType> faceStream(256);
forAll(cellShapes, cellI)
forAll(cellShapes, celli)
{
const cellShape& cellShape = cellShapes[cellI];
const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model();
superCells[addCellI++] = cellI;
superCells[addCelli++] = celli;
if (cellModel == tet)
{
@ -219,7 +219,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
nodeIds
);
}
else if (cellModel == tetWedge)
else if (cellModel == tetWedge && !reader_->GetUseVTKPolyhedron())
{
// Treat as squeezed prism (VTK_WEDGE)
@ -273,15 +273,15 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
else if (reader_->GetUseVTKPolyhedron())
{
// Polyhedral cell - use VTK_POLYHEDRON
const labelList& cFaces = mesh.cells()[cellI];
const labelList& cFaces = mesh.cells()[celli];
vtkIdType nFaces = cFaces.size();
vtkIdType nLabels = nFaces;
// count size for face stream
forAll(cFaces, cFaceI)
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const face& f = mesh.faces()[cFaces[cFacei]];
nLabels += f.size();
}
@ -291,10 +291,10 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
faceStream.clear();
faceStream.reserve(nLabels + nFaces);
forAll(cFaces, cFaceI)
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const bool isOwner = (owner[cFaces[cFaceI]] == cellI);
const face& f = mesh.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFacei]] == celli);
const label nFacePoints = f.size();
// number of labels for this face
@ -325,20 +325,20 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
// Polyhedral cell. Decompose into tets + prisms.
// Mapping from additional point to cell
addPointCellLabels[addPointI] = cellI;
addPointCellLabels[addPointi] = celli;
// The new vertex from the cell-centre
const label newVertexLabel = mesh.nPoints() + addPointI;
vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[cellI]);
const label newVertexLabel = mesh.nPoints() + addPointi;
vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[celli]);
// Whether to insert cell in place of original or not.
bool substituteCell = true;
const labelList& cFaces = mesh.cells()[cellI];
forAll(cFaces, cFaceI)
const labelList& cFaces = mesh.cells()[celli];
forAll(cFaces, cFacei)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const bool isOwner = (owner[cFaces[cFaceI]] == cellI);
const face& f = mesh.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFacei]] == celli);
// Number of triangles and quads in decomposition
label nTris = 0;
@ -360,7 +360,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
}
else
{
superCells[addCellI++] = cellI;
superCells[addCelli++] = celli;
}
const face& quad = quadFcs[quadI];
@ -403,7 +403,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
}
else
{
superCells[addCellI++] = cellI;
superCells[addCelli++] = celli;
}
const face& tri = triFcs[triI];
@ -432,7 +432,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
}
}
addPointI++;
addPointi++;
}
}

View File

@ -54,9 +54,9 @@ vtkPolyData* Foam::vtkPVFoam::pointZoneVTKMesh
vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate(pointLabels.size());
forAll(pointLabels, pointI)
forAll(pointLabels, pointi)
{
vtkInsertNextOpenFOAMPoint(vtkpoints, meshPoints[pointLabels[pointI]]);
vtkInsertNextOpenFOAMPoint(vtkpoints, meshPoints[pointLabels[pointi]]);
}
vtkmesh->SetPoints(vtkpoints);

View File

@ -152,7 +152,7 @@ void Foam::vtkPVFoam::convertPointFields
// Extract the field on the zone
Field<Type> fld
(
ptf.internalField(),
ptf.primitiveField(),
mesh.faceZones()[zoneId]().meshPoints()
);

View File

@ -71,9 +71,9 @@ vtkPolyData* Foam::vtkPVFoam::patchVTKMesh
vtkCellArray* vtkcells = vtkCellArray::New();
vtkcells->Allocate(faces.size());
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
vtkIdType nodeIds[f.size()];
forAll(f, fp)

View File

@ -228,7 +228,7 @@ void Foam::vtkPVFoam::updateInfoPatches
if (debug)
{
Info<< "<beg> Foam::vtkPVFoam::updateInfoPatches"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
@ -295,9 +295,9 @@ void Foam::vtkPVFoam::updateInfoPatches
if (!reader_->GetShowGroupsOnly())
{
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (pp.size())
{
@ -344,12 +344,12 @@ void Foam::vtkPVFoam::updateInfoPatches
wordList names(patchEntries.size());
labelList sizes(patchEntries.size());
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
const dictionary& patchDict = patchEntries[patchI].dict();
const dictionary& patchDict = patchEntries[patchi].dict();
sizes[patchI] = readLabel(patchDict.lookup("nFaces"));
names[patchI] = patchEntries[patchI].keyword();
sizes[patchi] = readLabel(patchDict.lookup("nFaces"));
names[patchi] = patchEntries[patchi].keyword();
}
@ -358,9 +358,9 @@ void Foam::vtkPVFoam::updateInfoPatches
HashTable<labelList, word> groups(patchEntries.size());
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
const dictionary& patchDict = patchEntries[patchI].dict();
const dictionary& patchDict = patchEntries[patchi].dict();
wordList groupNames;
patchDict.readIfPresent("inGroups", groupNames);
@ -373,11 +373,11 @@ void Foam::vtkPVFoam::updateInfoPatches
);
if (iter != groups.end())
{
iter().append(patchI);
iter().append(patchi);
}
else
{
groups.insert(groupNames[groupI], labelList(1, patchI));
groups.insert(groupNames[groupI], labelList(1, patchi));
}
}
}
@ -432,14 +432,14 @@ void Foam::vtkPVFoam::updateInfoPatches
if (!reader_->GetShowGroupsOnly())
{
forAll(names, patchI)
forAll(names, patchi)
{
// Valid patch if nFace > 0 - add patch to GUI list
if (sizes[patchI])
if (sizes[patchi])
{
arraySelection->AddArray
(
(names[patchI] + " - patch").c_str()
(names[patchi] + " - patch").c_str()
);
++nPatches;
@ -476,7 +476,7 @@ void Foam::vtkPVFoam::updateInfoZones
if (debug)
{
Info<< "<beg> Foam::vtkPVFoam::updateInfoZones"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
wordList namesLst;

View File

@ -41,7 +41,7 @@ void Foam::vtkPVFoam::updateInfoFields
{
Info<< "<beg> Foam::vtkPVFoam::updateInfoFields <"
<< meshType::Mesh::typeName
<< "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]"
<< "> [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]"
<< endl;
}

View File

@ -2,13 +2,12 @@
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# Source the wmake functions
. $WM_DIR/scripts/wmakeFunctions
# ensure CMake gets the correct C/C++ compilers
# Ensure CMake gets the correct C/C++ compilers
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
@ -16,19 +15,23 @@ set -x
if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
then
wmake $targetType vtkPVblockMesh
sourceDir=$PWD/PVblockMeshReader
# Where are any generated files stored?
findObjectDir $sourceDir
(
mkdir -p $objectsDir \
&& cd $objectsDir \
&& cmake $sourceDir \
&& make
) || {
echo
echo "WARNING: incomplete build of ParaView BlockMesh plugin"
}
if [ "$targetType" != "objects" ]
then
sourceDir=$PWD/PVblockMeshReader
# Where are any generated files stored?
findObjectDir $sourceDir
(
mkdir -p $objectsDir \
&& cd $objectsDir \
&& cmake $sourceDir \
&& make
) || {
echo
echo "WARNING: incomplete build of ParaView BlockMesh plugin"
}
fi
fi
#------------------------------------------------------------------------------

View File

@ -60,7 +60,7 @@ IF(("${PARAVIEW_VERSION_MAJOR}" LESS 5) AND ("${PARAVIEW_VERSION_MINOR}" LESS 4)
SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx
GUI_INTERFACES ${IFACES}
GUI_SOURCES pqPVblockMeshReaderPanel.cxx
${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
GUI_RESOURCE_FILES PVblockMeshReader.xml
)
ELSE()
@ -70,7 +70,7 @@ ELSE()
SERVER_MANAGER_SOURCES vtkPVblockMeshReader.cxx
GUI_INTERFACES ${IFACES}
GUI_SOURCES pqPVblockMeshReaderPanel.cxx
${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
${MOC_SRCS} ${UI_SRCS} ${IFACE_SRCS}
)
ENDIF()

View File

@ -56,8 +56,8 @@ vtkPVblockMeshReader::vtkPVblockMeshReader()
SetNumberOfInputPorts(0);
FileName = NULL;
foamData_ = NULL;
FileName = nullptr;
foamData_ = nullptr;
ShowPointNumbers = 1;
UpdateGUI = 0;
@ -165,7 +165,7 @@ int vtkPVblockMeshReader::RequestInformation
//
// // delete foamData and flag it as fatal error
// delete foamData_;
// foamData_ = NULL;
// foamData_ = nullptr;
// return 0;
// }

View File

@ -66,7 +66,7 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
if (debug)
{
Info<< "<beg> Foam::vtkPVblockMesh::updateInfoBlocks"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
arrayRangeBlocks_.reset( arraySelection->GetNumberOfArrays() );
@ -109,7 +109,7 @@ void Foam::vtkPVblockMesh::updateInfoEdges
if (debug)
{
Info<< "<beg> Foam::vtkPVblockMesh::updateInfoEdges"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
}
arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
@ -150,8 +150,8 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
)
:
reader_(reader),
dbPtr_(NULL),
meshPtr_(NULL),
dbPtr_(nullptr),
meshPtr_(nullptr),
meshRegion_(polyMesh::defaultRegion),
meshDir_(polyMesh::meshSubDir),
arrayRangeBlocks_("block"),
@ -252,9 +252,9 @@ Foam::vtkPVblockMesh::~vtkPVblockMesh()
// Hmm. pointNumberTextActors are not getting removed
//
forAll(pointNumberTextActorsPtrs_, pointI)
forAll(pointNumberTextActorsPtrs_, pointi)
{
pointNumberTextActorsPtrs_[pointI]->Delete();
pointNumberTextActorsPtrs_[pointi]->Delete();
}
pointNumberTextActorsPtrs_.clear();
@ -269,7 +269,7 @@ void Foam::vtkPVblockMesh::updateInfo()
if (debug)
{
Info<< "<beg> Foam::vtkPVblockMesh::updateInfo"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] " << endl;
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] " << endl;
}
resetCounters();
@ -420,10 +420,10 @@ void Foam::vtkPVblockMesh::renderPointNumbers
{
// always remove old actors first
forAll(pointNumberTextActorsPtrs_, pointI)
forAll(pointNumberTextActorsPtrs_, pointi)
{
renderer->RemoveViewProp(pointNumberTextActorsPtrs_[pointI]);
pointNumberTextActorsPtrs_[pointI]->Delete();
renderer->RemoveViewProp(pointNumberTextActorsPtrs_[pointi]);
pointNumberTextActorsPtrs_[pointi]->Delete();
}
pointNumberTextActorsPtrs_.clear();
@ -433,11 +433,11 @@ void Foam::vtkPVblockMesh::renderPointNumbers
const scalar scaleFactor = meshPtr_->scaleFactor();
pointNumberTextActorsPtrs_.setSize(cornerPts.size());
forAll(cornerPts, pointI)
forAll(cornerPts, pointi)
{
vtkTextActor* txt = vtkTextActor::New();
txt->SetInput(Foam::name(pointI).c_str());
txt->SetInput(Foam::name(pointi).c_str());
// Set text properties
vtkTextProperty* tprop = txt->GetTextProperty();
@ -454,9 +454,9 @@ void Foam::vtkPVblockMesh::renderPointNumbers
txt->GetPositionCoordinate()->SetValue
(
cornerPts[pointI].x()*scaleFactor,
cornerPts[pointI].y()*scaleFactor,
cornerPts[pointI].z()*scaleFactor
cornerPts[pointi].x()*scaleFactor,
cornerPts[pointi].y()*scaleFactor,
cornerPts[pointi].z()*scaleFactor
);
// Add text to each renderer
@ -464,7 +464,7 @@ void Foam::vtkPVblockMesh::renderPointNumbers
// Maintain a list of text labels added so that they can be
// removed later
pointNumberTextActorsPtrs_[pointI] = txt;
pointNumberTextActorsPtrs_[pointi] = txt;
}
}
}

View File

@ -2,7 +2,6 @@
cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
wmake $targetType

View File

@ -13,11 +13,6 @@ const word cloudName(propsDict.lookup("cloudName"));
label sampleFrequency(readLabel(propsDict.lookup("sampleFrequency")));
// outputMode: compositeFile, filePerTrack
//word outputmode(propsDict.lookup("outputMode"))
label maxPositions(readLabel(propsDict.lookup("maxPositions")));
// outputFormat: raw, vtk
//word outputFormat(propsDict.lookup("outputFormat"));
word setFormat(propsDict.lookupOrDefault<word>("setFormat", "vtk"));

View File

@ -20,6 +20,6 @@ sampleFrequency 1;
maxPositions 1000000;
setFormat vtk; // see sampleDict for set formats
setFormat vtk;
// ************************************************************************* //

View File

@ -75,6 +75,7 @@ int main(int argc, char *argv[])
Info<< " Reading particle positions" << endl;
passiveParticleCloud myCloud(mesh, cloudName);
Info<< " Read " << returnReduce(myCloud.size(), sumOp<label>())
<< " particles" << endl;
@ -85,7 +86,6 @@ int main(int argc, char *argv[])
if (origProc >= maxIds.size())
{
// Expand size
maxIds.setSize(origProc+1, -1);
}
@ -106,15 +106,15 @@ int main(int argc, char *argv[])
labelList numIds = maxIds + 1;
Info<< nl << "Particle statistics:" << endl;
forAll(maxIds, procI)
forAll(maxIds, proci)
{
Info<< " Found " << numIds[procI] << " particles originating"
<< " from processor " << procI << endl;
Info<< " Found " << numIds[proci] << " particles originating"
<< " from processor " << proci << endl;
}
Info<< nl << endl;
// calc starting ids for particles on each processor
// Calculate starting ids for particles on each processor
List<label> startIds(numIds.size(), 0);
for (label i = 0; i < numIds.size()-1; i++)
{
@ -123,11 +123,10 @@ int main(int argc, char *argv[])
label nParticle = startIds.last() + numIds[startIds.size()-1];
// number of tracks to generate
// Number of tracks to generate
label nTracks = nParticle/sampleFrequency;
// storage for all particle tracks
// Storage for all particle tracks
List<DynamicList<vector>> allTracks(nTracks);
Info<< "\nGenerating " << nTracks << " particle tracks for cloud "
@ -146,7 +145,7 @@ int main(int argc, char *argv[])
Info<< " Reading particle positions" << endl;
passiveParticleCloud myCloud(mesh, cloudName);
// collect the track data on all processors that have positions
// Collect the track data on all processors that have positions
allPositions[Pstream::myProcNo()].setSize
(
myCloud.size(),
@ -164,7 +163,7 @@ int main(int argc, char *argv[])
i++;
}
// collect the track data on the master processor
// Collect the track data on the master processor
Pstream::gatherList(allPositions);
Pstream::gatherList(allOrigIds);
Pstream::gatherList(allOrigProcs);
@ -172,13 +171,13 @@ int main(int argc, char *argv[])
Info<< " Constructing tracks" << nl << endl;
if (Pstream::master())
{
forAll(allPositions, procI)
forAll(allPositions, proci)
{
forAll(allPositions[procI], i)
forAll(allPositions[proci], i)
{
label globalId =
startIds[allOrigProcs[procI][i]]
+ allOrigIds[procI][i];
startIds[allOrigProcs[proci][i]]
+ allOrigIds[proci][i];
if (globalId % sampleFrequency == 0)
{
@ -187,7 +186,7 @@ int main(int argc, char *argv[])
{
allTracks[trackId].append
(
allPositions[procI][i]
allPositions[proci][i]
);
}
}
@ -231,18 +230,16 @@ int main(int argc, char *argv[])
OFstream vtkTracks
(
vtkPath
/ "particleTracks." + vtkFile.ext()
vtkPath/("particleTracks." + vtkFile.ext())
);
Info<< "\nWriting particle tracks in " << setFormat
<< " format to " << vtkTracks.name()
<< nl << endl;
scalarFormatterPtr().write
(
true, // writeTracks
true,
tracks,
wordList(0),
List<List<scalarField>>(0),

Some files were not shown because too many files have changed in this diff Show More