Skip to content
Snippets Groups Projects
Commit 3795cd67 authored by Will Schroeder's avatar Will Schroeder Committed by Kitware Robot
Browse files

Merge topic 'SPH-CutoffArray'


cabbdb3a Fixed bug related to cutoff array

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Acked-by: default avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !8229
parents 7a4b4b2d cabbdb3a
Branches
No related tags found
No related merge requests found
......@@ -32,12 +32,8 @@ output = reader.GetOutput()
scalarRange = output.GetPointData().GetArray("Rho").GetRange()
output2 = dsa.WrapDataObject(output)
# the constant value in the Cutoff array below is equal to
# the spatialStep (0.1) set below, and the CutoffFactor (3) of the QuinticKernel
Cutoff = np.ones(output.GetNumberOfPoints()) * 3.0/10.0;
Mass = np.ones(output.GetNumberOfPoints()) * 1.0;
output2.PointData.append(Mass, "Mass")
output2.PointData.append(Cutoff, "Cutoff")
# Something to sample with
center = output.GetCenter()
......@@ -53,6 +49,15 @@ plane.SetCenter(center)
plane.SetNormal(0,0,1)
plane.Push(1.15)
plane.Update()
planeOutput = plane.GetOutput()
planeOutput2 = dsa.WrapDataObject(planeOutput)
# The constant value in the Cutoff array below is equal to
# the spatialStep (0.1) set below, and the CutoffFactor (3) of the QuinticKernel.
# Note that the cutoff array should be associated with the input
# sampling points.
Cutoff = np.ones(planeOutput.GetNumberOfPoints()) * 3.0/10.0;
planeOutput2.PointData.append(Cutoff, "Cutoff")
# SPH kernel------------------------------------------------
......
......@@ -325,6 +325,7 @@ void vtkSPHInterpolator::Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet
// Set up the interpolation process
vtkIdType numPts = input->GetNumberOfPoints();
vtkPointData* inputPD = input->GetPointData();
vtkPointData* sourcePD = source->GetPointData();
vtkPointData* outPD = output->GetPointData();
......@@ -359,7 +360,7 @@ void vtkSPHInterpolator::Probe(vtkDataSet* input, vtkDataSet* source, vtkDataSet
// Initialize the SPH kernel
if (this->Kernel->GetRequiresInitialization())
{
this->Kernel->SetCutoffArray(sourcePD->GetArray(this->CutoffArrayName));
this->Kernel->SetCutoffArray(inputPD->GetArray(this->CutoffArrayName));
this->Kernel->SetDensityArray(sourcePD->GetArray(this->DensityArrayName));
this->Kernel->SetMassArray(sourcePD->GetArray(this->MassArrayName));
this->Kernel->Initialize(this->Locator, source, sourcePD);
......
......@@ -31,11 +31,11 @@
* name of the source's density and mass arrays can optionally be provided;
* however if not provided then the local volume is computed from the
* kernel's spatial step. Finally, a cutoff distance array can optionally be
* provided when the local neighborhood around each point varies. The cutoff
* distance defines a local neighborhood in which the points in that
* neighborhood are used to interpolate values. If not provided, then the
* cutoff distance is computed from the spatial step size times the cutoff
* factor (see vtkSPHKernel).
* provided (as part of the input P point data) when the local neighborhood
* around each sample point varies. The cutoff distance defines a local
* neighborhood in which the points in that neighborhood are used to
* interpolate values. If not provided, then the cutoff distance is computed
* from the spatial step size times the cutoff factor (see vtkSPHKernel).
*
* Other options to the filter include specifying which data attributes to
* interpolate from the source. By default, all data attributes contained in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment