mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Added colorize routine to PlotsFile
This commit is contained in:
parent
698dba369b
commit
64a7cd9607
1 changed files with 19 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue