wolfgpu.simplesimu.boundary_conditions
Module Contents
- class wolfgpu.simplesimu.boundary_conditions.BoundaryConditionsTypes(*args, **kwds)[source]
Bases:
enum.Enum
The boundary conditions types.
Note: The values match the numbers in Wolf’s simulations parameters.
- class wolfgpu.simplesimu.boundary_conditions.Direction(*args, **kwds)[source]
Bases:
enum.Enum
Create a collection of name/value pairs.
Example enumeration:
>>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3
Access them by:
attribute access:
>>> Color.RED <Color.RED: 1>
value lookup:
>>> Color(1) <Color.RED: 1>
name lookup:
>>> Color['RED'] <Color.RED: 1>
Enumerations can be iterated over, and know how many members they have:
>>> len(Color) 3
>>> list(Color) [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.
- class wolfgpu.simplesimu.boundary_conditions.BoundaryConditionIndices(*args, **kwds)[source]
Bases:
enum.Enum
The column indices of each supported boundary conditions in the boundary conditions table. This also covers cell parameters.
IMPORTANT: These values are tied to data representation in the shader. Don’t change them!
These are separate from the BoundaryConditionsTypes because they don’t serve the same purpose. These are for data representation in wolfgpu whereas BoundaryConditionsTypes are for CPU Wolf compatibility.
BoundaryConditionsTypes and CellParameterType must all be converted to this enum when loading the sim in the gpu.
- classmethod index_for_bc_type(param_type: BoundaryConditionsTypes, direction: Direction) BoundaryConditionIndices[source]
Find the column index in the BC table for a given BC type and direction. :param param_type: The type of parameter to set. See
BoundaryConditionIndices enum for possible values.
- Parameters:
direction – The direction of the boundary condition.
- Returns:
The column index in the BC table.
- class wolfgpu.simplesimu.boundary_conditions.boundary_condition_2D(i: int, j: int, ntype: BoundaryConditionsTypes, val: float, direction: Direction)[source]
Type des CL générales, faibles et fortes @author Pierre Archambeau