pyPENELOPE

interactionforcings – Interaction forcings

Inheritance diagram of penelopetools.api.input.penepma.interactionforcings

class penelopetools.api.input.penepma.interactionforcings.Collisions(particle_type)

Bases: object

Structure for the particle_type of collisions for each primary particle.

Parameters:particle_type – particle_type of particle (use ELECTRON, PHOTON or POSITRON)
Particle_type particle_type:
 int

Examples:

>>> collisionType = CollisionTypes().HARD_ELASTIC_COLLISION
>>> print collisionType
>>> 2
possible_collisions

Returns all the possible collisions for the primary particle.

Return type:dict
class penelopetools.api.input.penepma.interactionforcings.InteractionForcing(module_id, particle, collision, forcer=-1, weightlow=0.1, weighthigh=1.0)

Bases: object

Constructor of an interaction forcing for a given body, particle and type of collision.

Parameters:
  • module_id (int) – id of the body/module
  • particle (int) – type of particle (use ELECTRON, PHOTON or POSITRON)
  • collision (int) – type of collisions (see CollisionTypes)
  • forcer – forcing factor (default=-1)
  • weightlow – lower limit of the weight window where interaction is applied (default=0.1)
  • weighthigh – upper limit of the weight window where interaction is applied (default=1.0)
ATTR_COLLISION = 'collision'
ATTR_FORCER = 'forcer'
ATTR_MODULE_ID = 'moduleId'
ATTR_PARTICLE = 'particle'
ATTR_WEIGHTHIGH = 'weightHigh'
ATTR_WEIGHTLOW = 'weightLow'
KEYWORD = <penelopetools.api.input.penelope.util.Keyword object at 0x63d7d50>
TAG_NAME = 'interactionForcing'
collision

Type of collision. A value between 1 and 8. See Collisions for the definitions.

forcer

Forcing value. If negative the foring value is adjusted based on the interaction volume. The value is stored in a magnitude.Magnitude.

classmethod from_inputfile(lines)

Creates a InteractionForcing from lines of a IN file.

Parameters:lines – lines
classmethod from_xml(element)

Creates a InteractionForcing from a XML element.

Parameters:element – XML element
module_id

Id of the body/module. The id must be greater or equal to 1.

particle

Type of particle. The particle can either be a ELECTRON, PHOTON or POSITRON.

to_html(header_level=1)

Returns a HTML representation of this option.

to_inputfile()

Returns the lines of this option to create a IN file.

to_xml()

Returns a XML representation of this option.

validate()

Validates the interaction forcing to check if the upper limit is greater than the lower limit. Raises ValueError

weighthigh

Upper limit of the weighting factor of the interaction forcing. The value must be between 0.0 and 1.0. The value is stored in a magnitude.Magnitude.

weightlow

Lower limit of the weighting factor of the interaction forcing. The value must be between 0.0 and 1.0. The value is stored in a magnitude.Magnitude.

class penelopetools.api.input.penepma.interactionforcings.InteractionForcings(data=[])

Bases: list, penelopetools.api.input.penelope.option.Option

Store the interaction forcings of a simulation job in a list object.

Parameters:data (list) – list of InteractionForcing.InteractionForcing
TAG_NAME = 'interactionForcings'
append(value)

Appends an InteractionForcing to the list of interactionForcings.

clear()

Removes all the interaction forcings from the list.

extend(values)

Extends the list of interaction forcings by another list of interaction forcings.

classmethod from_inputfile(lines)

Creates a InteractionForcings from lines of a IN file.

Parameters:lines – lines
classmethod from_xml(root)

Creates a InteractionForcings from a XML element.

Parameters:element – XML element
insert(index, value)

Inserts an interaction forcing at index.

to_html(header_level=1)

Returns a HTML representation of this option.

to_inputfile()

Returns the lines of this option to create a IN file.

to_xml()

Returns a XML representation of this option.

validate()

Validates every interaction forcing in the list. Raises: ValueError

penelopetools.api.input.penepma.interactionforcings.apply_on_all_modules(geometry, interactionforcings)

Applies a set of interaction forcings interactionforcings to all modules in the geometry.

The interaction forcings in the given set are duplicated for each module.

Parameters:
  • geometry (Geometry) – options of the geometry
  • interactionforcings (InteractionForcings) – set of interaction forcings defined for one module
Return type:

InteractionForcings