pogona.SceneManager

class pogona.SceneManager[source]

Bases: pogona.component.Component

Attributes

component_name

Since this component is not created by the config, choose a name

__init__()[source]

Methods

__init__()

add_interconnection(sensor_teleporting)

Called by SensorTeleporting to register itself.

add_object(object_to_add)

construct_from_config(filename, ...[, ...])

Set up the basic scene from a YAML configuration file (possibly created with the MaMoKo Blender Add-on).

finalize(simulation_kernel)

get_all_objects()

get_closest_cell_centre_id(object_id, ...)

returns

Array of closest cell centers to position.

get_flow_by_position(simulation_kernel, ...)

get_inlets(object_id)

get_outlets(object_id)

initialize(simulation_kernel, init_stage)

Use InitStages to initialize this Component instance.

plot_to_csv(filename)

process_changed_outlet_flow_rate(...)

process_new_time_step(simulation_kernel, ...)

set_arguments(**kwargs)

Read arguments as key value pairs and set this component's member variables accordingly.

__init__()[source]
add_interconnection(sensor_teleporting: pogona.sensor_teleporting.SensorTeleporting)[source]

Called by SensorTeleporting to register itself.

add_object(object_to_add: pogona.object.Object)[source]
static construct_from_config(filename: str, openfoam_cases_path: str, additional_component_classes: Optional[Dict[str, Type[Any]]] = None, override_config: Optional[dict] = None, results_dir: str = '.', log_config: bool = False)[source]

Set up the basic scene from a YAML configuration file (possibly created with the MaMoKo Blender Add-on).

Parameters
  • filename – YAML configuration file, not to be confused with the scene layout configuration file. Typically config.yaml. scene.yaml and config.yaml are assumed to have matching names in their objects entry. Where scene.yaml defines the object’s shape and transformation, config.yaml defines additional configuration parameters for the simulation.

  • openfoam_cases_path – Path to OpenFOAM cases (should include a tube/ subdirectory). cache/ will be created here.

  • additional_component_classes – Dict of additional classes to search in when constructing objects.

  • override_config – If given, this dict will be used to update the configuration loaded from filename.

  • results_dir

  • log_config – Write the final assembled configuration to results_dir.

Returns

the SimulationKernel, and a dictionary mapping object names to tuples of the corresponding component and its original definition in the configuration.

finalize(simulation_kernel: pogona.simulation_kernel.SimulationKernel)
get_all_objects()[source]
get_closest_cell_centre_id(object_id: int, position_global: numpy.ndarray) Optional[numpy.ndarray][source]
Returns

Array of closest cell centers to position. If there’s only one position, output is squeezed. None if the Object instance is inactive. See documentation of cKDTree.query().

get_flow_by_position(simulation_kernel: pogona.simulation_kernel.SimulationKernel, position_global: numpy.ndarray, object_id: int, sim_time: float)[source]
get_inlets(object_id)[source]
get_outlets(object_id)[source]
initialize(simulation_kernel: pogona.simulation_kernel.SimulationKernel, init_stage: pogona.component.InitStages)[source]

Use InitStages to initialize this Component instance.

plot_to_csv(filename)[source]
process_changed_outlet_flow_rate(simulation_kernel, source_object: pogona.object.Object, outlet_name: str, flow_rate: float)[source]
process_new_time_step(simulation_kernel: pogona.simulation_kernel.SimulationKernel, notification_stage: pogona.component.NotificationStages)
set_arguments(**kwargs)

Read arguments as key value pairs and set this component’s member variables accordingly. Validity of the argument values will be checked in initialize().

component_name = 'scene_manager'

Since this component is not created by the config, choose a name

id

Unique integer component ID