picongpu.pypicongpu.species.species

This file is part of the PIConGPU. Copyright 2021-2023 PIConGPU contributors Authors: Hannes Troepgen, Brian Edward Marre License: GPLv3+

Module Contents

Classes

Species

PyPIConGPU species definition

class picongpu.pypicongpu.species.species.Species

Bases: picongpu.pypicongpu.rendering.RenderedObject

Inheritance diagram of picongpu.pypicongpu.species.species.Species

PyPIConGPU species definition

A “species” is a set of particles, which is defined by:

  • A set of species constants (mass, charge, etc.),

  • a set of species attributes (position, number of bound electrons), and

  • a set of operations which collectively initialize these attributes, where one attribute is initializated by exactly one operation.

  • (and a name)

Note that some of the species attributes or constants are considered mandatory. Each species constant or attribute may only be defined once.

constants

PIConGPU particle flags

attributes

PIConGPU particle attributes

name

name of the species

get_cxx_typename() str

get (standalone) C++ name for this species

check() None

sanity-check self, if ok pass silently

Ensure that:

  • species has valid name

  • constants have unique types

  • attributes have unique types

get_constant_by_type(needle_type: Type[picongpu.pypicongpu.species.constant.Constant]) picongpu.pypicongpu.species.constant.Constant

retrieve constant of given type, raise if not found

Searches through constants of this species and returns the constant of the given type if found. If no constant of this type is found, an error is raised.

Parameters:

needle_type – constant type to look for

Raises:

RuntimeError – on failure to find constant of given type

Returns:

constant of given type

has_constant_of_type(needle_type: Type[picongpu.pypicongpu.species.constant.Constant]) bool

lookup if constant of given type is present

Searches through constants of this species and returns true iff a constant of the given type is present.

Parameters:

needle_type – constant type to look for

Returns:

whether constant of needle_type exists

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