reflect change only on source side

This commit is contained in:
AI-Pranto 2021-03-01 21:45:42 +06:00
parent fff8e5d1bd
commit 6fdc7657c7
3 changed files with 8 additions and 8 deletions

View file

@ -152,7 +152,7 @@ class Settings:
:surface_ids: List of surface ids at which crossing particles are to be
banked (int)
:max_surface_particles: Maximum number of particles to be banked on
:max_particles: Maximum number of particles to be banked on
surfaces per process (int)
survival_biasing : bool
Indicate whether survival biasing is to be used
@ -604,14 +604,14 @@ class Settings:
cv.check_type('surface source writing options', surf_source_write, Mapping)
for key, value in surf_source_write.items():
cv.check_value('surface source writing key', key,
('surface_ids', 'max_surface_particles'))
('surface_ids', 'max_particles'))
if key == 'surface_ids':
cv.check_type('surface ids for source banking', value,
Iterable, Integral)
for surf_id in value:
cv.check_greater_than('surface id for source banking',
surf_id, 0)
elif key == 'max_surface_particles':
elif key == 'max_particles':
cv.check_type('maximum particle banks on surfaces per process',
value, Integral)
cv.check_greater_than('maximum particle banks on surfaces per process',
@ -954,9 +954,9 @@ class Settings:
subelement = ET.SubElement(element, "surface_ids")
subelement.text = ' '.join(
str(x) for x in self._surf_source_write['surface_ids'])
if 'max_surface_particles' in self._surf_source_write:
if 'max_particles' in self._surf_source_write:
subelement = ET.SubElement(element, "max_surface_particles")
subelement.text = str(self._surf_source_write['max_surface_particles'])
subelement.text = str(self._surf_source_write['max_particles'])
def _create_confidence_intervals(self, root):
if self._confidence_intervals is not None:

View file

@ -47,7 +47,7 @@ def model(request):
openmc_model.settings.source = pt_src
openmc_model.settings.surf_source_write = {'surface_ids': [1],
'max_surface_particles': 1000}
'max_particles': 1000}
elif surf_source_op == 'read':
openmc_model.settings.surf_source_read = {'path': 'surface_source_true.h5'}

View file

@ -21,7 +21,7 @@ def test_export_to_xml(run_in_tmpdir):
'write': True, 'overwrite': True}
s.statepoint = {'batches': [50, 150, 500, 1000]}
s.surf_source_read = {'path': 'surface_source_1.h5'}
s.surf_source_write = {'surface_ids': [2], 'max_surface_particles': 200}
s.surf_source_write = {'surface_ids': [2], 'max_particles': 200}
s.confidence_intervals = True
s.ptables = True
s.seed = 17
@ -79,7 +79,7 @@ def test_export_to_xml(run_in_tmpdir):
'write': True, 'overwrite': True}
assert s.statepoint == {'batches': [50, 150, 500, 1000]}
assert s.surf_source_read == {'path': 'surface_source_1.h5'}
assert s.surf_source_write == {'surface_ids': [2], 'max_surface_particles': 200}
assert s.surf_source_write == {'surface_ids': [2], 'max_particles': 200}
assert s.confidence_intervals
assert s.ptables
assert s.seed == 17