Manager Class¶
- class plask.Manager(materials=None, draft=False)¶
Main input manager.
Object of this class provides methods to read the XML file and fetch geometry objects, paths, meshes, and generators by name. It also allows to access solvers defined in the XPL file.
Some global PLaSK function like
loadxpl()
orrunxpl()
create a default manager and use it to load the data from XPL into the global namespace.- Parameters:
draft (bool) – If True then partially incomplete XML is accepted (e.g. non-existent materials are allowed).
Methods¶
|
Export loaded objects into a target dictionary. |
|
Load data from source. |
Attributes¶
Local defines. |
|
Flag indicating draft mode. |
|
List of errors that occurred during loading in draft mode. |
|
Dictionary of all named geometries and geometry objects. |
|
Dictionary of all named meshes and generators. |
|
Dictionary of all named meshes and generators. |
|
Overridden local defines. |
|
Dictionary of all named paths. |
|
Script read from XML file. |
|
Dictionary of all named solvers. |
Descriptions¶
Method Details¶
- Manager.export(target)¶
Export loaded objects into a target dictionary.
All the loaded solvers are exported with keys equal to their names and the other objects under the following keys:
- Manager.load(source, defs={}, sections=None)¶
Load data from source.
- Parameters:
source (string or file) – File to read. The value of this argument can be either a file name, an open file object, or an XML string to read.
defs (dict) – Dictionary of user-defined variables (which string keys). The values of this dictionary overrides the ones given in the
<defines>
section of the XPL file.sections (list) – List of section to read. If this parameter is given, only the listed sections of the XPL file are read and the other ones are skipped.
Attribute Details¶
- Manager.defs = <property object>¶
Local defines.
This is a combination of the values specified in the
<defines>
section of the XPL file and the ones specified by the user in theload()
method.
- Manager.draft = <property object>¶
Flag indicating draft mode. If True then dummy material is created if the proper one cannot be found in the database. Also some objects do not need to have all the attributes set, which are then filled with some reasonable defaults.Otherwise an exception is raised.
- Manager.errors = <property object>¶
List of errors that occurred during loading in draft mode.
- Manager.geo = <property object>¶
Dictionary of all named geometries and geometry objects.
- Manager.msg = <property object>¶
Dictionary of all named meshes and generators.
- Manager.msh = <property object>¶
Dictionary of all named meshes and generators.
- Manager.overrites = <property object>¶
Overridden local defines.
This is a list of local defines that have been overridden in a
plask
command line or specified as avars
argument to theload()
method.
- Manager.pth = <property object>¶
Dictionary of all named paths.
- Manager.script = <property object>¶
Script read from XML file.
- Manager.solvers = <property object>¶
Dictionary of all named solvers.