mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Merge pull request #2385 from bam241/model_mats_per_id
Model mats per id
This commit is contained in:
commit
fa4aa4ad21
1 changed files with 3 additions and 3 deletions
|
|
@ -124,10 +124,10 @@ class Model:
|
|||
@lru_cache(maxsize=None)
|
||||
def _materials_by_id(self):
|
||||
"""Dictionary mapping material ID --> material"""
|
||||
if self.materials is None:
|
||||
mats = self.geometry.get_all_materials().values()
|
||||
else:
|
||||
if self.materials:
|
||||
mats = self.materials
|
||||
else:
|
||||
mats = self.geometry.get_all_materials().values()
|
||||
return {mat.id: mat for mat in mats}
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue