Bases: object
Constructor of an element. Once set the symbol cannot be changed.
Parameters: |
|
---|
Atomic number of the symbol.
Weight fraction of the element between 0.0 and 1.0. The fraction can be set as a wildcard (see WILDCARD_FRACTION). The fraction will then be calculated based on all the defined elements.
Creates a Element from a XML element.
Parameters: | element – XML element |
---|
Returns whether the fraction is set as the WILDCARD_FRACTION.
Mass density in g/cm3. The value is stored in a magnitude.Magnitude.
Symbol of the element.
Returns a HTML representation of this option.
Returns a XML representation of this option.
Bases: dict, misctools.base.Validable
Store the elements and their weight fraction for a material in a dictionary.
The keys corresponds to the symbols and the values to the Element objects.
Adds a new element by defining the symbol and fraction. If the symbol of the new object Element already exists, the new object will overwrite the previous one.
Adds a new element from a Element object. If the symbol of the new object element already exists, the new object will overwrite the previous one.
Parameters: | element (Element) – element object |
---|
Return a dictionary containing the atomic fraction of each symbol.
Return type: | dict |
---|
Return a list of tuples containing the element’s atomic number and atomic fraction.
Return type: | list |
---|
Return a list of tuples containing the element’s atomic number and weight fraction.
Return type: | list |
---|
Returns the chemical formula from these elements.
Returns the density in g per cm3. If a user density is defined, it is return. If not, the mean mass density is calculated.
The value is stored in a magnitude.Magnitude.
Parameters: | precision – precision of the comparison () |
---|
Creates a Elements from a single element. The fraction is set to 1.0.
Parameters: | symbol – symbol of the element. |
---|
Creates a Elements from a list of (symbol, weightFraction).
Parameters: | symbol_weightfraction_list (list) – list of tuple containing the symbol and weight fraction |
---|
Creates a Elements from a XML element.
Parameters: | element – XML element |
---|
Returns whether one of the element has a wildcard fraction.
Returns the mean mass density in g per cm3:
The value is stored in a magnitude.Magnitude.
Not implemented.
Return a list of tuples containing the element’s symbol and atomic fraction.
Return type: | list |
---|
Return a list of tuples containing the element’s symbol and weight fraction.
Return type: | list |
---|
Returns a HTML representation of this option.
Returns a XML representation of this option.
Returns the total fraction of all the elements
Return type: | float |
---|
Not implemented.
The user defined density in g per cm3. None is returned if no density is defined. If the attribute is deleted, the user defined density is ignored and the calculated density from the elements if used.
The value is stored in a magnitude.Magnitude.
Validates the elements. At least one element must be defined, and the total fraction must be equal to 1.0. Raises ValueError
Bases: misctools.base.Validable
Constructor of an material. The material contains the elements and simulation parameters associated with the material.
Parameters: |
|
---|
Elements of the material.
Filename of the material file.
Creates a Material from lines of a IN file.
Parameters: | lines – lines |
---|
Creates a Material from a XML element.
Parameters: | element – XML element |
---|
Name of the material.
Simulation parameters associated with the material.
Returns a HTML representation of this option.
Returns the lines of this option to create a IN file.
Returns a XML representation of this option.
Bases: dict, penelopetools.api.input.penelope.option.Option
Store the materials of a simulation job.
Each material is given an id representing its unique address in memory. This is referred as the id of the material. The number of material is controlled not to exceed the limits. The index represents the integer representing each material in PENELOPE.
Adds a material and returns its id. Raises MaximumMaterialsError if the number of materials exceeds the maximum number allowed by PENELOPE.
Parameters: |
|
---|
Adds multiple material. An id is automatically assigned to each of them. A tuple of the ids for materials is returned. Raises MaximumMaterialsError if the number of materials exceeds the maximum number allowed by PENELOPE.
Sets the simulation parameters to all the materials.
Parameters: | params (SimulationParameters) – simulation parameters |
---|
Removes all the materials (except the vacuum).
Creates a Materials from lines of a IN file.
Parameters: | lines – lines |
---|
Creates a Materials from a XML element.
Parameters: | element – XML element |
---|
Returns a list linking the id to the index for PENELOPE. The Vacuum material is add to the list. It’s id and index are both equal to 0. The first index is equal to 1.
Note
This list is dynamic and will changing depending on the materials added. In other words, the index for a particular id is not static.
Removes a material.
Not implemented.
Returns a HTML representation of this option.
Returns the lines of this option to create a IN file.
Returns a XML representation of this option.
Not implemented.
Validates every material and checks that at least one material is defined. Raises ValueError.
Returns the materials without the vacuum.
Return type: | list |
---|
Bases: exceptions.Exception
Exception raised when trying to add a material passed the maximum.
Bases: object
Store the simulation parameters for a given material.
Parameters: |
|
---|
Absorption energy of the electrons. Below this energy, electrons are no longer simulated. The energy must be between 50 and 1e6 eV. The value is stored in a magnitude.Magnitude.
Absorption energy of the photons. Below this energy, photons are no longer simulated. The energy must be between 50 and 1e6 eV. The value is stored in a magnitude.Magnitude.
Absorption energy of the positrons. Below this energy, positrons are no longer simulated. The energy must be between 50 and 1e6 eV. The value is stored in a magnitude.Magnitude.
Cutoff energy loss for bremsstrahlung emission. The energy must be between 50 and 1e6 eV. The value is stored in a magnitude.Magnitude.
Cutoff energy loss for inelastic collisions. The energy must be between 50 and 1e6 eV. The value is stored in a magnitude.Magnitude.
Elastic scattering parameter C1. The value must be between 0.0 and 0.2. The value is stored in a magnitude.Magnitude.
Elastic scattering parameter C2. The value must be between 0.0 and 0.2. The value is stored in a magnitude.Magnitude.
Creates a SimulationParameters from lines of a IN file.
Parameters: | lines – lines |
---|
Creates a SimulationParameters from a XML element.
Parameters: | element – XML element |
---|
Returns a HTML representation of this option.
Returns the lines of this option to create a IN file.
Returns a XML representation of this option.
Bases: penelopetools.api.input.penelope.materials.Material
Material representing the vacuum.