Preserve nonfinite input rejection at feasible-repair application boundary
This commit is contained in:
@@ -492,6 +492,15 @@ export namespace mean_field::solver {
|
|||||||
MPI_Allreduce(&fraction,&maximum,1,MPI_DOUBLE,MPI_MAX,m_space->GetComm()) != MPI_SUCCESS)
|
MPI_Allreduce(&fraction,&maximum,1,MPI_DOUBLE,MPI_MAX,m_space->GetComm()) != MPI_SUCCESS)
|
||||||
throw std::runtime_error("Could not validate the collective enthalpy repair fraction.");
|
throw std::runtime_error("Could not validate the collective enthalpy repair fraction.");
|
||||||
if (minimum != maximum) throw std::invalid_argument("The enthalpy repair fraction must agree across ranks.");
|
if (minimum != maximum) throw std::invalid_argument("The enthalpy repair fraction must agree across ranks.");
|
||||||
|
bool finite = true;
|
||||||
|
for (int i = 0; i < Size(); ++i)
|
||||||
|
finite = finite && std::isfinite(base(i)) && std::isfinite(anchor(i)) &&
|
||||||
|
std::isfinite(originalDirection(i));
|
||||||
|
if (enthalpy_detail::CollectiveMaximum(finite ? 0 : 1,m_space->GetComm())) {
|
||||||
|
PolynomialSignReport report;
|
||||||
|
report.status = PolynomialSignStatus::non_finite;
|
||||||
|
return report;
|
||||||
|
}
|
||||||
mfem::Vector repaired(Size()), candidate(Size());
|
mfem::Vector repaired(Size()), candidate(Size());
|
||||||
for (int i = 0; i < Size(); ++i) {
|
for (int i = 0; i < Size(); ++i) {
|
||||||
repaired(i) = fraction == 0.0 ? originalDirection(i) :
|
repaired(i) = fraction == 0.0 ? originalDirection(i) :
|
||||||
|
|||||||
Reference in New Issue
Block a user