Merge branch 'master' into cvm

This commit is contained in:
graham
2009-11-16 15:50:36 +00:00
45 changed files with 1639 additions and 621 deletions

View File

@ -39,6 +39,8 @@ Description
\* ------------------------------------------------------------------------- */
#include <sstream>
// For EOF only
#include <cstdio>
#include "scalar.H"
#include "IStringStream.H"

View File

@ -41,6 +41,9 @@ Description
#include "scalarList.H"
#include "IStringStream.H"
// For EOF only
#include <cstdio>
using namespace Foam;
#include "argList.H"

View File

@ -428,7 +428,43 @@ void Foam::ensightMesh::writePrimsBinary
}
void Foam::ensightMesh::writePolys
void Foam::ensightMesh::writePolysNFaces
(
const labelList& polys,
const cellList& cellFaces,
OFstream& ensightGeometryFile
) const
{
forAll(polys, i)
{
ensightGeometryFile
<< setw(10) << cellFaces[polys[i]].size() << nl;
}
}
void Foam::ensightMesh::writePolysNPointsPerFace
(
const labelList& polys,
const cellList& cellFaces,
const faceList& faces,
OFstream& ensightGeometryFile
) const
{
forAll(polys, i)
{
const labelList& cf = cellFaces[polys[i]];
forAll(cf, faceI)
{
ensightGeometryFile
<< setw(10) << faces[cf[faceI]].size() << nl;
}
}
}
void Foam::ensightMesh::writePolysPoints
(
const labelList& polys,
const cellList& cellFaces,
@ -437,50 +473,190 @@ void Foam::ensightMesh::writePolys
OFstream& ensightGeometryFile
) const
{
if (polys.size())
label po = pointOffset + 1;
forAll(polys, i)
{
ensightGeometryFile
<< "nfaced" << nl << setw(10) << polys.size() << nl;
const labelList& cf = cellFaces[polys[i]];
label po = pointOffset + 1;
forAll(polys, i)
forAll(cf, faceI)
{
ensightGeometryFile
<< setw(10) << cellFaces[polys[i]].size() << nl;
}
const face& f = faces[cf[faceI]];
forAll(polys, i)
{
const labelList& cf = cellFaces[polys[i]];
forAll(cf, faceI)
forAll(f, pointI)
{
ensightGeometryFile
<< setw(10) << faces[cf[faceI]].size() << nl;
}
}
forAll(polys, i)
{
const labelList& cf = cellFaces[polys[i]];
forAll(cf, faceI)
{
const face& f = faces[cf[faceI]];
forAll(f, pointI)
{
ensightGeometryFile << setw(10) << f[pointI] + po;
}
ensightGeometryFile << nl;
ensightGeometryFile << setw(10) << f[pointI] + po;
}
ensightGeometryFile << nl;
}
}
}
void Foam::ensightMesh::writePolysBinary
void Foam::ensightMesh::writeAllPolys
(
const labelList& pointOffsets,
OFstream& ensightGeometryFile
) const
{
if (meshCellSets_.nPolys)
{
const cellList& cellFaces = mesh_.cells();
const faceList& faces = mesh_.faces();
if (Pstream::master())
{
ensightGeometryFile
<< "nfaced" << nl << setw(10) << meshCellSets_.nPolys << nl;
}
// Number of faces for each poly cell
if (Pstream::master())
{
// Master
writePolysNFaces
(
meshCellSets_.polys,
cellFaces,
ensightGeometryFile
);
// Slaves
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
IPstream fromSlave(Pstream::scheduled, slave);
labelList polys(fromSlave);
cellList cellFaces(fromSlave);
writePolysNFaces
(
polys,
cellFaces,
ensightGeometryFile
);
}
}
else
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< meshCellSets_.polys << cellFaces;
}
// Number of points for each face of the above list
if (Pstream::master())
{
// Master
writePolysNPointsPerFace
(
meshCellSets_.polys,
cellFaces,
faces,
ensightGeometryFile
);
// Slaves
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
IPstream fromSlave(Pstream::scheduled, slave);
labelList polys(fromSlave);
cellList cellFaces(fromSlave);
faceList faces(fromSlave);
writePolysNPointsPerFace
(
polys,
cellFaces,
faces,
ensightGeometryFile
);
}
}
else
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< meshCellSets_.polys << cellFaces << faces;
}
// List of points id for each face of the above list
if (Pstream::master())
{
// Master
writePolysPoints
(
meshCellSets_.polys,
cellFaces,
faces,
0,
ensightGeometryFile
);
// Slaves
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
IPstream fromSlave(Pstream::scheduled, slave);
labelList polys(fromSlave);
cellList cellFaces(fromSlave);
faceList faces(fromSlave);
writePolysPoints
(
polys,
cellFaces,
faces,
pointOffsets[slave-1],
ensightGeometryFile
);
}
}
else
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< meshCellSets_.polys << cellFaces << faces;
}
}
}
void Foam::ensightMesh::writePolysNFacesBinary
(
const labelList& polys,
const cellList& cellFaces,
std::ofstream& ensightGeometryFile
) const
{
forAll(polys, i)
{
writeEnsDataBinary
(
cellFaces[polys[i]].size(),
ensightGeometryFile
);
}
}
void Foam::ensightMesh::writePolysNPointsPerFaceBinary
(
const labelList& polys,
const cellList& cellFaces,
const faceList& faces,
std::ofstream& ensightGeometryFile
) const
{
forAll(polys, i)
{
const labelList& cf = cellFaces[polys[i]];
forAll(cf, faceI)
{
writeEnsDataBinary
(
faces[cf[faceI]].size(),
ensightGeometryFile
);
}
}
}
void Foam::ensightMesh::writePolysPointsBinary
(
const labelList& polys,
const cellList& cellFaces,
@ -489,51 +665,142 @@ void Foam::ensightMesh::writePolysBinary
std::ofstream& ensightGeometryFile
) const
{
if (polys.size())
label po = pointOffset + 1;
forAll(polys, i)
{
writeEnsDataBinary("nfaced",ensightGeometryFile);
writeEnsDataBinary(polys.size(),ensightGeometryFile);
const labelList& cf = cellFaces[polys[i]];
label po = pointOffset + 1;
//TODO No buffer at the moment. To be done for speed purposes!
forAll(polys, i)
forAll(cf, faceI)
{
writeEnsDataBinary
(
cellFaces[polys[i]].size(),
ensightGeometryFile
);
const face& f = faces[cf[faceI]];
forAll(f, pointI)
{
writeEnsDataBinary(f[pointI] + po,ensightGeometryFile);
}
}
}
}
void Foam::ensightMesh::writeAllPolysBinary
(
const labelList& pointOffsets,
std::ofstream& ensightGeometryFile
) const
{
if (meshCellSets_.nPolys)
{
const cellList& cellFaces = mesh_.cells();
const faceList& faces = mesh_.faces();
if (Pstream::master())
{
writeEnsDataBinary("nfaced",ensightGeometryFile);
writeEnsDataBinary(meshCellSets_.nPolys,ensightGeometryFile);
}
forAll(polys, i)
// Number of faces for each poly cell
if (Pstream::master())
{
const labelList& cf = cellFaces[polys[i]];
forAll(cf, faceI)
// Master
writePolysNFacesBinary
(
meshCellSets_.polys,
cellFaces,
ensightGeometryFile
);
// Slaves
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
writeEnsDataBinary
IPstream fromSlave(Pstream::scheduled, slave);
labelList polys(fromSlave);
cellList cellFaces(fromSlave);
writePolysNFacesBinary
(
faces[cf[faceI]].size(),
polys,
cellFaces,
ensightGeometryFile
);
}
}
forAll(polys, i)
else
{
const labelList& cf = cellFaces[polys[i]];
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< meshCellSets_.polys << cellFaces;
}
forAll(cf, faceI)
// Number of points for each face of the above list
if (Pstream::master())
{
// Master
writePolysNPointsPerFaceBinary
(
meshCellSets_.polys,
cellFaces,
faces,
ensightGeometryFile
);
// Slaves
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
const face& f = faces[cf[faceI]];
IPstream fromSlave(Pstream::scheduled, slave);
labelList polys(fromSlave);
cellList cellFaces(fromSlave);
faceList faces(fromSlave);
forAll(f, pointI)
{
writeEnsDataBinary(f[pointI] + po,ensightGeometryFile);
}
writePolysNPointsPerFaceBinary
(
polys,
cellFaces,
faces,
ensightGeometryFile
);
}
}
else
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< meshCellSets_.polys << cellFaces << faces;
}
// List of points id for each face of the above list
if (Pstream::master())
{
// Master
writePolysPointsBinary
(
meshCellSets_.polys,
cellFaces,
faces,
0,
ensightGeometryFile
);
// Slaves
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
IPstream fromSlave(Pstream::scheduled, slave);
labelList polys(fromSlave);
cellList cellFaces(fromSlave);
faceList faces(fromSlave);
writePolysPointsBinary
(
polys,
cellFaces,
faces,
pointOffsets[slave-1],
ensightGeometryFile
);
}
}
else
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< meshCellSets_.polys << cellFaces << faces;
}
}
}
@ -619,7 +886,6 @@ void Foam::ensightMesh::writeAllPrimsBinary
void Foam::ensightMesh::writeFacePrims
(
const char* key,
const faceList& patchFaces,
const label pointOffset,
OFstream& ensightGeometryFile
@ -627,18 +893,6 @@ void Foam::ensightMesh::writeFacePrims
{
if (patchFaces.size())
{
if (word(key) == "nsided")
{
ensightGeometryFile
<< key << nl << setw(10) << patchFaces.size() << nl;
forAll(patchFaces, i)
{
ensightGeometryFile
<< setw(10) << patchFaces[i].size() << nl;
}
}
label po = pointOffset + 1;
forAll(patchFaces, i)
@ -657,7 +911,6 @@ void Foam::ensightMesh::writeFacePrims
void Foam::ensightMesh::writeFacePrimsBinary
(
const char* key,
const faceList& patchFaces,
const label pointOffset,
std::ofstream& ensightGeometryFile
@ -665,22 +918,6 @@ void Foam::ensightMesh::writeFacePrimsBinary
{
if (patchFaces.size())
{
//TODO No buffer at the moment. To be done for speed purposes!
if (word(key) == "nsided")
{
writeEnsDataBinary(key,ensightGeometryFile);
writeEnsDataBinary(patchFaces.size(),ensightGeometryFile);
forAll(patchFaces, i)
{
writeEnsDataBinary
(
patchFaces[i].size(),
ensightGeometryFile
);
}
}
label po = pointOffset + 1;
forAll(patchFaces, i)
@ -732,16 +969,12 @@ void Foam::ensightMesh::writeAllFacePrims
{
if (Pstream::master())
{
if (word(key) != "nsided")
{
ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
}
ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
if (&prims != NULL)
{
writeFacePrims
(
key,
map(patchFaces, prims),
0,
ensightGeometryFile
@ -758,7 +991,251 @@ void Foam::ensightMesh::writeAllFacePrims
writeFacePrims
(
key,
patchFaces,
pointOffsets[i],
ensightGeometryFile
);
}
}
}
else if (&prims != NULL)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< map(patchFaces, prims);
}
}
}
void Foam::ensightMesh::writeNSidedNPointsPerFace
(
const faceList& patchFaces,
OFstream& ensightGeometryFile
) const
{
forAll(patchFaces, i)
{
ensightGeometryFile
<< setw(10) << patchFaces[i].size() << nl;
}
}
void Foam::ensightMesh::writeNSidedPoints
(
const faceList& patchFaces,
const label pointOffset,
OFstream& ensightGeometryFile
) const
{
writeFacePrims
(
patchFaces,
pointOffset,
ensightGeometryFile
);
}
void Foam::ensightMesh::writeAllNSided
(
const labelList& prims,
const label nPrims,
const faceList& patchFaces,
const labelList& pointOffsets,
const labelList& patchProcessors,
OFstream& ensightGeometryFile
) const
{
if (nPrims)
{
if (Pstream::master())
{
ensightGeometryFile
<< "nsided" << nl << setw(10) << nPrims << nl;
}
// Number of points for each face
if (Pstream::master())
{
if (&prims != NULL)
{
writeNSidedNPointsPerFace
(
map(patchFaces, prims),
ensightGeometryFile
);
}
forAll (patchProcessors, i)
{
if (patchProcessors[i] != 0)
{
label slave = patchProcessors[i];
IPstream fromSlave(Pstream::scheduled, slave);
faceList patchFaces(fromSlave);
writeNSidedNPointsPerFace
(
patchFaces,
ensightGeometryFile
);
}
}
}
else if (&prims != NULL)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< map(patchFaces, prims);
}
// List of points id for each face
if (Pstream::master())
{
if (&prims != NULL)
{
writeNSidedPoints
(
map(patchFaces, prims),
0,
ensightGeometryFile
);
}
forAll (patchProcessors, i)
{
if (patchProcessors[i] != 0)
{
label slave = patchProcessors[i];
IPstream fromSlave(Pstream::scheduled, slave);
faceList patchFaces(fromSlave);
writeNSidedPoints
(
patchFaces,
pointOffsets[i],
ensightGeometryFile
);
}
}
}
else if (&prims != NULL)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< map(patchFaces, prims);
}
}
}
void Foam::ensightMesh::writeNSidedPointsBinary
(
const faceList& patchFaces,
const label pointOffset,
std::ofstream& ensightGeometryFile
) const
{
writeFacePrimsBinary
(
patchFaces,
pointOffset,
ensightGeometryFile
);
}
void Foam::ensightMesh::writeNSidedNPointsPerFaceBinary
(
const faceList& patchFaces,
std::ofstream& ensightGeometryFile
) const
{
forAll(patchFaces, i)
{
writeEnsDataBinary
(
patchFaces[i].size(),
ensightGeometryFile
);
}
}
void Foam::ensightMesh::writeAllNSidedBinary
(
const labelList& prims,
const label nPrims,
const faceList& patchFaces,
const labelList& pointOffsets,
const labelList& patchProcessors,
std::ofstream& ensightGeometryFile
) const
{
if (nPrims)
{
if (Pstream::master())
{
writeEnsDataBinary("nsided",ensightGeometryFile);
writeEnsDataBinary(nPrims,ensightGeometryFile);
}
// Number of points for each face
if (Pstream::master())
{
if (&prims != NULL)
{
writeNSidedNPointsPerFaceBinary
(
map(patchFaces, prims),
ensightGeometryFile
);
}
forAll (patchProcessors, i)
{
if (patchProcessors[i] != 0)
{
label slave = patchProcessors[i];
IPstream fromSlave(Pstream::scheduled, slave);
faceList patchFaces(fromSlave);
writeNSidedNPointsPerFaceBinary
(
patchFaces,
ensightGeometryFile
);
}
}
}
else if (&prims != NULL)
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< map(patchFaces, prims);
}
// List of points id for each face
if (Pstream::master())
{
if (&prims != NULL)
{
writeNSidedPointsBinary
(
map(patchFaces, prims),
0,
ensightGeometryFile
);
}
forAll (patchProcessors, i)
{
if (patchProcessors[i] != 0)
{
label slave = patchProcessors[i];
IPstream fromSlave(Pstream::scheduled, slave);
faceList patchFaces(fromSlave);
writeNSidedPointsBinary
(
patchFaces,
pointOffsets[i],
ensightGeometryFile
@ -790,17 +1267,13 @@ void Foam::ensightMesh::writeAllFacePrimsBinary
{
if (Pstream::master())
{
if (word(key) != "nsided")
{
writeEnsDataBinary(key,ensightGeometryFile);
writeEnsDataBinary(nPrims,ensightGeometryFile);
}
writeEnsDataBinary(key,ensightGeometryFile);
writeEnsDataBinary(nPrims,ensightGeometryFile);
if (&prims != NULL)
{
writeFacePrimsBinary
(
key,
map(patchFaces, prims),
0,
ensightGeometryFile
@ -817,7 +1290,6 @@ void Foam::ensightMesh::writeAllFacePrimsBinary
writeFacePrimsBinary
(
key,
patchFaces,
pointOffsets[i],
ensightGeometryFile
@ -863,8 +1335,6 @@ void Foam::ensightMesh::writeAscii
{
const Time& runTime = mesh_.time();
const pointField& points = mesh_.points();
const cellList& cellFaces = mesh_.cells();
const faceList& faces = mesh_.faces();
const cellShapeList& cellShapes = mesh_.cellShapes();
word timeFile = prepend;
@ -990,48 +1460,11 @@ void Foam::ensightMesh::writeAscii
ensightGeometryFile
);
if (meshCellSets_.nPolys)
{
if (Pstream::master())
{
/*
ensightGeometryFile
<< "nfaced" << nl
<< setw(10) << meshCellSets_.nPolys << nl;
*/
writePolys
(
meshCellSets_.polys,
cellFaces,
faces,
0,
ensightGeometryFile
);
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
IPstream fromSlave(Pstream::scheduled, slave);
labelList polys(fromSlave);
cellList cellFaces(fromSlave);
faceList faces(fromSlave);
writePolys
(
polys,
cellFaces,
faces,
pointOffsets[slave-1],
ensightGeometryFile
);
}
}
else
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< meshCellSets_.polys << cellFaces << faces;
}
}
writeAllPolys
(
pointOffsets,
ensightGeometryFile
);
}
@ -1166,9 +1599,8 @@ void Foam::ensightMesh::writeAscii
ensightGeometryFile
);
writeAllFacePrims
writeAllNSided
(
"nsided",
polys,
nfp.nPolys,
patchFaces,
@ -1197,8 +1629,6 @@ void Foam::ensightMesh::writeBinary
{
//const Time& runTime = mesh.time();
const pointField& points = mesh_.points();
const cellList& cellFaces = mesh_.cells();
const faceList& faces = mesh_.faces();
const cellShapeList& cellShapes = mesh_.cellShapes();
word timeFile = prepend;
@ -1316,47 +1746,11 @@ void Foam::ensightMesh::writeBinary
ensightGeometryFile
);
if (meshCellSets_.nPolys)
{
if (Pstream::master())
{
/*
ensightGeometryFile
<< "nfaced" << nl
<< setw(10) << meshCellSets_.nPolys << nl;
*/
writePolysBinary
(
meshCellSets_.polys,
cellFaces,
faces,
0,
ensightGeometryFile
);
for (int slave=1; slave<Pstream::nProcs(); slave++)
{
IPstream fromSlave(Pstream::scheduled, slave);
labelList polys(fromSlave);
cellList cellFaces(fromSlave);
faceList faces(fromSlave);
writePolysBinary
(
polys,
cellFaces,
faces,
pointOffsets[slave-1],
ensightGeometryFile
);
}
}
else
{
OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
toMaster<< meshCellSets_.polys << cellFaces << faces;
}
}
writeAllPolysBinary
(
pointOffsets,
ensightGeometryFile
);
}
@ -1495,9 +1889,8 @@ void Foam::ensightMesh::writeBinary
ensightGeometryFile
);
writeAllFacePrimsBinary
writeAllNSidedBinary
(
"nsided",
polys,
nfp.nPolys,
patchFaces,
@ -1516,4 +1909,5 @@ void Foam::ensightMesh::writeBinary
}
}
// ************************************************************************* //

View File

@ -134,7 +134,22 @@ class ensightMesh
OFstream& ensightGeometryFile
) const;
void writePolys
void writePolysNFaces
(
const labelList& polys,
const cellList& cellFaces,
OFstream& ensightGeometryFile
) const;
void writePolysNPointsPerFace
(
const labelList& polys,
const cellList& cellFaces,
const faceList& faces,
OFstream& ensightGeometryFile
) const;
void writePolysPoints
(
const labelList& polys,
const cellList& cellFaces,
@ -143,6 +158,12 @@ class ensightMesh
OFstream& ensightGeometryFile
) const;
void writeAllPolys
(
const labelList& pointOffsets,
OFstream& ensightGeometryFile
) const;
void writeAllPrims
(
const char* key,
@ -154,7 +175,6 @@ class ensightMesh
void writeFacePrims
(
const char* key,
const faceList& patchFaces,
const label pointOffset,
OFstream& ensightGeometryFile
@ -177,6 +197,29 @@ class ensightMesh
OFstream& ensightGeometryFile
) const;
void writeNSidedNPointsPerFace
(
const faceList& patchFaces,
OFstream& ensightGeometryFile
) const;
void writeNSidedPoints
(
const faceList& patchFaces,
const label pointOffset,
OFstream& ensightGeometryFile
) const;
void writeAllNSided
(
const labelList& prims,
const label nPrims,
const faceList& patchFaces,
const labelList& pointOffsets,
const labelList& patchProcessors,
OFstream& ensightGeometryFile
) const;
void writeAscii
(
const fileName& postProcPath,
@ -209,7 +252,22 @@ class ensightMesh
std::ofstream& ensightGeometryFile
) const;
void writePolysBinary
void writePolysNFacesBinary
(
const labelList& polys,
const cellList& cellFaces,
std::ofstream& ensightGeometryFile
) const;
void writePolysNPointsPerFaceBinary
(
const labelList& polys,
const cellList& cellFaces,
const faceList& faces,
std::ofstream& ensightGeometryFile
) const;
void writePolysPointsBinary
(
const labelList& polys,
const cellList& cellFaces,
@ -218,6 +276,12 @@ class ensightMesh
std::ofstream& ensightGeometryFile
) const;
void writeAllPolysBinary
(
const labelList& pointOffsets,
std::ofstream& ensightGeometryFile
) const;
void writeAllFacePrimsBinary
(
const char* key,
@ -231,12 +295,33 @@ class ensightMesh
void writeFacePrimsBinary
(
const char* key,
const faceList& patchFaces,
const label pointOffset,
std::ofstream& ensightGeometryFile
) const;
void writeNSidedPointsBinary
(
const faceList& patchFaces,
const label pointOffset,
std::ofstream& ensightGeometryFile
) const;
void writeNSidedNPointsPerFaceBinary
(
const faceList& patchFaces,
std::ofstream& ensightGeometryFile
) const;
void writeAllNSidedBinary
(
const labelList& prims,
const label nPrims,
const faceList& patchFaces,
const labelList& pointOffsets,
const labelList& patchProcessors,
std::ofstream& ensightGeometryFile
) const;
public:

View File

@ -35,6 +35,7 @@ InClass
#include "vtkFloatArray.h"
#include "vtkMultiBlockDataSet.h"
#include "vtkPolyData.h"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
@ -53,11 +54,11 @@ void Foam::vtkPV3Foam::convertFaceField
const labelList& faceOwner = mesh.faceOwner();
const labelList& faceNeigh = mesh.faceNeighbour();
vtkFloatArray *cellData = vtkFloatArray::New();
cellData->SetNumberOfTuples( faceLabels.size() );
cellData->SetNumberOfComponents( nComp );
cellData->Allocate( nComp*faceLabels.size() );
cellData->SetName( tf.name().c_str() );
vtkFloatArray* cellData = vtkFloatArray::New();
cellData->SetNumberOfTuples(faceLabels.size());
cellData->SetNumberOfComponents(nComp);
cellData->Allocate(nComp*faceLabels.size());
cellData->SetName(tf.name().c_str());
if (debug)
{
@ -123,11 +124,11 @@ void Foam::vtkPV3Foam::convertFaceField
const labelList& faceOwner = mesh.faceOwner();
const labelList& faceNeigh = mesh.faceNeighbour();
vtkFloatArray *cellData = vtkFloatArray::New();
cellData->SetNumberOfTuples( fSet.size() );
cellData->SetNumberOfComponents( nComp );
cellData->Allocate( nComp*fSet.size() );
cellData->SetName( tf.name().c_str() );
vtkFloatArray* cellData = vtkFloatArray::New();
cellData->SetNumberOfTuples(fSet.size());
cellData->SetNumberOfComponents(nComp);
cellData->Allocate(nComp*fSet.size());
cellData->SetName(tf.name().c_str());
if (debug)
{

View File

@ -80,8 +80,8 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
vtkPoints* vtkpoints = vtkPoints::New();
vtkCellArray* vtkcells = vtkCellArray::New();
vtkpoints->Allocate( parcels.size() );
vtkcells->Allocate( parcels.size() );
vtkpoints->Allocate(parcels.size());
vtkcells->Allocate(parcels.size());
vtkIdType particleId = 0;
forAllConstIter(Cloud<passiveParticle>, parcels, iter)

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "vtkPV3Foam.H"
@ -40,10 +38,7 @@ Description
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
vtkPolyData* Foam::vtkPV3Foam::patchVTKMesh
(
const polyPatch& p
)
vtkPolyData* Foam::vtkPV3Foam::patchVTKMesh(const polyPatch& p)
{
vtkPolyData* vtkmesh = vtkPolyData::New();
@ -56,8 +51,8 @@ vtkPolyData* Foam::vtkPV3Foam::patchVTKMesh
// Convert Foam mesh vertices to VTK
const Foam::pointField& points = p.localPoints();
vtkPoints *vtkpoints = vtkPoints::New();
vtkpoints->Allocate( points.size() );
vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate(points.size());
forAll(points, i)
{
vtkInsertNextOpenFOAMPoint(vtkpoints, points[i]);
@ -71,7 +66,7 @@ vtkPolyData* Foam::vtkPV3Foam::patchVTKMesh
const faceList& faces = p.localFaces();
vtkCellArray* vtkcells = vtkCellArray::New();
vtkcells->Allocate( faces.size() );
vtkcells->Allocate(faces.size());
forAll(faces, faceI)
{
const face& f = faces[faceI];

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "vtkPV3Foam.H"
@ -71,8 +69,8 @@ vtkPolyData* Foam::vtkPV3Foam::faceSetVTKMesh
// Convert Foam mesh vertices to VTK
const pointField& points = p.localPoints();
vtkPoints *vtkpoints = vtkPoints::New();
vtkpoints->Allocate( points.size() );
vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate(points.size());
forAll(points, i)
{
vtkInsertNextOpenFOAMPoint(vtkpoints, points[i]);
@ -84,7 +82,7 @@ vtkPolyData* Foam::vtkPV3Foam::faceSetVTKMesh
const faceList& faces = p.localFaces();
vtkCellArray* vtkcells = vtkCellArray::New();
vtkcells->Allocate( faces.size() );
vtkcells->Allocate(faces.size());
forAll(faces, faceI)
{
@ -127,8 +125,8 @@ vtkPolyData* Foam::vtkPV3Foam::pointSetVTKMesh
const pointField& meshPoints = mesh.points();
vtkPoints *vtkpoints = vtkPoints::New();
vtkpoints->Allocate( pSet.size() );
vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate(pSet.size());
forAllConstIter(pointSet, pSet, iter)
{

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "vtkPV3Foam.H"
@ -136,8 +134,8 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
}
// Convert Foam mesh vertices to VTK
vtkPoints *vtkpoints = vtkPoints::New();
vtkpoints->Allocate( mesh.nPoints() + nAddPoints );
vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate(mesh.nPoints() + nAddPoints);
const Foam::pointField& points = mesh.points();
@ -152,7 +150,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
Info<< "... converting cells" << endl;
}
vtkmesh->Allocate( mesh.nCells() + nAddCells );
vtkmesh->Allocate(mesh.nCells() + nAddCells);
// Set counters for additional points and additional cells
label addPointI = 0, addCellI = 0;

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "vtkPV3Foam.H"
@ -69,7 +67,7 @@ vtkPolyData* Foam::vtkPV3Foam::faceZoneVTKMesh
const pointField& points = p.localPoints();
vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate( points.size() );
vtkpoints->Allocate(points.size());
forAll(points, i)
{
vtkInsertNextOpenFOAMPoint(vtkpoints, points[i]);
@ -83,7 +81,7 @@ vtkPolyData* Foam::vtkPV3Foam::faceZoneVTKMesh
const faceList& faces = p.localFaces();
vtkCellArray* vtkcells = vtkCellArray::New();
vtkcells->Allocate( faces.size() );
vtkcells->Allocate(faces.size());
forAll(faces, faceI)
{
@ -126,8 +124,8 @@ vtkPolyData* Foam::vtkPV3Foam::pointZoneVTKMesh
const pointField& meshPoints = mesh.points();
vtkPoints *vtkpoints = vtkPoints::New();
vtkpoints->Allocate( pointLabels.size() );
vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate(pointLabels.size());
forAll(pointLabels, pointI)
{

View File

@ -52,10 +52,10 @@ void Foam::vtkPV3Foam::convertPatchField
const label nComp = pTraits<Type>::nComponents;
vtkFloatArray* cellData = vtkFloatArray::New();
cellData->SetNumberOfTuples( ptf.size() );
cellData->SetNumberOfComponents( nComp );
cellData->Allocate( nComp*ptf.size() );
cellData->SetName( name.c_str() );
cellData->SetNumberOfTuples(ptf.size());
cellData->SetNumberOfComponents(nComp);
cellData->Allocate(nComp*ptf.size());
cellData->SetName(name.c_str());
float vec[nComp];
forAll(ptf, i)
@ -91,11 +91,11 @@ void Foam::vtkPV3Foam::convertPatchPointField
{
const label nComp = pTraits<Type>::nComponents;
vtkFloatArray *pointData = vtkFloatArray::New();
pointData->SetNumberOfTuples( pptf.size() );
pointData->SetNumberOfComponents( nComp );
pointData->Allocate( nComp*pptf.size() );
pointData->SetName( name.c_str() );
vtkFloatArray* pointData = vtkFloatArray::New();
pointData->SetNumberOfTuples(pptf.size());
pointData->SetNumberOfComponents(nComp);
pointData->Allocate(nComp*pptf.size());
pointData->SetName(name.c_str());
float vec[nComp];
forAll(pptf, i)

View File

@ -110,9 +110,9 @@ void Foam::vtkPV3Foam::convertPointFields
++partId
)
{
const word patchName = getPartName(partId);
const word patchName = getPartName(partId);
const label datasetNo = partDataset_[partId];
const label patchId = patches.findPatchID(patchName);
const label patchId = patches.findPatchID(patchName);
if (!partStatus_[partId] || datasetNo < 0 || patchId < 0)
{
@ -187,7 +187,7 @@ void Foam::vtkPV3Foam::convertPointField
nPoints = ptf.size();
}
vtkFloatArray *pointData = vtkFloatArray::New();
vtkFloatArray* pointData = vtkFloatArray::New();
pointData->SetNumberOfTuples(nPoints + addPointCellLabels.size());
pointData->SetNumberOfComponents(nComp);
pointData->Allocate(nComp*(nPoints + addPointCellLabels.size()));

View File

@ -140,7 +140,6 @@ void Foam::vtkPV3Foam::updateInfoInternalMesh()
Info<< "<end> Foam::vtkPV3Foam::updateInfoInternalMesh" << endl;
}
}
@ -440,14 +439,13 @@ void Foam::vtkPV3Foam::updateInfoLagrangianFields()
<< endl;
}
vtkDataArraySelection *fieldSelection =
vtkDataArraySelection* fieldSelection =
reader_->GetLagrangianFieldSelection();
// preserve the enabled selections
stringList enabledEntries = getSelectedArrayEntries(fieldSelection);
fieldSelection->RemoveAllArrays();
//
// TODO - currently only get fields from ONE cloud
// have to decide if the second set of fields get mixed in
// or dealt with separately

View File

@ -35,7 +35,7 @@ InClass
template<template<class> class patchType, class meshType>
void Foam::vtkPV3Foam::updateInfoFields
(
vtkDataArraySelection *select
vtkDataArraySelection* select
)
{
if (debug)
@ -112,4 +112,5 @@ void Foam::vtkPV3Foam::updateInfoFields
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -69,6 +69,7 @@ namespace Foam
} // End namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::vtkPV3Foam::AddToBlock

View File

@ -62,7 +62,7 @@ void writeProcStats
// Determine surface bounding boxes, faces, points
List<treeBoundBox> surfBb(Pstream::nProcs());
{
surfBb[Pstream::myProcNo()] = boundBox(s.points(), false);
surfBb[Pstream::myProcNo()] = treeBoundBox(s.points());
Pstream::gatherList(surfBb);
Pstream::scatterList(surfBb);
}