picongpu.pypicongpu.species.constant

Submodules

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

ElementProperties

represents constants associated to a chemical element

GroundStateIonization

unmodifiable property of a species

Package Contents

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)

__eq__(other) bool

two constants are equal if they have the same attributes values

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.

__hash__()

custom hash function for indexing in dicts

get_rendering_context() dict | None

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 violation :raise RuntimeError: on schema not found :return: self as rendering context

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

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violation

  • 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.

__eq__(other) bool

two constants are equal if they have the same attributes values

__hash__()

custom hash function for indexing in dicts

get_rendering_context() dict | None

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 violation :raise RuntimeError: on schema not found :return: self as rendering context

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

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violation

  • 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.

__eq__(other) bool

two constants are equal if they have the same attributes values

__hash__()

custom hash function for indexing in dicts

get_rendering_context() dict | None

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 violation :raise RuntimeError: on schema not found :return: self as rendering context

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

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violation

  • 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.

__eq__(other) bool

two constants are equal if they have the same attributes values

__hash__()

custom hash function for indexing in dicts

get_rendering_context() dict | None

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 violation :raise RuntimeError: on schema not found :return: self as rendering context

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

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violation

  • 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.

__eq__(other) bool

two constants are equal if they have the same attributes values

__hash__()

custom hash function for indexing in dicts

get_rendering_context() dict | None

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 violation :raise RuntimeError: on schema not found :return: self as rendering context

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

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violation

  • RuntimeError – on schema not found

class picongpu.pypicongpu.species.constant.GroundStateIonization

Bases: picongpu.pypicongpu.species.constant.constant.Constant, pydantic.BaseModel

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

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)

ionization_model_list: list[picongpu.pypicongpu.species.constant.ionizationmodel.IonizationModel]

list of ground state only ionization models to apply for the species

get()
__hash__() int

custom hash function for indexing in dicts

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() list[type]

get all species one of the ionization models in ionization_model_list depends on

get_attribute_dependencies() list[type]

get all attributes one of the ionization models in ionization_model_list depends on

get_constant_dependencies() list[type]

get all constants one of the ionization models in ionization_model_list depends on

__eq__(other) bool

two constants are equal if they have the same attributes values

get_rendering_context() dict | None

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 violation :raise RuntimeError: on schema not found :return: self as rendering context

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

check if the given context is valid for the given type

Raises on error, passes silently if okay.

Raises:
  • ValidationError – on schema violation

  • RuntimeError – on schema not found