Skip to content

Commit

Permalink
Add tests for functor material property shortcut output
Browse files Browse the repository at this point in the history
  • Loading branch information
GiudGiud authored and subhendu-LANL committed Mar 12, 2024
1 parent a760039 commit a69c4e6
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/tests/functormaterials/output/gold/output_ad_out.e
Binary file not shown.
43 changes: 43 additions & 0 deletions test/tests/functormaterials/output/output.i
@@ -0,0 +1,43 @@
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
nz = 1
xmin = 0.0
xmax = 4.0
ymin = 0.0
ymax = 6.0
[]

[FunctorMaterials]
[parsed_fmat]
type = ParsedFunctorMaterial
expression = 't + x + y + z'
property_name = 'prop1'
outputs = 'exodus'
output_properties = 'prop1'
[]
[parsed_vector_fmat]
type = GenericVectorFunctorMaterial
prop_names = 'prop1_vec'
prop_values = '1 2 3'
outputs = 'exodus'
output_properties = 'prop1_vec'
[]
[]

[Problem]
solve = false
[]

[Executioner]
type = Steady
# Get the t to be equal to 4
time = 4.0
[]

[Outputs]
exodus = true
execute_on = 'INITIAL'
[]
43 changes: 43 additions & 0 deletions test/tests/functormaterials/output/output_ad.i
@@ -0,0 +1,43 @@
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
nz = 1
xmin = 0.0
xmax = 4.0
ymin = 0.0
ymax = 6.0
[]

[FunctorMaterials]
[parsed_fmat]
type = ADParsedFunctorMaterial
expression = 't + x + y + z'
property_name = 'prop1'
outputs = 'exodus'
output_properties = 'prop1'
[]
[parsed_vector_fmat]
type = ADGenericVectorFunctorMaterial
prop_names = 'prop1_vec'
prop_values = '1 2 3'
outputs = 'exodus'
output_properties = 'prop1_vec'
[]
[]

[Problem]
solve = false
[]

[Executioner]
type = Steady
# Get the t to be equal to 4
time = 4.0
[]

[Outputs]
exodus = true
execute_on = 'INITIAL'
[]
24 changes: 24 additions & 0 deletions test/tests/functormaterials/output/tests
@@ -0,0 +1,24 @@
[Tests]
design = 'syntax/FunctorMaterials/index.md syntax/Outputs/index.md'
issues = '#19382'

[types]
requirement = "The system shall support the output of functor material data as field variables including"

[regular]
type = 'Exodiff'
input = 'output.i'
exodiff = 'output_out.e'

detail = 'outputting a functor property, defined within a functor material;'
[]
[ad]
# Test the ability for Output objects to enable all material property output
type = 'Exodiff'
input = 'output_ad.i'
exodiff = 'output_ad_out.e'

detail = 'outputting a functor property with automatic differentiation, defined within a functor material;'
[]
[]
[]

0 comments on commit a69c4e6

Please sign in to comment.