Skip to content

Commit

Permalink
Used functor point in ParsedFunctorMaterial
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahansel committed Aug 23, 2023
1 parent f98d6c9 commit 2023494
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
9 changes: 4 additions & 5 deletions framework/src/functormaterials/ParsedFunctorMaterial.C
Expand Up @@ -75,14 +75,13 @@ ParsedFunctorMaterialTempl<is_ad>::ParsedFunctorMaterialTempl(const InputParamet
_func_params[i] = (*_functors[i])(r, t);

// Store the space and time values
// TODO: find some way to extract x,y,z from r. getPoint(r) does not exist yet.
// const auto r_point = getPoint(r);
_func_params[_n_functors] = 0;
const auto r_point = r.getPoint();
_func_params[_n_functors] = r_point(0);
#if LIBMESH_DIM > 1
_func_params[_n_functors + 1] = 0;
_func_params[_n_functors + 1] = r_point(1);
#endif
#if LIBMESH_DIM > 2
_func_params[_n_functors + 2] = 0;
_func_params[_n_functors + 2] = r_point(2);
#endif
_func_params[_n_functors + LIBMESH_DIM] = getTime(t);

Expand Down
@@ -0,0 +1,2 @@
time,get_prop1
0,71.859874482049
Expand Up @@ -35,11 +35,12 @@

[Postprocessors]
# The value should be:
# 5 + 3^2 + 2 + pi + e + 4 + 3 + 4.5 + 7.5 = 40.85987448204884
# 5 * 3^2 + 2 + pi + e + 4 + 3 + 4.5 + 7.5 = 71.85987448204884
[get_prop1]
type = ElementExtremeFunctorValue
functor = prop1
value_type = max
execute_on = 'INITIAL'
[]
[]

Expand All @@ -54,4 +55,5 @@

[Outputs]
csv = true
execute_on = 'INITIAL'
[]
11 changes: 11 additions & 0 deletions test/tests/functormaterials/parsed_functor_material/tests
@@ -0,0 +1,11 @@
[Tests]
issues = '#24380'
design = 'ParsedFunctorMaterial.md'

[test]
type = CSVDiff
input = parsed_functor_material.i
csvdiff = parsed_functor_material_out.csv
requirement = 'The system shall be able to parse an expression of functors to compute a functor material property.'
[]
[]

0 comments on commit 2023494

Please sign in to comment.