Skip to content

Commit

Permalink
Add test for capturing a component of a vector matprop in an auxvaria…
Browse files Browse the repository at this point in the history
…ble, refs idaholab#19382
  • Loading branch information
GiudGiud committed Nov 16, 2021
1 parent 2763a1f commit b168957
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 44 deletions.
36 changes: 18 additions & 18 deletions test/tests/materials/functor_properties/functor-mat-props.i
Expand Up @@ -5,71 +5,71 @@
nx = 10
xmax = 2
[]
[./subdomain1]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[../]
[./interface]
[]
[interface]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[../]
[]
[]

[Variables]
[./u]
[u]
order = FIRST
family = LAGRANGE
[../]
[]
[]

[Kernels]
[./diff_u]
[diff_u]
type = FunctorMatDiffusion
variable = u
[../]
[]
[]

[BCs]
[./left]
[left]
type = DirichletBC
variable = u
boundary = 'left'
value = 1
[../]
[./right]
[]
[right]
type = DirichletBC
variable = u
boundary = 'right'
value = 0
[../]
[]
[]

[Materials]
[./block0]
[block0]
type = GenericConstantFunctorMaterial
block = '0'
prop_names = 'D'
prop_values = '4'
[../]
[./block1]
[]
[block1]
type = GenericConstantFunctorMaterial
block = '1'
prop_names = 'D'
prop_values = '2'
[../]
[]
[]

[Preconditioning]
[./smp]
[smp]
type = SMP
full = true
[../]
[]
[]

[Executioner]
Expand Down
85 changes: 85 additions & 0 deletions test/tests/materials/functor_properties/functor-vector-mat-props.i
@@ -0,0 +1,85 @@
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 4
ny = 4
xmax = 2
ymax = 1
[]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[]
[]

[AuxVariables]
[mat_x]
[]
[mat_y]
[]
[mat_z]
[]
[]

[AuxKernels]
[matprop_to_aux_x]
type = FunctorADVectorMatPropElementalAux
variable = mat_x
mat_prop = 'matprop'
component = '0'
[]
[matprop_to_aux_y]
type = FunctorADVectorMatPropElementalAux
variable = mat_y
mat_prop = 'matprop'
component = '1'
[]
[matprop_to_aux_z]
type = FunctorADVectorMatPropElementalAux
variable = mat_z
mat_prop = 'matprop'
component = '2'
[]
[]

[Materials]
[block0]
type = ADGenericConstantVectorFunctorMaterial
block = '0'
prop_names = 'matprop'
prop_values = '4 2 1'
[]
[block1]
type = ADGenericFunctionVectorFunctorMaterial
block = '1'
prop_names = 'matprop'
prop_values = 'f_x f_x f_z'
[]
[]

[Functions]
[f_x]
type = ParsedFunction
value = 'x + 2 * y'
[]
[f_z]
type = ParsedFunction
value = 'x * y - 2'
[]
[]

[Problem]
solve = false
[]

[Executioner]
type = Steady
[]

[Outputs]
exodus = true
[]
16 changes: 8 additions & 8 deletions test/tests/materials/functor_properties/prop-caching.i
Expand Up @@ -11,31 +11,31 @@ n=5
[]

[Variables]
[./u]
[../]
[u]
[]
[]

[Kernels]
[./diff_u]
[diff_u]
type = FunctorMatDiffusion
variable = u
diffusivity = 'slow_prop'
[../]
[]
[]

[BCs]
[./left]
[left]
type = DirichletBC
variable = u
boundary = 'left'
value = 1
[../]
[./right]
[]
[right]
type = DirichletBC
variable = u
boundary = 'right'
value = 0
[../]
[]
[]

[Materials]
Expand Down
8 changes: 8 additions & 0 deletions test/tests/materials/functor_properties/tests
Expand Up @@ -32,6 +32,14 @@
ad_indexing_type = 'global'
[]
[]
[vector-functor]
type = Exodiff
input = 'functor-vector-mat-props.i'
exodiff = 'functor-vector-mat-props_out.e'
design = 'FunctorVectorMatPropElementalAux.md'
ad_indexing_type = 'global'
requirement = 'The system shall be able to transfer vector material properties to an auxiliary variable, on a per-component basis.'
[]
[prop_caching]
requirement = 'The system shall be able to evaluate, cache, and then clear functor material property evaluations'
[on_timestep_begin]
Expand Down
36 changes: 18 additions & 18 deletions test/tests/materials/functor_properties/traditional-mat-props.i
Expand Up @@ -5,71 +5,71 @@
nx = 10
xmax = 2
[]
[./subdomain1]
[subdomain1]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '1.0 0 0'
block_id = 1
top_right = '2.0 1.0 0'
[../]
[./interface]
[]
[interface]
input = subdomain1
type = SideSetsBetweenSubdomainsGenerator
primary_block = '0'
paired_block = '1'
new_boundary = 'primary0_interface'
[../]
[]
[]

[Variables]
[./u]
[u]
order = FIRST
family = LAGRANGE
[../]
[]
[]

[Kernels]
[./diff_u]
[diff_u]
type = MatDiffusion
variable = u
[../]
[]
[]

[BCs]
[./left]
[left]
type = DirichletBC
variable = u
boundary = 'left'
value = 1
[../]
[./right]
[]
[right]
type = DirichletBC
variable = u
boundary = 'right'
value = 0
[../]
[]
[]

[Materials]
[./block0]
[block0]
type = GenericConstantMaterial
block = '0'
prop_names = 'D'
prop_values = '4'
[../]
[./block1]
[]
[block1]
type = GenericConstantMaterial
block = '1'
prop_names = 'D'
prop_values = '2'
[../]
[]
[]

[Preconditioning]
[./smp]
[smp]
type = SMP
full = true
[../]
[]
[]

[Executioner]
Expand Down

0 comments on commit b168957

Please sign in to comment.