picongpu.pypicongpu.species.util.element

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

Classes

Element

Denotes an element from the periodic table of elements

Module Contents

class picongpu.pypicongpu.species.util.element.Element(openpmd_name: str)

Bases: picongpu.pypicongpu.rendering.RenderedObject, pydantic.BaseModel

Inheritance diagram of picongpu.pypicongpu.species.util.element.Element

Denotes an element from the periodic table of elements

Used to provide fundamental constants for elements, and to map them in a type-safe way to PIConGPU.

The number associated is just an id. Note: Spelling follows periodic table, e.g. “Na”, “C”, “He” + typical nuclear variations

Note that these denote Elements, but when initialized in a species only describe the core, i.e. without electrons. To describe atoms/ions you also need to initialize the charge_state of the species.

static parse_openpmd_isotopes(openpmd_name: str) tuple[int | None, str]
static is_element(openpmd_name: str) bool

does openpmd_name describe an element?

get_picongpu_name() str

get name as used in PIConGPU

Used for type name lookups

get_mass_si() float

Get mass of an individual particle

Calculated based of “conventional atomic weight” from the periodic table of elements

Returns:

mass in kg

get_charge_si() float

Get charge of an individual particle without electrons

Calculated from atomic number, applies with no electrons present.

Returns:

charge in C

get_atomic_number() int
get_symbol() str

get symbol

__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