Support cell densities per instances in plots (#4006)

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
GuySten 2026-07-10 01:45:09 +03:00 committed by GitHub
parent 5203640549
commit e73d8048da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 7 deletions

View file

@ -88,10 +88,7 @@ void PropertyData::set_value(size_t y, size_t x, const Particle& p, int level,
{
Cell* c = model::cells.at(p.lowest_coord().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.at(p.material()).get();
data_(y, x, 1) = m->density_gpcc_;
}
data_(y, x, 1) = c->density(p.cell_instance());
}
void PropertyData::set_overlap(size_t y, size_t x, int /*overlap_idx*/)
@ -150,7 +147,7 @@ void RasterData::set_value(size_t y, size_t x, const Particle& p, int level,
// set density (g/cm³)
if (c->type_ != Fill::UNIVERSE && p.material() != MATERIAL_VOID) {
Material* m = model::materials.at(p.material()).get();
property_data_(y, x, 1) = m->density_gpcc_;
property_data_(y, x, 1) = c->density(p.cell_instance());
}
}