Merge pull request #1502 from simondrichards/develop

Fix for enumeration values not explicitly handled in switch statements
This commit is contained in:
Adam Nelson 2020-03-01 07:29:31 -06:00 committed by GitHub
commit 7166b20794
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 0 deletions

View file

@ -43,6 +43,8 @@ int main(int argc, char* argv[]) {
case RunMode::VOLUME:
err = openmc_calculate_volumes();
break;
default:
break;
}
if (err) fatal_error(openmc_err_msg);

View file

@ -675,6 +675,8 @@ Particle::write_restart() const
case RunMode::PARTICLE:
write_dataset(file_id, "run_mode", "particle restart");
break;
default:
break;
}
write_dataset(file_id, "id", id_);
write_dataset(file_id, "type", static_cast<int>(type_));

View file

@ -227,6 +227,8 @@ ScattData::get_xs(MgxsType xstype, int gin, const int* gout, const double* mu)
fatal_error("Invalid call to get_xs");
}
break;
default:
break;
}
return val;
}

View file

@ -87,6 +87,8 @@ openmc_statepoint_write(const char* filename, bool* write_source)
case RunMode::EIGENVALUE:
write_dataset(file_id, "run_mode", "eigenvalue");
break;
default:
break;
}
write_attribute(file_id, "photon_transport", settings::photon_transport);
write_dataset(file_id, "n_particles", settings::n_particles);

View file

@ -295,6 +295,8 @@ std::vector<VolumeCalculation::Result> VolumeCalculation::execute() const
case TriggerMetric::variance:
val = result.volume[1] * result.volume[1];
break;
default:
break;
}
// update max if entry is valid
if (val > 0.0) { trigger_val = std::max(trigger_val, val); }
@ -374,6 +376,8 @@ void VolumeCalculation::to_hdf5(const std::string& filename,
case TriggerMetric::relative_error:
trigger_str = "rel_err";
break;
default:
break;
}
write_attribute(file_id, "trigger_type", trigger_str);
} else {