Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
VTK
VTK-m
Commits
1d2c4c29
Commit
1d2c4c29
authored
Oct 14, 2021
by
Li-Ta Lo
Browse files
fixed single/double precision converstion
parent
e680815d
Pipeline
#251512
passed with stages
in 14 minutes and 58 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
vtkm/source/Oscillator.cxx
View file @
1d2c4c29
...
...
@@ -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
;
}
...
...
vtkm/source/testing/UnitTestOscillatorSource.cxx
View file @
1d2c4c29
...
...
@@ -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.25
f
,
0.25
f
,
0.25
f
,
0.5
f
,
0.1
f
,
0.2
f
);
source
.
AddDecaying
(
0.5
f
,
0.5
f
,
0.5
f
,
0.35
f
,
0.2
f
,
0.1
f
);
source
.
AddPeriodic
(
0.6
f
,
0.2
f
,
0.7
f
,
0.15
f
,
0.1
f
,
0.2
f
);
vtkm
::
cont
::
DataSet
ds
=
source
.
Execute
();
...
...
Li-Ta Lo
@ollielo
mentioned in commit
14a788bb
·
Oct 14, 2021
mentioned in commit
14a788bb
mentioned in commit 14a788bb4949f280b29fb17631c247d7a9abf35b
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment