2017-08-30 20:27:04 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
2019-04-15 23:24:21 +00:00
|
|
|
//
|
2017-08-30 20:27:04 +00:00
|
|
|
// 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.
|
|
|
|
//============================================================================
|
2019-09-16 16:36:01 +00:00
|
|
|
#ifndef vtk_m_source_OscillatorSource_h
|
|
|
|
#define vtk_m_source_OscillatorSource_h
|
2017-08-30 20:27:04 +00:00
|
|
|
|
2019-09-16 16:36:01 +00:00
|
|
|
#include <vtkm/source/Source.h>
|
2017-08-30 20:27:04 +00:00
|
|
|
|
|
|
|
namespace vtkm
|
|
|
|
{
|
2019-09-16 16:36:01 +00:00
|
|
|
namespace source
|
2017-08-30 20:27:04 +00:00
|
|
|
{
|
|
|
|
|
2019-09-16 16:36:01 +00:00
|
|
|
/**\brief An analytical, time-varying uniform dataset with a point based array
|
|
|
|
*
|
|
|
|
* The Execute method creates a complete structured dataset that have a
|
2021-10-05 14:20:26 +00:00
|
|
|
* point field names 'oscillating'
|
2019-09-16 16:36:01 +00:00
|
|
|
*
|
|
|
|
* This array is based on the coordinates and evaluates to a sum of time-varying
|
|
|
|
* Gaussian exponentials specified in its configuration.
|
|
|
|
*/
|
|
|
|
class VTKM_SOURCE_EXPORT Oscillator final : public vtkm::source::Source
|
2017-08-30 20:27:04 +00:00
|
|
|
{
|
|
|
|
public:
|
2022-11-28 22:45:38 +00:00
|
|
|
VTKM_CONT Oscillator();
|
|
|
|
|
2019-09-16 16:36:01 +00:00
|
|
|
///Construct a Oscillator with Cell Dimensions
|
2022-11-28 22:45:38 +00:00
|
|
|
VTKM_CONT VTKM_DEPRECATED(
|
|
|
|
2.0,
|
|
|
|
"Use SetCellDimensions or SetPointDimensions.") explicit Oscillator(vtkm::Id3 dims);
|
2017-08-30 20:27:04 +00:00
|
|
|
|
2021-10-12 22:22:31 +00:00
|
|
|
// We can not declare default destructor here since compiler does not know how
|
|
|
|
// to create one for the Worklet at this point yet. However, the implementation
|
|
|
|
// in Oscillator.cxx does have ~Oscillator() = default;
|
2022-11-28 22:45:38 +00:00
|
|
|
VTKM_CONT ~Oscillator() override;
|
|
|
|
|
|
|
|
VTKM_CONT void SetPointDimensions(vtkm::Id3 pointDimensions);
|
|
|
|
VTKM_CONT vtkm::Id3 GetPointDimensions() const;
|
|
|
|
VTKM_CONT void SetCellDimensions(vtkm::Id3 pointDimensions);
|
|
|
|
VTKM_CONT vtkm::Id3 GetCellDimensions() const;
|
2021-10-12 20:04:40 +00:00
|
|
|
|
2017-08-30 20:27:04 +00:00
|
|
|
VTKM_CONT
|
2021-10-12 22:22:31 +00:00
|
|
|
void SetTime(vtkm::FloatDefault time);
|
2017-08-30 20:27:04 +00:00
|
|
|
|
|
|
|
VTKM_CONT
|
2021-10-12 22:22:31 +00:00
|
|
|
void AddPeriodic(vtkm::FloatDefault x,
|
|
|
|
vtkm::FloatDefault y,
|
|
|
|
vtkm::FloatDefault z,
|
|
|
|
vtkm::FloatDefault radius,
|
|
|
|
vtkm::FloatDefault omega,
|
|
|
|
vtkm::FloatDefault zeta);
|
2017-08-30 20:27:04 +00:00
|
|
|
|
|
|
|
VTKM_CONT
|
2021-10-12 22:22:31 +00:00
|
|
|
void AddDamped(vtkm::FloatDefault x,
|
|
|
|
vtkm::FloatDefault y,
|
|
|
|
vtkm::FloatDefault z,
|
|
|
|
vtkm::FloatDefault radius,
|
|
|
|
vtkm::FloatDefault omega,
|
|
|
|
vtkm::FloatDefault zeta);
|
2017-08-30 20:27:04 +00:00
|
|
|
|
|
|
|
VTKM_CONT
|
2021-10-12 22:22:31 +00:00
|
|
|
void AddDecaying(vtkm::FloatDefault x,
|
|
|
|
vtkm::FloatDefault y,
|
|
|
|
vtkm::FloatDefault z,
|
|
|
|
vtkm::FloatDefault radius,
|
|
|
|
vtkm::FloatDefault omega,
|
|
|
|
vtkm::FloatDefault zeta);
|
2017-08-30 20:27:04 +00:00
|
|
|
|
|
|
|
private:
|
2022-08-18 14:13:57 +00:00
|
|
|
VTKM_CONT vtkm::cont::DataSet DoExecute() const override;
|
|
|
|
|
2022-11-28 22:45:38 +00:00
|
|
|
struct InternalStruct;
|
|
|
|
std::unique_ptr<InternalStruct> Internals;
|
2017-08-30 20:27:04 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-18 14:13:57 +00:00
|
|
|
#endif // vtk_m_source_OscillatorSource_h
|