Skip to content

Commit ab15418

Browse files
committed
give feedback on probe location
1 parent f911efc commit ab15418

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

SU2_CFD/src/output/CFlowOutput.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
2626
*/
2727

28+
#include <sstream>
2829
#include <string>
2930

3031
#include "../../include/output/CFlowOutput.hpp"
@@ -795,7 +796,12 @@ void CFlowOutput::SetCustomOutputs(const CSolver* const* solver, const CGeometry
795796
/*--- Decide which rank owns the probe. ---*/
796797
su2double globMinDist;
797798
SU2_MPI::Allreduce(&minDist, &globMinDist, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm());
798-
output.iPoint = (minDist == globMinDist) ? minPoint : CustomOutput::PROBE_NOT_OWNED;
799+
output.iPoint = fabs(minDist - globMinDist) < EPS ? minPoint : CustomOutput::PROBE_NOT_OWNED;
800+
if (output.iPoint != CustomOutput::PROBE_NOT_OWNED) {
801+
std::cout << "Probe " << output.name << " is using global point "
802+
<< geometry->nodes->GetGlobalIndex(output.iPoint)
803+
<< ", distance from target location is " << sqrt(minDist) << std::endl;
804+
}
799805
}
800806
}
801807

0 commit comments

Comments
 (0)