picongpu.pypicongpu.species.constant

Submodules

Package Contents

Classes

Constant

unmodifiable property of a species

Mass

mass of a physical particle

Charge

charge of a physical particle

DensityRatio

factor for weighting when using profiles/deriving

Ionizers

ionizers describing the ionization methods

ElementProperties

represents constants associated to a chemical element

class picongpu.pypicongpu.species.constant.Constant

Bases: picongpu.pypicongpu.rendering.RenderedObject

Inheritance diagram of picongpu.pypicongpu.species.constant.Constant

unmodifiable property of a species

Equal for all macroparticles, e.g. mass, charge, ionization levels etc. Owned by exactly one species.

PIConGPU term: “particle flags”

Parent class for actual SpeciesConstants

A Constant can have the following dependencies:

  • species objects

    • dependency species must be available for the init manager

    • code for dependency species will be generated before the code for this species

  • attributes (types)

    • dependency attributes must be generated by any property on the species with this constant

    • there are no further checks employed, the constant is never shown the concrete attribute object of its species

  • constants (types)

    • dependency constants must be present before the initmanager performs any actions

    • checks on the value of constants are not possible, only if a constant of a given type is present

    • (the concrete constant that is being checked is never passed to this constant)

abstract check() None

ensure validity of self

If ok passes silently, else raises. Intendend to check for invalid value (ranges), perhaps types etc.

Must be overwritten in child implementation.

abstract get_species_dependencies() List

get dependencies for definition

Returns a list of species which this flags requires being present. Mainly intended for ionization flags, i.e. should typically return [].

abstract get_attribute_dependencies() List[type]

get required attributes (during execution)

During execution some constants require an attribute to be present, e.g. the pusher required the Momentum attribute

This method returns a list of attribute types which it requires on its species.

abstract get_constant_dependencies() List[type]

get required constants (during execution)

Some constants (e.g. those selecting algorithms) may require other constants to be present.

This method returns the types of constants that must be present for this constant to be valid. Checking the value of these dependency constants is NOT possible.

Dependencies between constants MAY be circular. Rationale: Only presence of constants is checked, a reordering (as for inter-species-dependencies) is not performed, hence circular dependencies between constants can be handled.

However, as self-references do not make sense (theoretically speaking are always true), they are considered a programmer error and therefore self-references are NOT allowed.

This has no influence on the order of code generation.

get_rendering_context() dict

get rendering context representation of this object

delegates work to _get_serialized and invokes checks performed by check_context_for_type(). :raise ValidationError: on schema violiation :raise RuntimeError: on schema not found :return: self as rendering context

static check_context_for_type(type_to_check: type, context: dict) None

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violiation

  • RuntimeError – on schema not found

class picongpu.pypicongpu.species.constant.Mass

Bases: picongpu.pypicongpu.species.constant.constant.Constant

Inheritance diagram of picongpu.pypicongpu.species.constant.Mass

mass of a physical particle

mass_si

mass in kg of an individual particle

check() None

ensure validity of self

If ok passes silently, else raises. Intendend to check for invalid value (ranges), perhaps types etc.

Must be overwritten in child implementation.

get_species_dependencies()

get dependencies for definition

Returns a list of species which this flags requires being present. Mainly intended for ionization flags, i.e. should typically return [].

get_attribute_dependencies() List[type]

get required attributes (during execution)

During execution some constants require an attribute to be present, e.g. the pusher required the Momentum attribute

This method returns a list of attribute types which it requires on its species.

get_constant_dependencies() List[type]

get required constants (during execution)

Some constants (e.g. those selecting algorithms) may require other constants to be present.

This method returns the types of constants that must be present for this constant to be valid. Checking the value of these dependency constants is NOT possible.

Dependencies between constants MAY be circular. Rationale: Only presence of constants is checked, a reordering (as for inter-species-dependencies) is not performed, hence circular dependencies between constants can be handled.

However, as self-references do not make sense (theoretically speaking are always true), they are considered a programmer error and therefore self-references are NOT allowed.

This has no influence on the order of code generation.

get_rendering_context() dict

get rendering context representation of this object

delegates work to _get_serialized and invokes checks performed by check_context_for_type(). :raise ValidationError: on schema violiation :raise RuntimeError: on schema not found :return: self as rendering context

static check_context_for_type(type_to_check: type, context: dict) None

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violiation

  • RuntimeError – on schema not found

class picongpu.pypicongpu.species.constant.Charge

Bases: picongpu.pypicongpu.species.constant.constant.Constant

Inheritance diagram of picongpu.pypicongpu.species.constant.Charge

charge of a physical particle

charge_si

charge in C of an individual particle

check() None

ensure validity of self

If ok passes silently, else raises. Intendend to check for invalid value (ranges), perhaps types etc.

Must be overwritten in child implementation.

get_species_dependencies()

get dependencies for definition

Returns a list of species which this flags requires being present. Mainly intended for ionization flags, i.e. should typically return [].

get_attribute_dependencies() List[type]

get required attributes (during execution)

During execution some constants require an attribute to be present, e.g. the pusher required the Momentum attribute

This method returns a list of attribute types which it requires on its species.

get_constant_dependencies() List[type]

get required constants (during execution)

Some constants (e.g. those selecting algorithms) may require other constants to be present.

This method returns the types of constants that must be present for this constant to be valid. Checking the value of these dependency constants is NOT possible.

Dependencies between constants MAY be circular. Rationale: Only presence of constants is checked, a reordering (as for inter-species-dependencies) is not performed, hence circular dependencies between constants can be handled.

However, as self-references do not make sense (theoretically speaking are always true), they are considered a programmer error and therefore self-references are NOT allowed.

This has no influence on the order of code generation.

get_rendering_context() dict

get rendering context representation of this object

delegates work to _get_serialized and invokes checks performed by check_context_for_type(). :raise ValidationError: on schema violiation :raise RuntimeError: on schema not found :return: self as rendering context

static check_context_for_type(type_to_check: type, context: dict) None

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violiation

  • RuntimeError – on schema not found

class picongpu.pypicongpu.species.constant.DensityRatio

Bases: picongpu.pypicongpu.species.constant.constant.Constant

Inheritance diagram of picongpu.pypicongpu.species.constant.DensityRatio

factor for weighting when using profiles/deriving

ratio

factor for weighting calculation

check() None

ensure validity of self

If ok passes silently, else raises. Intendend to check for invalid value (ranges), perhaps types etc.

Must be overwritten in child implementation.

get_species_dependencies()

get dependencies for definition

Returns a list of species which this flags requires being present. Mainly intended for ionization flags, i.e. should typically return [].

get_attribute_dependencies() List[type]

get required attributes (during execution)

During execution some constants require an attribute to be present, e.g. the pusher required the Momentum attribute

This method returns a list of attribute types which it requires on its species.

get_constant_dependencies() List[type]

get required constants (during execution)

Some constants (e.g. those selecting algorithms) may require other constants to be present.

This method returns the types of constants that must be present for this constant to be valid. Checking the value of these dependency constants is NOT possible.

Dependencies between constants MAY be circular. Rationale: Only presence of constants is checked, a reordering (as for inter-species-dependencies) is not performed, hence circular dependencies between constants can be handled.

However, as self-references do not make sense (theoretically speaking are always true), they are considered a programmer error and therefore self-references are NOT allowed.

This has no influence on the order of code generation.

get_rendering_context() dict

get rendering context representation of this object

delegates work to _get_serialized and invokes checks performed by check_context_for_type(). :raise ValidationError: on schema violiation :raise RuntimeError: on schema not found :return: self as rendering context

static check_context_for_type(type_to_check: type, context: dict) None

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violiation

  • RuntimeError – on schema not found

class picongpu.pypicongpu.species.constant.Ionizers

Bases: picongpu.pypicongpu.species.constant.constant.Constant

Inheritance diagram of picongpu.pypicongpu.species.constant.Ionizers

ionizers describing the ionization methods

Currently the selected ionizers are fixed by the code generation. When they are selectable by the user, they can be added here.

electron_species

species to be used as electrons

check() None

ensure validity of self

If ok passes silently, else raises. Intendend to check for invalid value (ranges), perhaps types etc.

Must be overwritten in child implementation.

get_species_dependencies()

get dependencies for definition

Returns a list of species which this flags requires being present. Mainly intended for ionization flags, i.e. should typically return [].

get_attribute_dependencies() List[type]

get required attributes (during execution)

During execution some constants require an attribute to be present, e.g. the pusher required the Momentum attribute

This method returns a list of attribute types which it requires on its species.

get_constant_dependencies() List[type]

get required constants (during execution)

Some constants (e.g. those selecting algorithms) may require other constants to be present.

This method returns the types of constants that must be present for this constant to be valid. Checking the value of these dependency constants is NOT possible.

Dependencies between constants MAY be circular. Rationale: Only presence of constants is checked, a reordering (as for inter-species-dependencies) is not performed, hence circular dependencies between constants can be handled.

However, as self-references do not make sense (theoretically speaking are always true), they are considered a programmer error and therefore self-references are NOT allowed.

This has no influence on the order of code generation.

get_rendering_context() dict

get rendering context representation of this object

delegates work to _get_serialized and invokes checks performed by check_context_for_type(). :raise ValidationError: on schema violiation :raise RuntimeError: on schema not found :return: self as rendering context

static check_context_for_type(type_to_check: type, context: dict) None

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violiation

  • RuntimeError – on schema not found

class picongpu.pypicongpu.species.constant.ElementProperties

Bases: picongpu.pypicongpu.species.constant.constant.Constant

Inheritance diagram of picongpu.pypicongpu.species.constant.ElementProperties

represents constants associated to a chemical element

Produces PIConGPU atomic number and ionization energies.

Note: Not necessarily all of the generated properties will be required during runtime. However, this is left to the compiler to optimize (which is a core concept of PIConGPU).

element

represented chemical element

check()

ensure validity of self

If ok passes silently, else raises. Intendend to check for invalid value (ranges), perhaps types etc.

Must be overwritten in child implementation.

get_species_dependencies()

get dependencies for definition

Returns a list of species which this flags requires being present. Mainly intended for ionization flags, i.e. should typically return [].

get_attribute_dependencies() List[type]

get required attributes (during execution)

During execution some constants require an attribute to be present, e.g. the pusher required the Momentum attribute

This method returns a list of attribute types which it requires on its species.

get_constant_dependencies() List[type]

get required constants (during execution)

Some constants (e.g. those selecting algorithms) may require other constants to be present.

This method returns the types of constants that must be present for this constant to be valid. Checking the value of these dependency constants is NOT possible.

Dependencies between constants MAY be circular. Rationale: Only presence of constants is checked, a reordering (as for inter-species-dependencies) is not performed, hence circular dependencies between constants can be handled.

However, as self-references do not make sense (theoretically speaking are always true), they are considered a programmer error and therefore self-references are NOT allowed.

This has no influence on the order of code generation.

get_rendering_context() dict

get rendering context representation of this object

delegates work to _get_serialized and invokes checks performed by check_context_for_type(). :raise ValidationError: on schema violiation :raise RuntimeError: on schema not found :return: self as rendering context

static check_context_for_type(type_to_check: type, context: dict) None

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violiation

  • RuntimeError – on schema not found