From 5e20eeb0e9f7ca8ddcca192e6d399ee1c5a26bb4 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Jan 2009 15:54:42 +0000 Subject: [PATCH] bugfix: - convertPointField caused a seg-fault if the internal field was null - attempted to name the vtk object the name of the null field + minor clean-up --- .../PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H index 47a6e89ef6..63b5c0c3a6 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H @@ -190,16 +190,15 @@ void Foam::vtkPV3Foam::convertPointField } vtkFloatArray *pointData = vtkFloatArray::New(); - pointData->SetNumberOfTuples( nPoints + addPointCellLabels.size() ); - pointData->SetNumberOfComponents( nComp ); - pointData->Allocate( nComp*(nPoints + addPointCellLabels.size()) ); - pointData->SetName( tf.name().c_str() ); - + pointData->SetNumberOfTuples(nPoints + addPointCellLabels.size()); + pointData->SetNumberOfComponents(nComp); + pointData->Allocate(nComp*(nPoints + addPointCellLabels.size())); + pointData->SetName(ptf.name().c_str()); if (debug) { Info<< "convert convertPointField: " - << tf.name() + << ptf.name() << " size = " << nPoints << " nComp=" << nComp << " nTuples = " << (nPoints + addPointCellLabels.size())