Skip to content

Commit

Permalink
Update CovarianceMatrixMath.H
Browse files Browse the repository at this point in the history
Update treatment of warnings.
  • Loading branch information
cemitch99 authored Oct 8, 2024
1 parent d8128ac commit 4b8f7b3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/particles/diagnostics/CovarianceMatrixMath.H
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define COVARIANCE_MATRIX_MATH_H

#include <ablastr/constant.H>
#include <ablastr/warn_manager/WarnManager.H>

#include <AMReX_Array.H>
#include <AMReX_REAL.H>
Expand Down Expand Up @@ -62,6 +63,15 @@ namespace impactx::diagnostics
amrex::ParticleReal tol = 1.0e-12; //allow for roundoff error
if (discriminant > tol) {

ablastr::warn_manager::WMRecordWarning(
"Impactx::diagnostics::CubicRootsTrig",
"Polynomial appearing in CubicRootsTrig has one or more complex "
"(non-real) roots. Only the real part is returned. This "
"suggests a loss of numerical precision in computation of the "
"eigenemittances. Treat eigenemittance values with caution.",
ablastr::warn_manager::WarnPriority::medium
);

std::cout << "Polynomial in CubicRoots has one or more complex roots." << "\n";

} else if (Q == 0.0_prt) { // Special case of a triple root
Expand Down

0 comments on commit 4b8f7b3

Please sign in to comment.