mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Fix implicit conversion loses floating-point precision warning
This commit is contained in:
parent
94bf457da9
commit
50248aec9c
@ -850,7 +850,8 @@ VTKM_EXEC vtkm::Vec<typename FieldVecType::ComponentType, 3> CellDerivative(
|
||||
using T = typename FieldVecType::ComponentType;
|
||||
using VecT = vtkm::Vec<T, 2>;
|
||||
|
||||
VecT pc(static_cast<T>(pcoords[0]), static_cast<T>(pcoords[1]));
|
||||
VecT pc(static_cast<typename vtkm::VecTraits<T>::ComponentType>(pcoords[0]),
|
||||
static_cast<typename vtkm::VecTraits<T>::ComponentType>(pcoords[1]));
|
||||
VecT rc = VecT(T(1)) - pc;
|
||||
|
||||
VecT sum = field[0] * VecT(-rc[1], -rc[0]);
|
||||
@ -1043,7 +1044,9 @@ VTKM_EXEC vtkm::Vec<typename FieldVecType::ComponentType, 3> CellDerivative(
|
||||
using T = typename FieldVecType::ComponentType;
|
||||
using VecT = vtkm::Vec<T, 3>;
|
||||
|
||||
VecT pc(static_cast<T>(pcoords[0]), static_cast<T>(pcoords[1]), static_cast<T>(pcoords[2]));
|
||||
VecT pc(static_cast<typename vtkm::VecTraits<T>::ComponentType>(pcoords[0]),
|
||||
static_cast<typename vtkm::VecTraits<T>::ComponentType>(pcoords[1]),
|
||||
static_cast<typename vtkm::VecTraits<T>::ComponentType>(pcoords[2]));
|
||||
VecT rc = VecT(T(1)) - pc;
|
||||
|
||||
VecT sum = field[0] * VecT(-rc[1] * rc[2], -rc[0] * rc[2], -rc[0] * rc[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user