scivianna package
Subpackages
- scivianna.agent package
- scivianna.component package
- scivianna.coupling package
- Scivianna Coupling Module
- Submodules
- scivianna.coupling.icoco module
- scivianna.coupling.problem_server module
ProblemClientProblemClient.GetICoCoMajorVersion()ProblemClient.abortTimeStep()ProblemClient.computeTimeStep()ProblemClient.forget()ProblemClient.getFieldType()ProblemClient.getFieldUnit()ProblemClient.getInputFieldsNames()ProblemClient.getInputMEDDoubleFieldTemplate()ProblemClient.getInputMEDIntFieldTemplate()ProblemClient.getInputMEDStringFieldTemplate()ProblemClient.getInputValuesNames()ProblemClient.getMEDCouplingMajorVersion()ProblemClient.getMeshUnit()ProblemClient.getOutputDoubleValue()ProblemClient.getOutputFieldsNames()ProblemClient.getOutputIntValue()ProblemClient.getOutputMEDDoubleField()ProblemClient.getOutputMEDIntField()ProblemClient.getOutputMEDStringField()ProblemClient.getOutputStringValue()ProblemClient.getOutputValuesNames()ProblemClient.getStationaryMode()ProblemClient.getValueType()ProblemClient.getValueUnit()ProblemClient.initTimeStep()ProblemClient.initialize()ProblemClient.isMEDCoupling64Bits()ProblemClient.isStationary()ProblemClient.iterateTimeStep()ProblemClient.presentTime()ProblemClient.resetTime()ProblemClient.restore()ProblemClient.save()ProblemClient.setDataFile()ProblemClient.setInputDoubleValue()ProblemClient.setInputIntValue()ProblemClient.setInputMEDDoubleField()ProblemClient.setInputMEDIntField()ProblemClient.setInputMEDStringField()ProblemClient.setInputStringValue()ProblemClient.setMPIComm()ProblemClient.setStationaryMode()ProblemClient.solveTimeStep()ProblemClient.terminate()ProblemClient.updateOutputMEDDoubleField()ProblemClient.updateOutputMEDIntField()ProblemClient.updateOutputMEDStringField()ProblemClient.validateTimeStep()
RemoteExceptionServerManagerredirect_icoco_to_server()
- scivianna.coupling.visualizer module
- Module contents
- scivianna.data package
- Scivianna Data Module
- Submodules
- scivianna.data.data1d module
- scivianna.data.data2d module
Data2DData2D.cell_colorsData2D.cell_edge_colorsData2D.cell_idsData2D.cell_valuesData2D.check_valid()Data2D.convert_to_polygons()Data2D.copy()Data2D.data_typeData2D.from_grid()Data2D.from_polygon_list()Data2D.get_grid()Data2D.get_polygons()Data2D.gridData2D.polygonsData2D.simplifyData2D.u_valuesData2D.v_values
- scivianna.data.data_2d_worker module
- scivianna.data.data_container module
- Module contents
- scivianna.extension package
- Scivianna Extension Module
- Submodules
- scivianna.extension.ai_assistant module
- scivianna.extension.axes module
- scivianna.extension.coupling module
CouplingExtensionCouplingExtension.add_time_value()CouplingExtension.from_json()CouplingExtension.iconCouplingExtension.make_gui()CouplingExtension.nameCouplingExtension.panelCouplingExtension.plotterCouplingExtension.provide_options()CouplingExtension.request_recompute()CouplingExtension.show_play_buttonCouplingExtension.slaveCouplingExtension.titleCouplingExtension.to_json()
- scivianna.extension.extension module
ExtensionExtension.descriptionExtension.from_json()Extension.iconExtension.iconsizeExtension.make_gui()Extension.on_field_change()Extension.on_file_load()Extension.on_frame_change()Extension.on_mouse_clic()Extension.on_mouse_move()Extension.on_range_change()Extension.on_updated_data()Extension.panelExtension.plotterExtension.provide_options()Extension.slaveExtension.titleExtension.to_json()
- scivianna.extension.field_selector module
FieldSelectorFieldSelector.from_json()FieldSelector.make_gui()FieldSelector.on_field_change()FieldSelector.on_file_load()FieldSelector.on_updated_data()FieldSelector.receive_colormap_change()FieldSelector.to_json()FieldSelector.trigger_colormap_change()FieldSelector.trigger_field_change()FieldSelector.trigger_update()
set_colors_list()
- scivianna.extension.file_loader module
- scivianna.extension.layout module
- scivianna.extension.line_selector module
- scivianna.extension.save_load_extension module
- Module contents
- scivianna.input_file package
- scivianna.interface package
- Scivianna Interface Module
- Submodules
- scivianna.interface.csv_result module
- scivianna.interface.generic_interface module
- scivianna.interface.med_interface module
- scivianna.interface.structured_mesh_interface module
- scivianna.interface.time_dataframe module
- scivianna.interface.vtk_interface module
- Module contents
- scivianna.layout package
- scivianna.panel package
- Scivianna Panel Module
- Submodules
- scivianna.panel.demo module
- scivianna.panel.gui module
- scivianna.panel.panel_1d module
Panel1DPanel1D.async_update_data()Panel1D.cell_idPanel1D.duplicate()Panel1D.field_change_callbackPanel1D.from_json()Panel1D.get_slave()Panel1D.namePanel1D.plotterPanel1D.positionPanel1D.provide_field_change_callback()Panel1D.provide_on_clic_callback()Panel1D.provide_on_mouse_move_callback()Panel1D.recompute()Panel1D.recompute_at()Panel1D.set_colormap()Panel1D.set_field()Panel1D.to_json()Panel1D.update_event
- scivianna.panel.panel_2d module
Panel2DPanel2D.async_update_data()Panel2D.colormapPanel2D.compute_fn()Panel2D.current_dataPanel2D.duplicate()Panel2D.field_change_callbackPanel2D.from_json()Panel2D.get_slave()Panel2D.get_uv()Panel2D.namePanel2D.plotterPanel2D.provide_field_change_callback()Panel2D.provide_on_clic_callback()Panel2D.provide_on_mouse_move_callback()Panel2D.ranges_callback()Panel2D.recompute()Panel2D.recompute_at()Panel2D.set_colormap()Panel2D.set_coordinates()Panel2D.set_field()Panel2D.to_json()Panel2D.update_polygons
- scivianna.panel.visualisation_panel module
VisualizationPanelVisualizationPanel.current_dataVisualizationPanel.duplicate()VisualizationPanel.extensionsVisualizationPanel.field_change_callbackVisualizationPanel.figureVisualizationPanel.from_json()VisualizationPanel.get_new_name()VisualizationPanel.get_slave()VisualizationPanel.main_frameVisualizationPanel.marked_to_recomputeVisualizationPanel.nameVisualizationPanel.outline_color()VisualizationPanel.panel_coupling_extensionVisualizationPanel.panel_nameVisualizationPanel.periodic_recompute_addedVisualizationPanel.plotterVisualizationPanel.provide_field_change_callback()VisualizationPanel.provide_on_clic_callback()VisualizationPanel.provide_on_mouse_move_callback()VisualizationPanel.recompute()VisualizationPanel.recompute_at()VisualizationPanel.rename()VisualizationPanel.set_colormap()VisualizationPanel.set_field()VisualizationPanel.slaveVisualizationPanel.sync_fieldVisualizationPanel.to_json()VisualizationPanel.trigger_on_file_load()VisualizationPanel.update_eventVisualizationPanel.update_polygons
- Module contents
- scivianna.plotter_1d package
- Scivianna 1D Plotter Module
- Submodules
- scivianna.plotter_1d.bokeh_1d_plotter module
BokehPlotter1DBokehPlotter1D.fig_paneBokehPlotter1D.get_x_bounds()BokehPlotter1D.get_y_bounds()BokehPlotter1D.hoverBokehPlotter1D.line_dictBokehPlotter1D.make_panel()BokehPlotter1D.plot()BokehPlotter1D.set_visible()BokehPlotter1D.set_x_scale()BokehPlotter1D.set_y_scale()BokehPlotter1D.source_data_dictBokehPlotter1D.update_plot()BokehPlotter1D.visible
- scivianna.plotter_1d.generic_plotter module
- Module contents
- scivianna.plotter_2d package
- Scivianna 2D Plotter Module
- Subpackages
- Submodules
- scivianna.plotter_2d.api module
- scivianna.plotter_2d.generic_plotter module
Plotter2DPlotter2D.display_borders()Plotter2D.enable_highlight()Plotter2D.line_widthPlotter2D.make_panel()Plotter2D.on_clic_callbackPlotter2D.on_mouse_move_callbackPlotter2D.plot_2d_frame()Plotter2D.provide_on_clic_callback()Plotter2D.provide_on_mouse_move_callback()Plotter2D.set_axes()Plotter2D.set_color_map()Plotter2D.update_2d_frame()Plotter2D.update_colorbar()Plotter2D.update_colors()
- Module contents
- scivianna.utils package
- Scivianna Utils Module
- Submodules
- scivianna.utils.color_tools module
- scivianna.utils.extruded_mesh module
- scivianna.utils.file_cleaner module
- scivianna.utils.interface_tools module
- scivianna.utils.polygon_sorter module
- scivianna.utils.polygonize_tools module
- scivianna.utils.serialization module
- scivianna.utils.structured_mesh module
- Module contents
Submodules
scivianna.constants module
scivianna.enums module
- class scivianna.enums.DataType(*values)
Bases:
EnumAre the data returned in a grid or polygons
- GRID = 0
Data are contained in a numpy array
- POLYGONS = 1
Data are contained in a list of polygons
- class scivianna.enums.GeometryType(*values)
Bases:
EnumIs the geometry 2D or 3D.
- class scivianna.enums.PlotType(*values)
Bases:
EnumIs the plot 1D or 2D.
- class scivianna.enums.UpdateEvent(*values)
Bases:
int,EnumWhat triggers a plot update
- CLIC = 1
The plot is updated when the mouse is clics on a 2D plot, the applicable plots are updated requesting the mouse space location.
- MOUSE_CELL_CHANGE = 3
The plot is updated when the mouse is moved over a 2D plot and enters a new cell.
- MOUSE_POSITION_CHANGE = 2
The plot is updated when the mouse is moved over a 2D plot, the applicable plots are updated requesting the mouse space location.
- PERIODIC = 4
The plot is preiodically updated, applicable in real-time code coupling simulations
- RANGE_CHANGE = 5
The plot is updated when the (u, v) ranges change
- RECOMPUTE = 0
The plot is only updated by pressing the mouse button
- class scivianna.enums.UpdatePolicy(*values)
Bases:
EnumThis enum lets the user define how the code interface manages its fields update with time.
- APPEND_DATA = 1
If applicable, the supporting mesh is keep constant during the simulation. The data is stored and associated to the current time.
- APPEND_MESH = 3
If applicable, the supporting mesh is changes during the simulation: The data and its mesh are stored and associated to the current time. otherwise, the behavior is equivalent to APPEND_DATA.
- UPDATE_DATA = 2
If applicable, the supporting mesh is keep constant during the simulation. The data is stored and replaces the last data.
- UPDATE_MESH = 4
If applicable, the supporting mesh is changes during the simulation: The data and its mesh are stored and replace the last data. Without mesh, the behavior is equivalent to UPDATE_DATA.
scivianna.notebook_tools module
scivianna.slave module
- class scivianna.slave.ComputeSlave(code_interface: Type[GenericInterface], allow_errors: bool = False)
Bases:
objectClass that creates a subprocess to interface with the code.
- append_data(key: str, data: Any)
Stores the data and associates it to the current time.
- Parameters:
key (str) – Data associated key
data (Any) – New value
- append_mesh(key: str, data: Any)
Stores the data and mesh and associate them to the current time.
- Parameters:
key (str) – Data associated key
data (Any) – New value
- call_custom_function(function_name: str, arguments: Dict[str, Any])
Call an custom function meant to ease extension developments
- Parameters:
function_name (str) – Name of the interface function
arguments (Dict[str, Any]) – Kwargs of the custom function
- Returns:
Function return
- Return type:
Any
- code_interface: Type[GenericInterface]
Code interface class
- compute_1D_line_data(pos: Tuple[float, float, float], u: Tuple[float, float, float], d: float, q_tasks: Queue, options: Dict[str, Any]) DataFrame
Returns a list of polygons that defines the geometry in a given frame
- Parameters:
pos (Tuple[float, float, float]) – 1D data line start location
u (Tuple[float, float, float]) – Data line direction vector
d (float) – Distance to travel by the 1D line
q_tasks (mp.Queue) – Queue from which get orders from the master.
options (Dict[str, Any]) – Additional options for frame computation.
- Returns:
Pandas dataframe containing the data
- Return type:
pd.DataFrame
- compute_2D_data(u: Tuple[float, float, float], v: Tuple[float, float, float], u_min: float, u_max: float, v_min: float, v_max: float, w_value: float, q_tasks: Queue, coloring_label: str, options: Dict[str, Any], caller: str = 'API') Tuple[Data2D, bool]
Get the geometry from the interface
- Parameters:
u (Tuple[float, float, float]) – Horizontal coordinate director vector
v (Tuple[float, float, float]) – Vertical coordinate director vector
u_min (float) – Lower bound value along the u axis
u_max (float) – Upper bound value along the u axis
v_min (float) – Lower bound value along the v axis
v_max (float) – Upper bound value along the v axis
w_value (float) – Value along the u ^ v axis
q_tasks (mp.Queue) – Queue from which get orders from the master.
coloring_label (str) – Field label to display
options (Dict[str, Any]) – Additional options for frame computation.
caller (str) – Identifier of the caller requesting the computation (default: “API”)
- Returns:
Data2D object containing the geometry, whether the polygons were updated
- Return type:
Tuple[Data2D, bool]
- duplicate() ComputeSlave
Returns a duplicate of the current ComputeSlave. The copy is reseted, and reads the file history.
- Returns:
ComputeSlave copy.
- Return type:
- file_read: List[Tuple[str, str]]
List of file read and their associated key.
- get_1D_value(position: Tuple[float, float, float], cell_index: str, material_name: str, field: str, options: Dict[str, Any] = None) Series | List[Series]
Provides the 1D value of a field from either the (x, y, z) position, the cell index, or the material name.
- Parameters:
position (Tuple[float, float, float]) – Position at which the value is requested
cell_index (str) – Index of the requested cell
material_name (str) – Name of the requested material
field (str) – Requested field name
options (Dict[str, Any], optional) – Additional options for 1D value computation.
- Returns:
Field value
- Return type:
Union[pd.Series, List[pd.Series]]
- get_file_input_list() List[Tuple[str, str]]
Get from the interface the list of files labels and their description
- Returns:
List of (file label, description)
- Return type:
List[Tuple[str, str]]
- get_geometry_type() GeometryType
Returns the interface geometry type
- Returns:
Interface geometry type
- Return type:
- get_label_coloring_mode(field_name: str) VisualizationMode
Returns the coloring mode of the plot
- Parameters:
field_name (str) – Name of the displayed field
- Returns:
Coloring mode
- Return type:
- get_labels() List[str]
Get from the interface the list of displayable labels (fields list)
- Returns:
List of labels
- Return type:
List[str]
- get_result_or_error()
Gets the return value from the process. If an error was sent, raise the error instead.
- Returns:
Any returned data from the process
- Return type:
Any
- Raises:
error – Any error sent by the slave
- get_template(name: str)
Returns the template for the C3PO getOutputxxxFieldTemplate functions
- Parameters:
name (str) – Field name
- get_value(position: Tuple[float, float, float], cell_index: str, material_name: str, field: str, options: Dict[str, Any] = None) str | float
Provides the result value of a field from either the (x, y, z) position, the cell index, or the material name.
- Parameters:
position (Tuple[float, float, float]) – Position at which the value is requested
cell_index (str) – Index of the requested cell
material_name (str) – Name of the requested material
field (str) – Requested field name
options (Dict[str, Any], optional) – Additional options for value computation.
- Returns:
Field value
- Return type:
Union[str, float]
- get_value_dict(value_label: str, cells: List[int | str], options: Dict[str, Any], caller: str = 'API') Dict[int | str, str]
Returns a cell name - field value map for a given field name
- Parameters:
value_label (str) – Field name to get values from
cells (List[Union[int,str]]) – List of cells names
options (Dict[str, Any]) – Additional options for frame computation.
caller (str) – Identifier of the caller requesting the computation (default: “API”)
- Returns:
Field value for each requested cell names
- Return type:
Dict[Union[int,str], str]
- get_values(positions: List[Tuple[float, float, float]], cell_indexes: List[str], material_names: List[str], field: str, options: Dict[str, Any] = None) List[str | float]
Provides the result values at different positions from either the (x, y, z) positions, the cell indexes, or the material names.
- Parameters:
positions (List[Tuple[float, float, float]]) – List of position at which the value is requested
cell_indexes (List[str]) – Indexes of the requested cells
material_names (List[str]) – Names of the requested materials
field (str) – Requested field name
options (Dict[str, Any], optional) – Additional options for value computation.
- Returns:
Field values
- Return type:
List[Union[str, float]]
- load(file_path: Path, include_files: bool)
Pickle loads the slave content to a file, allows slave state reload
- Two modes are available:
If include_files is at True, all loaded data are saved, the pickled file can be loaded on its own to recover last session.
If include_files is at False, only the computed data are loaded, enabling faster first computation allowing a smaller pickle file size.
- Parameters:
file_path (Path) – File from which load the slave
include_files (bool) – Included loaded file
- p: Process
Subprocess hosting the worker
- q_returns: Queue
Queue to get the results
- q_tasks: Queue
Queue in which the tasks are pushed
- read_file(file_path: str, file_label: str)
Forwards to the worker a file path to read and its associated label
- Parameters:
file_path (str) – File to read
file_label (str) – File label
- reset()
Kills the worker and create a new one.
- save(file_path: Path, include_files: bool)
Pickle saves the slave content to a file, allows slave state reload.
- Two modes are available:
If include_files is at True, all loaded data are saved, the pickled file can be loaded on its own to recover last session.
If include_files is at False, only the computed data are loaded, enabling faster first computation allowing a smaller pickle file size.
- Parameters:
file_path (Path) – File in which save the file
include_files (bool) – Included loaded file
- set_template(name: str, template: Any)
Sets the template returned by C3PO getOutputxxxFieldTemplate functions
- Parameters:
name (str) – Field name
template (Any) – Object to set as template
- set_time(time_: float)
Set the current time in an interface to associate to the received value.
- Parameters:
time (float) – Current time
- terminate()
Terminates the subprocess
- update_data(key: str, data: Any)
Replaces the interface data by the current value
- Parameters:
key (str) – Data associated key
data (Any) – New value
- update_mesh(key: str, data: Any)
Replaces the interface data and mesh by the current value
- Parameters:
key (str) – Data associated key
data (Any) – New value
- property update_policy
Returns the update_policy attribute from the interface
- Returns:
The update_policy value
- Return type:
Any
- wait_available()
- class scivianna.slave.SlaveCommand
Bases:
objectClass defining the available commands that are forwarded to the compute slaves
- APPEND_DATA = 'append_data'
Appends interface data
- APPEND_MESH = 'append_mesh'
Appends interface mesh
- COMPUTE_1D_LINE_DATA = 'compute_1d_line_data'
Compute a 1D result along a line
- COMPUTE_2D_DATA = 'compute_2d_data'
Compute a 2D slice of the geometry
- CUSTOM = 'custom'
Custom call to transfer to the interface to ease extension development
- GET_1D_VALUE = 'get_1D_value'
Returns the 1Dvalue at a location/cell
- GET_FILE_INPUT_LIST = 'get_file_input_list'
Returns the list of read input files
- GET_GEOMETRY_TYPE = 'get_geometry_type'
Returns the geometry type
- GET_LABELS = 'get_labels'
Returns the list of displayable fields
- GET_LABEL_COLORING_MODE = 'get_label_coloring_mode'
Returns the coloring mode of a field
- GET_TEMPLATE = 'get_template'
Gets field template
- GET_UPDATE_POLICY = 'get_update_policy'
Gets the update policy attribute
- GET_VALUE = 'get_value'
Returns the value at a location/cell
- GET_VALUES = 'get_values'
Returns the value at a set of locations/cells
- GET_VALUE_DICT = 'get_value_dict'
Returns the values of a field at cells
- LOAD = 'load'
Pickle loads the slave state from a file
- READ_FILE = 'read_file'
Reads an input file
- SAVE = 'save'
Pickle saves the slave state to a file
- SET_TEMPLATE = 'set_template'
Sets field template
- SET_TIME = 'set_time'
Sets the current time
- SET_UPDATE_POLICY = 'set_update_policy'
Sets the update policy attribute
- UPDATE_DATA = 'update_data'
Updates interface data
- UPDATE_MESH = 'update_mesh'
Updates interface mesh
- scivianna.slave.worker(q_tasks: Queue, q_returns: Queue, q_errors: Queue, code_interface: Type[GenericInterface])
Creates a worker that will forward the panel requests to the GenericInterface on another process
- Parameters:
q_tasks (mp.Queue) – Queue containing the tasks
q_returns (mp.Queue) – Queue to return the results
code_interface (Type[GenericInterface]) – GenericInterface to instanciate.