fixed another copy paste bug

This commit is contained in:
Li-Ta Lo 2021-03-19 12:48:51 -06:00
parent afe0a3e5fe
commit 056ee7269c
2 changed files with 9 additions and 12 deletions

@ -21,7 +21,7 @@ namespace filter
/// This filter treats the CoordinateSystem of a DataSet as positions of particles.
/// The particles are infinitesimal in size with finite mass (or other scalar attributes
/// such as charge). The filter estimates density by imposing a regular grid as
/// specified in the constructor. It spread the mass of each particle to its 8 nearest
/// specified in the constructor. It spreads the mass of each particle to its 8 nearest
/// neighboring grid points and summing the contribution of particles for each point
/// in the grid.
/// The mass of particles is established by setting the active field (using SetActiveField).

@ -49,22 +49,19 @@ public:
{
// iterate through all the points of the cell and deposit with correct weight.
auto indices = cellSet.GetIndices(cellId);
auto rparametric = vtkm::Vec3f{ 1, 1, 1 } - parametric;
// deposit the scalar field value in proportion to the volume of the sub-hexahedron
// the vertex is in.
density.Add(indices[0], value * parametric[0] * parametric[1] * parametric[2]);
density.Add(indices[0], value * (1.0f - parametric[0]) * parametric[1] * parametric[2]);
density.Add(indices[0],
value * (1.0f - parametric[0]) * (1.0f - parametric[1]) * parametric[2]);
density.Add(indices[0], value * parametric[0] * (1.0f - parametric[1]) * parametric[2]);
density.Add(indices[1], value * rparametric[0] * parametric[1] * parametric[2]);
density.Add(indices[2], value * rparametric[0] * rparametric[1] * parametric[2]);
density.Add(indices[3], value * parametric[0] * rparametric[1] * parametric[2]);
density.Add(indices[0], value * parametric[0] * parametric[1] * (1.0f - parametric[2]));
density.Add(indices[0],
value * (1.0f - parametric[0]) * parametric[1] * (1.0f - parametric[2]));
density.Add(indices[0],
value * (1.0f - parametric[0]) * (1.0f - parametric[1]) * (1.0f - parametric[2]));
density.Add(indices[0],
value * parametric[0] * (1.0f - parametric[1]) * (1.0f - parametric[2]));
density.Add(indices[4], value * parametric[0] * parametric[1] * rparametric[2]);
density.Add(indices[5], value * rparametric[0] * parametric[1] * rparametric[2]);
density.Add(indices[6], value * rparametric[0] * rparametric[1] * rparametric[2]);
density.Add(indices[7], value * parametric[0] * rparametric[1] * rparametric[2]);
}
// We simply ignore that particular particle when it is not in the mesh.