mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
PV3FoamReader - minor changes
- remove TimeRange property from XML. Not needed for discrete time data - represent Lagrangian data as VTK_VERTEX for simple visualization
This commit is contained in:
@ -27,13 +27,6 @@
|
||||
</Documentation>
|
||||
</DoubleVectorProperty>
|
||||
|
||||
<!-- Send continuous time info to the animation panel -->
|
||||
<DoubleVectorProperty
|
||||
name="TimeRange"
|
||||
information_only="1">
|
||||
<TimeRangeInformationHelper/>
|
||||
</DoubleVectorProperty>
|
||||
|
||||
<!-- Available Parts (volume, patches, lagrangian) array -->
|
||||
<StringVectorProperty
|
||||
name="PartArrayInfo"
|
||||
|
||||
@ -186,7 +186,6 @@ int vtkPV3FoamReader::RequestInformation
|
||||
int nTimeSteps = 0;
|
||||
double* timeSteps = foamData_->findTimes(nTimeSteps);
|
||||
|
||||
|
||||
// set identical time steps for all ports
|
||||
for (int infoI = 0; infoI < nInfo; ++infoI)
|
||||
{
|
||||
|
||||
@ -103,10 +103,8 @@ int Foam::vtkPV3Foam::setTime(const double& requestedTime)
|
||||
// Get times list
|
||||
instantList Times = runTime.times();
|
||||
|
||||
int foundIndex = Time::findClosestTimeIndex(Times, requestedTime);
|
||||
int nearestIndex = foundIndex;
|
||||
|
||||
if (foundIndex < 0)
|
||||
int nearestIndex = Time::findClosestTimeIndex(Times, requestedTime);
|
||||
if (nearestIndex < 0)
|
||||
{
|
||||
nearestIndex = 0;
|
||||
}
|
||||
@ -146,7 +144,7 @@ int Foam::vtkPV3Foam::setTime(const double& requestedTime)
|
||||
<< " fieldsChanged=" << fieldsChanged_ << endl;
|
||||
}
|
||||
|
||||
return foundIndex;
|
||||
return nearestIndex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -716,6 +716,7 @@ public:
|
||||
return timeIndex_;
|
||||
}
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Debug information
|
||||
|
||||
@ -36,6 +36,7 @@ Description
|
||||
#include "vtkPV3FoamPoints.H"
|
||||
|
||||
// VTK includes
|
||||
#include "vtkCellArray.h"
|
||||
#include "vtkPoints.h"
|
||||
#include "vtkPolyData.h"
|
||||
|
||||
@ -75,15 +76,25 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
|
||||
|
||||
vtkmesh = vtkPolyData::New();
|
||||
vtkPoints* vtkpoints = vtkPoints::New();
|
||||
vtkpoints->Allocate( parcels.size() );
|
||||
vtkCellArray* vtkcells = vtkCellArray::New();
|
||||
|
||||
vtkpoints->Allocate( parcels.size() );
|
||||
vtkcells->Allocate( parcels.size() );
|
||||
|
||||
vtkIdType particleId = 0;
|
||||
forAllConstIter(Cloud<passiveParticle>, parcels, iter)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, iter().position());
|
||||
|
||||
vtkcells->InsertNextCell(1, &particleId);
|
||||
particleId++;
|
||||
}
|
||||
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
vtkpoints->Delete();
|
||||
|
||||
vtkmesh->SetVerts(vtkcells);
|
||||
vtkcells->Delete();
|
||||
}
|
||||
|
||||
if (debug)
|
||||
|
||||
@ -35,8 +35,8 @@ Description
|
||||
|
||||
// VTK includes
|
||||
#include "vtkCellArray.h"
|
||||
#include "vtkPoints.h"
|
||||
#include "vtkPolyData.h"
|
||||
#include "vtkUnstructuredGrid.h"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Reference in New Issue
Block a user