wolfgpu.simplesimu.boundary_conditions

Module Contents

class wolfgpu.simplesimu.boundary_conditions.BoundaryConditionsTypes(*args, **kwds)[source]

Bases: enum.Enum

Inheritance diagram of wolfgpu.simplesimu.boundary_conditions.BoundaryConditionsTypes

The boundary conditions types.

Note: The values match the numbers in Wolf’s simulations parameters.

H = 1[source]

Weak boundary condition over \(h+b\), the water free surface height (that is, height of water plus bathymetry level).

QX = 2[source]

Weak boundary condition over \(q_x\), the discharge over the x-axis.

QY = 3[source]

Weak boundary condition over \(q_y\), the discharge over the x-axis.

NONE = 4[source]

This is used to represent the absence of boundary condition.

QBX = 5[source]

Not used.

QBY = 6[source]

Not used.

HMOD = 7[source]

Weak boundary condition over \(h\), the water free surface height.

FROUDE_NORMAL = 8[source]

Weak boundary condition for Froude limited height. Water height becomes \(\min(h, \frac{u^2}{g \times \text{Fr}^2})\) where \(\text{Fr}\) is given.

class wolfgpu.simplesimu.boundary_conditions.Direction(*args, **kwds)[source]

Bases: enum.Enum

Inheritance diagram of wolfgpu.simplesimu.boundary_conditions.Direction

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.

LEFT = 1[source]
BOTTOM = 2[source]
X = 1[source]
Y = 2[source]
class wolfgpu.simplesimu.boundary_conditions.BoundaryConditionIndices(*args, **kwds)[source]

Bases: enum.Enum

Inheritance diagram of wolfgpu.simplesimu.boundary_conditions.BoundaryConditionIndices

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.

BC_TABLE_INDEX_FOR_H_ON_LEFT = 1[source]
BC_TABLE_INDEX_FOR_HMOD_ON_LEFT = 2[source]
BC_TABLE_INDEX_FOR_QX_ON_LEFT = 0[source]
BC_TABLE_INDEX_FOR_QY_ON_LEFT = 3[source]
BC_TABLE_INDEX_FOR_FROUDE_NORMAL_ON_LEFT = 8[source]
BC_TABLE_INDEX_FOR_H_ON_BOTTOM = 4[source]
BC_TABLE_INDEX_FOR_HMOD_ON_BOTTOM = 5[source]
BC_TABLE_INDEX_FOR_QX_ON_BOTTOM = 6[source]
BC_TABLE_INDEX_FOR_QY_ON_BOTTOM = 7[source]
BC_TABLE_INDEX_FOR_FROUDE_NORMAL_ON_BOTTOM = 9[source]
BC_TABLE_INDEX_FOR_BRIDGE_DECK_ELEVATION = 10[source]
BC_TABLE_INDEX_FOR_BRIDGE_ROOF_ELEVATION = 11[source]
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.

wolfgpu.simplesimu.boundary_conditions.BC_ON_LEFT[source]
wolfgpu.simplesimu.boundary_conditions.BC_ON_BOTTOM[source]
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

i[source]
j[source]
ntype[source]
val[source]
direction[source]
to_dict()[source]
classmethod from_dict(js)[source]
wolfgpu.simplesimu.boundary_conditions.BC_BLANK_VALUE[source]
wolfgpu.simplesimu.boundary_conditions.NB_BC_TYPES[source]