mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Fixing streamline output for no step
This commit is contained in:
parent
1026b6dbaf
commit
6f57f33318
@ -35,6 +35,12 @@ public:
|
||||
VTKM_EXEC_CONT
|
||||
NoAnalysisExec() {}
|
||||
|
||||
VTKM_EXEC void PreStepAnalyze(const vtkm::Id index, const ParticleType& particle)
|
||||
{
|
||||
(void)index;
|
||||
(void)particle;
|
||||
}
|
||||
|
||||
//template <typename ParticleType>
|
||||
VTKM_EXEC void Analyze(const vtkm::Id index,
|
||||
const ParticleType& oldParticle,
|
||||
@ -147,21 +153,26 @@ public:
|
||||
Validity = validity.PrepareForInPlace(device, token);
|
||||
}
|
||||
|
||||
VTKM_EXEC void PreStepAnalyze(const vtkm::Id index, const ParticleType& particle)
|
||||
{
|
||||
vtkm::Id streamLength = this->StreamLengths.Get(index);
|
||||
if (streamLength == 0)
|
||||
{
|
||||
this->StreamLengths.Set(index, 1);
|
||||
vtkm::Id loc = index * MaxSteps;
|
||||
this->Streams.Set(loc, particle.GetPosition());
|
||||
this->Validity.Set(loc, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//template <typename ParticleType>
|
||||
VTKM_EXEC void Analyze(const vtkm::Id index,
|
||||
const ParticleType& oldParticle,
|
||||
const ParticleType& newParticle)
|
||||
{
|
||||
vtkm::Id loc = index * MaxSteps;
|
||||
(void)oldParticle;
|
||||
vtkm::Id streamLength = this->StreamLengths.Get(index);
|
||||
if (streamLength == 0)
|
||||
{
|
||||
this->StreamLengths.Set(index, 1);
|
||||
this->Streams.Set(loc, oldParticle.GetPosition());
|
||||
this->Validity.Set(loc, 1);
|
||||
++streamLength;
|
||||
}
|
||||
loc += streamLength;
|
||||
vtkm::Id loc = index * MaxSteps + streamLength;
|
||||
this->StreamLengths.Set(index, ++streamLength);
|
||||
this->Streams.Set(loc, newParticle.GetPosition());
|
||||
this->Validity.Set(loc, 1);
|
||||
@ -317,9 +328,6 @@ public:
|
||||
|
||||
this->PolyLines.Fill(this->Streams.GetNumberOfValues(), cellTypes, connectivity, offsets);
|
||||
this->Particles = particles;
|
||||
//this->Validity.ReleaseResources();
|
||||
//this->InitialLengths.ReleaseResources();
|
||||
//this->StreamLengths.ReleaseResources();
|
||||
}
|
||||
|
||||
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
// 1. you could have success AND at temporal boundary.
|
||||
// 2. could you have success AND at spatial?
|
||||
// 3. all three?
|
||||
integralCurve.PreStepUpdate(idx);
|
||||
integralCurve.PreStepUpdate(idx, particle);
|
||||
do
|
||||
{
|
||||
particle = integralCurve.GetParticle(idx);
|
||||
|
@ -51,7 +51,10 @@ public:
|
||||
ParticleType GetParticle(const vtkm::Id& idx) { return this->Particles.Get(idx); }
|
||||
|
||||
VTKM_EXEC
|
||||
void PreStepUpdate(const vtkm::Id& vtkmNotUsed(idx)) {}
|
||||
void PreStepUpdate(const vtkm::Id& idx, const ParticleType& particle)
|
||||
{
|
||||
this->Analysis.PreStepAnalyze(idx, particle);
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
void StepUpdate(const vtkm::Id& idx,
|
||||
|
Loading…
Reference in New Issue
Block a user