mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Added check to MGXS Library domains setter to compare with domains in geometry
This commit is contained in:
parent
d74dc64bd0
commit
cfe1f1dfcd
1 changed files with 9 additions and 0 deletions
|
|
@ -240,15 +240,24 @@ class Library(object):
|
|||
else:
|
||||
if self.domain_type == 'material':
|
||||
cv.check_iterable_type('domain', domains, openmc.Material)
|
||||
all_domains = self.openmc_geometry.get_all_materials()
|
||||
elif self.domain_type in ['cell', 'distribcell']:
|
||||
cv.check_iterable_type('domain', domains, openmc.Cell)
|
||||
all_domains = self.openmc_geometry.get_all_material_cells()
|
||||
elif self.domain_type == 'universe':
|
||||
cv.check_iterable_type('domain', domains, openmc.Universe)
|
||||
all_domains = self.openmc_geometry.get_all_universes()
|
||||
else:
|
||||
msg = 'Unable to set domains with ' \
|
||||
'domain type "{}"'.format(self.domain_type)
|
||||
raise ValueError(msg)
|
||||
|
||||
# Check that each domain can be found in the geometry
|
||||
for domain in domains:
|
||||
if domain not in all_domains:
|
||||
msg = 'Domain "{}" could not be found in the geometry'
|
||||
raise ValueError(msg)
|
||||
|
||||
self._domains = domains
|
||||
|
||||
@correction.setter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue