3.1.2.6. opengate.engines
¶
3.1.2.6.1. Module Contents¶
3.1.2.6.1.1. Classes¶
Base class for all engines (SimulationEngine, VolumeEngine, etc.) |
|
Source Engine manages the G4 objects of sources at runtime |
|
Class that contains all the information and mechanism regarding physics |
|
Main object to manage all actions during a simulation. |
|
This object manages all actors G4 objects at runtime |
|
FIXME: Doc ParallelWorldEngine |
|
Engine that will create all G4 elements for the hierarchy of volumes. |
|
Main class to manage visualisation |
|
FIXME |
|
Main class to execute a Simulation (optionally in a separate subProcess) |
3.1.2.6.1.2. Functions¶
|
|
|
- class opengate.engines.EngineBase(simulation_engine)[source]¶
Base class for all engines (SimulationEngine, VolumeEngine, etc.)
- class opengate.engines.SourceEngine(simulation_engine)[source]¶
Bases:
EngineBase
Source Engine manages the G4 objects of sources at runtime
- initialize_actors(actors)[source]¶
3.1.2.6. Parameters¶
- actorsdict
The dictionary ActorEngine.actors which contains key-value pairs “actor_name” : “Actor object”
- class opengate.engines.PhysicsEngine(*args)[source]¶
Bases:
EngineBase
Class that contains all the information and mechanism regarding physics to actually run a simulation. It is associated with a simulation engine.
- close_physics_constructors()[source]¶
This method removes PhysicsConstructors defined in python from the physics list.
It should be called after a simulation run, i.e. when a simulation engine closes, because the RunManager will otherwise attempt to delete the PhysicsConstructor and cause a segfault.
- class opengate.engines.ActionEngine(simulation_engine)[source]¶
Bases:
opengate_core.G4VUserActionInitialization
,EngineBase
Main object to manage all actions during a simulation.
- class opengate.engines.ActorEngine(simulation_engine)[source]¶
Bases:
EngineBase
This object manages all actors G4 objects at runtime
- class opengate.engines.ParallelWorldEngine(parallel_world_name, *args)[source]¶
Bases:
opengate_core.G4VUserParallelWorld
,EngineBase
FIXME: Doc ParallelWorldEngine
- class opengate.engines.VolumeEngine(simulation_engine)[source]¶
Bases:
opengate_core.G4VUserDetectorConstruction
,EngineBase
Engine that will create all G4 elements for the hierarchy of volumes. Correspond to the G4VUserDetectorConstruction (inherit) Also manage the list of parallel worlds.
- class opengate.engines.VisualisationEngine(simulation_engine)[source]¶
Bases:
EngineBase
Main class to manage visualisation
- class opengate.engines.SimulationEngine(simulation, new_process=False)[source]¶
Main class to execute a Simulation (optionally in a separate subProcess)
- run_engine()[source]¶
When the simulation is about to init, if the Simulation object is in a separate process (with ‘spawn’), it has been pickled (copied) and the G4 phys list classes does not exist anymore, so we need to recreate them with ‘create_physics_list_classes’ Also, the StateManager must be recreated.
NK: Yes, but not this way. Each class should take care of recreating attributes which where set to None during pickling by implementing a __setstate__ method. Implementing the resetting somewhere else (maybe in multiple places…) in the code will make it very difficult to maintain.
-> removed the lines and implemented __setstate__ methods for the classes in question