Skip to content

Commit

Permalink
added element and nodal variable sampling test to reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnmunday committed Sep 1, 2022
1 parent d2f302c commit 9808a44
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/reporters/ClosestElemsToLineVarValue.C
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ ClosestElemsToLineVarValue::validParams()
{
InputParameters params = ClosestElemsToLine::validParams();
params.addClassDescription("Creates a real_vector_names reporter that has each "
"elements average nodal variable value.");
params.addRequiredParam<VariableName>("variable_to_sample", "The nodal variable to monitor.");
"elements average variable value.");
params.addRequiredParam<VariableName>("variable_to_sample", "The variable to sample.");
return params;
}

Expand Down Expand Up @@ -50,6 +50,8 @@ ClosestElemsToLineVarValue::finalize()
const Elem * elem = mesh.getMesh().query_elem_ptr(_eid[i]);
if (elem->processor_id() == processor_id())
{
// The element average is computed this way because the reporter system
// does not have a base class that derives off the nodal or element userobject
_fe_problem.setCurrentSubdomainID(elem, 0);
_subproblem.prepare(elem, _tid);
_subproblem.reinitElem(elem, _tid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
order = SECOND
family = LAGRANGE
[../]
[./v2]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
Expand All @@ -30,6 +36,12 @@
variable = v
function = 't*x*y'
[]
[v2]
type = ParsedAux
use_xyzt = true
variable = v2
function = '-t*x*y'
[]
[]
[Reporters]
Expand Down Expand Up @@ -65,6 +77,19 @@
variable_to_sample = v
outputs = out
[]
[elem_var]
type = ClosestElemsToLineVarValue
projection_tolerance = 5
point_x1 = pt/pt1_x
point_y1 = pt/pt1_y
point_z1 = pt/pt1_z
point_x2 = pt/pt2_x
point_y2 = pt/pt2_y
point_z2 = pt/pt2_z
variable_filter = v
variable_to_sample = v2
outputs = out
[]
[]

[Executioner]
Expand Down

0 comments on commit 9808a44

Please sign in to comment.