mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-24 03:55:38 -04:00
Using std::vector accessors.
This commit is contained in:
parent
9c62259645
commit
77c911be05
1 changed files with 5 additions and 5 deletions
10
src/plot.cpp
10
src/plot.cpp
|
|
@ -45,16 +45,16 @@ IdData::set_value(size_t y, size_t x, const Particle& p, int level) {
|
|||
if (p.n_coord_ < level) {
|
||||
data_(y, x, 0) = NOT_FOUND;
|
||||
} else {
|
||||
data_(y, x, 0) = model::cells[p.coord_[level].cell]->id_;
|
||||
data_(y, x, 0) = model::cells.at(p.coord_.at(level).cell)->id_;
|
||||
}
|
||||
|
||||
// set material data
|
||||
Cell* c = model::cells[p.coord_[p.n_coord_ - 1].cell].get();
|
||||
Cell* c = model::cells.at(p.coord_.at(p.n_coord_ - 1).cell).get();
|
||||
if (p.material_ == MATERIAL_VOID) {
|
||||
data_(y, x, 1) = MATERIAL_VOID;
|
||||
return;
|
||||
} else if (c->type_ == Fill::MATERIAL) {
|
||||
Material* m = model::materials[p.material_].get();
|
||||
Material* m = model::materials.at(p.material_).get();
|
||||
data_(y, x, 1) = m->id_;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,10 +69,10 @@ PropertyData::PropertyData(size_t h_res, size_t v_res)
|
|||
|
||||
void
|
||||
PropertyData::set_value(size_t y, size_t x, const Particle& p, int level) {
|
||||
Cell* c = model::cells[p.coord_[p.n_coord_ - 1].cell].get();
|
||||
Cell* c = model::cells.at(p.coord_.at(p.n_coord_ - 1).cell).get();
|
||||
data_(y,x,0) = (p.sqrtkT_ * p.sqrtkT_) / K_BOLTZMANN;
|
||||
if (c->type_ != Fill::UNIVERSE && p.material_ != MATERIAL_VOID) {
|
||||
Material* m = model::materials[p.material_].get();
|
||||
Material* m = model::materials.at(p.material_).get();
|
||||
data_(y,x,1) = m->density_gpcc_;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue