vtk-m/vtkm/source/Tangle.h
Kenneth Moreland ea1a55359f Name tangle source fields appropriately
The `Tangle` source would create a point field generically named
`nodevar`. This name was not indicitive of the data or its source. Thus,
the output point field has been renamed `tangle`.

The `Tangle` source was also creating a cell field (named `cellvar`).
This field was really just a mirror of the cell indices (counting from 0
on up). This field has been removed from the input. If you want such a
field, you can now use the `GenerateIds` filter to add it to any data
set.
2021-10-04 13:44:27 -06:00

54 lines
1.4 KiB
C++

//============================================================================
// 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.
//============================================================================
#ifndef vtk_m_source_Tangle_h
#define vtk_m_source_Tangle_h
#include <vtkm/source/Source.h>
namespace vtkm
{
namespace source
{
/**
* @brief The Tangle source creates a uniform dataset.
*
* This class generates a predictable uniform grid dataset with an
* interesting point field, which is useful for testing and
* benchmarking.
*
* The Execute method creates a complete structured dataset of a
* resolution specified in the constructor that is bounded by the
* cube in the range [0,1] in each dimension. The dataset has a
* point field named 'tangle' computed with the following formula
*
* x^4 - 5x^2 + y^4 - 5y^2 + z^4 - 5z^2
*
**/
class VTKM_SOURCE_EXPORT Tangle final : public vtkm::source::Source
{
public:
///Construct a Tangle with Cell Dimensions
VTKM_CONT
Tangle(vtkm::Id3 dims)
: Dims(dims)
{
}
vtkm::cont::DataSet Execute() const;
private:
vtkm::Id3 Dims;
};
} //namespace source
} //namespace vtkm
#endif //vtk_m_source_Tangle_h