picongpu.pypicongpu.species.initmanager
This file is part of the PIConGPU. Copyright 2021-2023 PIConGPU contributors Authors: Hannes Troepgen, Brian Edward Marre License: GPLv3+
Module Contents
Classes
Helper to manage species translation to PIConGPU |
- class picongpu.pypicongpu.species.initmanager.InitManager
Bases:
picongpu.pypicongpu.rendering.RenderedObject
Helper to manage species translation to PIConGPU
Collects all species to be initialized and the operations initializing them.
Invokes the methods of the Operation lifecycle (check, prebook, bake).
Workflow:
Fill InitManager (from outside) with
Species and their constants (no attributes!)
Operations, fully initialized (all params set)
invoke InitManager.bake(), which
checks the Species for conflicts (name…)
performs dependency checks, possibly reorders species
invokes the Operation lifecycle (check, prebook, bake)
sanity-checks the results
retrieve rendering context
organizes operations into lists
- Note: The InitManager manages a lifecycle, it does not perform deep checks
-> most errors have to be caught by delegated checks.
- all_species
all species to be initialized
- all_operations
all species to be initialized
- bake() None
apply operations to species
- get_typical_particle_per_cell() int
get typical number of macro particles per cell(ppc) of simulation
@returns middle value of ppc-range of all operations, minimum 1
- 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