wolfgpu.simplesimu.boundary_conditions ====================================== .. py:module:: wolfgpu.simplesimu.boundary_conditions Module Contents --------------- .. py:class:: BoundaryConditionsTypes(*args, **kwds) Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfgpu.simplesimu.boundary_conditions.BoundaryConditionsTypes :parts: 1 :private-bases: The boundary conditions types. Note: The values match the numbers in Wolf's simulations parameters. .. py:attribute:: H :value: 1 Weak boundary condition over :math:`h+b`, the water free surface height (that is, height of water plus bathymetry level). .. py:attribute:: QX :value: 2 Weak boundary condition over :math:`q_x`, the discharge over the x-axis. .. py:attribute:: QY :value: 3 Weak boundary condition over :math:`q_y`, the discharge over the x-axis. .. py:attribute:: NONE :value: 4 This is used to represent the absence of boundary condition. .. py:attribute:: QBX :value: 5 Not used. .. py:attribute:: QBY :value: 6 Not used. .. py:attribute:: HMOD :value: 7 Weak boundary condition over :math:`h`, the water free surface height. .. py:attribute:: FROUDE_NORMAL :value: 8 Weak boundary condition for Froude limited height. Water height becomes :math:`\min(h, \frac{u^2}{g \times \text{Fr}^2})` where :math:`\text{Fr}` is given. .. py:class:: Direction(*args, **kwds) Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfgpu.simplesimu.boundary_conditions.Direction :parts: 1 :private-bases: 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 - value lookup: >>> Color(1) - name lookup: >>> Color['RED'] Enumerations can be iterated over, and know how many members they have: >>> len(Color) 3 >>> list(Color) [, , ] Methods can be added to enumerations, and members can have their own attributes -- see the documentation for details. .. py:attribute:: LEFT :value: 1 .. py:attribute:: BOTTOM :value: 2 .. py:attribute:: X :value: 1 .. py:attribute:: Y :value: 2 .. py:class:: BoundaryConditionIndices(*args, **kwds) Bases: :py:obj:`enum.Enum` .. autoapi-inheritance-diagram:: wolfgpu.simplesimu.boundary_conditions.BoundaryConditionIndices :parts: 1 :private-bases: 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. .. py:attribute:: BC_TABLE_INDEX_FOR_H_ON_LEFT :value: 1 .. py:attribute:: BC_TABLE_INDEX_FOR_HMOD_ON_LEFT :value: 2 .. py:attribute:: BC_TABLE_INDEX_FOR_QX_ON_LEFT :value: 0 .. py:attribute:: BC_TABLE_INDEX_FOR_QY_ON_LEFT :value: 3 .. py:attribute:: BC_TABLE_INDEX_FOR_FROUDE_NORMAL_ON_LEFT :value: 8 .. py:attribute:: BC_TABLE_INDEX_FOR_H_ON_BOTTOM :value: 4 .. py:attribute:: BC_TABLE_INDEX_FOR_HMOD_ON_BOTTOM :value: 5 .. py:attribute:: BC_TABLE_INDEX_FOR_QX_ON_BOTTOM :value: 6 .. py:attribute:: BC_TABLE_INDEX_FOR_QY_ON_BOTTOM :value: 7 .. py:attribute:: BC_TABLE_INDEX_FOR_FROUDE_NORMAL_ON_BOTTOM :value: 9 .. py:attribute:: BC_TABLE_INDEX_FOR_BRIDGE_DECK_ELEVATION :value: 10 .. py:attribute:: BC_TABLE_INDEX_FOR_BRIDGE_ROOF_ELEVATION :value: 11 .. py:method:: index_for_bc_type(param_type: BoundaryConditionsTypes, direction: Direction) -> BoundaryConditionIndices :classmethod: 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. :param direction: The direction of the boundary condition. :return: The column index in the BC table. .. py:data:: BC_ON_LEFT .. py:data:: BC_ON_BOTTOM .. py:class:: boundary_condition_2D(i: int, j: int, ntype: BoundaryConditionsTypes, val: float, direction: Direction) Type des CL générales, faibles et fortes @author Pierre Archambeau .. py:attribute:: i .. py:attribute:: j .. py:attribute:: ntype .. py:attribute:: val .. py:attribute:: direction .. py:method:: to_dict() .. py:method:: from_dict(js) :classmethod: .. py:data:: BC_BLANK_VALUE .. py:data:: NB_BC_TYPES