Skip to content

Commit

Permalink
Add extreme value pp test (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen committed Feb 1, 2025
1 parent 7ba0858 commit fb2c395
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/tests/postprocessors/gold/average.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
time,avg_c
0,0.8
2 changes: 2 additions & 0 deletions test/tests/postprocessors/gold/extreme_value.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
time,max_c,min_c
0,3.2375,-1.6375
2 changes: 2 additions & 0 deletions test/tests/postprocessors/gold/integral.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
time,int_c
0,4.8
63 changes: 63 additions & 0 deletions test/tests/postprocessors/postprocessors.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[Domain]
dim = 2
nx = 40
ny = 40
xmax = 2
ymax = 3
mesh_mode = DUMMY
device_names = cpu
[]

[TensorBuffers]
[c]
[]
[]

[TensorComputes]
[Initialize]
[c]
type = ParsedCompute
buffer = c
extra_symbols = true
expression = -x+y+0.3
[]
[]
[]

[Postprocessors]
[min_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MIN
execute_on = 'INITIAL TIMESTEP_END'
[]
[max_c]
type = TensorExtremeValuePostprocessor
buffer = c
value_type = MAX
execute_on = 'INITIAL TIMESTEP_END'
[]
[avg_c]
type = TensorAveragePostprocessor
buffer = c
execute_on = 'INITIAL TIMESTEP_END'
[]
[int_c]
type = TensorIntegralPostprocessor
buffer = c
execute_on = 'INITIAL TIMESTEP_END'
[]
[]

[Problem]
type = TensorProblem
[]

[Executioner]
type = Transient
num_steps = 0
[]

[Outputs]
csv = true
[]
31 changes: 31 additions & 0 deletions test/tests/postprocessors/tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[Tests]
[extreme_value]
type = CSVDiff
input = postprocessors.i
csvdiff = extreme_value.csv
cli_args = 'Outputs/file_base=extreme_value Postprocessors/active="min_c max_c"'
requirement = 'The system shall be able to determine the minimum and maximum item value in a tensor.'
issues = '#6'
design = 'TensorExtremeValuePostprocessor.md'
[]

[average]
type = CSVDiff
input = postprocessors.i
csvdiff = average.csv
cli_args = 'Outputs/file_base=average Postprocessors/active="avg_c"'
requirement = 'The system shall be able to determine the average value in a tensor.'
issues = '#6'
design = 'TensorAveragePostprocessor.md'
[]

[integral]
type = CSVDiff
input = postprocessors.i
csvdiff = integral.csv
cli_args = 'Outputs/file_base=integral Postprocessors/active="int_c"'
requirement = 'The system shall be able to compute the integral over a simulation cell tensor.'
issues = '#6'
design = 'TensorIntegralPostprocessor.md'
[]
[]

0 comments on commit fb2c395

Please sign in to comment.