#undef VTKPV3FOAM_DUALPORT to disable dual-port output for paraview reader

This commit is contained in:
Mark Olesen
2009-03-23 18:39:29 +01:00
parent 5af070f914
commit 852d9f3298
3 changed files with 21 additions and 11 deletions

View File

@ -50,6 +50,7 @@ vtkPV3FoamReader::vtkPV3FoamReader()
output0_ = NULL; output0_ = NULL;
#ifdef VTKPV3FOAM_DUALPORT
// Add second output for the Lagrangian // Add second output for the Lagrangian
this->SetNumberOfOutputPorts(2); this->SetNumberOfOutputPorts(2);
vtkMultiBlockDataSet *lagrangian = vtkMultiBlockDataSet::New(); vtkMultiBlockDataSet *lagrangian = vtkMultiBlockDataSet::New();
@ -57,6 +58,7 @@ vtkPV3FoamReader::vtkPV3FoamReader()
this->GetExecutive()->SetOutputData(1, lagrangian); this->GetExecutive()->SetOutputData(1, lagrangian);
lagrangian->Delete(); lagrangian->Delete();
#endif
TimeStepRange[0] = 0; TimeStepRange[0] = 0;
TimeStepRange[1] = 0; TimeStepRange[1] = 0;
@ -319,15 +321,6 @@ int vtkPV3FoamReader::RequestData
) )
); );
vtkMultiBlockDataSet* lagrangianOutput = vtkMultiBlockDataSet::SafeDownCast
(
outputVector->GetInformationObject(1)->Get
(
vtkMultiBlockDataSet::DATA_OBJECT()
)
);
if (Foam::vtkPV3Foam::debug) if (Foam::vtkPV3Foam::debug)
{ {
cout<< "update output with " cout<< "update output with "
@ -376,7 +369,21 @@ int vtkPV3FoamReader::RequestData
#else #else
foamData_->Update(output, lagrangianOutput); #ifdef VTKPV3FOAM_DUALPORT
foamData_->Update
(
output,
vtkMultiBlockDataSet::SafeDownCast
(
outputVector->GetInformationObject(1)->Get
(
vtkMultiBlockDataSet::DATA_OBJECT()
)
);
);
#else
foamData_->Update(output, output);
#endif
if (ShowPatchNames) if (ShowPatchNames)
{ {

View File

@ -465,7 +465,6 @@ void Foam::vtkPV3Foam::Update
cout<< "<beg> Foam::vtkPV3Foam::Update - output with " cout<< "<beg> Foam::vtkPV3Foam::Update - output with "
<< output->GetNumberOfBlocks() << " and " << output->GetNumberOfBlocks() << " and "
<< lagrangianOutput->GetNumberOfBlocks() << " blocks\n"; << lagrangianOutput->GetNumberOfBlocks() << " blocks\n";
output->Print(cout); output->Print(cout);
lagrangianOutput->Print(cout); lagrangianOutput->Print(cout);
printMemory(); printMemory();
@ -504,8 +503,10 @@ void Foam::vtkPV3Foam::Update
reader_->UpdateProgress(0.7); reader_->UpdateProgress(0.7);
} }
#ifdef VTKPV3FOAM_DUALPORT
// restart port1 at block=0 // restart port1 at block=0
blockNo = 0; blockNo = 0;
#endif
convertMeshLagrangian(lagrangianOutput, blockNo); convertMeshLagrangian(lagrangianOutput, blockNo);
reader_->UpdateProgress(0.8); reader_->UpdateProgress(0.8);

View File

@ -71,6 +71,8 @@ SourceFiles
#include "PrimitivePatchInterpolation.H" #include "PrimitivePatchInterpolation.H"
#include "volPointInterpolation.H" #include "volPointInterpolation.H"
#undef VTKPV3FOAM_DUALPORT
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * // // * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
class vtkDataArraySelection; class vtkDataArraySelection;