Skip to content

Commit

Permalink
adding cell name to volume calculation when possible (#2652)
Browse files Browse the repository at this point in the history
  • Loading branch information
bam241 authored Aug 18, 2023
1 parent 1d29adc commit e332861
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/volume_calc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,17 @@ int openmc_calculate_volumes()

// Display domain volumes
for (int j = 0; j < vol_calc.domain_ids_.size(); j++) {
write_message(4, "{}{}: {} +/- {} cm^3", domain_type,
vol_calc.domain_ids_[j], results[j].volume[0], results[j].volume[1]);
std::string cell_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
}

write_message(4, "{}{}{}: {} +/- {} cm^3", domain_type,
vol_calc.domain_ids_[j], cell_name, results[j].volume[0],
results[j].volume[1]);
}

// Write volumes to HDF5 file
Expand Down

0 comments on commit e332861

Please sign in to comment.