Fixing issues with LCS Filter files

This commit is contained in:
Abhishek Yenpure 2019-08-08 15:20:11 -07:00
parent 386a30d288
commit 9634924e15
4 changed files with 35 additions and 13 deletions

@ -1,3 +1,14 @@
##=============================================================================
##
## Copyright (c) Kitware, Inc.
## All rights reserved.
## See LICENSE.txt for details.
##
## This software is distributed WITHOUT ANY WARRANTY; without even
## the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
## PURPOSE. See the above copyright notice for more information.
##
##=============================================================================
cmake_minimum_required(VERSION 3.8...3.14 FATAL_ERROR)
project(ParticleAdvection CXX)

@ -1,3 +1,15 @@
//=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
//=============================================================================
#include <cmath>
#include <string>
#include <vector>

@ -66,24 +66,25 @@ public:
}
VTKM_EXEC
void GetNeighborIndices(const vtkm::Id index, vtkm::Vec<vtkm::Id, 6>& indices) const
const vtkm::Vec<vtkm::Id, 6> GetNeighborIndices(const vtkm::Id index) const
{
vtkm::Vec<vtkm::Id, 6> indices;
vtkm::Id3 logicalIndex;
GetLogicalIndex(index, logicalIndex);
// For differentials w.r.t delta in x
indices[0] = (logicalIndex[0] == 0) ? index : index - 1;
indices[1] = (logicalIndex[0] == Dims[0] - 1) ? index : index + 1;
// For differentials w.r.t delta in y
indices[2] = (logicalIndex[1] == 0) ? index : index - RowSize;
indices[3] = (logicalIndex[1] == Dims[1] - 1) ? index : index + RowSize;
if (this->cellSet2D)
return;
// For differentials w.r.t delta in z
indices[4] = (logicalIndex[2] == 0) ? index : index - PlaneSize;
indices[5] = (logicalIndex[2] == Dims[2] - 1) ? index : index + PlaneSize;
if (!this->cellSet2D)
{
// For differentials w.r.t delta in z
indices[4] = (logicalIndex[2] == 0) ? index : index - PlaneSize;
indices[5] = (logicalIndex[2] == Dims[2] - 1) ? index : index + PlaneSize;
}
return indices;
}
private:
@ -122,8 +123,7 @@ public:
{
using Point = typename PointArray::ValueType;
vtkm::Vec<vtkm::Id, 6> neighborIndices;
this->GridData.GetNeighborIndices(index, neighborIndices);
const vtkm::Vec<vtkm::Id, 6> neighborIndices = this->GridData.GetNeighborIndices(index);
// Calculate Stretching / Squeezing
Point xin1 = input.Get(neighborIndices[0]);
@ -205,8 +205,7 @@ public:
{
using Point = typename PointArray::ValueType;
vtkm::Vec<vtkm::Id, 6> neighborIndices;
this->GridData.GetNeighborIndices(index, neighborIndices);
const vtkm::Vec<vtkm::Id, 6> neighborIndices = this->GridData.GetNeighborIndices(index);
Point xin1 = input.Get(neighborIndices[0]);
Point xin2 = input.Get(neighborIndices[1]);

@ -171,7 +171,7 @@ VTKM_EXEC_CONT void Jacobi(vtkm::Matrix<T, 3, 3> tensor, vtkm::Vec<T, 3>& eigen)
phi = vtkm::ATan(vtkm::Sqrt(D) / q) / 3.0f;
if (phi < 0)
phi += static_cast<T>(M_PI);
phi += static_cast<T>(vtkm::Pi());
}
const T sqrt3 = vtkm::Sqrt(3.0f);