Skip to content

Commit ad71231

Browse files
committed
Fix warning messages about inconsistent flags.
Previously, the terminal ouptut looked like this: Refinement flags were not consistent between processors! Correcting and continuing.Refinement flags were not consistent between processors! Correcting and continuing.Refinement flags were not consistent between processors! Correcting and continuing.Refinement flags were not consistent between processors! Correcting and continuing.Refinement flags were not consistent between processors! Correcting and continuing. Now it looks like this (one copy): Warning: Refinement flags were not consistent between processors! Correcting and continuing. ../../libmesh-src/src/mesh/mesh_refinement.C, line 725, compiled Nov 4 2022 at 09:17:47 *** Note that including a newline in the string passed to libmesh_warning() improves the formatting of the message, since otherwise it appears all on one line with the line number and other information.
1 parent 54021cc commit ad71231

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/mesh/mesh_refinement.C

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,10 @@ bool MeshRefinement::coarsen_elements ()
644644
// we don't want to abort large parallel runs in opt mode... but we
645645
// do want to warn that they should be fixed.
646646
libmesh_assert(flags_were_consistent);
647+
647648
if (!flags_were_consistent)
648-
{
649-
libMesh::out << "Refinement flags were not consistent between processors!\n"
650-
<< "Correcting and continuing.";
651-
}
649+
libmesh_warning("Warning: Refinement flags were not consistent between processors! "
650+
"Correcting and continuing.\n");
652651

653652
// Smooth coarsening flags
654653
_smooth_flags(false, true);
@@ -720,11 +719,10 @@ bool MeshRefinement::refine_elements ()
720719
// we don't want to abort large parallel runs in opt mode... but we
721720
// do want to warn that they should be fixed.
722721
libmesh_assert(flags_were_consistent);
722+
723723
if (!flags_were_consistent)
724-
{
725-
libMesh::out << "Refinement flags were not consistent between processors!\n"
726-
<< "Correcting and continuing.";
727-
}
724+
libmesh_warning("Warning: Refinement flags were not consistent between processors! "
725+
"Correcting and continuing.\n");
728726

729727
// Smooth refinement flags
730728
_smooth_flags(true, false);

0 commit comments

Comments
 (0)