From 77c911be0530019f5a39ac97c19da8e99c145dc8 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 3 Sep 2020 08:26:19 -0500 Subject: [PATCH] Using std::vector accessors. --- src/plot.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plot.cpp b/src/plot.cpp index e1261e44e..6a2024d93 100644 --- a/src/plot.cpp +++ b/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_; } }