Skip to content
Snippets Groups Projects
Commit ac4c1cde authored by Norihiro Watanabe's avatar Norihiro Watanabe Committed by Dmitri Naumov
Browse files

[Num/DOF] check each entry in MeshSubsets in norm()

parent 6b69d970
No related branches found
No related tags found
No related merge requests found
...@@ -20,15 +20,20 @@ double norm(GlobalVector const& x, unsigned const global_component, ...@@ -20,15 +20,20 @@ double norm(GlobalVector const& x, unsigned const global_component,
LocalToGlobalIndexMap const& dof_table, MeshLib::Mesh const& mesh, CalculateNorm calculate_norm) LocalToGlobalIndexMap const& dof_table, MeshLib::Mesh const& mesh, CalculateNorm calculate_norm)
{ {
// TODO that also includes ghost nodes. // TODO that also includes ghost nodes.
MeshLib::MeshSubset const& ms =
dof_table.getMeshSubsets(global_component).getMeshSubset(mesh.getID());
double res = 0.0; double res = 0.0;
for (MeshLib::Node const* node : ms.getNodes()) MeshLib::MeshSubsets const& mss = dof_table.getMeshSubsets(global_component);
for (unsigned i=0; i<mss.size(); i++)
{ {
auto const value = MeshLib::MeshSubset const& ms = mss.getMeshSubset(i);
getNodalValue(x, mesh, dof_table, node->getID(), global_component); if (ms.getMeshID() != mesh.getID())
continue;
res = calculate_norm(res, value); for (MeshLib::Node const* node : ms.getNodes())
{
auto const value =
getNodalValue(x, mesh, dof_table, node->getID(), global_component);
res = calculate_norm(res, value);
}
} }
// TODO for PETSc some global accumulation is necessary. // TODO for PETSc some global accumulation is necessary.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment