Commit 1d2c4c29 authored by Li-Ta Lo's avatar Li-Ta Lo
Browse files

fixed single/double precision converstion

parent e680815d
Pipeline #251512 passed with stages
in 14 minutes and 58 seconds
......@@ -83,7 +83,7 @@ public:
const internal::Oscillator* oscillator;
t0 = 0.0;
t = this->Time * 2 * 3.14159265358979323846;
t = vtkm::FloatDefault(this->Time * 2 * 3.14159265358979323846);
// Compute damped
for (oIdx = 0; oIdx < this->DampedOscillators.GetNumberOfComponents(); oIdx++)
......@@ -95,11 +95,12 @@ public:
vtkm::FloatDefault dist_damp =
vtkm::Exp(-dist2 / (2 * oscillator->Radius * oscillator->Radius));
vtkm::FloatDefault phi = vtkm::ACos(oscillator->Zeta);
vtkm::FloatDefault val = 1. -
vtkm::FloatDefault val = vtkm::FloatDefault(
1. -
vtkm::Exp(-oscillator->Zeta * oscillator->Omega * t0) *
(vtkm::Sin(vtkm::Sqrt(1 - oscillator->Zeta * oscillator->Zeta) * oscillator->Omega * t +
phi) /
vtkm::Sin(phi));
vtkm::Sin(phi)));
result += val * dist_damp;
}
......
......@@ -20,9 +20,9 @@ void OscillatorSourceTest()
vtkm::source::Oscillator source(vtkm::Id3{ 20, 20, 20 });
source.SetTime(0.5);
source.AddDamped(0.25, 0.25, 0.25, 0.5, 0.1, 0.2);
source.AddDecaying(0.5, 0.5, 0.5, 0.35, 0.2, 0.1);
source.AddPeriodic(0.6, 0.2, 0.7, 0.15, 0.1, 0.2);
source.AddDamped(0.25f, 0.25f, 0.25f, 0.5f, 0.1f, 0.2f);
source.AddDecaying(0.5f, 0.5f, 0.5f, 0.35f, 0.2f, 0.1f);
source.AddPeriodic(0.6f, 0.2f, 0.7f, 0.15f, 0.1f, 0.2f);
vtkm::cont::DataSet ds = source.Execute();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment