diff --git a/test/tests/materials/functor_conversion/conversion_vec.i b/test/tests/materials/functor_conversion/conversion_vec.i new file mode 100644 index 000000000000..282190625947 --- /dev/null +++ b/test/tests/materials/functor_conversion/conversion_vec.i @@ -0,0 +1,84 @@ +[Mesh] + [gen] + type = GeneratedMeshGenerator + dim = 1 + nx = 10 + xmax = 2 + [] + [subdomain1] + input = gen + type = SubdomainBoundingBoxGenerator + bottom_left = '1.0 0 0' + block_id = 1 + top_right = '2.0 1.0 0' + [] + [interface] + input = subdomain1 + type = SideSetsBetweenSubdomainsGenerator + primary_block = '0' + paired_block = '1' + new_boundary = 'primary0_interface' + [] +[] + +[Variables] + [u] + order = FIRST + family = LAGRANGE_VEC + initial_condition = 2 + [] +[] + +[AuxVariables] + [v] + order = FIRST + family = MONOMIAL_VEC + initial_condition = 3 + [] +[] + +[FunctorMaterials] + [block0] + type = GenericVectorFunctorMaterial + block = '0' + prop_names = 'D' + prop_values = '4 3 2' + [] + [block1] + type = GenericVectorFunctorMaterial + block = '1' + prop_names = 'D' + prop_values = '2 1 0' + [] +[] + +[Materials] + [convert_to_reg] + type = VectorMaterialFunctorConverter + functors_in = 'D u v' + reg_props_out = 'm1 m3 m4' + outputs = 'exo' + [] + [convert_to_ad] + type = VectorMaterialFunctorConverter + functors_in = 'D u v' + ad_props_out = 'm1a m3a m4a' + outputs = 'exo' + [] +[] + +[Executioner] + type = Steady + solve_type = NEWTON +[] + +[Problem] + solve = false +[] + +[Outputs] + [exo] + type = Exodus + hide = 'u v' + [] +[] diff --git a/test/tests/materials/functor_conversion/gold/conversion_vec_exo.e b/test/tests/materials/functor_conversion/gold/conversion_vec_exo.e new file mode 100644 index 000000000000..b2594f604ce9 Binary files /dev/null and b/test/tests/materials/functor_conversion/gold/conversion_vec_exo.e differ diff --git a/test/tests/materials/functor_conversion/tests b/test/tests/materials/functor_conversion/tests index 22b554aa1c99..54d68d1e075a 100644 --- a/test/tests/materials/functor_conversion/tests +++ b/test/tests/materials/functor_conversion/tests @@ -1,11 +1,40 @@ [Tests] - design = 'Materials/MaterialFunctorConverter.md' + design = 'MaterialFunctorConverter.md' [scalar] type = 'Exodiff' input = 'conversion.i' - exodiff = 'conversion_out.e' + exodiff = 'conversion_exo.e' requirement = "The system shall be able to convert functors to regular (using automatic " "differentiation or not) material properties." issues = "#19420" [] + # Note: Functions are declared as real functors, even functions that return a vector. + # They are excluded from the conversions for now until we find a solution #24502 + [vector] + type = 'Exodiff' + input = 'conversion_vec.i' + exodiff = 'conversion_vec_exo.e' + requirement = "The system shall be able to convert vector functors to regular vector material " + "properties." + issues = "#19420" + [] + + [exception_checks] + requirement = 'The system shall error' + issues = '#19420' + [ad_and_regular] + type = RunException + input = conversion.i + cli_args = "Materials/convert_to_reg/ad_props_out='m1 m2 m3 m4'" + expect_err = 'We dont support converting functors to both AD and regular material properties' + detail = 'if the user requests conversions to both AD and regular material properties, as this is not supported,' + [] + [wrong_size] + type = RunException + input = conversion.i + cli_args = "Materials/convert_to_reg/reg_props_out='m1 m2 m3'" + expect_err = 'The number of output properties must match the number of input functors' + detail = 'if the user inputs a different number of functors and material properties, as the conversion match one to one, and' + [] + [] []