Skip to content

Commit

Permalink
Add a test for testing new AD dot routines in coupleable
Browse files Browse the repository at this point in the history
  • Loading branch information
GiudGiud committed Oct 16, 2024
1 parent 16a8021 commit 90e9fe8
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
82 changes: 82 additions & 0 deletions test/tests/interfaces/coupleable/coupled_dots.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 1
nx = 2
[]
[]

[Functions]
[linear]
type = ParsedFunction
expression = 'x + 10*t + 2*t*t'
[]
[]

[AuxVariables]
[base]
family = MONOMIAL
order = CONSTANT
[]
[second]
family = MONOMIAL
order = CONSTANT
[]
[]

[AuxKernels]
[base_aux]
type = FunctionAux
function = 'linear'
variable = 'base'
[]
[]

[Executioner]
type = Transient
num_steps = 3

[TimeIntegrator]
type = CentralDifference
[]
[]

[Problem]
solve = false

[]

[Materials]
[coupled]
type = CoupledValuesMaterial
variable = 'base'
[]
[ad_coupled]
type = ADCoupledValuesMaterial
variable = 'base'
declare_suffix = 'ad'
[]
[]

[Postprocessors]
[dot]
type = ElementAverageMaterialProperty
mat_prop = 'base_dot'
[]
[dot_dot]
type = ElementAverageMaterialProperty
mat_prop = 'base_dot_dot'
[]
[ad_dot]
type = ADElementAverageMaterialProperty
mat_prop = 'base_dot_ad'
[]
[ad_dot_dot]
type = ADElementAverageMaterialProperty
mat_prop = 'base_dot_dot_ad'
[]
[]

[Outputs]
csv = true
[]
5 changes: 5 additions & 0 deletions test/tests/interfaces/coupleable/gold/coupled_dots_out.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
time,ad_dot,ad_dot_dot,dot,dot_dot
0,0,0,0,0
1,6.25,12.5,6.25,12.5
2,14.25,3.5,14.25,3.5
3,18,4,18,4
8 changes: 8 additions & 0 deletions test/tests/interfaces/coupleable/tests
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@
exodiff = 'array_coupling_by_name_out.e'
requirement = 'The system shall be able to couple an array variable with its name directly through the coupling interface.'
[]
[time_derivative_coupling]
design = 'Coupleable.md'
issues = '#28'
type = CSVDiff
input = 'coupled_dots.i'
csvdiff = 'coupled_dots_out.csv'
requirement = 'The system shall be able to retrieve the time derivatives of variables through the coupling interface.'
[]
[]

0 comments on commit 90e9fe8

Please sign in to comment.