42
43
44
45 +
46
47
48
49
50
51 +
52 +
53 +
54
55 +
56
57
58 +
59
60 +
61
62
63
64
65
66 +
67
68 +
69
70 +
71 +
72 +
73
74
75
76 +
77 +
78 +
79
80
81
|
{
const unsigned int n_nodes = elem->n_nodes();
nodal_soln.assign(n_nodes, 0);
// We request nodal solutions when plotting, for consistency with
// other elements. Side solutions do not have unique values at element
// nodes shared by multiple sides, so average the side values there.
// libmesh_warning("Nodal solution requested for a side element; this makes no sense.");
std::vector<unsigned int> nodal_soln_count(n_nodes, 0);
const FEType fe_type{order, SIDE_HIERARCHIC};
std::vector<Number> nodal_soln_on_side;
for (const auto side : elem->side_index_range())
{
const std::vector<unsigned int> side_nodes =
elem->nodes_on_side(side);
FEInterface::side_nodal_soln(fe_type,
elem,
side,
elem_soln,
nodal_soln_on_side,
add_p_level);
libmesh_assert_equal_to(nodal_soln_on_side.size(), side_nodes.size());
for (const auto i : index_range(side_nodes))
{
const auto n = side_nodes[i];
nodal_soln[n] += nodal_soln_on_side[i];
++nodal_soln_count[n];
}
}
for (const auto n : index_range(nodal_soln))
if (nodal_soln_count[n])
nodal_soln[n] /= nodal_soln_count[n];
} // side_hierarchic_nodal_soln()
|