added cell name to vol calc print out (#2656)

This commit is contained in:
Jonathan Shimwell 2023-08-20 21:29:20 +01:00 committed by GitHub
parent 8e77a1ffb6
commit d687ce419f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -534,16 +534,20 @@ int openmc_calculate_volumes()
// Display domain volumes
for (int j = 0; j < vol_calc.domain_ids_.size(); j++) {
std::string cell_name {""};
std::string region_name {""};
if (vol_calc.domain_type_ == VolumeCalculation::TallyDomain::CELL) {
int cell_idx = model::cell_map[vol_calc.domain_ids_[j]];
cell_name = model::cells[cell_idx]->name();
if (cell_name.size())
cell_name.insert(0, " "); // prepend space for formatting
region_name = model::cells[cell_idx]->name();
} else if (vol_calc.domain_type_ ==
VolumeCalculation::TallyDomain::MATERIAL) {
int mat_idx = model::material_map[vol_calc.domain_ids_[j]];
region_name = model::materials[mat_idx]->name();
}
if (region_name.size())
region_name.insert(0, " "); // prepend space for formatting
write_message(4, "{}{}{}: {} +/- {} cm^3", domain_type,
vol_calc.domain_ids_[j], cell_name, results[j].volume[0],
vol_calc.domain_ids_[j], region_name, results[j].volume[0],
results[j].volume[1]);
}