Skip to content

Commit

Permalink
Only set the densities of fluid elements when reading from OpenMC inp…
Browse files Browse the repository at this point in the history
…ut. Refs enrico-dev#17
  • Loading branch information
aprilnovak committed Jun 16, 2019
1 parent 19fa1be commit 1ff2ee8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/openmc_nek_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,16 @@ void OpenmcNekDriver::init_densities()
// the correct index in the densities_ array. This mapping assumes that
// each Nek element is fully contained within an OpenMC cell, i.e. Nek
// elements are not split between multiple OpenMC cells.
for (const auto& c: openmc_driver_->cells_) {
const auto& global_elems = mat_to_elems_.at(c.material_index_);
for (int i = 0; i < openmc_driver_->cells_.size(); ++i) {
if (cell_fluid_mask_[i] == 1) {
auto& c = openmc_driver_->cells_[i];
const auto& global_elems = mat_to_elems_.at(c.material_index_);

for (int elem: global_elems) {
double rho = c.get_density();
densities_[elem] = rho;
densities_prev_[elem] = rho;
for (int elem: global_elems) {
double rho = c.get_density();
densities_[elem] = rho;
densities_prev_[elem] = rho;
}
}
}
}
Expand Down

0 comments on commit 1ff2ee8

Please sign in to comment.