meshkernel.c_structures module

class CContacts

Bases: Structure

C-structure intended for internal use only. It represents a Contacts struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • mesh1d_indices (POINTER(c_int)): The indices of the mesh1d nodes.

  • mesh2d_indices (POINTER(c_int)): The indices of the mesh2d faces.

  • num_contacts (c_int): The number of contacts.

allocate_memory() Contacts

Allocate data according to the parameters with the "num_" prefix. The pointers are then set to the freshly allocated memory. The memory is owned by the Contacts instance which is returned by this method.

Returns:

The object owning the allocated memory.

Return type:

Contacts

static from_contacts(contacts: Contacts) CContacts

Creates a new CContacts instance from the given Contacts instance.

Parameters:

contacts (Contacts) – The contacts.

Returns:

The created C-Structure for the given Contacts.

Return type:

CContacts

mesh1d_indices

Structure/Union member

mesh2d_indices

Structure/Union member

num_contacts

Structure/Union member

class CCurvilinearGrid

Bases: Structure

C-structure intended for internal use only. It represents a Curvilinear struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • node_x (POINTER(c_double)): The x-coordinates of the nodes.

  • node_y (POINTER(c_double)): The y-coordinates of the nodes.

  • num_m (c_int): The number of curvilinear grid nodes along m.

  • num_n (c_int): The number of curvilinear grid nodes along n.

allocate_memory() CurvilinearGrid

Allocate data according to the parameters with the "num_" prefix. The pointers are then set to the freshly allocated memory. The memory is owned by the CurvilinearGrid instance which is returned by this method.

Returns:

The object owning the allocated memory.

Return type:

CurvilinearGrid

static from_curvilinearGrid(curvilinear_grid: CurvilinearGrid) CCurvilinearGrid

Creates a new CMesh instance from a given CurvilinearGrid instance.

Parameters:

curvilinear_grid (CurvilinearGrid) – Class of numpy instances owning the state.

Returns:

The created CCurvilinearGrid instance.

Return type:

CCurvilinearGrid

node_x

Structure/Union member

node_y

Structure/Union member

num_m

Structure/Union member

num_n

Structure/Union member

class CCurvilinearParameters

Bases: Structure

C-structure intended for internal use only. It represents an CurvilinearParameters struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • m_refinement (c_int): M-refinement factor for regular grid generation.

  • n_refinement (c_int): N-refinement factor for regular grid generation.

  • smoothing_iterations (c_int): Nr. of inner iterations in regular grid smoothing.

  • smoothing_parameter (c_double): Smoothing parameter.

  • attraction_parameter (c_double): Attraction/repulsion parameter.

attraction_parameter

Structure/Union member

static from_curvilinearParameters(curvilinear_parameters: CurvilinearParameters) CCurvilinearParameters

Creates a new CCurvilinearParameters instance from the given CurvilinearParameters instance.

Parameters:

curvilinear_parameters (CurvilinearParameters) – The curvilinear parameters.

Returns:

The created C-Structure for the given CurvilinearParameters.

Return type:

CCurvilinearParameters

m_refinement

Structure/Union member

n_refinement

Structure/Union member

smoothing_iterations

Structure/Union member

smoothing_parameter

Structure/Union member

class CGeometryList

Bases: Structure

C-structure intended for internal use only. It represents a GeometryList struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • geometry_separator (c_double): The value used as a separator in the coordinates.

  • inner_outer_separator (c_double): The value used to separate the inner part of a polygon from its outer part.

  • n_coordinates (c_int): The number of coordinate values.

  • x_coordinates (POINTER(c_double)): The x coordinates.

  • y_coordinates (POINTER(c_double)): The y coordinates.

  • values (POINTER(c_double)): The values on this mesh2d.

static from_geometrylist(geometry_list: GeometryList) CGeometryList

Creates a new CGeometryList instance from the given GeometryList instance.

Parameters:

geometry_list (GeometryList) – The geometry list.

Returns:

The created C-Structure for the given GeometryList.

Return type:

CGeometryList

geometry_separator

Structure/Union member

inner_outer_separator

Structure/Union member

n_coordinates

Structure/Union member

values

Structure/Union member

x_coordinates

Structure/Union member

y_coordinates

Structure/Union member

class CGriddedSamples

Bases: Structure

C-structure intended for internal use only. It represents a GriddedSamples struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • num_x (c_int): Number of x gridded samples coordinates.

  • num_y (c_int): Number of y gridded samples coordinates.

  • x_origin (c_double): X coordinate of the grid origin.

  • y_origin (c_double): Y coordinate of the grid origin.

  • cell_size (c_int): Constant grid cell size.

  • x_coordinates (POINTER(c_double)): If not nullptr, coordinates for non-uniform grid spacing in x direction.

  • y_coordinates (POINTER(c_double)): If not nullptr, coordinates for non-uniform grid spacing in y direction.

  • values (POINTER(c_double)): Sample values.

cell_size

Structure/Union member

static from_griddedSamples(gridded_samples: GriddedSamples) CGriddedSamples

Creates a new CGriddedSamples instance from the given GriddedSamples instance.

Parameters:

gridded_samples (GriddedSamples) – The GriddedSamples samples.

Returns:

The created C-Structure for the given CGriddedSamples.

Return type:

CGriddedSamples

num_x

Structure/Union member

num_y

Structure/Union member

value_type

Structure/Union member

values

Structure/Union member

x_coordinates

Structure/Union member

x_origin

Structure/Union member

y_coordinates

Structure/Union member

y_origin

Structure/Union member

class CMakeGridParameters

Bases: Structure

C-structure intended for internal use only. It represents a MakeGridParameters struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • num_columns (c_int): The number of columns in x direction.

  • num_rows (c_int): The number of columns in y direction.

  • angle (c_double): The grid angle.

  • origin_x (c_double): The x coordinate of the origin, located at the bottom left corner.

  • origin_y (c_double): The y coordinate of the origin, located at the bottom left corner.

  • block_size_x (c_double): The grid block size in x dimension, used only for squared grids.

  • block_size_y (c_double): The grid block size in y dimension, used only for squared grids.

  • upper_right_x (c_double): The x coordinate of the upper right corner.

  • upper_right_y (c_double): The y coordinate of the upper right corner.

angle

Structure/Union member

block_size_x

Structure/Union member

block_size_y

Structure/Union member

static from_makegridparameters(make_grid_parameters: MakeGridParameters) CMakeGridParameters

Creates a new CMeshRefinementParameters instance from the given MeshRefinementParameters instance.

Parameters:

make_grid_parameters (MakeGridParameters) – The make grid parameters.

Returns:

The created C-Structure for the given MakeGridParameters.

Return type:

CMakeGridParameters

num_columns

Structure/Union member

num_rows

Structure/Union member

origin_x

Structure/Union member

origin_y

Structure/Union member

upper_right_x

Structure/Union member

upper_right_y

Structure/Union member

class CMesh1d

Bases: Structure

C-structure intended for internal use only. It represents a Mesh1D struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • edge_nodes (POINTER(c_int)): The nodes composing each mesh 1d edge.

  • node_x (POINTER(c_double)): The x-coordinates of the nodes.

  • node_y (POINTER(c_double)): The y-coordinates of the nodes.

  • num_nodes (c_int): The number of nodes.

  • num_valid_nodes (c_int): The number of valid mesh nodes.

  • num_edges (c_int): The number of edges.

  • num_valid_edges (c_int): The number of valid edges.

allocate_memory() Mesh1d

Allocate data according to the parameters with the "num_" prefix. The pointers are then set to the freshly allocated memory. The memory is owned by the Mesh1d instance which is returned by this method.

Returns:

The object owning the allocated memory.

Return type:

Mesh1d

edge_nodes

Structure/Union member

static from_mesh1d(mesh1d: Mesh1d) CMesh1d

Creates a new CMesh instance from a given Mesh1d instance.

Parameters:

mesh1d (Mesh1d) – Class of numpy instances owning the state.

Returns:

The created CMesh1d instance.

Return type:

CMesh1d

node_x

Structure/Union member

node_y

Structure/Union member

num_edges

Structure/Union member

num_nodes

Structure/Union member

num_valid_edges

Structure/Union member

num_valid_nodes

Structure/Union member

class CMesh2d

Bases: Structure

C-structure intended for internal use only. It represents a Mesh2D struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • edge_faces (POINTER(c_int)): The face indices for each edge.

  • edge_nodes (POINTER(c_int)): The nodes composing each mesh 2d edge.

  • face_edges (POINTER(c_int)): The edge indices for each face.

  • face_nodes (POINTER(c_int)): The nodes composing each mesh 2d face.

  • nodes_per_face (POINTER(c_int)): The nodes composing each mesh 2d face.

  • node_x (POINTER(c_double)): The x-coordinates of the nodes.

  • node_y (POINTER(c_double)): The y-coordinates of the nodes.

  • edge_x (POINTER(c_double)): The x-coordinates of the mesh edges’ middle points.

  • edge_y (POINTER(c_double)): The x-coordinates of the mesh edges’ middle points.

  • face_x (POINTER(c_double)): The x-coordinates of the mesh faces’ mass centers.

  • face_y (POINTER(c_double)): The y-coordinates of the mesh faces’ mass centers.

  • num_nodes (c_int): The number of mesh nodes.

  • num_valid_nodes (c_int): The number of valid 1d nodes

  • num_edges (c_int): The number of edges.

  • num_valid_edges (c_int): The number of valid edges

  • num_faces (c_int): The number of faces.

  • num_face_nodes (c_int): The total number of nodes composing the mesh 2d faces.

allocate_memory() Mesh2d

Allocate data according to the parameters with the "num_" prefix. The pointers are then set to the freshly allocated memory. The memory is owned by the Mesh2d instance which is returned by this method.

Returns:

The object owning the allocated memory.

Return type:

Mesh2d

edge_faces

Structure/Union member

edge_nodes

Structure/Union member

edge_x

Structure/Union member

edge_y

Structure/Union member

face_edges

Structure/Union member

face_nodes

Structure/Union member

face_x

Structure/Union member

face_y

Structure/Union member

static from_mesh2d(mesh2d: Mesh2d) CMesh2d

Creates a new CMesh instance from a given Mesh2d instance.

Parameters:

mesh2d (Mesh2d) – Class of numpy instances owning the state.

Returns:

The created CMesh2d instance.

Return type:

CMesh2d

node_x

Structure/Union member

node_y

Structure/Union member

nodes_per_face

Structure/Union member

num_edges

Structure/Union member

num_face_nodes

Structure/Union member

num_faces

Structure/Union member

num_nodes

Structure/Union member

num_valid_edges

Structure/Union member

num_valid_nodes

Structure/Union member

class CMeshRefinementParameters

Bases: Structure

C-structure intended for internal use only. It represents a MeshRefinementParameters struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • max_refinement_iterations (c_int): Maximum number of refinement iterations.

  • refine_intersected (c_int): Whether to compute faces intersected by polygon (yes=1/no=0)

  • use_mass_center_when_refining (c_int): Whether to use the mass center when splitting a face in the refinement process (yes=1/no=0)

  • min_edge_size (c_double): Minimum cell size.

  • refinement_type (c_int): Refinement criterion type.

  • connect_hanging_nodes (c_int): Whether to connect hanging nodes at the end of the iteration.

  • account_for_samples_outside (c_int): Whether to take samples outside face into account.

account_for_samples_outside_face

Structure/Union member

connect_hanging_nodes

Structure/Union member

directional_refinement

Structure/Union member

static from_meshrefinementparameters(mesh_refinement_parameters: MeshRefinementParameters) CMeshRefinementParameters

Creates a new CMeshRefinementParameters instance from the given MeshRefinementParameters instance.

Parameters:

mesh_refinement_parameters (MeshRefinementParameters) – The mesh refinement parameters.

Returns:

The created C-Structure for the given MeshRefinementParameters.

Return type:

CMeshRefinementParameters

max_courant_time

Structure/Union member

max_refinement_iterations

Structure/Union member

min_edge_size

Structure/Union member

refine_intersected

Structure/Union member

refinement_type

Structure/Union member

smoothing_iterations

Structure/Union member

use_mass_center_when_refining

Structure/Union member

class COrthogonalizationParameters

Bases: Structure

C-structure intended for internal use only. It represents an OrthogonalizationParameters struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • outer_iterations (c_int): Number of outer iterations in orthogonalization.

  • boundary_iterations (c_int): Number of boundary iterations in grid/net orthogonalization within itatp.

  • inner_iterations (c_int): Number of inner iterations in grid/net orthogonalization within itbnd.

  • orthogonalization_to_smoothing_factor (c_double): Factor from between grid smoothing (0) and grid orthogonality (1).

  • orthogonalization_to_smoothing_factor_at_boundary (c_double): Minimum ATPF on the boundary.

  • areal_to_angle_smoothing_factor (c_double): Factor between smoother 1d0 and area-homogenizer 0d0.

areal_to_angle_smoothing_factor

Structure/Union member

boundary_iterations

Structure/Union member

static from_orthogonalizationparameters(orthogonalization_parameters: OrthogonalizationParameters) COrthogonalizationParameters

Creates a new COrthogonalizationParameters instance from the given OrthogonalizationParameters instance.

Parameters:

orthogonalization_parameters (OrthogonalizationParameters) – The orthogonalization parameters.

Returns:

The created C-Structure for the given OrthogonalizationParameters.

Return type:

COrthogonalizationParameters

inner_iterations

Structure/Union member

orthogonalization_to_smoothing_factor

Structure/Union member

orthogonalization_to_smoothing_factor_at_boundary

Structure/Union member

outer_iterations

Structure/Union member

class CSplinesToCurvilinearParameters

Bases: Structure

C-structure intended for internal use only. It represents an SplinesToCurvilinearParameters struct as described by the MeshKernel API.

Used for communicating with the MeshKernel dll.

The _fields_ attribute of this class contains the following fields:
  • aspect_ratio (c_double): Aspect ratio.

  • aspect_ratio_grow_factor (c_double): Grow factor of aspect ratio.

  • average_width (c_double): Average mesh width on center spline.

  • curvature_adapted_grid_spacing (c_int): Curvature adapted grid spacing.

  • grow_grid_outside (c_int): Grow the grid outside the prescribed grid height.

  • maximum_num_faces_in_uniform_part (c_int): Maximum number of layers in the uniform part.

  • nodes_on_top_of_each_other_tolerance (c_double): On-top-of-each-other tolerance.).

  • min_cosine_crossing_angles (c_double): Minimum allowed absolute value of crossing-angle cosine.

  • check_front_collisions (c_int): Check for collisions with other parts of the front.

  • remove_skinny_triangles (c_int): Check for collisions with other parts of the front.

aspect_ratio

Structure/Union member

aspect_ratio_grow_factor

Structure/Union member

average_width

Structure/Union member

check_front_collisions

Structure/Union member

curvature_adapted_grid_spacing

Structure/Union member

static from_splinesToCurvilinearParameters(splines_to_curvilinear_parameters: SplinesToCurvilinearParameters) CSplinesToCurvilinearParameters

Creates a new COrthogonalizationParameters instance from the given OrthogonalizationParameters instance.

Parameters:

orthogonalization_parameters (OrthogonalizationParameters) – The orthogonalization parameters.

Returns:

The created C-Structure for the given OrthogonalizationParameters.

Return type:

COrthogonalizationParameters

grow_grid_outside

Structure/Union member

maximum_num_faces_in_uniform_part

Structure/Union member

min_cosine_crossing_angles

Structure/Union member

nodes_on_top_of_each_other_tolerance

Structure/Union member

remove_skinny_triangles

Structure/Union member