Skip to content

Commit 5949972

Browse files
committed
Created tests for BaselineCorrection (refs idaholab#296)
1 parent 3629862 commit 5949972

File tree

5 files changed

+135
-0
lines changed

5 files changed

+135
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
time,check_func_value
2+
0,-9.3474
3+
0.1,-5.36266
4+
0.2,-1.67692
5+
0.3,1.44182
6+
0.4,3.77856
7+
0.5,5.1963
8+
0.6,5.64804
9+
0.7,5.18078
10+
0.8,3.93152
11+
0.9,2.11526
12+
1,1.0658141036402e-14
13+
1.1,-2.11526
14+
1.2,-3.93152
15+
1.3,-5.18078
16+
1.4,-5.64804
17+
1.5,-5.1963
18+
1.6,-3.77856
19+
1.7,-1.44182
20+
1.8,1.67692
21+
1.9,5.36266
22+
2,9.3474
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
time,check_func_value
2+
0,-6.2316
3+
0.1,-3.1816
4+
0.2,-0.4306
5+
0.3,1.7534
6+
0.4,3.1554
7+
0.5,3.6384
8+
0.6,3.1554
9+
0.7,1.7534
10+
0.8,-0.4306
11+
0.9,-3.1816
12+
1,-6.2316
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# A simple test of the BaselineCorrection function output. The input acceleration
2+
# time history is a single cycle of `9.87 \sin(\pi t)`
3+
4+
[Mesh]
5+
type = GeneratedMesh
6+
dim = 1
7+
[]
8+
9+
[Problem]
10+
solve = false
11+
[]
12+
13+
[Functions]
14+
[corrected_accel_func]
15+
type = BaselineCorrection
16+
time_values = '0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
17+
1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0'
18+
acceleration_values = '0.000 3.050 5.801 7.985 9.387 9.870 9.387 7.985 5.801 3.050 0.000
19+
-3.050 -5.801 -7.985 -9.387 -9.870 -9.387 -7.985 -5.801 -3.050 0.000'
20+
gamma = 0.5
21+
beta = 0.25
22+
order = 2
23+
[]
24+
[]
25+
26+
[Executioner]
27+
type = Transient
28+
num_steps = 20
29+
dt = 0.1
30+
[]
31+
32+
[Postprocessors]
33+
[check_func_value]
34+
type = FunctionValuePostprocessor
35+
function = corrected_accel_func
36+
execute_on = 'INITIAL TIMESTEP_END'
37+
[]
38+
[]
39+
40+
[Outputs]
41+
csv = true
42+
[]
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# A simple test of the BaselineCorrection function output. The input acceleration
2+
# time history is a half cycle of `9.87 \sin(\pi t)`
3+
4+
[Mesh]
5+
type = GeneratedMesh
6+
dim = 1
7+
[]
8+
9+
[Problem]
10+
solve = false
11+
[]
12+
13+
[Functions]
14+
[corrected_accel_func]
15+
type = BaselineCorrection
16+
time_values = '0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0'
17+
acceleration_values = '0.000 3.050 5.801 7.985 9.387 9.870 9.387 7.985 5.801 3.050 0.000'
18+
gamma = 0.5
19+
beta = 0.25
20+
order = 1
21+
[]
22+
[]
23+
24+
[Executioner]
25+
type = Transient
26+
num_steps = 10
27+
dt = 0.1
28+
[]
29+
30+
[Postprocessors]
31+
[check_func_value]
32+
type = FunctionValuePostprocessor
33+
function = corrected_accel_func
34+
execute_on = 'INITIAL TIMESTEP_END'
35+
[]
36+
[]
37+
38+
[Outputs]
39+
csv = true
40+
[]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[Tests]
2+
issues = '#296'
3+
#design = functions/BaselineCorrection.md
4+
5+
[test_correction]
6+
requirement = "The BaselineCorrection class shall accurately adjust a raw acceleration time history according to the method of using least squares polynomial fits."
7+
[half_sine]
8+
type = CSVDiff
9+
input = test_correction_half_sine.i
10+
csvdiff = test_correction_half_sine_out.csv
11+
[]
12+
[full_sine]
13+
type = CSVDiff
14+
input = test_correction_full_sine.i
15+
csvdiff = test_correction_full_sine_out.csv
16+
[]
17+
[]
18+
19+
[]

0 commit comments

Comments
 (0)