Skip to content

Commit de68534

Browse files
committed
reporter that reports the nodal variable values at the elements located by the nearestElemsToLine. Also renamed the variable used to for filtering elements and updated tests. closes #108
1 parent d4c068a commit de68534

File tree

8 files changed

+709
-6
lines changed

8 files changed

+709
-6
lines changed

src/reporters/ClosestElemsToLine.C

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ ClosestElemsToLine::validParams()
3636
params.addRequiredParam<ReporterName>("point_z2",
3737
"input reporter of z-coordinate name for point. This uses "
3838
"the reporter syntax <reporter>/<name>.");
39-
params.addParam<VariableName>("variable",
40-
"Name for the variable in domain to determine uniqueness");
39+
params.addParam<VariableName>("variable_filter",
40+
"Variable name to filter elements by. Only one element can be "
41+
"found for each integer value of this variable.");
4142
params.addParam<Real>("projection_tolerance",
4243
libMesh::TOLERANCE,
4344
"Search tolerance between line and the closest node. If a node is not "
@@ -59,7 +60,7 @@ ClosestElemsToLine::ClosestElemsToLine(const InputParameters & parameters)
5960
_pt_x(declareValueByName<std::vector<Real>>("point_x", REPORTER_MODE_REPLICATED)),
6061
_pt_y(declareValueByName<std::vector<Real>>("point_y", REPORTER_MODE_REPLICATED)),
6162
_pt_z(declareValueByName<std::vector<Real>>("point_z", REPORTER_MODE_REPLICATED)),
62-
_var(isParamValid("variable") ? getParam<VariableName>("variable") : "")
63+
_var(isParamValid("variable_filter") ? getParam<VariableName>("variable_filter") : "")
6364
{
6465
}
6566

test/tests/reporters/closest_elems_to_line/constant_line_projection.i

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
point_x2 = pt/pt2_x
108108
point_y2 = pt/pt2_y
109109
point_z2 = pt/pt2_z
110-
variable = oneID
110+
variable_filter = oneID
111111
outputs = out
112112
[]
113113
[differentID_out]
@@ -119,7 +119,7 @@
119119
point_x2 = pt/pt2_x
120120
point_y2 = pt/pt2_y
121121
point_z2 = pt/pt2_z
122-
variable = differentID
122+
variable_filter = differentID
123123
outputs = out
124124
[]
125125
[noID_out]
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[Mesh]
2+
[cluster34]
3+
type = FileMeshGenerator
4+
file = 'Cluster_34_zid.e'
5+
use_for_exodus_restart = true
6+
[]
7+
[]
8+
9+
[Problem]
10+
solve = false
11+
[]
12+
13+
[AuxVariables]
14+
[z_id]
15+
family = MONOMIAL
16+
order = CONSTANT
17+
initial_from_file_var = z_id
18+
initial_from_file_timestep = 'LATEST'
19+
[]
20+
[one]
21+
order = FIRST
22+
family = LAGRANGE
23+
initial_condition = 1
24+
[]
25+
[]
26+
27+
[Executioner]
28+
type = Steady
29+
[]
30+
31+
[Reporters]
32+
[pt]
33+
type = ConstantReporter
34+
real_vector_names = 'pt1_x pt1_y pt1_z pt2_x pt2_y pt2_z'
35+
real_vector_values = '132.1; 97.5; 189.5; 136.5; 103.2; 50.6'
36+
outputs = none
37+
[]
38+
39+
[no_var]
40+
block = "9 10"
41+
type = ClosestElemsToLineNodalVarValue
42+
projection_tolerance = 5
43+
point_x1 = pt/pt1_x
44+
point_y1 = pt/pt1_y
45+
point_z1 = pt/pt1_z
46+
point_x2 = pt/pt2_x
47+
point_y2 = pt/pt2_y
48+
point_z2 = pt/pt2_z
49+
variable_to_sample = one
50+
outputs = out
51+
[]
52+
[domain_var]
53+
type = ClosestElemsToLineNodalVarValue
54+
projection_tolerance = 5
55+
point_x1 = pt/pt1_x
56+
point_y1 = pt/pt1_y
57+
point_z1 = pt/pt1_z
58+
point_x2 = pt/pt2_x
59+
point_y2 = pt/pt2_y
60+
point_z2 = pt/pt2_z
61+
variable_filter = z_id
62+
variable_to_sample = one
63+
outputs = out
64+
[]
65+
[]
66+
67+
[Outputs]
68+
[out]
69+
type = JSON
70+
execute_system_information_on = none
71+
[]
72+
[]

0 commit comments

Comments
 (0)