Commit 26c322ca authored by Andrew Heather's avatar Andrew Heather

code tidying

parent a6d0ccfc
......@@ -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)
{
......
......@@ -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)
......
......@@ -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];
......
......@@ -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)
{
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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)
......
......@@ -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()));
......
......@@ -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
......
......@@ -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
// ************************************************************************* //
......@@ -69,6 +69,7 @@ namespace Foam
} // End namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::vtkPV3Foam::AddToBlock
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment