From b168957fa1f1115368155fcb1e3508e73383ec43 Mon Sep 17 00:00:00 2001 From: Guillaume Giudicelli Date: Mon, 15 Nov 2021 17:52:41 -0700 Subject: [PATCH] Add test for capturing a component of a vector matprop in an auxvariable, refs #19382 --- .../functor_properties/functor-mat-props.i | 36 ++++---- .../functor-vector-mat-props.i | 85 +++++++++++++++++++ .../functor_properties/prop-caching.i | 16 ++-- test/tests/materials/functor_properties/tests | 8 ++ .../traditional-mat-props.i | 36 ++++---- 5 files changed, 137 insertions(+), 44 deletions(-) create mode 100644 test/tests/materials/functor_properties/functor-vector-mat-props.i diff --git a/test/tests/materials/functor_properties/functor-mat-props.i b/test/tests/materials/functor_properties/functor-mat-props.i index 0a02bfaeeeb9..ebfd54bebb5b 100644 --- a/test/tests/materials/functor_properties/functor-mat-props.i +++ b/test/tests/materials/functor_properties/functor-mat-props.i @@ -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] diff --git a/test/tests/materials/functor_properties/functor-vector-mat-props.i b/test/tests/materials/functor_properties/functor-vector-mat-props.i new file mode 100644 index 000000000000..7f6a9097e316 --- /dev/null +++ b/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 +[] diff --git a/test/tests/materials/functor_properties/prop-caching.i b/test/tests/materials/functor_properties/prop-caching.i index 23cfefe9e525..4032f129b5f9 100644 --- a/test/tests/materials/functor_properties/prop-caching.i +++ b/test/tests/materials/functor_properties/prop-caching.i @@ -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] diff --git a/test/tests/materials/functor_properties/tests b/test/tests/materials/functor_properties/tests index 1ea834bb08c7..bf49bcba2170 100644 --- a/test/tests/materials/functor_properties/tests +++ b/test/tests/materials/functor_properties/tests @@ -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] diff --git a/test/tests/materials/functor_properties/traditional-mat-props.i b/test/tests/materials/functor_properties/traditional-mat-props.i index 97ea52fd4f6a..7944702fb4a9 100644 --- a/test/tests/materials/functor_properties/traditional-mat-props.i +++ b/test/tests/materials/functor_properties/traditional-mat-props.i @@ -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]