From b8e9e25da8cbedc7af7e4826de19c65f7f0497ec Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Tue, 17 Nov 2015 20:04:56 -0500 Subject: [PATCH 01/13] Added fine granularity control for MGXS Libraries --- openmc/mgxs/library.py | 52 ++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 4c173f81a9..2a293cb0ba 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -53,6 +53,8 @@ class Library(object): The types of cross sections in the library (e.g., ['total', 'scatter']) domain_type : {'material', 'cell', 'distribcell', 'universe'} Domain type for spatial homogenization + domains : Iterable of Material, Cell or Universe + The spatial domain(s) for which MGXS in the Library are computed correction : 'P0' or None Apply the P0 correction to scattering matrices if set to 'P0' energy_groups : EnergyGroups @@ -80,6 +82,7 @@ class Library(object): self._by_nuclide = None self._mgxs_types = [] self._domain_type = None + self._domains = 'all' self._correction = 'P0' self._energy_groups = None self._tally_trigger = None @@ -105,6 +108,7 @@ class Library(object): clone._by_nuclide = self.by_nuclide clone._mgxs_types = self.mgxs_types clone._domain_type = self.domain_type + clone._domains = self.domains clone._correction = self.correction clone._energy_groups = copy.deepcopy(self.energy_groups, memo) clone._tally_trigger = copy.deepcopy(self.tally_trigger, memo) @@ -153,22 +157,24 @@ class Library(object): def by_nuclide(self): return self._by_nuclide - @property - def domains(self): - if self.domain_type is None: - raise ValueError('Unable to get all domains without a domain type') - - if self.domain_type == 'material': - return self.openmc_geometry.get_all_materials() - elif self.domain_type == 'cell' or self.domain_type == 'distribcell': - return self.openmc_geometry.get_all_material_cells() - elif self.domain_type == 'universe': - return self.openmc_geometry.get_all_universes() - @property def domain_type(self): return self._domain_type + @property + def domains(self): + if self._domains == 'all': + if self.domain_type == 'material': + return self.openmc_geometry.get_all_materials() + elif self.domain_type == 'cell' or self.domain_type == 'distribcell': + return self.openmc_geometry.get_all_material_cells() + elif self.domain_type == 'universe': + return self.openmc_geometry.get_all_universes() + else: + raise ValueError('Unable to get domains without a domain type') + else: + return self._domains + @property def correction(self): return self._correction @@ -223,6 +229,28 @@ class Library(object): cv.check_value('domain type', domain_type, tuple(openmc.mgxs.DOMAIN_TYPES)) self._domain_type = domain_type + @domains.setter + def domains(self, domains): + + # Use all materials, cells or universes in the geometry as domains + if domains == 'all': + self._domains = domains + + # User specified a list of material, cell or universe domains + else: + if self.domain_type == 'material': + cv.check_iterable_type('domain', domains, openmc.Material) + elif self.domain_type == 'cell': + cv.check_iterable_type('domain', domains, openmc.Cell) + elif self.domain_type == 'universe': + cv.check_iterable_type('domain', domains, openmc.Universe) + else: + msg = 'Unable to set domains with ' \ + 'domain type "{}"'.format(self.domain_type) + raise ValueError(msg) + + self._domains = domains + @correction.setter def correction(self, correction): cv.check_value('correction', correction, ('P0', None)) From d74dc64bd01ece1fd85ddaf46b99d8df9409ce85 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Tue, 17 Nov 2015 20:09:56 -0500 Subject: [PATCH 02/13] MGXS Library domains setter now works for distribcells --- openmc/mgxs/library.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 2a293cb0ba..ee9ffc4fa3 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -166,7 +166,7 @@ class Library(object): if self._domains == 'all': if self.domain_type == 'material': return self.openmc_geometry.get_all_materials() - elif self.domain_type == 'cell' or self.domain_type == 'distribcell': + elif self.domain_type in ['cell', 'distribcell']: return self.openmc_geometry.get_all_material_cells() elif self.domain_type == 'universe': return self.openmc_geometry.get_all_universes() @@ -240,7 +240,7 @@ class Library(object): else: if self.domain_type == 'material': cv.check_iterable_type('domain', domains, openmc.Material) - elif self.domain_type == 'cell': + elif self.domain_type in ['cell', 'distribcell']: cv.check_iterable_type('domain', domains, openmc.Cell) elif self.domain_type == 'universe': cv.check_iterable_type('domain', domains, openmc.Universe) From 698dba369b2655a7c1ce1d2117efcc642330e087 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Tue, 17 Nov 2015 20:31:22 -0500 Subject: [PATCH 03/13] Added colorize routine to Python API Plot class to generate random color schemes --- openmc/plots.py | 97 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 67 insertions(+), 30 deletions(-) diff --git a/openmc/plots.py b/openmc/plots.py index 6cff095ec0..449374a3f4 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -5,9 +5,9 @@ import sys import numpy as np +import openmc +import openmc.checkvalue as cv from openmc.clean_xml import * -from openmc.checkvalue import (check_type, check_value, check_length, - check_greater_than, check_less_than) if sys.version_info[0] >= 3: basestring = str @@ -143,70 +143,70 @@ class Plot(object): self._id = AUTO_PLOT_ID AUTO_PLOT_ID += 1 else: - check_type('plot ID', plot_id, Integral) - check_greater_than('plot ID', plot_id, 0, equality=True) + cv.check_type('plot ID', plot_id, Integral) + cv.check_greater_than('plot ID', plot_id, 0, equality=True) self._id = plot_id @name.setter def name(self, name): - check_type('plot name', name, basestring) + cv.check_type('plot name', name, basestring) self._name = name @width.setter def width(self, width): - check_type('plot width', width, Iterable, Real) - check_length('plot width', width, 2, 3) + cv.check_type('plot width', width, Iterable, Real) + cv.check_length('plot width', width, 2, 3) self._width = width @origin.setter def origin(self, origin): - check_type('plot origin', origin, Iterable, Real) - check_length('plot origin', origin, 3) + cv.check_type('plot origin', origin, Iterable, Real) + cv.check_length('plot origin', origin, 3) self._origin = origin @pixels.setter def pixels(self, pixels): - check_type('plot pixels', pixels, Iterable, Integral) - check_length('plot pixels', pixels, 2, 3) + cv.check_type('plot pixels', pixels, Iterable, Integral) + cv.check_length('plot pixels', pixels, 2, 3) for dim in pixels: - check_greater_than('plot pixels', dim, 0) + cv.check_greater_than('plot pixels', dim, 0) self._pixels = pixels @filename.setter def filename(self, filename): - check_type('filename', filename, basestring) + cv.check_type('filename', filename, basestring) self._filename = filename @color.setter def color(self, color): - check_type('plot color', color, basestring) - check_value('plot color', color, ['cell', 'mat']) + cv.check_type('plot color', color, basestring) + cv.check_value('plot color', color, ['cell', 'mat']) self._color = color @type.setter def type(self, plottype): - check_type('plot type', plottype, basestring) - check_value('plot type', plottype, ['slice', 'voxel']) + cv.check_type('plot type', plottype, basestring) + cv.check_value('plot type', plottype, ['slice', 'voxel']) self._type = plottype @basis.setter def basis(self, basis): - check_type('plot basis', basis, basestring) - check_value('plot basis', basis, ['xy', 'xz', 'yz']) + cv.check_type('plot basis', basis, basestring) + cv.check_value('plot basis', basis, ['xy', 'xz', 'yz']) self._basis = basis @background.setter def background(self, background): - check_type('plot background', background, Iterable, Integral) - check_length('plot background', background, 3) + cv.check_type('plot background', background, Iterable, Integral) + cv.check_length('plot background', background, 3) for rgb in background: - check_greater_than('plot background',rgb, 0, True) - check_less_than('plot background', rgb, 256) + cv.check_greater_than('plot background',rgb, 0, True) + cv.check_less_than('plot background', rgb, 256) self._background = background @col_spec.setter def col_spec(self, col_spec): - check_type('plot col_spec parameter', col_spec, dict, Integral) + cv.check_type('plot col_spec parameter', col_spec, dict, Integral) for key in col_spec: if key < 0: @@ -229,18 +229,18 @@ class Plot(object): @mask_componenets.setter def mask_components(self, mask_components): - check_type('plot mask_components', mask_components, Iterable, Integral) + cv.check_type('plot mask_components', mask_components, Iterable, Integral) for component in mask_components: - check_greater_than('plot mask_components', component, 0, True) + cv.check_greater_than('plot mask_components', component, 0, True) self._mask_components = mask_components @mask_background.setter def mask_background(self, mask_background): - check_type('plot mask background', mask_background, Iterable, Integral) - check_length('plot mask background', mask_background, 3) + cv.check_type('plot mask background', mask_background, Iterable, Integral) + cv.check_length('plot mask background', mask_background, 3) for rgb in mask_background: - check_greater_than('plot mask background', rgb, 0, True) - check_less_than('plot mask background', rgb, 256) + cv.check_greater_than('plot mask background', rgb, 0, True) + cv.check_less_than('plot mask background', rgb, 256) self._mask_background = mask_background def __repr__(self): @@ -261,6 +261,43 @@ class Plot(object): string += '{0: <16}{1}{2}\n'.format('\tCol Spec', '=\t', self._col_spec) return string + def colorize(self, geometry, seed=1): + """Generate a color scheme for each domain in the plot. + + This routine may be used to generate random, reproducible color schemes. + The colors generated are based upon cell/material IDs in the geometry. + + Params + ------ + geometry : openmc.Geometry + The geometry for which the plot is created + seed : Integral + The random number seed used to generate the color scheme + + """ + + cv.check_type('geometry', geometry, openmc.Geometry) + cv.check_type('seed', seed, Integral) + cv.check_greater_than('seed', seed, 1, equality=True) + + # Get collections of the domains which will be plotted + if self.color is 'mat': + domains = geometry.get_all_materials() + else: + domains = geometry.get_all_materials() + + # Set the seed for the random number generator + np.random.seed(seed) + + # Generate random colors for each feature + self.col_spec = {} + for domain in domains: + r = np.random.randint(0, 255) + g = np.random.randint(0, 255) + b = np.random.randint(0, 255) + self.col_spec[domain.id] = (r, g, b) + + def get_plot_xml(self): """Return XML representation of the plot From 64a7cd960728407df4ea3f9376b362b1a7aa070f Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Tue, 17 Nov 2015 20:39:03 -0500 Subject: [PATCH 04/13] Added colorize routine to PlotsFile --- openmc/plots.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/openmc/plots.py b/openmc/plots.py index 449374a3f4..acc7d4d13c 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -386,6 +386,25 @@ class PlotsFile(object): self._plots.remove(plot) + def colorize(self, geometry, seed=1): + """Generate a consistent color scheme for each domain in each plot. + + This routine may be used to generate random, reproducible color schemes. + The colors generated are based upon cell/material IDs in the geometry. + The color schemes will be consistent for all plots in "plots.xml". + + Params + ------ + geometry : openmc.Geometry + The geometry for which the plots are defined + seed : Integral + The random number seed used to generate the color scheme + + """ + + for plot in self._plots: + plot.colorize(geometry, seed) + def _create_plot_subelements(self): for plot in self._plots: xml_element = plot.get_plot_xml() From 372d751fa64967443adcc655bed2bf3d89512822 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Tue, 17 Nov 2015 21:18:26 -0500 Subject: [PATCH 05/13] Added alpha compositing scheme to Python API Plot class to highlight domains --- openmc/plots.py | 60 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/openmc/plots.py b/openmc/plots.py index acc7d4d13c..d04f9a036e 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -270,7 +270,7 @@ class Plot(object): Params ------ geometry : openmc.Geometry - The geometry for which the plot is created + The geometry for which the plot is defined seed : Integral The random number seed used to generate the color scheme @@ -284,7 +284,7 @@ class Plot(object): if self.color is 'mat': domains = geometry.get_all_materials() else: - domains = geometry.get_all_materials() + domains = geometry.get_all_cells() # Set the seed for the random number generator np.random.seed(seed) @@ -295,9 +295,63 @@ class Plot(object): r = np.random.randint(0, 255) g = np.random.randint(0, 255) b = np.random.randint(0, 255) - self.col_spec[domain.id] = (r, g, b) + self.col_spec[domain] = (r, g, b) + def highlight_domains(self, geometry, domains, seed=1, + alpha=0.5, background='grey'): + """Use alpha compositing to highlight one or more domains in the plot. + + This routine generates a color scheme and applies alpha compositing + to make all domains except the highlighted ones partially transparent. + + Params + ------ + geometry : openmc.Geometry + The geometry for which the plot is defined + domains : Iterable of Integral + A collection of the domain IDs to highlight in the plot + seed : Integral + The random number seed used to generate the color scheme + alpha : Real in [0,1] + The value to apply in alpha compisiting + background : 3-tuple of Integral or 'white' or 'black' or 'grey' + The background color to apply in alpha compisiting + + """ + + cv.check_iterable_type('domains', domains, Integral) + cv.check_type('alpha', alpha, Real) + cv.check_greater_than('alpha', alpha, 0., equality=True) + cv.check_less_than('alpha', alpha, 1., equality=True) + + # Get a background (R,G,B) tuple to apply in alpha compositing + if isinstance(background, basestring): + if background == 'white': + background = (255, 255, 255) + elif background == 'black': + background = (0, 0, 0) + elif background == 'grey': + background = (160, 160, 160) + else: + msg = 'The background "{}" is not defined'.format(background) + raise ValueError(msg) + + cv.check_iterable_type('background', background, Integral) + + # Generate a color scheme + self.colorize(geometry, seed) + + # Apply alpha compositing to the colors for all domains + # other than those the user wishes to highlight + for domain_id in self.col_spec: + if domain_id not in domains: + r, g, b = self.col_spec[domain_id] + r = int(((1-alpha) * background[0]) + (alpha * r)) + g = int(((1-alpha) * background[1]) + (alpha * g)) + b = int(((1-alpha) * background[2]) + (alpha * b)) + self._col_spec[domain_id] = (r, g, b) + def get_plot_xml(self): """Return XML representation of the plot From 0933cd7e8aa74d8a6f39bcc901de4e2bb2de9273 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Tue, 17 Nov 2015 21:19:42 -0500 Subject: [PATCH 06/13] Added alpha compositing routine to PlotsFile in Python API --- openmc/plots.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openmc/plots.py b/openmc/plots.py index d04f9a036e..aedc6ed41b 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -459,6 +459,32 @@ class PlotsFile(object): for plot in self._plots: plot.colorize(geometry, seed) + + def highlight_domains(self, geometry, domains, seed=1, + alpha=0.5, background='grey'): + """Use alpha compositing to highlight one or more domains in the plot. + + This routine generates a color scheme and applies alpha compositing + to make all domains except the highlighted ones partially transparent. + + Params + ------ + geometry : openmc.Geometry + The geometry for which the plot is defined + domains : Iterable of Integral + A collection of the domain IDs to highlight in the plot + seed : Integral + The random number seed used to generate the color scheme + alpha : Real in [0,1] + The value to apply in alpha compisiting + background : 3-tuple of Integral or 'white' or 'black' or 'grey' + The background color to apply in alpha compisiting + + """ + + for plot in self._plots: + plot.highlight_domains(geometry, domains, seed, alpha, background) + def _create_plot_subelements(self): for plot in self._plots: xml_element = plot.get_plot_xml() From 59f9b77333710b26300afddd32d556aa00536564 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Tue, 17 Nov 2015 21:21:14 -0500 Subject: [PATCH 07/13] Fixed bug in Plot.colorize() for cell plots --- openmc/plots.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmc/plots.py b/openmc/plots.py index acc7d4d13c..e805e09d27 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -284,7 +284,7 @@ class Plot(object): if self.color is 'mat': domains = geometry.get_all_materials() else: - domains = geometry.get_all_materials() + domains = geometry.get_all_cells() # Set the seed for the random number generator np.random.seed(seed) @@ -295,7 +295,7 @@ class Plot(object): r = np.random.randint(0, 255) g = np.random.randint(0, 255) b = np.random.randint(0, 255) - self.col_spec[domain.id] = (r, g, b) + self.col_spec[domain] = (r, g, b) def get_plot_xml(self): From 4d3c97f6989ff385b09fbcc4d8e7f5e1bb70cdc4 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Wed, 18 Nov 2015 11:01:12 -0500 Subject: [PATCH 08/13] Made upper bound for random colors 256 per comments by @paulromano --- openmc/plots.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openmc/plots.py b/openmc/plots.py index e805e09d27..41254d832d 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -267,8 +267,8 @@ class Plot(object): This routine may be used to generate random, reproducible color schemes. The colors generated are based upon cell/material IDs in the geometry. - Params - ------ + Parameters + ---------- geometry : openmc.Geometry The geometry for which the plot is created seed : Integral @@ -292,9 +292,9 @@ class Plot(object): # Generate random colors for each feature self.col_spec = {} for domain in domains: - r = np.random.randint(0, 255) - g = np.random.randint(0, 255) - b = np.random.randint(0, 255) + r = np.random.randint(0, 256) + g = np.random.randint(0, 256) + b = np.random.randint(0, 256) self.col_spec[domain] = (r, g, b) @@ -393,8 +393,8 @@ class PlotsFile(object): The colors generated are based upon cell/material IDs in the geometry. The color schemes will be consistent for all plots in "plots.xml". - Params - ------ + Parameters + ---------- geometry : openmc.Geometry The geometry for which the plots are defined seed : Integral From 0c7d58457e2738c1373c1e9747462434721c68fe Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Wed, 18 Nov 2015 11:04:09 -0500 Subject: [PATCH 09/13] Now using American English for gray (not grey) in alpha transparency --- openmc/plots.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openmc/plots.py b/openmc/plots.py index e0237f525d..0f12c8a93a 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -298,7 +298,7 @@ class Plot(object): self.col_spec[domain] = (r, g, b) def highlight_domains(self, geometry, domains, seed=1, - alpha=0.5, background='grey'): + alpha=0.5, background='gray'): """Use alpha compositing to highlight one or more domains in the plot. This routine generates a color scheme and applies alpha compositing @@ -314,7 +314,7 @@ class Plot(object): The random number seed used to generate the color scheme alpha : Real in [0,1] The value to apply in alpha compisiting - background : 3-tuple of Integral or 'white' or 'black' or 'grey' + background : 3-tuple of Integral or 'white' or 'black' or 'gray' The background color to apply in alpha compisiting """ @@ -330,7 +330,7 @@ class Plot(object): background = (255, 255, 255) elif background == 'black': background = (0, 0, 0) - elif background == 'grey': + elif background == 'gray': background = (160, 160, 160) else: msg = 'The background "{}" is not defined'.format(background) @@ -460,7 +460,7 @@ class PlotsFile(object): def highlight_domains(self, geometry, domains, seed=1, - alpha=0.5, background='grey'): + alpha=0.5, background='gray'): """Use alpha compositing to highlight one or more domains in the plot. This routine generates a color scheme and applies alpha compositing @@ -476,7 +476,7 @@ class PlotsFile(object): The random number seed used to generate the color scheme alpha : Real in [0,1] The value to apply in alpha compisiting - background : 3-tuple of Integral or 'white' or 'black' or 'grey' + background : 3-tuple of Integral or 'white' or 'black' or 'gray' The background color to apply in alpha compisiting """ From 7abbee6df69a0c50e4167b07f3173a31c258a820 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Wed, 18 Nov 2015 11:05:10 -0500 Subject: [PATCH 10/13] Revised docstring Params -> Parameters for alpha transparency --- openmc/plots.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openmc/plots.py b/openmc/plots.py index 0f12c8a93a..636ca225cb 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -302,10 +302,11 @@ class Plot(object): """Use alpha compositing to highlight one or more domains in the plot. This routine generates a color scheme and applies alpha compositing - to make all domains except the highlighted ones partially transparent. + to make all domains except the highlighted ones appear partially + transparent. - Params - ------ + Parameters + ---------- geometry : openmc.Geometry The geometry for which the plot is defined domains : Iterable of Integral @@ -466,8 +467,8 @@ class PlotsFile(object): This routine generates a color scheme and applies alpha compositing to make all domains except the highlighted ones partially transparent. - Params - ------ + Parameters + ---------- geometry : openmc.Geometry The geometry for which the plot is defined domains : Iterable of Integral From cfe1f1dfcd420bc235432c3edef5848e45f6076f Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Wed, 18 Nov 2015 11:10:31 -0500 Subject: [PATCH 11/13] Added check to MGXS Library domains setter to compare with domains in geometry --- openmc/mgxs/library.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index ee9ffc4fa3..9def79eeb2 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -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 From 9e4cd5ae2b0c6d437efb6b574c703f41eaf40882 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Wed, 18 Nov 2015 11:57:36 -0500 Subject: [PATCH 12/13] Fixed typo in error checking in MGXS Library domains setter per comment by @nelsonag --- openmc/mgxs/library.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 9def79eeb2..87c6665b2d 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -255,7 +255,8 @@ class Library(object): # 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' + msg = 'Domain "{}" could not be found in the ' \ + 'geometry.'.format(domain) raise ValueError(msg) self._domains = domains From a592f2ad1501aa8cb8c7f4e813ea335628ab70e0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Nov 2015 07:16:48 -0600 Subject: [PATCH 13/13] Extend length of string for reading region specification to 1000 --- src/input_xml.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index ae01b0b5cc..5449b169dd 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -994,7 +994,7 @@ contains logical :: boundary_exists character(MAX_LINE_LEN) :: filename character(MAX_WORD_LEN) :: word - character(MAX_LINE_LEN) :: region_spec + character(1000) :: region_spec type(Cell), pointer :: c class(Surface), pointer :: s class(Lattice), pointer :: lat