Skip to content

Commit

Permalink
Avoid using get_info on bad elements, they could trigger errors thems…
Browse files Browse the repository at this point in the history
…elves

refs idaholab#25278
  • Loading branch information
GiudGiud committed Dec 23, 2023
1 parent 23ce577 commit 688c1c9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions framework/src/meshgenerators/MeshDiagnosticsGenerator.C
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ MeshDiagnosticsGenerator::checkElementVolumes(const std::unique_ptr<MeshBase> &
{
if (num_tiny_elems < _num_outputs)
_console << "Element with volume below threshold detected : \n"
<< elem->get_info() << std::endl;
<< "id " << elem->id() << " near point " << elem->vertex_average() << std::endl;
else if (num_tiny_elems == _num_outputs)
_console << "Maximum output reached, log is silenced" << std::endl;
num_tiny_elems++;
Expand Down Expand Up @@ -392,7 +392,8 @@ MeshDiagnosticsGenerator::checkElementOverlap(const std::unique_ptr<MeshBase> &
{
num_elem_overlaps++;
if (num_elem_overlaps < _num_outputs)
_console << "Element overlap detected with element : " << elem->get_info() << std::endl;
_console << "Element overlap detected with element : " << elem->id() << " near point "
<< elem->vertex_average() << std::endl;
else if (num_elem_overlaps == _num_outputs)
_console << "Maximum output reached, log is silenced" << std::endl;
}
Expand Down Expand Up @@ -1209,7 +1210,8 @@ MeshDiagnosticsGenerator::checkLocalJacobians(const std::unique_ptr<MeshBase> &
if (msg.find("negative Jacobian") != std::string::npos)
{
if (num_negative_elem_qp_jacobians < _num_outputs)
_console << "Negative Jacobian found in element\n" << elem->get_info() << std::endl;
_console << "Negative Jacobian found in element " << elem->id() << " near point "
<< elem->vertex_average() << std::endl;
else if (num_negative_elem_qp_jacobians == _num_outputs)
_console << "Maximum log output reached, silencing output" << std::endl;
}
Expand Down Expand Up @@ -1264,8 +1266,8 @@ MeshDiagnosticsGenerator::checkLocalJacobians(const std::unique_ptr<MeshBase> &
{
num_negative_side_qp_jacobians++;
if (num_negative_side_qp_jacobians < _num_outputs)
_console << "Negative Jacobian found in side " << side << " of element\n"
<< elem->get_info() << std::endl;
_console << "Negative Jacobian found in side " << side << " of element" << elem->id()
<< " near point " << elem->vertex_average() << std::endl;
else if (num_negative_side_qp_jacobians == _num_outputs)
_console << "Maximum log output reached, silencing output" << std::endl;
}
Expand Down

0 comments on commit 688c1c9

Please sign in to comment.