MeshKernel
Classes | Functions
meshkernelapi Namespace Reference

Contains all structs and functions exposed at the API level. More...

Classes

struct  BoundingBox
 A struct describing a bounding box. More...
 
struct  Contacts
 A struct used to describe contacts between a 1d and a 2d mesh. More...
 
struct  CurvilinearGrid
 A struct used to describe the values of a curvilinear grid in a C-compatible manner. More...
 
struct  GeometryList
 A struct used to describe a list of geometries in a C-compatible manner. More...
 
struct  GriddedSamples
 A struct describing gridded samples. More...
 
struct  Mesh1D
 A struct used to describe the values of a mesh 1d in a C-compatible manner. More...
 
struct  Mesh2D
 A struct used to describe the values of an unstructured, two-dimensional mesh in a C-compatible manner. More...
 
struct  MeshKernelState
 The class holding the state of the C API library. More...
 
class  MKStateUndoAction
 Undo action for MeshKernelState. More...
 

Functions

MKERNEL_API double mkernel_get_separator ()
 Gets the double value used in the back-end library as separator and missing value. More...
 
MKERNEL_API double mkernel_get_inner_outer_separator ()
 Gets the double value used to separate the inner part of a polygon from its outer part. More...
 
MKERNEL_API int mkernel_allocate_state (int projectionType, int &meshKernelId)
 Creates a new mesh state and returns the generated meshKernelId. More...
 
MKERNEL_API int mkernel_is_valid_state (int meshKernelId, bool &isValid)
 Determine if the meshKernelId is valid. More...
 
MKERNEL_API int mkernel_set_undo_size (int undoStackSize)
 Set the maximum size of the undo stack. More...
 
MKERNEL_API int mkernel_undo_state (bool &undone, int &meshKernelId)
 Attempt to undo by one undo-action. More...
 
MKERNEL_API int mkernel_undo_state_count (int &committedCount, int &restoredCount)
 Count the number of undo actions. More...
 
MKERNEL_API int mkernel_undo_state_count_for_id (int meshKernelId, int &committedCount, int &restoredCount)
 Count the number of undo actions for a particular meshKernelId. More...
 
MKERNEL_API int mkernel_redo_state (bool &redone, int &meshKernelId)
 Attempt to redo by one undo-action. More...
 
MKERNEL_API int mkernel_clear_state ()
 Clear all internal mesh kernel state and undo actions, no undo will be possible after this. More...
 
MKERNEL_API int mkernel_clear_undo_state ()
 Clear the undo state for all mesh kernel ids, no undo is possible after this. More...
 
MKERNEL_API int mkernel_clear_undo_state_for_id (int meshKernelId)
 Clear the undo state for particular mesh kernel id, no undo for the id is possible after this. More...
 
MKERNEL_API int mkernel_contacts_compute_boundary (int meshKernelId, const int *oneDNodeMask, const GeometryList &polygons, double searchRadius)
 Computes 1d-2d contacts, where 1d nodes are connected to the closest 2d faces at the boundary (ggeo_make1D2DRiverLinks_dll) More...
 
MKERNEL_API int mkernel_contacts_compute_multiple (int meshKernelId, const int *oneDNodeMask)
 Computes 1d-2d contacts, where a single 1d node is connected to multiple 2d face circumcenters (ggeo_make1D2Dembeddedlinks_dll) More...
 
MKERNEL_API int mkernel_contacts_compute_single (int meshKernelId, const int *oneDNodeMask, const GeometryList &polygons, double projectionFactor)
 Computes 1d-2d contacts, where each single 1d node is connected to one mesh2d face circumcenter (ggeo_make1D2Dinternalnetlinks_dll) More...
 
MKERNEL_API int mkernel_contacts_compute_with_points (int meshKernelId, const int *oneDNodeMask, const GeometryList &points)
 Computes 1d-2d contacts, where 1d nodes are connected to the 2d faces mass centers containing the input point (ggeo_make1D2Dstreetinletpipes_dll) More...
 
MKERNEL_API int mkernel_contacts_compute_with_polygons (int meshKernelId, const int *oneDNodeMask, const GeometryList &polygons)
 Computes 1d-2d contacts, where a 2d face per polygon is connected to the closest 1d node (ggeo_make1D2Droofgutterpipes_dll) More...
 
MKERNEL_API int mkernel_contacts_get_data (int meshKernelId, Contacts &contacts)
 Gets the 1d-2d contacts indices (from index / to indices) More...
 
MKERNEL_API int mkernel_contacts_get_dimensions (int meshKernelId, Contacts &contacts)
 Gets the number of 1d-2d contacts. More...
 
MKERNEL_API int mkernel_contacts_set (int meshKernelId, const Contacts &contacts)
 Sets the 1d-2d contacts. More...
 
MKERNEL_API int mkernel_curvilinear_compute_curvature (int meshKernelId, int direction, double *curvature)
 Computes the curvature of a curvilinear grid. More...
 
MKERNEL_API int mkernel_curvilinear_compute_orthogonal_grid_from_splines (int meshKernelId, const GeometryList &geometryList, const meshkernel::CurvilinearParameters &curvilinearParameters, const meshkernel::SplinesToCurvilinearParameters &splinesToCurvilinearParameters)
 Generates curvilinear grid from splines with the advancing front method. More...
 
MKERNEL_API int mkernel_curvilinear_compute_grid_from_splines (int meshKernelId, const GeometryList &geometryList, const meshkernel::CurvilinearParameters &curvilinearParameters)
 Generates curvilinear grid from splines. More...
 
MKERNEL_API int mkernel_curvilinear_compute_smoothness (int meshKernelId, int direction, double *smoothness)
 Computes the smoothness of a curvilinear grid. More...
 
MKERNEL_API int mkernel_curvilinear_compute_transfinite_from_polygon (int meshKernelId, const GeometryList &polygons, int firstNode, int secondNode, int thirdNode, int useFourthSide)
 Computes a curvilinear grid in a polygon. 3 separate polygon nodes need to be selected. More...
 
MKERNEL_API int mkernel_curvilinear_compute_transfinite_from_splines (int meshKernelId, const GeometryList &splines, const meshkernel::CurvilinearParameters &curvilinearParameters)
 Generates curvilinear grid from splines with transfinite interpolation. More...
 
MKERNEL_API int mkernel_curvilinear_compute_transfinite_from_triangle (int meshKernelId, const GeometryList &polygon, int firstNode, int secondNode, int thirdNode)
 Computes a curvilinear grid in a triangle. 3 separate polygon nodes need to be selected. More...
 
MKERNEL_API int mkernel_curvilinear_convert_to_mesh2d (int meshKernelId)
 Converts a curvilinear grid to an unstructured mesh.
 
MKERNEL_API int mkernel_curvilinear_delete_exterior (int meshKernelId, double xFirstPointCoordinate, double yFirstPointCoordinate, double xSecondPointCoordinate, double ySecondPointCoordinate)
 Delete the exterior part of a curvilinear gris. More...
 
MKERNEL_API int mkernel_curvilinear_delete_interior (int meshKernelId, double xFirstPointCoordinate, double yFirstPointCoordinate, double xSecondPointCoordinate, double ySecondPointCoordinate)
 Delete the interior part of a curvilinear gris. More...
 
MKERNEL_API int mkernel_curvilinear_delete_node (int meshKernelId, double xPointCoordinate, double yPointCoordinate)
 Delete the node closest to a point. More...
 
MKERNEL_API int mkernel_curvilinear_delete_orthogonal_grid_from_splines (int meshKernelId)
 Finalizes curvilinear grid from splines algorithm. More...
 
MKERNEL_API int mkernel_curvilinear_derefine (int meshKernelId, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner)
 Directional curvilinear grid de-refinement. Grid lines are removed perpendicularly to the segment defined by lowerLeftCorner and xUpperRightCorner. More...
 
MKERNEL_API int mkernel_curvilinear_finalize_line_shift (int meshKernelId)
 Resets the instance of the line shift algorithm in MeshKernelState. More...
 
MKERNEL_API int mkernel_curvilinear_finalize_orthogonalize (int meshKernelId)
 Resets the CurvilinearGridOrthogonalization instance in MeshKernelState. More...
 
MKERNEL_API int mkernel_curvilinear_get_data (int meshKernelId, CurvilinearGrid &curvilinearGrid)
 Gets the curvilinear grid data as a CurvilinearGrid struct (converted as set of edges and nodes) More...
 
MKERNEL_API int mkernel_curvilinear_get_boundaries_as_polygons (int meshKernelId, int lowerLeftN, int lowerLeftM, int upperRightN, int upperRightM, GeometryList &boundaryPolygons)
 Gets the boundary polygon of a curvilinear grid, nodes with invalid coordinates are excluded. More...
 
MKERNEL_API int mkernel_curvilinear_count_boundaries_as_polygons (int meshKernelId, int lowerLeftN, int lowerLeftM, int upperRightN, int upperRightM, int &numberOfPolygonNodes)
 Count the number of nodes in curvilinear grid boundary polygons. More...
 
MKERNEL_API int mkernel_curvilinear_get_dimensions (int meshKernelId, CurvilinearGrid &curvilinearGrid)
 Gets the curvilinear grid dimensions as a CurvilinearGrid struct (converted as set of edges and nodes). More...
 
MKERNEL_API int mkernel_curvilinear_get_location_index (int meshKernelId, double xCoordinate, double yCoordinate, int locationType, const BoundingBox &boundingBox, int &locationIndex)
 Gets the grid location closet to a specific coordinate. More...
 
MKERNEL_API int mkernel_curvilinear_initialize_line_shift (int meshKernelId)
 Initializes the curvilinear line shift algorithm. More...
 
MKERNEL_API int mkernel_curvilinear_initialize_orthogonal_grid_from_splines (int meshKernelId, const GeometryList &geometryList, const meshkernel::CurvilinearParameters &curvilinearParameters, const meshkernel::SplinesToCurvilinearParameters &splinesToCurvilinearParameters)
 Generates a curvilinear grid from splines with the advancing front method. Initialization step (interactive) More...
 
MKERNEL_API int mkernel_curvilinear_initialize_orthogonalize (int meshKernelId, const meshkernel::OrthogonalizationParameters &orthogonalizationParameters)
 Initializes the orthogonal curvilinear algorithm. More...
 
MKERNEL_API int mkernel_curvilinear_insert_face (int meshKernelId, double xCoordinate, double yCoordinate)
 Inserts a new face on a curvilinear grid. The new face will be inserted on top of the closest edge by linear extrapolation. More...
 
MKERNEL_API int mkernel_curvilinear_iterate_orthogonal_grid_from_splines (int meshKernelId, int layer)
 One advancement of the front in curvilinear grid from splines (interactive) More...
 
MKERNEL_API int mkernel_curvilinear_line_attraction_repulsion (int meshKernelId, double repulsionParameter, double xFirstNodeOnTheLine, double yFirstNodeOnTheLine, double xSecondNodeOnTheLine, double ySecondNodeOnTheLine, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner)
 Attracts/repulses grid lines in a block towards another set grid line. More...
 
MKERNEL_API int mkernel_curvilinear_line_mirror (int meshKernelId, double mirroringFactor, double xFirstGridLineNode, double yFirstGridLineNode, double xSecondGridLineNode, double ySecondGridLineNode)
 Mirrors a boundary gridline outwards. The boundary grid line is defined by its starting and ending points. More...
 
MKERNEL_API int mkernel_curvilinear_line_shift (int meshKernelId)
 Computes the new grid, shifting the line towards the moved nodes and distributing the shifting in block specified before. More...
 
MKERNEL_API int mkernel_curvilinear_compute_rectangular_grid (int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters)
 Computes a rectangular curvilinear grid. More...
 
MKERNEL_API int mkernel_curvilinear_compute_rectangular_grid_from_polygon (int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters, const GeometryList &geometryList)
 Computes a rectangular curvilinear grid from polygon. More...
 
MKERNEL_API int mkernel_curvilinear_compute_rectangular_grid_on_extension (int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters)
 Computes a rectangular curvilinear grid on a defined extension. More...
 
MKERNEL_API int mkernel_curvilinear_compute_circular_grid (int meshKernelId, const meshkernel::MakeGridParameters &parameters)
 Compute a rectangular or circular curvilinear grid. More...
 
MKERNEL_API int mkernel_curvilinear_move_node (int meshKernelId, double xFromPoint, double yFromPoint, double xToPoint, double yToPoint)
 Moves a point of a curvilinear grid from one location to another. More...
 
MKERNEL_API int mkernel_curvilinear_move_node_line_shift (int meshKernelId, double xFromCoordinate, double yFromCoordinate, double xToCoordinate, double yToCoordinate)
 Moves a node of the line to shift, the operation can be performed multiple times. More...
 
MKERNEL_API int mkernel_curvilinear_orthogonalize (int meshKernelId)
 Orthogonalize a curvilinear grid. More...
 
MKERNEL_API int mkernel_curvilinear_refine (int meshKernelId, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner, int refinement)
 Directional curvilinear grid refinement. Additional gridlines are added perpendicularly to the segment defined by lowerLeftCorner and xUpperRightCorner. More...
 
MKERNEL_API int mkernel_curvilinear_refresh_orthogonal_grid_from_splines (int meshKernelId)
 Converts curvilinear grid to mesh and refreshes the state (interactive) More...
 
MKERNEL_API int mkernel_curvilinear_full_refine (int meshKernelId, int mRefinement, int nRefinement)
 Curvilinear grid refinement. Additional gridlines are added in both directions, over the entire grid. More...
 
MKERNEL_API int mkernel_curvilinear_set (int meshKernelId, const CurvilinearGrid &grid)
 Sets the curvilinear grid. More...
 
MKERNEL_API int mkernel_curvilinear_set_block_line_shift (int meshKernelId, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner)
 Defines a block on the curvilinear where the shifting is distributed. More...
 
MKERNEL_API int mkernel_curvilinear_set_block_orthogonalize (int meshKernelId, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner)
 Define a block on the curvilinear grid where to perform orthogonalization. More...
 
MKERNEL_API int mkernel_curvilinear_set_frozen_lines_orthogonalize (int meshKernelId, double xFirstGridLineNode, double yFirstGridLineNode, double xSecondGridLineNode, double ySecondGridLineNode)
 Freezes a line in the curvilinear orthogonalization process. More...
 
MKERNEL_API int mkernel_curvilinear_set_line_line_shift (int meshKernelId, double xFirstGridLineNode, double yFirstGridLineNode, double xSecondGridLineNode, double ySecondGridLineNode)
 Sets the start and end nodes of the line to shift. More...
 
MKERNEL_API int mkernel_curvilinear_smoothing (int meshKernelId, int smoothingIterations, double xLowerLeftCorner, double yLowerLeftCorner, double xUpperRightCorner, double yUpperRightCorner)
 Smooths a curvilinear grid. More...
 
MKERNEL_API int mkernel_curvilinear_smoothing_directional (int meshKernelId, int smoothingIterations, double xFirstGridlineNode, double yFirstGridlineNode, double xSecondGridLineNode, double ySecondGridLineNode, double xLowerLeftCornerSmoothingArea, double yLowerLeftCornerSmoothingArea, double xUpperRightCornerSmootingArea, double yUpperRightCornerSmootingArea)
 Smooths a curvilinear grid along the direction specified by a segment. More...
 
MKERNEL_API int mkernel_curvilinear_snap_to_landboundary (int meshKernelId, const GeometryList &land, double sectionControlPoint1x, double sectionControlPoint1y, double sectionControlPoint2x, double sectionControlPoint2y, double regionControlPointX=mkernel_get_separator(), double regionControlPointY=mkernel_get_separator())
 Sets the curvilinear grid. More...
 
MKERNEL_API int mkernel_curvilinear_snap_to_spline (int meshKernelId, const GeometryList &spline, double sectionControlPoint1x, double sectionControlPoint1y, double sectionControlPoint2x, double sectionControlPoint2y, double regionControlPointX=mkernel_get_separator(), double regionControlPointY=mkernel_get_separator())
 Sets the curvilinear grid. More...
 
MKERNEL_API int mkernel_deallocate_state (int meshKernelId)
 Deallocate mesh state. More...
 
MKERNEL_API int mkernel_expunge_state (int meshKernelId)
 Deallocate mesh state and remove it completely, no undo for this meshKernelId will be possible after expunging. More...
 
MKERNEL_API int mkernel_get_averaging_method_closest_point (int &method)
 Gets an int indicating the closest point averaging method type. More...
 
MKERNEL_API int mkernel_get_averaging_method_inverse_distance_weighting (int &method)
 Gets an int indicating the inverse distance weights averaging method type. More...
 
MKERNEL_API int mkernel_get_averaging_method_max (int &method)
 Gets an int indicating the max value averaging method type. More...
 
MKERNEL_API int mkernel_get_averaging_method_min (int &method)
 Gets an int indicating the minimum averaging method type. More...
 
MKERNEL_API int mkernel_get_averaging_method_min_absolute_value (int &method)
 Gets an int indicating the minimum absolute value averaging method type. More...
 
MKERNEL_API int mkernel_get_averaging_method_simple_averaging (int &method)
 Gets an int indicating the simple averaging method type. More...
 
MKERNEL_API int mkernel_get_edges_location_type (int &type)
 Gets an int indicating the edge location type. More...
 
MKERNEL_API int mkernel_get_error (char *errorMessage)
 Gets pointer to error message. More...
 
MKERNEL_API int mkernel_get_exit_code_success (int &exitCode)
 Gets the success exit code. More...
 
MKERNEL_API int mkernel_get_exit_code_meshkernel_error (int &exitCode)
 Gets the exit code of an exception of type MeshKernelError. More...
 
MKERNEL_API int mkernel_get_exit_code_not_implemented_error (int &exitCode)
 Gets the exit code of an exception of type NotImplementedCode. More...
 
MKERNEL_API int mkernel_get_exit_code_algorithm_error (int &exitCode)
 Gets the exit code of an exception of type AlgorithmexitCode. More...
 
MKERNEL_API int mkernel_get_exit_code_constraint_error (int &exitCode)
 Gets the exit code of an exception of type ConstraintexitCode. More...
 
MKERNEL_API int mkernel_get_exit_code_mesh_geometry_error (int &exitCode)
 Gets the exit code of an exception of type MeshGeometryexitCode. More...
 
MKERNEL_API int mkernel_get_exit_code_linear_algebra_error (int &exitCode)
 Gets the exit code of an exception of type LinearAlgebraexitCode. More...
 
MKERNEL_API int mkernel_get_exit_code_range_error (int &exitCode)
 Gets the exit code of an exception of type RangeexitCode. More...
 
MKERNEL_API int mkernel_get_exit_code_stdlib_exception (int &exitCode)
 Gets the exit code of an exception of type std::exception. More...
 
MKERNEL_API int mkernel_get_exit_code_unknown_exception (int &exitCode)
 Gets the exit code of an exception of unknown type. More...
 
MKERNEL_API int mkernel_get_faces_location_type (int &type)
 Gets an int indicating the faces location type. More...
 
MKERNEL_API int mkernel_get_geometry_error (int &invalidIndex, int &type)
 Gets the index of the erroneous entity. More...
 
MKERNEL_API int mkernel_get_interpolation_type_short (int &type)
 Get the integer indicating the interpolation type short. More...
 
MKERNEL_API int mkernel_get_interpolation_type_float (int &type)
 Get the integer indicating the interpolation type float. More...
 
MKERNEL_API int mkernel_get_interpolation_type_int (int &type)
 Get the integer indicating the interpolation type int. More...
 
MKERNEL_API int mkernel_get_interpolation_type_double (int &type)
 Get the integer indicating the interpolation type double. More...
 
MKERNEL_API int mkernel_get_nodes_location_type (int &type)
 Gets an int indicating the node location type. More...
 
MKERNEL_API int mkernel_get_projection (int meshKernelId, int &projection)
 Gets the coordinate projection of the meshkernel state. More...
 
MKERNEL_API int mkernel_get_projection_cartesian (int &projection)
 Gets an int indicating the cartesian projection. More...
 
MKERNEL_API int mkernel_get_projection_spherical (int &projection)
 Gets an int indicating the spherical projection. More...
 
MKERNEL_API int mkernel_get_projection_spherical_accurate (int &projection)
 Gets an int indicating the spherical accurate projection. More...
 
MKERNEL_API int mkernel_get_splines (const GeometryList &geometryListIn, GeometryList &geometryListOut, int numberOfPointsBetweenNodes)
 Get the computed spline points between two corner nodes. More...
 
MKERNEL_API int mkernel_get_version (char *version)
 Gets pointer to version string. More...
 
MKERNEL_API int mkernel_mesh1d_get_data (int meshKernelId, Mesh1D &mesh1d)
 Gets the Mesh1D data. More...
 
MKERNEL_API int mkernel_mesh1d_get_dimensions (int meshKernelId, Mesh1D &mesh1d)
 Gets the Mesh1D data dimensions. More...
 
MKERNEL_API int mkernel_mesh1d_set (int meshKernelId, const Mesh1D &mesh1d)
 Sets the meshkernel::Mesh1D state. More...
 
MKERNEL_API int mkernel_mesh1d_add (int meshKernelId, const Mesh1D &mesh1d)
 Adds a mesh to the meshkernel::Mesh1D state. More...
 
MKERNEL_API int mkernel_mesh2d_averaging_interpolation (int meshKernelId, const GeometryList &samples, int locationType, int averagingMethodType, double relativeSearchSize, size_t minNumSamples, GeometryList &results)
 AveragingInterpolation interpolation (ec_module) More...
 
MKERNEL_API int mkernel_mesh2d_compute_inner_ortogonalization_iteration (int meshKernelId)
 Performs inner orthogonalization iteration, by slowly moving the mesh nodes to new optimal positions (interactive mode). More...
 
MKERNEL_API int mkernel_mesh2d_rotate (int meshKernelId, double centreX, double centreY, double theta)
 Rotate a mesh2d about a point. More...
 
MKERNEL_API int mkernel_splines_snap_to_landboundary (int meshKernelId, const GeometryList &land, GeometryList &splines, int startSplineIndex, int endSplineIndex)
 Snaps the spline (or splines) to the land boundary. More...
 
MKERNEL_API int mkernel_mesh2d_translate (int meshKernelId, double translationX, double translationY)
 Translate a mesh2d. More...
 
MKERNEL_API int mkernel_mesh2d_casulli_derefinement_elements (int meshKernelId, GeometryList &elements)
 Get list of elements that will be removed after the Casulli de-refinement algorithm. More...
 
MKERNEL_API int mkernel_mesh2d_casulli_derefinement_elements_on_polygon (int meshKernelId, const GeometryList &polygonGeometry, GeometryList &elements)
 Get list of elements that will be removed after the Casulli de-refinement algorithm. More...
 
MKERNEL_API int mkernel_mesh2d_casulli_derefinement (int meshKernelId)
 De-refine mesh using the Casulli de-refinement algorithm. More...
 
MKERNEL_API int mkernel_mesh2d_casulli_derefinement_on_polygon (int meshKernelId, const GeometryList &polygons)
 De-refine mesh using the Casulli de-refinement algorithm. More...
 
MKERNEL_API int mkernel_mesh2d_casulli_refinement (int meshKernelId)
 Refine mesh using the Casulli refinement algorithm. More...
 
MKERNEL_API int mkernel_mesh2d_casulli_refinement_on_polygon (int meshKernelId, const GeometryList &polygons)
 Refine mesh using the Casulli refinement algorithm. More...
 
MKERNEL_API int mkernel_mesh2d_compute_orthogonalization (int meshKernelId, int projectToLandBoundaryOption, const meshkernel::OrthogonalizationParameters &orthogonalizationParameters, const GeometryList &selectingPolygon, const GeometryList &landBoundaries)
 
MKERNEL_API int mkernel_mesh2d_connect_meshes (int meshKernelId, const Mesh2D &mesh2d, double searchFraction)
 Connect two or more disconnected regions along boundary. More...
 
MKERNEL_API int mkernel_mesh2d_convert_projection (int meshKernelId, int projectionType, const char *const zoneString)
 Converts the projection of a mesh2d. More...
 
MKERNEL_API int mkernel_mesh2d_convert_to_curvilinear (int meshKernelId, double xPointCoordinate, double yPointCoordinate)
 Converts a mesh to a curvilinear mesh. More...
 
MKERNEL_API int mkernel_mesh2d_count_hanging_edges (int meshKernelId, int &numEdges)
 Count the number of hanging edges in a mesh2d. An hanging edge is an edge where one of the two nodes is not connected. More...
 
MKERNEL_API int mkernel_mesh2d_count_mesh_boundaries_as_polygons (int meshKernelId, int &numberOfPolygonNodes)
 Counts the number of polygon nodes contained in the mesh boundary polygons computed in function mkernel_mesh2d_get_mesh_boundaries_as_polygons More...
 
MKERNEL_API int mkernel_mesh2d_count_nodes_in_polygons (int meshKernelId, const GeometryList &geometryListIn, int inside, int &numberOfMeshNodes)
 Counts the number of selected mesh node indices. More...
 
MKERNEL_API int mkernel_mesh2d_count_obtuse_triangles (int meshKernelId, int &numObtuseTriangles)
 Gets the number of obtuse mesh2d triangles. Obtuse triangles are those having one edge longer than the sum of the other two. More...
 
MKERNEL_API int mkernel_mesh2d_count_small_flow_edge_centers (int meshKernelId, double smallFlowEdgesLengthThreshold, int &numSmallFlowEdges)
 Counts the number of small mesh2d flow edges. The flow edges are the edges connecting faces circumcenters. More...
 
MKERNEL_API int mkernel_mesh2d_delete (int meshKernelId, const GeometryList &polygon, int deletionOption, int invertDeletion)
 Deletes a mesh in a polygon using several options. More...
 
MKERNEL_API int mkernel_mesh2d_delete_edge (int meshKernelId, double xCoordinate, double yCoordinate, double xLowerLeftBoundingBox, double yLowerLeftBoundingBox, double xUpperRightBoundingBox, double yUpperRightBoundingBox)
 Deletes the closest mesh2d edge to a point. The coordinates of the edge middle points are used for calculating the distances to the point. More...
 
MKERNEL_API int mkernel_mesh2d_delete_edge_by_index (int meshKernelId, int edgeIndex)
 Deletes a mesh2d edge given the index of the edge. The coordinates of the edge middle points are used for calculating the distances to the point. More...
 
MKERNEL_API int mkernel_mesh2d_delete_hanging_edges (int meshKernelId)
 Deletes all hanging edges. An hanging edge is an edge where one of the two nodes is not connected. More...
 
MKERNEL_API int mkernel_mesh2d_delete_node (int meshKernelId, int nodeIndex)
 Deletes a mesh2d node. More...
 
MKERNEL_API int mkernel_mesh2d_delete_orthogonalization (int meshKernelId)
 Cleans the orthogonalization algorithm state, allocated in mkernel_mesh2d_initialize_orthogonalization (interactive mode) More...
 
MKERNEL_API int mkernel_mesh2d_delete_small_flow_edges_and_small_triangles (int meshKernelId, double smallFlowEdgesThreshold, double minFractionalAreaTriangles)
 Deletes all small mesh2d flow edges and small triangles. The flow edges are the edges connecting faces circumcenters. More...
 
MKERNEL_API int mkernel_mesh2d_finalize_inner_ortogonalization_iteration (int meshKernelId)
 Finalizes the orthogonalization outer iteration, computing the new coefficients for grid adaption and the new face circumcenters (interactive mode). More...
 
MKERNEL_API int mkernel_mesh2d_flip_edges (int meshKernelId, int isTriangulationRequired, int projectToLandBoundaryRequired, const GeometryList &selectingPolygon, const GeometryList &landBoundaries)
 Flips mesh2d edges, to optimize the mesh smoothness. This operation is usually performed after mkernel_mesh2d_refine_based_on_samples or mkernel_mesh2d_refine_based_on_polygon. More...
 
MKERNEL_API int mkernel_mesh2d_get_closest_node (int meshKernelId, double xCoordinateIn, double yCoordinateIn, double searchRadius, double xLowerLeftBoundingBox, double yLowerLeftBoundingBox, double xUpperRightBoundingBox, double yUpperRightBoundingBox, double &xCoordinateOut, double &yCoordinateOut)
 Gets the closest mesh2d node coordinates to a point, searching within a radius. More...
 
MKERNEL_API int mkernel_mesh2d_get_data (int meshKernelId, Mesh2D &mesh2d)
 Gets the Mesh2D dimensions data. More...
 
MKERNEL_API int mkernel_mesh2d_get_orthogonality_property_type (int &type)
 Gets an int indicating the orthogonality property type for mesh2d. More...
 
MKERNEL_API int mkernel_mesh2d_get_node_edge_data (int meshKernelId, Mesh2D &mesh2d)
 Gets only the node and edge Mesh2D data. More...
 
MKERNEL_API int mkernel_mesh2d_get_dimensions (int meshKernelId, Mesh2D &mesh2d)
 Gets the Mesh2D dimensions. More...
 
MKERNEL_API int mkernel_mesh2d_get_edge (int meshKernelId, double xCoordinate, double yCoordinate, double xLowerLeftBoundingBox, double yLowerLeftBoundingBox, double xUpperRightBoundingBox, double yUpperRightBoundingBox, int &edgeIndex)
 Gets the closest mesh2d edge to a point in a bounding box. More...
 
MKERNEL_API int mkernel_mesh2d_get_hanging_edges (int meshKernelId, int *edges)
 Gets the indices of hanging edges. An hanging edge is an edge where one of the two nodes is not connected. More...
 
MKERNEL_API int mkernel_mesh2d_get_face_polygons (int meshKernelId, int numEdges, const GeometryList &facePolygons)
 Gets the faces polygons with a number of edges larger or equal to numEdges. More...
 
MKERNEL_API int mkernel_mesh2d_get_face_polygons_dimension (int meshKernelId, int numEdges, int &geometryListDimension)
 Gets the dimension of faces polygons with a number of edges larger or equal to numNodes. More...
 
MKERNEL_API int mkernel_mesh2d_get_filtered_face_polygons_dimension (int meshKernelId, int propertyValue, double minValue, double maxValue, int &geometryListDimension)
 Retrieves the dimension of the geometry list containing the face polygons within the filtering range. More...
 
MKERNEL_API int mkernel_mesh2d_get_filtered_face_polygons (int meshKernelId, int propertyValue, double minValue, double maxValue, const GeometryList &facePolygons)
 Gets the geometry list containing the face polygons within the filtering range. More...
 
MKERNEL_API int mkernel_mesh2d_get_location_index (int meshKernelId, double xCoordinate, double yCoordinate, int locationType, const BoundingBox &boundingBox, int &locationIndex)
 Gets the mesh location closet to a specific coordinate. More...
 
MKERNEL_API int mkernel_mesh2d_get_mesh_boundaries_as_polygons (int meshKernelId, GeometryList &boundaryPolygons)
 Retrieves the boundaries of a mesh as a series of separated polygons. More...
 
MKERNEL_API int mkernel_mesh2d_get_node_index (int meshKernelId, double xCoordinate, double yCoordinate, double searchRadius, double xLowerLeftBoundingBox, double yLowerLeftBoundingBox, double xUpperRightBoundingBox, double yUpperRightBoundingBox, int &nodeIndex)
 Finds the mesh2d node closest to a point, within a search radius. More...
 
MKERNEL_API int mkernel_mesh2d_get_nodes_in_polygons (int meshKernelId, const GeometryList &geometryListIn, int inside, int *selectedNodes)
 Gets the indices of the mesh2d nodes selected with a polygon. More...
 
MKERNEL_API int mkernel_mesh2d_get_obtuse_triangles_mass_centers (int meshKernelId, GeometryList &result)
 Gets the mass centers of obtuse mesh2d triangles. Obtuse triangles are those having one edge longer than the sum of the other two. More...
 
MKERNEL_API int mkernel_mesh2d_get_orthogonality (int meshKernelId, GeometryList &geometryList)
 Gets the mesh orthogonality, expressed as the ratio between the edges and the segments connecting the face circumcenters. More...
 
MKERNEL_API int mkernel_mesh2d_get_property (int meshKernelId, int propertyValue, const GeometryList &geometrylist)
 Retrieves a specified property of a 2D mesh. More...
 
MKERNEL_API int mkernel_mesh2d_get_property_dimension (int meshKernelId, int propertyValue, int &dimension)
 The dimension of a specified property of a 2D mesh. More...
 
MKERNEL_API int mkernel_mesh2d_get_small_flow_edge_centers (int meshKernelId, double smallFlowEdgesThreshold, GeometryList &result)
 Gets the small mesh2d flow edges. The flow edges are the edges connecting faces circumcenters. More...
 
MKERNEL_API int mkernel_mesh2d_get_smoothness (int meshKernelId, GeometryList &geometryList)
 Gets the smoothness, expressed as the ratio between the values of two neighboring faces areas. More...
 
MKERNEL_API int mkernel_mesh2d_initialize_orthogonalization (int meshKernelId, int projectToLandBoundaryOption, meshkernel::OrthogonalizationParameters &orthogonalizationParameters, const GeometryList &selectingPolygon, const GeometryList &landBoundaries)
 Initialization of the meshkernel::OrthogonalizationAndSmoothing algorithm. More...
 
MKERNEL_API int mkernel_mesh2d_insert_edge (int meshKernelId, int startNode, int endNode, int &newEdgeIndex)
 Insert a new mesh2d edge connecting two nodes. More...
 
MKERNEL_API int mkernel_mesh2d_insert_edge_from_coordinates (int meshKernelId, double firstNodeX, double firstNodeY, double secondNodeX, double secondNodeY, int &firstNodeIndex, int &secondNodeIndex, int &edgeIndex)
 Insert a new mesh2d edge from 2 coordinates. More...
 
MKERNEL_API int mkernel_mesh2d_insert_node (int meshKernelId, double xCoordinate, double yCoordinate, int &nodeIndex)
 Insert a new mesh2d node at a specific coordinate. More...
 
MKERNEL_API int mkernel_mesh2d_intersections_from_polygon (int meshKernelId, const GeometryList &boundaryPolygon, int *edgeNodes, int *edgeIndex, double *edgeDistances, double *segmentDistances, int *segmentIndexes, int *faceIndexes, int *faceNumEdges, int *faceEdgeIndex)
 Gets the edges intersected by a polygon, with additional information on the intersections. More...
 
MKERNEL_API int mkernel_mesh2d_make_global (int meshKernelId, int numLongitudeNodes, int numLatitudeNodes)
 Compute the global mesh with a given number of points along the longitude and latitude directions. More...
 
MKERNEL_API int mkernel_mesh2d_make_triangular_mesh_from_polygon (int meshKernelId, const GeometryList &polygonPoints)
 Generates a triangular mesh2d grid within a polygon. The size of the triangles is determined from the length of the polygon edges. More...
 
MKERNEL_API int mkernel_mesh2d_make_triangular_mesh_from_samples (int meshKernelId, const GeometryList &samples)
 Makes a triangular mesh from a set of samples, triangulating the sample points. More...
 
MKERNEL_API int mkernel_mesh2d_make_rectangular_mesh (int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters)
 Makes a rectangular mesh. More...
 
MKERNEL_API int mkernel_mesh2d_make_rectangular_mesh_from_polygon (int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters, const GeometryList &geometryList)
 Makes a rectangular mesh from a polygon. More...
 
MKERNEL_API int mkernel_mesh2d_make_rectangular_mesh_on_extension (int meshKernelId, const meshkernel::MakeGridParameters &makeGridParameters)
 Makes a rectangular mesh on a defined extension. More...
 
MKERNEL_API int mkernel_mesh2d_merge_nodes (int meshKernelId, const GeometryList &geometryListIn)
 Merges the mesh2d nodes within a distance of 0.001 m, effectively removing all small edges. More...
 
MKERNEL_API int mkernel_mesh2d_merge_nodes_with_merging_distance (int meshKernelId, const GeometryList &geometryListIn, double mergingDistance)
 Merges the mesh2d nodes within a distance of 0.001 m, effectively removing all small edges. More...
 
MKERNEL_API int mkernel_mesh2d_merge_two_nodes (int meshKernelId, int firstNode, int secondNode)
 Merges two mesh2d nodes into one. More...
 
MKERNEL_API int mkernel_mesh2d_move_node (int meshKernelId, double xCoordinate, double yCoordinate, int nodeIndex)
 Moves a mesh2d node to a new position. More...
 
MKERNEL_API int mkernel_mesh2d_prepare_outer_iteration_orthogonalization (int meshKernelId)
 Prepares an outer orthogonalization iteration, computing the new orthogonalization and smoothing weights from the modified mesh geometry (in interactive mode). More...
 
MKERNEL_API int mkernel_mesh2d_refine_based_on_gridded_samples (int meshKernelId, const GriddedSamples &griddedSamples, const meshkernel::MeshRefinementParameters &meshRefinementParameters, bool useNodalRefinement)
 Refine based on gridded samples. More...
 
MKERNEL_API int mkernel_mesh2d_refine_based_on_polygon (int meshKernelId, const GeometryList &geometryList, const meshkernel::MeshRefinementParameters &meshRefinementParameters)
 Refines a mesh2d within a polygon. Refinement is achieved by splitting the edges contained in the polygon by two. More...
 
MKERNEL_API int mkernel_mesh2d_refine_based_on_samples (int meshKernelId, const GeometryList &samples, double relativeSearchRadius, int minimumNumSamples, const meshkernel::MeshRefinementParameters &meshRefinementParameters)
 Refines a mesh2d based on samples. Refinement is achieved by successive splits of the face edges. More...
 
MKERNEL_API int mkernel_mesh2d_refine_ridges_based_on_gridded_samples (int meshKernelId, const GriddedSamples &griddedSamples, double relativeSearchRadius, int minimumNumSamples, int numberOfSmoothingIterations, const meshkernel::MeshRefinementParameters &meshRefinementParameters)
 Refines a mesh2d based on samples with ridge refinement. This method automatically detects the ridges in a sample set. More...
 
MKERNEL_API int mkernel_mesh2d_remove_disconnected_regions (int meshKernelId)
 Remove any disconnected regions from a mesh2d. More...
 
MKERNEL_API int mkernel_mesh2d_set (int meshKernelId, const Mesh2D &mesh2d)
 Sets the meshkernel::Mesh2D state. More...
 
MKERNEL_API int mkernel_mesh2d_snap_to_landboundary (int meshKernelId, const GeometryList &selectingPolygon, const GeometryList &landBoundaries)
 Snaps a mesh to a land boundary. More...
 
MKERNEL_API int mkernel_mesh2d_split_row (int meshKernelId, int firstNode, int secondNode)
 An-isotropically refines the elements along a row or column, given a starting edge. More...
 
MKERNEL_API int mkernel_mesh2d_add (int meshKernelId, const Mesh2D &mesh2d)
 Adds a mesh to the meshkernel::Mesh2D state. More...
 
MKERNEL_API int mkernel_mesh2d_triangulation_interpolation (int meshKernelId, const GeometryList &samples, int locationType, GeometryList &results)
 Triangle interpolation (ec_module) More...
 
MKERNEL_API int mkernel_network1d_compute_fixed_chainages (int meshKernelId, double *fixedChainages, int sizeFixedChainages, double minFaceSize, double fixedChainagesOffset)
 Compute the network chainages from fixed point locations. More...
 
MKERNEL_API int mkernel_network1d_compute_offsetted_chainages (int meshKernelId, double offset)
 Compute the network chainages at a regular offset. More...
 
MKERNEL_API int mkernel_network1d_set (int meshKernelId, const GeometryList &polylines)
 Sets the meshkernel::Network1D state. More...
 
MKERNEL_API int mkernel_network1d_to_mesh1d (int meshKernelId, double minFaceSize)
 Convert network chainages to mesh1d nodes and edges. More...
 
MKERNEL_API int mkernel_polygon_count_offset (int meshKernelId, const GeometryList &geometryListIn, int innerPolygon, double distance, int &numberOfPolygonNodes)
 Counts the number of polygon nodes resulting from polygon offset. More...
 
MKERNEL_API int mkernel_polygon_count_refine (int meshKernelId, const GeometryList &polygonToRefine, int firstIndex, int secondIndex, double distance, int &numberOfPolygonNodes)
 Counts the number of polygon nodes resulting from polygon refinement with mkernel_polygon_refine. More...
 
MKERNEL_API int mkernel_polygon_count_linear_refine (int meshKernelId, const GeometryList &polygonToRefine, int firstIndex, int secondIndex, int &numberOfPolygonNodes)
 Counts the number of polygon nodes resulting from polygon refinement with mkernel_polygon_linear_refine. More...
 
MKERNEL_API int mkernel_polygon_get_included_points (int meshKernelId, const GeometryList &selectingPolygon, const GeometryList &polygonToSelect, GeometryList &selectionResults)
 Selects the polygon nodes within another polygon. More...
 
MKERNEL_API int mkernel_polygon_get_offset (int meshKernelId, const GeometryList &geometryListIn, int inWard, double distance, GeometryList &geometryListOut)
 Generate a new polygon from an existing one by offsetting the perimeter by a given distance. More...
 
MKERNEL_API int mkernel_polygon_refine (int meshKernelId, const GeometryList &polygonToRefine, int firstNodeIndex, int secondNodeIndex, double targetEdgeLength, GeometryList &refinedPolygon)
 Refines the polygon perimeter between two nodes. This interval is refined to achieve a target edge length. More...
 
MKERNEL_API int mkernel_polygon_linear_refine (int meshKernelId, const GeometryList &polygonToRefine, int firstNodeIndex, int secondNodeIndex, GeometryList &refinedPolygon)
 Linear refines the polygon perimeter between two nodes. More...
 
MKERNEL_API int mkernel_polygon_snap_to_landboundary (int meshKernelId, const GeometryList &land, GeometryList &polygon, int startIndex, int endIndex)
 Snaps the polygon to the land boundary. More...
 

Detailed Description

Contains all structs and functions exposed at the API level.

Function Documentation

◆ mkernel_allocate_state()

MKERNEL_API int meshkernelapi::mkernel_allocate_state ( int  projectionType,
int &  meshKernelId 
)

Creates a new mesh state and returns the generated meshKernelId.

Parameters
[in]projectionTypeCartesian (0), spherical (1) or spherical accurate(2) state
[out]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_clear_state()

MKERNEL_API int meshkernelapi::mkernel_clear_state ( )

Clear all internal mesh kernel state and undo actions, no undo will be possible after this.

Returns
Error code

◆ mkernel_clear_undo_state()

MKERNEL_API int meshkernelapi::mkernel_clear_undo_state ( )

Clear the undo state for all mesh kernel ids, no undo is possible after this.

Returns
Error code

◆ mkernel_clear_undo_state_for_id()

MKERNEL_API int meshkernelapi::mkernel_clear_undo_state_for_id ( int  meshKernelId)

Clear the undo state for particular mesh kernel id, no undo for the id is possible after this.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_contacts_compute_boundary()

MKERNEL_API int meshkernelapi::mkernel_contacts_compute_boundary ( int  meshKernelId,
const int *  oneDNodeMask,
const GeometryList polygons,
double  searchRadius 
)

Computes 1d-2d contacts, where 1d nodes are connected to the closest 2d faces at the boundary (ggeo_make1D2DRiverLinks_dll)

See also
meshkernel::Contacts::ComputeBoundaryContacts
Parameters
[in]meshKernelIdThe id of the mesh state.
[in]oneDNodeMaskThe mask to apply to 1d nodes (1 = generate a connection, 0 = do not generate a connection)
[in]polygonsThe points selecting the faces to connect.
[in]searchRadiusThe radius used for searching neighboring faces, if equal to constants::missing::doubleValue, the search radius will be calculated internally.
Returns
Error code

◆ mkernel_contacts_compute_multiple()

MKERNEL_API int meshkernelapi::mkernel_contacts_compute_multiple ( int  meshKernelId,
const int *  oneDNodeMask 
)

Computes 1d-2d contacts, where a single 1d node is connected to multiple 2d face circumcenters (ggeo_make1D2Dembeddedlinks_dll)

See also
meshkernel::Contacts::ComputeMultipleContacts
Parameters
[in]meshKernelIdThe id of the mesh state
[in]oneDNodeMaskThe mask to apply to 1d nodes (1 = generate a connection, 0 = do not generate a connection)
Returns
Error code

◆ mkernel_contacts_compute_single()

MKERNEL_API int meshkernelapi::mkernel_contacts_compute_single ( int  meshKernelId,
const int *  oneDNodeMask,
const GeometryList polygons,
double  projectionFactor 
)

Computes 1d-2d contacts, where each single 1d node is connected to one mesh2d face circumcenter (ggeo_make1D2Dinternalnetlinks_dll)

See also
meshkernel::Contacts::ComputeSingleContacts
Parameters
[in]meshKernelIdThe id of the mesh state
[in]oneDNodeMaskThe mask to apply to 1d nodes (1 = connect node, 0 = do not connect)
[in]polygonsThe polygons selecting the area where the 1d-2d contacts will be generated.
[in]projectionFactorThe projection factor used for generating links when 1d nodes are not inside mesh2d
Returns
Error code

◆ mkernel_contacts_compute_with_points()

MKERNEL_API int meshkernelapi::mkernel_contacts_compute_with_points ( int  meshKernelId,
const int *  oneDNodeMask,
const GeometryList points 
)

Computes 1d-2d contacts, where 1d nodes are connected to the 2d faces mass centers containing the input point (ggeo_make1D2Dstreetinletpipes_dll)

See also
meshkernel::Contacts::ComputeContactsWithPoints
Parameters
[in]meshKernelIdThe id of the mesh state
[in]oneDNodeMaskThe mask to apply to 1d nodes (1 = generate a connection, 0 = do not generate a connection)
[in]pointsThe points selecting the faces to connect
Returns
Error code

◆ mkernel_contacts_compute_with_polygons()

MKERNEL_API int meshkernelapi::mkernel_contacts_compute_with_polygons ( int  meshKernelId,
const int *  oneDNodeMask,
const GeometryList polygons 
)

Computes 1d-2d contacts, where a 2d face per polygon is connected to the closest 1d node (ggeo_make1D2Droofgutterpipes_dll)

See also
meshkernel::Contacts::ComputeContactsWithPolygons
Parameters
[in]meshKernelIdThe id of the mesh state
[in]oneDNodeMaskThe mask to apply to 1d nodes (1 = generate a connection, 0 = do not generate a connection)
[in]polygonsThe polygons to connect
Returns
Error code

◆ mkernel_contacts_get_data()

MKERNEL_API int meshkernelapi::mkernel_contacts_get_data ( int  meshKernelId,
Contacts contacts 
)

Gets the 1d-2d contacts indices (from index / to indices)

Parameters
[in]meshKernelIdThe id of the mesh state
[out]contactsContacts data
Returns
Error code

◆ mkernel_contacts_get_dimensions()

MKERNEL_API int meshkernelapi::mkernel_contacts_get_dimensions ( int  meshKernelId,
Contacts contacts 
)

Gets the number of 1d-2d contacts.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]contactsContacts data
Returns
Error code

◆ mkernel_contacts_set()

MKERNEL_API int meshkernelapi::mkernel_contacts_set ( int  meshKernelId,
const Contacts contacts 
)

Sets the 1d-2d contacts.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]contactsContacts data
Returns
Error code

◆ mkernel_curvilinear_compute_circular_grid()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_circular_grid ( int  meshKernelId,
const meshkernel::MakeGridParameters parameters 
)

Compute a rectangular or circular curvilinear grid.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]parametersThe structure containing the make grid parameters
Returns
Error code

◆ mkernel_curvilinear_compute_curvature()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_curvature ( int  meshKernelId,
int  direction,
double *  curvature 
)

Computes the curvature of a curvilinear grid.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]directionThe direction in which to compute the curvature
[out]curvatureThe grid curvature values in the selected direction
Returns
Error code

◆ mkernel_curvilinear_compute_grid_from_splines()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_grid_from_splines ( int  meshKernelId,
const GeometryList geometryList,
const meshkernel::CurvilinearParameters curvilinearParameters 
)

Generates curvilinear grid from splines.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]geometryListThe input splines corners
[in]curvilinearParametersThe input parameters to generate the curvilinear grid
Returns
Error code

◆ mkernel_curvilinear_compute_orthogonal_grid_from_splines()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_orthogonal_grid_from_splines ( int  meshKernelId,
const GeometryList geometryList,
const meshkernel::CurvilinearParameters curvilinearParameters,
const meshkernel::SplinesToCurvilinearParameters splinesToCurvilinearParameters 
)

Generates curvilinear grid from splines with the advancing front method.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]geometryListThe input splines corners
[in]curvilinearParametersThe input parameters to generate the curvilinear grid
[in]splinesToCurvilinearParametersThe parameters of the advancing front algorithm
Returns
Error code

◆ mkernel_curvilinear_compute_rectangular_grid()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_rectangular_grid ( int  meshKernelId,
const meshkernel::MakeGridParameters makeGridParameters 
)

Computes a rectangular curvilinear grid.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]makeGridParametersThe structure containing the make grid parameters
Returns
Error code

◆ mkernel_curvilinear_compute_rectangular_grid_from_polygon()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_rectangular_grid_from_polygon ( int  meshKernelId,
const meshkernel::MakeGridParameters makeGridParameters,
const GeometryList geometryList 
)

Computes a rectangular curvilinear grid from polygon.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]makeGridParametersThe structure containing the make grid parameters
[in]geometryListThe polygons to account for
Returns
Error code

◆ mkernel_curvilinear_compute_rectangular_grid_on_extension()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_rectangular_grid_on_extension ( int  meshKernelId,
const meshkernel::MakeGridParameters makeGridParameters 
)

Computes a rectangular curvilinear grid on a defined extension.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]makeGridParametersThe structure containing the make grid parameters
Returns
Error code

◆ mkernel_curvilinear_compute_smoothness()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_smoothness ( int  meshKernelId,
int  direction,
double *  smoothness 
)

Computes the smoothness of a curvilinear grid.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]directionThe direction in which to compute the smoothness
[out]smoothnessThe grid smoothness values in the selected direction
Returns
Error code

◆ mkernel_curvilinear_compute_transfinite_from_polygon()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_transfinite_from_polygon ( int  meshKernelId,
const GeometryList polygons,
int  firstNode,
int  secondNode,
int  thirdNode,
int  useFourthSide 
)

Computes a curvilinear grid in a polygon. 3 separate polygon nodes need to be selected.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonsThe input polygons
[in]firstNodeThe first selected node
[in]secondNodeThe second selected node
[in]thirdNodeThe third selected node
[in]useFourthSideUse the fourth polygon side to compute the curvilinear grid (0 no, 1 yes)
Returns
Error code

◆ mkernel_curvilinear_compute_transfinite_from_splines()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_transfinite_from_splines ( int  meshKernelId,
const GeometryList splines,
const meshkernel::CurvilinearParameters curvilinearParameters 
)

Generates curvilinear grid from splines with transfinite interpolation.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]splinesThe splines to use for curvilinear grid generation
[in]curvilinearParametersThe curvilinear parameters
Returns
Error code

◆ mkernel_curvilinear_compute_transfinite_from_triangle()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_compute_transfinite_from_triangle ( int  meshKernelId,
const GeometryList polygon,
int  firstNode,
int  secondNode,
int  thirdNode 
)

Computes a curvilinear grid in a triangle. 3 separate polygon nodes need to be selected.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonThe input polygons
[in]firstNodeThe first selected node
[in]secondNodeThe second selected node
[in]thirdNodeThe third node
Returns
Error code

◆ mkernel_curvilinear_count_boundaries_as_polygons()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_count_boundaries_as_polygons ( int  meshKernelId,
int  lowerLeftN,
int  lowerLeftM,
int  upperRightN,
int  upperRightM,
int &  numberOfPolygonNodes 
)

Count the number of nodes in curvilinear grid boundary polygons.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]lowerLeftNThe n index of the lower left corner
[in]lowerLeftMThe m index of the lower left corner
[in]upperRightNThe n index of the upper right corner
[in]upperRightMThe m index of the upper right corner
[out]numberOfPolygonNodesThe number of polygon nodes
Returns
Error code
Note
Refined boundary polygon values are cached, so that they can be copied

◆ mkernel_curvilinear_delete_exterior()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_delete_exterior ( int  meshKernelId,
double  xFirstPointCoordinate,
double  yFirstPointCoordinate,
double  xSecondPointCoordinate,
double  ySecondPointCoordinate 
)

Delete the exterior part of a curvilinear gris.

Parameters
meshKernelIdThe id of the mesh state
[in]xFirstPointCoordinateThe x coordinate of the first point
[in]yFirstPointCoordinateThe y coordinate of the first point
[in]xSecondPointCoordinateThe x coordinate of the second point
[in]ySecondPointCoordinateThe y coordinate of the second point
Returns
Error code

◆ mkernel_curvilinear_delete_interior()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_delete_interior ( int  meshKernelId,
double  xFirstPointCoordinate,
double  yFirstPointCoordinate,
double  xSecondPointCoordinate,
double  ySecondPointCoordinate 
)

Delete the interior part of a curvilinear gris.

Parameters
meshKernelIdThe id of the mesh state
[in]xFirstPointCoordinateThe x coordinate of the first point
[in]yFirstPointCoordinateThe y coordinate of the first point
[in]xSecondPointCoordinateThe x coordinate of the second point
[in]ySecondPointCoordinateThe y coordinate of the second point
Returns
Error code

◆ mkernel_curvilinear_delete_node()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_delete_node ( int  meshKernelId,
double  xPointCoordinate,
double  yPointCoordinate 
)

Delete the node closest to a point.

Parameters
meshKernelIdThe id of the mesh state
[in]xPointCoordinateThe x coordinate of the point
[in]yPointCoordinateThe y coordinate of the point
Returns
Error code

◆ mkernel_curvilinear_delete_orthogonal_grid_from_splines()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_delete_orthogonal_grid_from_splines ( int  meshKernelId)

Finalizes curvilinear grid from splines algorithm.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_curvilinear_derefine()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_derefine ( int  meshKernelId,
double  xLowerLeftCorner,
double  yLowerLeftCorner,
double  xUpperRightCorner,
double  yUpperRightCorner 
)

Directional curvilinear grid de-refinement. Grid lines are removed perpendicularly to the segment defined by lowerLeftCorner and xUpperRightCorner.

firstPoint and secondPoint must lie on the same grid line.

Parameters
meshKernelIdThe id of the mesh state.
[in]xLowerLeftCornerThe x coordinate of the lower left corner of the block to de-refine
[in]yLowerLeftCornerThe y coordinate of the lower left corner of the block to de-refine
[in]xUpperRightCornerThe x coordinate of the upper right corner of the block to de-refine
[in]yUpperRightCornerThe y coordinate of the upper right corner of the block to de-refine
Returns
Error code

◆ mkernel_curvilinear_finalize_line_shift()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_finalize_line_shift ( int  meshKernelId)

Resets the instance of the line shift algorithm in MeshKernelState.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_curvilinear_finalize_orthogonalize()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_finalize_orthogonalize ( int  meshKernelId)

Resets the CurvilinearGridOrthogonalization instance in MeshKernelState.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_curvilinear_full_refine()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_full_refine ( int  meshKernelId,
int  mRefinement,
int  nRefinement 
)

Curvilinear grid refinement. Additional gridlines are added in both directions, over the entire grid.

Parameters
[in]meshKernelIdThe id of the mesh state.
[in]mRefinementThe amount of refinement to compute in m-direction
[in]nRefinementThe amount of refinement to compute in n-direction
Returns
Error code

◆ mkernel_curvilinear_get_boundaries_as_polygons()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_get_boundaries_as_polygons ( int  meshKernelId,
int  lowerLeftN,
int  lowerLeftM,
int  upperRightN,
int  upperRightM,
GeometryList boundaryPolygons 
)

Gets the boundary polygon of a curvilinear grid, nodes with invalid coordinates are excluded.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]lowerLeftNThe n index of the lower left corner
[in]lowerLeftMThe m index of the lower left corner
[in]upperRightNThe n index of the upper right corner
[in]upperRightMThe m index of the upper right corner
[out]boundaryPolygonsThe geometry list containing the boundary polygons
Returns
Error code
Note
Values are retrieved from the cache, cached values are deleted after copying

◆ mkernel_curvilinear_get_data()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_get_data ( int  meshKernelId,
CurvilinearGrid curvilinearGrid 
)

Gets the curvilinear grid data as a CurvilinearGrid struct (converted as set of edges and nodes)

This function ought to be called after mkernel_get_curvilinear_dimension has been called and the pointers have been set to correctly sized memory.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]curvilinearGridThe structure containing the curvilinear grid arrays.
Returns
Error code

◆ mkernel_curvilinear_get_dimensions()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_get_dimensions ( int  meshKernelId,
CurvilinearGrid curvilinearGrid 
)

Gets the curvilinear grid dimensions as a CurvilinearGrid struct (converted as set of edges and nodes).

The integer parameters of the CurvilinearGrid struct are set to the corresponding dimensions The pointers are set to null, and must be set to correctly sized memory before passing the struct to mkernel_curvilinear_get_data.

Parameters
[in]meshKernelIdThe id of the mesh state.
[out]curvilinearGridThe structure containing the dimensions of the curvilinear grid.
Returns
Error code

◆ mkernel_curvilinear_get_location_index()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_get_location_index ( int  meshKernelId,
double  xCoordinate,
double  yCoordinate,
int  locationType,
const BoundingBox boundingBox,
int &  locationIndex 
)

Gets the grid location closet to a specific coordinate.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xCoordinateThe input xCoordinate
[in]yCoordinateThe input yCoordinate
[in]locationTypeThe location type
[in]boundingBoxThe input bounding box
[out]locationIndexThe location index
Returns
Error code

◆ mkernel_curvilinear_initialize_line_shift()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_initialize_line_shift ( int  meshKernelId)

Initializes the curvilinear line shift algorithm.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_curvilinear_initialize_orthogonal_grid_from_splines()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_initialize_orthogonal_grid_from_splines ( int  meshKernelId,
const GeometryList geometryList,
const meshkernel::CurvilinearParameters curvilinearParameters,
const meshkernel::SplinesToCurvilinearParameters splinesToCurvilinearParameters 
)

Generates a curvilinear grid from splines with the advancing front method. Initialization step (interactive)

Parameters
[in]meshKernelIdThe id of the mesh state
[in]geometryListThe input splines corners
[in]curvilinearParametersThe input parameters to generate the curvilinear grid
[in]splinesToCurvilinearParametersThe parameters of the advancing front algorithm
Returns
Error code

◆ mkernel_curvilinear_initialize_orthogonalize()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_initialize_orthogonalize ( int  meshKernelId,
const meshkernel::OrthogonalizationParameters orthogonalizationParameters 
)

Initializes the orthogonal curvilinear algorithm.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]orthogonalizationParametersThe orthogonalization parameters to use in the algorithm
Returns
Error code

◆ mkernel_curvilinear_insert_face()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_insert_face ( int  meshKernelId,
double  xCoordinate,
double  yCoordinate 
)

Inserts a new face on a curvilinear grid. The new face will be inserted on top of the closest edge by linear extrapolation.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xCoordinateThe x coordinate of the point used for finding the closest face.
[in]yCoordinateThe y coordinate of the point used for finding the closest face.
Returns
Error code

◆ mkernel_curvilinear_iterate_orthogonal_grid_from_splines()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_iterate_orthogonal_grid_from_splines ( int  meshKernelId,
int  layer 
)

One advancement of the front in curvilinear grid from splines (interactive)

Parameters
[in]meshKernelIdThe id of the mesh state
[in]layerThe layer index
Returns
Error code

◆ mkernel_curvilinear_line_attraction_repulsion()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_line_attraction_repulsion ( int  meshKernelId,
double  repulsionParameter,
double  xFirstNodeOnTheLine,
double  yFirstNodeOnTheLine,
double  xSecondNodeOnTheLine,
double  ySecondNodeOnTheLine,
double  xLowerLeftCorner,
double  yLowerLeftCorner,
double  xUpperRightCorner,
double  yUpperRightCorner 
)

Attracts/repulses grid lines in a block towards another set grid line.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]repulsionParameterThe attraction/repulsion parameter. If positive the grid lines will be attracted towards the set line, if negative the lines will be repulsed
[in]xFirstNodeOnTheLineThe x coordinate of the first node of the set line
[in]yFirstNodeOnTheLineThe y coordinate of the first node of the set line
[in]xSecondNodeOnTheLineThe x coordinate of the second node of the set line
[in]ySecondNodeOnTheLineThe y coordinate of the second node of the set line
[in]xLowerLeftCornerThe x coordinate of the lower left corner of the block where the operation is performed
[in]yLowerLeftCornerThe y coordinate of the lower left corner of the block where the operation is performed
[in]xUpperRightCornerThe x coordinate of the upper right corner of the block where the operation is performed
[in]yUpperRightCornerThe y coordinate of the upper right corner of the block where the operation is performed
Returns
Error code

◆ mkernel_curvilinear_line_mirror()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_line_mirror ( int  meshKernelId,
double  mirroringFactor,
double  xFirstGridLineNode,
double  yFirstGridLineNode,
double  xSecondGridLineNode,
double  ySecondGridLineNode 
)

Mirrors a boundary gridline outwards. The boundary grid line is defined by its starting and ending points.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]mirroringFactorThe mirroring factor
[in]xFirstGridLineNodeThe x coordinate of the first grid line point
[in]yFirstGridLineNodeThe y coordinate of the first grid line point
[in]xSecondGridLineNodeThe x coordinate of the second grid line point
[in]ySecondGridLineNodeThe y coordinate of the second grid line point
Returns
Error code

◆ mkernel_curvilinear_line_shift()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_line_shift ( int  meshKernelId)

Computes the new grid, shifting the line towards the moved nodes and distributing the shifting in block specified before.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_curvilinear_move_node()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_move_node ( int  meshKernelId,
double  xFromPoint,
double  yFromPoint,
double  xToPoint,
double  yToPoint 
)

Moves a point of a curvilinear grid from one location to another.

Parameters
meshKernelIdThe id of the mesh state
[in]xFromPointThe x coordinate of point to move
[in]yFromPointThe y coordinate of point to move
[in]xToPointThe new x coordinate of the point
[in]yToPointThe new y coordinate of the point
Returns
Error code

◆ mkernel_curvilinear_move_node_line_shift()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_move_node_line_shift ( int  meshKernelId,
double  xFromCoordinate,
double  yFromCoordinate,
double  xToCoordinate,
double  yToCoordinate 
)

Moves a node of the line to shift, the operation can be performed multiple times.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xFromCoordinateThe x coordinate of the node to move (the closest curvilinear grid node will be found)
[in]yFromCoordinateThe y coordinate of the node to move (the closest curvilinear grid node will be found)
[in]xToCoordinateThe x coordinate of the new node position
[in]yToCoordinateThe y coordinate of the new node position
Returns
Error code

◆ mkernel_curvilinear_orthogonalize()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_orthogonalize ( int  meshKernelId)

Orthogonalize a curvilinear grid.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_curvilinear_refine()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_refine ( int  meshKernelId,
double  xLowerLeftCorner,
double  yLowerLeftCorner,
double  xUpperRightCorner,
double  yUpperRightCorner,
int  refinement 
)

Directional curvilinear grid refinement. Additional gridlines are added perpendicularly to the segment defined by lowerLeftCorner and xUpperRightCorner.

firstPoint and secondPoint must lie on the same grid line.

Parameters
[in]meshKernelIdThe id of the mesh state.
[in]xLowerLeftCornerThe x coordinate of the lower left corner of the block to refine
[in]yLowerLeftCornerThe y coordinate of the lower left corner of the block to refine
[in]xUpperRightCornerThe x coordinate of the upper right corner of the block to refine
[in]yUpperRightCornerThe y coordinate of the upper right corner of the block to refine
[in]refinementThe number of grid lines to add between firstPoint and secondPoint
Returns
Error code

◆ mkernel_curvilinear_refresh_orthogonal_grid_from_splines()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_refresh_orthogonal_grid_from_splines ( int  meshKernelId)

Converts curvilinear grid to mesh and refreshes the state (interactive)

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_curvilinear_set()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_set ( int  meshKernelId,
const CurvilinearGrid grid 
)

Sets the curvilinear grid.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]gridThe curvilinear grid
Returns
Error code

◆ mkernel_curvilinear_set_block_line_shift()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_set_block_line_shift ( int  meshKernelId,
double  xLowerLeftCorner,
double  yLowerLeftCorner,
double  xUpperRightCorner,
double  yUpperRightCorner 
)

Defines a block on the curvilinear where the shifting is distributed.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xLowerLeftCornerThe x coordinate of the lower left corner of the block
[in]yLowerLeftCornerThe y coordinate of the lower left corner of the block
[in]xUpperRightCornerThe x coordinate of the upper right corner of the block
[in]yUpperRightCornerThe y coordinate of the upper right corner of the block
Returns
Error code

◆ mkernel_curvilinear_set_block_orthogonalize()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_set_block_orthogonalize ( int  meshKernelId,
double  xLowerLeftCorner,
double  yLowerLeftCorner,
double  xUpperRightCorner,
double  yUpperRightCorner 
)

Define a block on the curvilinear grid where to perform orthogonalization.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xLowerLeftCornerThe x coordinate of the lower left corner of the block to orthogonalize
[in]yLowerLeftCornerThe y coordinate of the lower left corner of the block to orthogonalize
[in]xUpperRightCornerThe x coordinate of the upper right corner of the block to orthogonalize
[in]yUpperRightCornerThe y coordinate of the upper right corner of the block to orthogonalize
Returns
Error code

◆ mkernel_curvilinear_set_frozen_lines_orthogonalize()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_set_frozen_lines_orthogonalize ( int  meshKernelId,
double  xFirstGridLineNode,
double  yFirstGridLineNode,
double  xSecondGridLineNode,
double  ySecondGridLineNode 
)

Freezes a line in the curvilinear orthogonalization process.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xFirstGridLineNodeThe x coordinate of the first point of the line to freeze
[in]yFirstGridLineNodeThe y coordinate of the first point of the line to freeze
[in]xSecondGridLineNodeThe x coordinate of the second point of the line to freeze
[in]ySecondGridLineNodeThe y coordinate of the second point of the line to freeze
Returns
Error code

◆ mkernel_curvilinear_set_line_line_shift()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_set_line_line_shift ( int  meshKernelId,
double  xFirstGridLineNode,
double  yFirstGridLineNode,
double  xSecondGridLineNode,
double  ySecondGridLineNode 
)

Sets the start and end nodes of the line to shift.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xFirstGridLineNodeThe x coordinate of the first curvilinear grid node to shift
[in]yFirstGridLineNodeThe y coordinate of the first curvilinear grid node to shift
[in]xSecondGridLineNodeThe x coordinate of the second curvilinear grid node to shift
[in]ySecondGridLineNodeThe y coordinate of the second curvilinear grid node to shift
Returns
Error code

◆ mkernel_curvilinear_smoothing()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_smoothing ( int  meshKernelId,
int  smoothingIterations,
double  xLowerLeftCorner,
double  yLowerLeftCorner,
double  xUpperRightCorner,
double  yUpperRightCorner 
)

Smooths a curvilinear grid.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]smoothingIterationsThe number of smoothing iterations to perform
[in]xLowerLeftCornerThe x coordinate of the lower left corner of the block to smooth
[in]yLowerLeftCornerThe y coordinate of the lower left corner of the block to smooth
[in]xUpperRightCornerThe x coordinate of the right corner of the block to smooth
[in]yUpperRightCornerThe y coordinate of the upper right corner of the block to smooth
Returns
Error code

◆ mkernel_curvilinear_smoothing_directional()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_smoothing_directional ( int  meshKernelId,
int  smoothingIterations,
double  xFirstGridlineNode,
double  yFirstGridlineNode,
double  xSecondGridLineNode,
double  ySecondGridLineNode,
double  xLowerLeftCornerSmoothingArea,
double  yLowerLeftCornerSmoothingArea,
double  xUpperRightCornerSmootingArea,
double  yUpperRightCornerSmootingArea 
)

Smooths a curvilinear grid along the direction specified by a segment.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]smoothingIterationsThe number of smoothing iterations to perform
[in]xFirstGridlineNodeThe x coordinate of the first curvilinear grid node
[in]yFirstGridlineNodeThe y coordinate of the first curvilinear grid node
[in]xSecondGridLineNodeThe x coordinate of the second curvilinear grid node
[in]ySecondGridLineNodeThe y coordinate of the second curvilinear grid node
[in]xLowerLeftCornerSmoothingAreaThe x coordinate of the lower left corner of the smoothing area
[in]yLowerLeftCornerSmoothingAreaThe y coordinate of the lower left corner of the smoothing area
[in]xUpperRightCornerSmootingAreaThe x coordinate of the upper right corner of the smoothing area
[in]yUpperRightCornerSmootingAreaThe y coordinate of the upper right corner of the smoothing area
Returns
Error code

◆ mkernel_curvilinear_snap_to_landboundary()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_snap_to_landboundary ( int  meshKernelId,
const GeometryList land,
double  sectionControlPoint1x,
double  sectionControlPoint1y,
double  sectionControlPoint2x,
double  sectionControlPoint2y,
double  regionControlPointX = mkernel_get_separator(),
double  regionControlPointY = mkernel_get_separator() 
)

Sets the curvilinear grid.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]landThe land boundary
[in]sectionControlPoint1xStart point x-coordinate for boundary section
[in]sectionControlPoint1yStart point y-coordinate for boundary section
[in]sectionControlPoint2xEnd point x-coordinate for boundary section
[in]sectionControlPoint2yEnd point y-coordinate for boundary section
[in]regionControlPointXX-coordinate of region defining point, if null value then use default region
[in]regionControlPointYY-coordinate of region defining point, if null value then use default region
Returns
Error code

◆ mkernel_curvilinear_snap_to_spline()

MKERNEL_API int meshkernelapi::mkernel_curvilinear_snap_to_spline ( int  meshKernelId,
const GeometryList spline,
double  sectionControlPoint1x,
double  sectionControlPoint1y,
double  sectionControlPoint2x,
double  sectionControlPoint2y,
double  regionControlPointX = mkernel_get_separator(),
double  regionControlPointY = mkernel_get_separator() 
)

Sets the curvilinear grid.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]splineThe spline
[in]sectionControlPoint1xStart point x-coordinate for boundary section
[in]sectionControlPoint1yStart point y-coordinate for boundary section
[in]sectionControlPoint2xEnd point x-coordinate for boundary section
[in]sectionControlPoint2yEnd point y-coordinate for boundary section
[in]regionControlPointXX-coordinate of region defining point, if null value then use default region
[in]regionControlPointYY-coordinate of region defining point, if null value then use default region
Returns
Error code

◆ mkernel_deallocate_state()

MKERNEL_API int meshkernelapi::mkernel_deallocate_state ( int  meshKernelId)

Deallocate mesh state.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_expunge_state()

MKERNEL_API int meshkernelapi::mkernel_expunge_state ( int  meshKernelId)

Deallocate mesh state and remove it completely, no undo for this meshKernelId will be possible after expunging.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_get_averaging_method_closest_point()

MKERNEL_API int meshkernelapi::mkernel_get_averaging_method_closest_point ( int &  method)

Gets an int indicating the closest point averaging method type.

Parameters
[out]methodThe int indicating the closest point averaging method type
Returns
Error code

◆ mkernel_get_averaging_method_inverse_distance_weighting()

MKERNEL_API int meshkernelapi::mkernel_get_averaging_method_inverse_distance_weighting ( int &  method)

Gets an int indicating the inverse distance weights averaging method type.

Parameters
[out]methodThe int indicating the inverse weight distance averaging method type
Returns
Error code

◆ mkernel_get_averaging_method_max()

MKERNEL_API int meshkernelapi::mkernel_get_averaging_method_max ( int &  method)

Gets an int indicating the max value averaging method type.

Parameters
[out]methodThe int indicating the max value averaging method type
Returns
Error code

◆ mkernel_get_averaging_method_min()

MKERNEL_API int meshkernelapi::mkernel_get_averaging_method_min ( int &  method)

Gets an int indicating the minimum averaging method type.

Parameters
[out]methodThe int indicating the minimum averaging method type
Returns
Error code

◆ mkernel_get_averaging_method_min_absolute_value()

MKERNEL_API int meshkernelapi::mkernel_get_averaging_method_min_absolute_value ( int &  method)

Gets an int indicating the minimum absolute value averaging method type.

Parameters
[out]methodThe int indicating the minimum absolute value averaging method type
Returns
Error code

◆ mkernel_get_averaging_method_simple_averaging()

MKERNEL_API int meshkernelapi::mkernel_get_averaging_method_simple_averaging ( int &  method)

Gets an int indicating the simple averaging method type.

Parameters
[out]methodThe int indicating the averaging method type
Returns
Error code

◆ mkernel_get_edges_location_type()

MKERNEL_API int meshkernelapi::mkernel_get_edges_location_type ( int &  type)

Gets an int indicating the edge location type.

Parameters
[out]typeThe int indicating the edge location type
Returns
Error code

◆ mkernel_get_error()

MKERNEL_API int meshkernelapi::mkernel_get_error ( char *  errorMessage)

Gets pointer to error message.

Parameters
[out]errorMessageThe pointer to the latest error message
Returns
Error code

◆ mkernel_get_exit_code_algorithm_error()

MKERNEL_API int meshkernelapi::mkernel_get_exit_code_algorithm_error ( int &  exitCode)

Gets the exit code of an exception of type AlgorithmexitCode.

Parameters
[in,out]exitCodeThe exit code
Returns
Error code

◆ mkernel_get_exit_code_constraint_error()

MKERNEL_API int meshkernelapi::mkernel_get_exit_code_constraint_error ( int &  exitCode)

Gets the exit code of an exception of type ConstraintexitCode.

Parameters
[in,out]exitCodeThe exit code
Returns
Error code

◆ mkernel_get_exit_code_linear_algebra_error()

MKERNEL_API int meshkernelapi::mkernel_get_exit_code_linear_algebra_error ( int &  exitCode)

Gets the exit code of an exception of type LinearAlgebraexitCode.

Parameters
[in,out]exitCodeThe exit code
Returns
Error code

◆ mkernel_get_exit_code_mesh_geometry_error()

MKERNEL_API int meshkernelapi::mkernel_get_exit_code_mesh_geometry_error ( int &  exitCode)

Gets the exit code of an exception of type MeshGeometryexitCode.

Parameters
[in,out]exitCodeThe exit code
Returns
Error code

◆ mkernel_get_exit_code_meshkernel_error()

MKERNEL_API int meshkernelapi::mkernel_get_exit_code_meshkernel_error ( int &  exitCode)

Gets the exit code of an exception of type MeshKernelError.

Parameters
[in,out]exitCodeThe exit code
Returns
Error code

◆ mkernel_get_exit_code_not_implemented_error()

MKERNEL_API int meshkernelapi::mkernel_get_exit_code_not_implemented_error ( int &  exitCode)

Gets the exit code of an exception of type NotImplementedCode.

Parameters
[in,out]exitCodeThe exit code
Returns
Error code

◆ mkernel_get_exit_code_range_error()

MKERNEL_API int meshkernelapi::mkernel_get_exit_code_range_error ( int &  exitCode)

Gets the exit code of an exception of type RangeexitCode.

Parameters
[in,out]exitCodeThe exit code
Returns
Error code

◆ mkernel_get_exit_code_stdlib_exception()

MKERNEL_API int meshkernelapi::mkernel_get_exit_code_stdlib_exception ( int &  exitCode)

Gets the exit code of an exception of type std::exception.

Parameters
[in,out]exitCodeThe exit code
Returns
Error code

◆ mkernel_get_exit_code_success()

MKERNEL_API int meshkernelapi::mkernel_get_exit_code_success ( int &  exitCode)

Gets the success exit code.

Parameters
[in,out]exitCodeThe exit code
Returns
Error code

◆ mkernel_get_exit_code_unknown_exception()

MKERNEL_API int meshkernelapi::mkernel_get_exit_code_unknown_exception ( int &  exitCode)

Gets the exit code of an exception of unknown type.

Parameters
[in,out]exitCodeThe exit code
Returns
Error code

◆ mkernel_get_faces_location_type()

MKERNEL_API int meshkernelapi::mkernel_get_faces_location_type ( int &  type)

Gets an int indicating the faces location type.

Parameters
[out]typeThe int indicating the face location type
Returns
Error code

◆ mkernel_get_geometry_error()

MKERNEL_API int meshkernelapi::mkernel_get_geometry_error ( int &  invalidIndex,
int &  type 
)

Gets the index of the erroneous entity.

Parameters
[out]invalidIndexThe index of the erroneous entity
[out]typeThe entity type (node, edge or face, see MeshLocations)
Returns
Error code

◆ mkernel_get_inner_outer_separator()

MKERNEL_API double meshkernelapi::mkernel_get_inner_outer_separator ( )

Gets the double value used to separate the inner part of a polygon from its outer part.

Returns
The double missing value used in mesh kernel

◆ mkernel_get_interpolation_type_double()

MKERNEL_API int meshkernelapi::mkernel_get_interpolation_type_double ( int &  type)

Get the integer indicating the interpolation type double.

Parameters
[out]typeThe integer indicating the interpolation type double
Returns
Error code

◆ mkernel_get_interpolation_type_float()

MKERNEL_API int meshkernelapi::mkernel_get_interpolation_type_float ( int &  type)

Get the integer indicating the interpolation type float.

Parameters
[out]typeThe integer indicating the interpolation type float
Returns
Error code

◆ mkernel_get_interpolation_type_int()

MKERNEL_API int meshkernelapi::mkernel_get_interpolation_type_int ( int &  type)

Get the integer indicating the interpolation type int.

Parameters
[out]typeThe integer indicating the interpolation type int
Returns
Error code

◆ mkernel_get_interpolation_type_short()

MKERNEL_API int meshkernelapi::mkernel_get_interpolation_type_short ( int &  type)

Get the integer indicating the interpolation type short.

Parameters
[out]typeThe integer indicating the interpolation type short
Returns
Error code

◆ mkernel_get_nodes_location_type()

MKERNEL_API int meshkernelapi::mkernel_get_nodes_location_type ( int &  type)

Gets an int indicating the node location type.

Parameters
[out]typeThe int indicating the node location type
Returns
Error code

◆ mkernel_get_projection()

MKERNEL_API int meshkernelapi::mkernel_get_projection ( int  meshKernelId,
int &  projection 
)

Gets the coordinate projection of the meshkernel state.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]projectionThe int indicating the projection type
Returns
Error code

◆ mkernel_get_projection_cartesian()

MKERNEL_API int meshkernelapi::mkernel_get_projection_cartesian ( int &  projection)

Gets an int indicating the cartesian projection.

Parameters
[out]projectionThe int indicating the cartesian projection
Returns
Error code

◆ mkernel_get_projection_spherical()

MKERNEL_API int meshkernelapi::mkernel_get_projection_spherical ( int &  projection)

Gets an int indicating the spherical projection.

Parameters
[out]projectionThe int indicating the spherical projection
Returns
Error code

◆ mkernel_get_projection_spherical_accurate()

MKERNEL_API int meshkernelapi::mkernel_get_projection_spherical_accurate ( int &  projection)

Gets an int indicating the spherical accurate projection.

Parameters
[out]projectionThe int indicating the spherical accurate projection
Returns
Error code

◆ mkernel_get_separator()

MKERNEL_API double meshkernelapi::mkernel_get_separator ( )

Gets the double value used in the back-end library as separator and missing value.

Returns
The double missing value used in mesh kernel

◆ mkernel_get_splines()

MKERNEL_API int meshkernelapi::mkernel_get_splines ( const GeometryList geometryListIn,
GeometryList geometryListOut,
int  numberOfPointsBetweenNodes 
)

Get the computed spline points between two corner nodes.

Parameters
[in]geometryListInThe input corner nodes of the splines
[out]geometryListOutThe output spline
[out]numberOfPointsBetweenNodesThe number of spline points to generate between two corner nodes.
Returns
Error code

◆ mkernel_get_version()

MKERNEL_API int meshkernelapi::mkernel_get_version ( char *  version)

Gets pointer to version string.

Parameters
[out]versionVersion string
Returns
Error code

◆ mkernel_is_valid_state()

MKERNEL_API int meshkernelapi::mkernel_is_valid_state ( int  meshKernelId,
bool &  isValid 
)

Determine if the meshKernelId is valid.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]isValidIndicates if the mesh id is valid, true is its valid, false otherwise
Returns
Error code

◆ mkernel_mesh1d_add()

MKERNEL_API int meshkernelapi::mkernel_mesh1d_add ( int  meshKernelId,
const Mesh1D mesh1d 
)

Adds a mesh to the meshkernel::Mesh1D state.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]mesh1dThe Mesh1D data
Returns
Error code

◆ mkernel_mesh1d_get_data()

MKERNEL_API int meshkernelapi::mkernel_mesh1d_get_data ( int  meshKernelId,
Mesh1D mesh1d 
)

Gets the Mesh1D data.

This function ought to be called after mkernel_mesh1d_get_dimensions has been called and the pointers have been set to correctly sized memory

Parameters
[in]meshKernelIdThe id of the mesh state
[in,out]mesh1dThe structure containing the Mesh1D arrays.
Returns
Error code

◆ mkernel_mesh1d_get_dimensions()

MKERNEL_API int meshkernelapi::mkernel_mesh1d_get_dimensions ( int  meshKernelId,
Mesh1D mesh1d 
)

Gets the Mesh1D data dimensions.

The integer parameters of the Mesh1D struct are set to the corresponding dimensions The pointers are set to null, and must be set to correctly sized memory before passing the struct to mkernel_mesh1d_get_dimensions

Parameters
[in]meshKernelIdThe id of the mesh state
[out]mesh1dThe structure containing the dimensions of the Mesh1D.
Returns
Error code

◆ mkernel_mesh1d_set()

MKERNEL_API int meshkernelapi::mkernel_mesh1d_set ( int  meshKernelId,
const Mesh1D mesh1d 
)

Sets the meshkernel::Mesh1D state.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]mesh1dThe Mesh1D data
Returns
Error code

◆ mkernel_mesh2d_add()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_add ( int  meshKernelId,
const Mesh2D mesh2d 
)

Adds a mesh to the meshkernel::Mesh2D state.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]mesh2dThe Mesh2D data
Returns
Error code

◆ mkernel_mesh2d_averaging_interpolation()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_averaging_interpolation ( int  meshKernelId,
const GeometryList samples,
int  locationType,
int  averagingMethodType,
double  relativeSearchSize,
size_t  minNumSamples,
GeometryList results 
)

AveragingInterpolation interpolation (ec_module)

See also
meshkernel::AveragingInterpolation
Parameters
[in]meshKernelIdThe id of the mesh state
[in]samplesThe samples coordinates and values
[in]locationTypeThe location type (see meshkernel::Location enum)
[in]averagingMethodTypeThe averaging method (see Method enum)
[in]relativeSearchSizeThe relative search size around the location (larger increases the number of samples considered)
[in]minNumSamplesThe minimum number of samples used for some interpolation algorithms to perform a valid interpolation
[in]resultsThe interpolation results with x and y coordinates
Returns
Error code

◆ mkernel_mesh2d_casulli_derefinement()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_casulli_derefinement ( int  meshKernelId)

De-refine mesh using the Casulli de-refinement algorithm.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_mesh2d_casulli_derefinement_elements()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_casulli_derefinement_elements ( int  meshKernelId,
GeometryList elements 
)

Get list of elements that will be removed after the Casulli de-refinement algorithm.

Parameters
[in]meshKernelIdThe id of the mesh state
[in,out]elementsList of elements to be removed.
Returns
Error code

◆ mkernel_mesh2d_casulli_derefinement_elements_on_polygon()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_casulli_derefinement_elements_on_polygon ( int  meshKernelId,
const GeometryList polygonGeometry,
GeometryList elements 
)

Get list of elements that will be removed after the Casulli de-refinement algorithm.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonGeometryThe input polygon geometry
[in,out]elementsList of elements to be removed.
Returns
Error code

◆ mkernel_mesh2d_casulli_derefinement_on_polygon()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_casulli_derefinement_on_polygon ( int  meshKernelId,
const GeometryList polygons 
)

De-refine mesh using the Casulli de-refinement algorithm.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonsThe input polygons
Returns
Error code

◆ mkernel_mesh2d_casulli_refinement()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_casulli_refinement ( int  meshKernelId)

Refine mesh using the Casulli refinement algorithm.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_mesh2d_casulli_refinement_on_polygon()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_casulli_refinement_on_polygon ( int  meshKernelId,
const GeometryList polygons 
)

Refine mesh using the Casulli refinement algorithm.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonsThe input polygons
Returns
Error code

◆ mkernel_mesh2d_compute_inner_ortogonalization_iteration()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_compute_inner_ortogonalization_iteration ( int  meshKernelId)

Performs inner orthogonalization iteration, by slowly moving the mesh nodes to new optimal positions (interactive mode).

mkernel_mesh2d_prepare_outer_iteration_orthogonalization function must be called before.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_mesh2d_compute_orthogonalization()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_compute_orthogonalization ( int  meshKernelId,
int  projectToLandBoundaryOption,
const meshkernel::OrthogonalizationParameters orthogonalizationParameters,
const GeometryList selectingPolygon,
const GeometryList landBoundaries 
)

The function modifies the mesh for achieving orthogonality between the edges and the segments connecting the face circumcenters. The amount of orthogonality is traded against the mesh smoothing (in this case the equality of face areas). The parameter to regulate the amount of orthogonalization is contained in meshkernel::OrthogonalizationParameters::orthogonalization_to_smoothing_factor

Parameters
[in]meshKernelIdThe id of the mesh state
[in]projectToLandBoundaryOptionThe option to determine how to snap to land boundaries
[in]orthogonalizationParametersThe structure containing the orthogonalization parameters meshkernel::OrthogonalizationParameters
[in]selectingPolygonThe polygon where to perform the orthogonalization (num_coordinates = 0 for an empty polygon)
[in]landBoundariesThe land boundaries to account for in the orthogonalization process (num_coordinates = 0 for no land boundaries)
Returns
Error code

◆ mkernel_mesh2d_connect_meshes()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_connect_meshes ( int  meshKernelId,
const Mesh2D mesh2d,
double  searchFraction 
)

Connect two or more disconnected regions along boundary.

Parameters
[in]meshKernelIdThe id of the mesh states
[in]mesh2dThe mesh we want to connect to the main mesh
[in]searchFractionFraction of the shortest edge (along an edge to be connected) to use when determining neighbour edge closeness
Returns
Error code

◆ mkernel_mesh2d_convert_projection()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_convert_projection ( int  meshKernelId,
int  projectionType,
const char *const  zoneString 
)

Converts the projection of a mesh2d.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]projectionTypeThe new projection for the mesh
[in]zoneStringThe UTM zone and information string
Returns
Error code

◆ mkernel_mesh2d_convert_to_curvilinear()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_convert_to_curvilinear ( int  meshKernelId,
double  xPointCoordinate,
double  yPointCoordinate 
)

Converts a mesh to a curvilinear mesh.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xPointCoordinateThe x coordinate of the point where to start the conversion point coordinate
[in]yPointCoordinateThe y point coordinate
Returns
Error code

◆ mkernel_mesh2d_count_hanging_edges()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_count_hanging_edges ( int  meshKernelId,
int &  numEdges 
)

Count the number of hanging edges in a mesh2d. An hanging edge is an edge where one of the two nodes is not connected.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]numEdgesThe number of hanging edges
Returns
Error code

◆ mkernel_mesh2d_count_mesh_boundaries_as_polygons()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_count_mesh_boundaries_as_polygons ( int  meshKernelId,
int &  numberOfPolygonNodes 
)

Counts the number of polygon nodes contained in the mesh boundary polygons computed in function mkernel_mesh2d_get_mesh_boundaries_as_polygons

Parameters
[in]meshKernelIdThe id of the mesh state
[out]numberOfPolygonNodesThe number of polygon nodes
Returns
Error code

◆ mkernel_mesh2d_count_nodes_in_polygons()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_count_nodes_in_polygons ( int  meshKernelId,
const GeometryList geometryListIn,
int  inside,
int &  numberOfMeshNodes 
)

Counts the number of selected mesh node indices.

This function should be used by clients before mkernel_mesh2d_get_nodes_in_polygons for allocating an integer array storing the selection results.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]geometryListInThe input polygon
[in]insideSelection of the nodes inside the polygon (1) or outside (0)
[out]numberOfMeshNodesThe number of selected nodes
Returns
Error code

◆ mkernel_mesh2d_count_obtuse_triangles()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_count_obtuse_triangles ( int  meshKernelId,
int &  numObtuseTriangles 
)

Gets the number of obtuse mesh2d triangles. Obtuse triangles are those having one edge longer than the sum of the other two.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]numObtuseTrianglesThe number of obtuse triangles
Returns
Error code

◆ mkernel_mesh2d_count_small_flow_edge_centers()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_count_small_flow_edge_centers ( int  meshKernelId,
double  smallFlowEdgesLengthThreshold,
int &  numSmallFlowEdges 
)

Counts the number of small mesh2d flow edges. The flow edges are the edges connecting faces circumcenters.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]smallFlowEdgesLengthThresholdThe configurable length for detecting a small flow edge
[out]numSmallFlowEdgesThe number of the small flow edges
Returns
Error code

◆ mkernel_mesh2d_delete()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_delete ( int  meshKernelId,
const GeometryList polygon,
int  deletionOption,
int  invertDeletion 
)

Deletes a mesh in a polygon using several options.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonThe polygon where to perform the operation
[in]deletionOptionThe deletion option meshkernel::Mesh2D::DeleteMeshOptions
[in]invertDeletionWhether to invert the deletion of selected features (0 no, 1 yes)
Returns
Error code

◆ mkernel_mesh2d_delete_edge()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_delete_edge ( int  meshKernelId,
double  xCoordinate,
double  yCoordinate,
double  xLowerLeftBoundingBox,
double  yLowerLeftBoundingBox,
double  xUpperRightBoundingBox,
double  yUpperRightBoundingBox 
)

Deletes the closest mesh2d edge to a point. The coordinates of the edge middle points are used for calculating the distances to the point.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xCoordinateThe x coordinate of the point
[in]yCoordinateThe y coordinate of the point
[in]xLowerLeftBoundingBoxThe x coordinate of the lower left corner of the bounding box
[in]yLowerLeftBoundingBoxThe y coordinate of the lower left corner of the bounding box
[in]xUpperRightBoundingBoxThe x coordinate of the upper right corner of the bounding box
[in]yUpperRightBoundingBoxThe y coordinate of the upper right corner of the bounding box
Returns
Error code

◆ mkernel_mesh2d_delete_edge_by_index()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_delete_edge_by_index ( int  meshKernelId,
int  edgeIndex 
)

Deletes a mesh2d edge given the index of the edge. The coordinates of the edge middle points are used for calculating the distances to the point.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]edgeIndexThe index of the edge to delete
Returns
Error code

◆ mkernel_mesh2d_delete_hanging_edges()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_delete_hanging_edges ( int  meshKernelId)

Deletes all hanging edges. An hanging edge is an edge where one of the two nodes is not connected.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_mesh2d_delete_node()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_delete_node ( int  meshKernelId,
int  nodeIndex 
)

Deletes a mesh2d node.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]nodeIndexThe index of the node to delete
Returns
Error code

◆ mkernel_mesh2d_delete_orthogonalization()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_delete_orthogonalization ( int  meshKernelId)

Cleans the orthogonalization algorithm state, allocated in mkernel_mesh2d_initialize_orthogonalization (interactive mode)

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_mesh2d_delete_small_flow_edges_and_small_triangles()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_delete_small_flow_edges_and_small_triangles ( int  meshKernelId,
double  smallFlowEdgesThreshold,
double  minFractionalAreaTriangles 
)

Deletes all small mesh2d flow edges and small triangles. The flow edges are the edges connecting faces circumcenters.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]smallFlowEdgesThresholdThe configurable threshold for detecting the small flow edges
[in]minFractionalAreaTrianglesThe ratio of the face area to the average area of neighboring non triangular faces. This parameter is used for determining if a triangular face is small.
Returns
Error code

◆ mkernel_mesh2d_finalize_inner_ortogonalization_iteration()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_finalize_inner_ortogonalization_iteration ( int  meshKernelId)

Finalizes the orthogonalization outer iteration, computing the new coefficients for grid adaption and the new face circumcenters (interactive mode).

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_mesh2d_flip_edges()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_flip_edges ( int  meshKernelId,
int  isTriangulationRequired,
int  projectToLandBoundaryRequired,
const GeometryList selectingPolygon,
const GeometryList landBoundaries 
)

Flips mesh2d edges, to optimize the mesh smoothness. This operation is usually performed after mkernel_mesh2d_refine_based_on_samples or mkernel_mesh2d_refine_based_on_polygon.

Nodes that are connected to more than six other nodes are typically enclosed by faces of highly non-uniform shape and wildly varying areas.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]isTriangulationRequiredThe option to triangulate also non triangular cells (if activated squares becomes triangles)
[in]projectToLandBoundaryRequiredThe option to determine how to snap to land boundaries
[in]selectingPolygonThe polygon where to perform the edge flipping (num_coordinates = 0 for an empty polygon)
[in]landBoundariesThe land boundaries to account for when flipping the edges (num_coordinates = 0 for no land boundaries)
Returns
Error code

◆ mkernel_mesh2d_get_closest_node()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_closest_node ( int  meshKernelId,
double  xCoordinateIn,
double  yCoordinateIn,
double  searchRadius,
double  xLowerLeftBoundingBox,
double  yLowerLeftBoundingBox,
double  xUpperRightBoundingBox,
double  yUpperRightBoundingBox,
double &  xCoordinateOut,
double &  yCoordinateOut 
)

Gets the closest mesh2d node coordinates to a point, searching within a radius.

Parameters
[in]meshKernelIdId of the grid state
[in]xCoordinateInThe x coordinate of the node to insert
[in]yCoordinateInThe y coordinate of the node to insert
[in]searchRadiusThe radii where to search for mesh nodes
[in]xLowerLeftBoundingBoxThe x coordinate of the lower left corner of the bounding box
[in]yLowerLeftBoundingBoxThe y coordinate of the lower left corner of the bounding box
[in]xUpperRightBoundingBoxThe x coordinate of the upper right corner of the bounding box
[in]yUpperRightBoundingBoxThe y coordinate of the upper right corner of the bounding box
[out]xCoordinateOutThe x coordinate of the found Mesh2D node
[out]yCoordinateOutThe y coordinate of the found Mesh2D node
Returns
Error code

◆ mkernel_mesh2d_get_data()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_data ( int  meshKernelId,
Mesh2D mesh2d 
)

Gets the Mesh2D dimensions data.

This function ought to be called after mkernel_mesh2d_get_dimensions has been called and the pointers have been set to correctly sized memory.

Parameters
[in]meshKernelIdThe id of the mesh state
[in,out]mesh2dThe Mesh2D data
Returns
Error code

◆ mkernel_mesh2d_get_dimensions()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_dimensions ( int  meshKernelId,
Mesh2D mesh2d 
)

Gets the Mesh2D dimensions.

The integer parameters of the Mesh2D struct are set to the corresponding dimensions The pointers are set to null, and must be set to correctly sized memory before passing the struct to mkernel_mesh2d_get_data.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]mesh2dThe Mesh2D dimensions
Returns
Error code

◆ mkernel_mesh2d_get_edge()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_edge ( int  meshKernelId,
double  xCoordinate,
double  yCoordinate,
double  xLowerLeftBoundingBox,
double  yLowerLeftBoundingBox,
double  xUpperRightBoundingBox,
double  yUpperRightBoundingBox,
int &  edgeIndex 
)

Gets the closest mesh2d edge to a point in a bounding box.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xCoordinateThe x coordinate of the point
[in]yCoordinateThe y coordinate of the point
[in]xLowerLeftBoundingBoxThe x coordinate of the lower left corner of the bounding box
[in]yLowerLeftBoundingBoxThe y coordinate of the lower left corner of the bounding box
[in]xUpperRightBoundingBoxThe x coordinate of the upper right corner of the bounding box
[in]yUpperRightBoundingBoxThe y coordinate of the upper right corner of the bounding box
[out]edgeIndexThe found edge index
Returns
Error code

◆ mkernel_mesh2d_get_face_polygons()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_face_polygons ( int  meshKernelId,
int  numEdges,
const GeometryList facePolygons 
)

Gets the faces polygons with a number of edges larger or equal to numEdges.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]numEdgesThe number of edges
[in]facePolygonsThe resulting face polygons
Returns
Error code

◆ mkernel_mesh2d_get_face_polygons_dimension()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_face_polygons_dimension ( int  meshKernelId,
int  numEdges,
int &  geometryListDimension 
)

Gets the dimension of faces polygons with a number of edges larger or equal to numNodes.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]numEdgesThe number of edges
[out]geometryListDimensionThe dimension of the geometry list containing the face polygons
Returns
Error code

◆ mkernel_mesh2d_get_filtered_face_polygons()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_filtered_face_polygons ( int  meshKernelId,
int  propertyValue,
double  minValue,
double  maxValue,
const GeometryList facePolygons 
)

Gets the geometry list containing the face polygons within the filtering range.

Parameters
[in]meshKernelIdThe identifier of the mesh kernel or mesh state.
[in]propertyValueThe property used to filter the locations.
[in]minValueThe minimum value of the property.
[in]maxValueThe maximum value of the property.
[out]facePolygonsThe geometry list containing the filtered locations.
Returns
Error code
Note
Values are retrieved from the cache, cached values are deleted after copying

◆ mkernel_mesh2d_get_filtered_face_polygons_dimension()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_filtered_face_polygons_dimension ( int  meshKernelId,
int  propertyValue,
double  minValue,
double  maxValue,
int &  geometryListDimension 
)

Retrieves the dimension of the geometry list containing the face polygons within the filtering range.

This function filters face polygons within a mesh based on a specific property and location, applying a range filter (minimum and maximum values). It then returns the dimension of the filtered geometry list.

Parameters
[in]meshKernelIdThe identifier of the mesh kernel or mesh state.
[in]propertyValueThe property used to filter the locations.
[in]minValueThe minimum value of the property.
[in]maxValueThe maximum value of the property.
[out]geometryListDimensionThe output parameter that will store the dimension (size) of the geometry list containing the polygons that match the filtering criteria.
Returns
An error code indicating the success or failure of the operation.
Note
property values are cached, so that they can be copied

◆ mkernel_mesh2d_get_hanging_edges()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_hanging_edges ( int  meshKernelId,
int *  edges 
)

Gets the indices of hanging edges. An hanging edge is an edge where one of the two nodes is not connected.

Parameters
[in]meshKernelIdThe id of the mesh state
[in,out]edgesPointer to memory where the indices of the hanging edges will be stored
Returns
Error code

◆ mkernel_mesh2d_get_location_index()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_location_index ( int  meshKernelId,
double  xCoordinate,
double  yCoordinate,
int  locationType,
const BoundingBox boundingBox,
int &  locationIndex 
)

Gets the mesh location closet to a specific coordinate.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xCoordinateThe input xCoordinate
[in]yCoordinateThe input yCoordinate
[in]locationTypeThe location type
[in]boundingBoxThe input bounding box
[out]locationIndexThe location index
Returns
Error code

◆ mkernel_mesh2d_get_mesh_boundaries_as_polygons()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_mesh_boundaries_as_polygons ( int  meshKernelId,
GeometryList boundaryPolygons 
)

Retrieves the boundaries of a mesh as a series of separated polygons.

For example, if a mesh has an single inner hole, two polygons will be generated, one for the inner boundary and one for the outer boundary.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]boundaryPolygonsThe output network boundary polygon
Returns
Error code

◆ mkernel_mesh2d_get_node_edge_data()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_node_edge_data ( int  meshKernelId,
Mesh2D mesh2d 
)

Gets only the node and edge Mesh2D data.

This function ought to be called after mkernel_mesh2d_get_dimensions has been called and the node_x, node_y and edge_nodes pointers have been set to correctly sized memory.

Parameters
[in]meshKernelIdThe id of the mesh state
[in,out]mesh2dThe Mesh2D data
Returns
Error code

◆ mkernel_mesh2d_get_node_index()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_node_index ( int  meshKernelId,
double  xCoordinate,
double  yCoordinate,
double  searchRadius,
double  xLowerLeftBoundingBox,
double  yLowerLeftBoundingBox,
double  xUpperRightBoundingBox,
double  yUpperRightBoundingBox,
int &  nodeIndex 
)

Finds the mesh2d node closest to a point, within a search radius.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xCoordinateThe x coordinate of the point
[in]yCoordinateThe y coordinate of the point
[in]searchRadiusThe search radius
[in]xLowerLeftBoundingBoxThe x coordinate of the lower left corner of the bounding box
[in]yLowerLeftBoundingBoxThe y coordinate of the lower left corner of the bounding box
[in]xUpperRightBoundingBoxThe x coordinate of the upper right corner of the bounding box
[in]yUpperRightBoundingBoxThe y coordinate of the upper right corner of the bounding box
[out]nodeIndexThe index of the found node
Returns
Error code

◆ mkernel_mesh2d_get_nodes_in_polygons()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_nodes_in_polygons ( int  meshKernelId,
const GeometryList geometryListIn,
int  inside,
int *  selectedNodes 
)

Gets the indices of the mesh2d nodes selected with a polygon.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]geometryListInThe input polygon
[in]insideSelection of the nodes inside the polygon (1) or outside (0)
[out]selectedNodesThe selected nodes indices
Returns
Error code

◆ mkernel_mesh2d_get_obtuse_triangles_mass_centers()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_obtuse_triangles_mass_centers ( int  meshKernelId,
GeometryList result 
)

Gets the mass centers of obtuse mesh2d triangles. Obtuse triangles are those having one edge longer than the sum of the other two.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]resultThe coordinates of the obtuse triangles mass centers stored in coordinates_x and coordinates_y of a GeometryList
Returns
Error code

◆ mkernel_mesh2d_get_orthogonality()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_orthogonality ( int  meshKernelId,
GeometryList geometryList 
)

Gets the mesh orthogonality, expressed as the ratio between the edges and the segments connecting the face circumcenters.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]geometryListThe orthogonality values of each edge
Returns
Error code

◆ mkernel_mesh2d_get_orthogonality_property_type()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_orthogonality_property_type ( int &  type)

Gets an int indicating the orthogonality property type for mesh2d.

Parameters
[out]typeThe int indicating the orthogonality property type
Returns
Error code

◆ mkernel_mesh2d_get_property()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_property ( int  meshKernelId,
int  propertyValue,
const GeometryList geometrylist 
)

Retrieves a specified property of a 2D mesh.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]propertyValueThe value representing the specific property
[in]geometrylistA reference to a GeometryList object that will be populated with the values of the requested property
Returns
Error code

◆ mkernel_mesh2d_get_property_dimension()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_property_dimension ( int  meshKernelId,
int  propertyValue,
int &  dimension 
)

The dimension of a specified property of a 2D mesh.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]propertyValueThe value representing the specific property
[in]dimensionThe dimension of the specified property
Returns
Error code

◆ mkernel_mesh2d_get_small_flow_edge_centers()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_small_flow_edge_centers ( int  meshKernelId,
double  smallFlowEdgesThreshold,
GeometryList result 
)

Gets the small mesh2d flow edges. The flow edges are the edges connecting faces circumcenters.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]smallFlowEdgesThresholdThe configurable threshold for detecting a small flow edge
[out]resultThe middle points of the small flow edges, stored in coordinates_x and coordinates_y of a GeometryList
Returns
Error code

◆ mkernel_mesh2d_get_smoothness()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_get_smoothness ( int  meshKernelId,
GeometryList geometryList 
)

Gets the smoothness, expressed as the ratio between the values of two neighboring faces areas.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]geometryListThe smoothness values at each edge
Returns
Error code

◆ mkernel_mesh2d_initialize_orthogonalization()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_initialize_orthogonalization ( int  meshKernelId,
int  projectToLandBoundaryOption,
meshkernel::OrthogonalizationParameters orthogonalizationParameters,
const GeometryList selectingPolygon,
const GeometryList landBoundaries 
)

Initialization of the meshkernel::OrthogonalizationAndSmoothing algorithm.

This is the first function to call when using orthogonalization in interactive mode (visualizing the grid while it is orthogonalizing), in order to set the internal state of the algorithm reused during the iterations.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]projectToLandBoundaryOptionThe option to determine how to snap to land boundaries
[in]orthogonalizationParametersThe structure containing the user defined orthogonalization parameters
[in]selectingPolygonThe polygon where to perform the orthogonalization (num_coordinates = 0 for an empty polygon)
[in]landBoundariesThe land boundaries to account for in the orthogonalization process (num_coordinates = 0 for no land boundaries)
Returns
Error code

◆ mkernel_mesh2d_insert_edge()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_insert_edge ( int  meshKernelId,
int  startNode,
int  endNode,
int &  newEdgeIndex 
)

Insert a new mesh2d edge connecting two nodes.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]startNodeThe index of the first node to connect
[in]endNodeThe index of the second node to connect
[out]newEdgeIndexThe index of the new generated edge
Returns
Error code

◆ mkernel_mesh2d_insert_edge_from_coordinates()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_insert_edge_from_coordinates ( int  meshKernelId,
double  firstNodeX,
double  firstNodeY,
double  secondNodeX,
double  secondNodeY,
int &  firstNodeIndex,
int &  secondNodeIndex,
int &  edgeIndex 
)

Insert a new mesh2d edge from 2 coordinates.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]firstNodeXThe index of the first node to connect
[in]firstNodeYThe index of the second node to connect
[in]secondNodeXThe index of the first node to connect
[in]secondNodeYThe index of the second node to connect
[in]firstNodeIndexThe index of the first node
[in]secondNodeIndexThe index of the second node
[in]edgeIndexThe index of the new generated edge
Returns
Error code

◆ mkernel_mesh2d_insert_node()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_insert_node ( int  meshKernelId,
double  xCoordinate,
double  yCoordinate,
int &  nodeIndex 
)

Insert a new mesh2d node at a specific coordinate.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xCoordinateThe x coordinate of the node to insert
[in]yCoordinateThe y coordinate of the node to insert
[out]nodeIndexThe index of the new mesh node
Returns
Error code

◆ mkernel_mesh2d_intersections_from_polygon()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_intersections_from_polygon ( int  meshKernelId,
const GeometryList boundaryPolygon,
int *  edgeNodes,
int *  edgeIndex,
double *  edgeDistances,
double *  segmentDistances,
int *  segmentIndexes,
int *  faceIndexes,
int *  faceNumEdges,
int *  faceEdgeIndex 
)

Gets the edges intersected by a polygon, with additional information on the intersections.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]boundaryPolygonAn input polygon, defined as a series of points
[out]edgeNodesThe indices of the intersected edge nodes. The first node of the edge is on the left (the virtual node), the second node of the edge is on the right (the inner node)
[out]edgeIndexFor each intersected edge, the edge index
[out]edgeDistancesFor each intersection, the location of the intersection expressed as adimensional distance from the edge starting node
[out]segmentDistancesFor each intersection, the location of the intersection expressed as adimensional distance from the polygon segment start
[out]segmentIndexesFor each intersection, the segment index
[out]faceIndexesFor each intersection, the face index
[out]faceNumEdgesFor each intersection, the number of intersections
[out]faceEdgeIndexFor each intersection, the index of the intersected edge
Returns
Error code

◆ mkernel_mesh2d_make_global()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_make_global ( int  meshKernelId,
int  numLongitudeNodes,
int  numLatitudeNodes 
)

Compute the global mesh with a given number of points along the longitude and latitude directions.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]numLongitudeNodesThe number of points along the longitude.
[in]numLatitudeNodesThe number of points along the latitude (half hemisphere).
Returns
Error code

◆ mkernel_mesh2d_make_rectangular_mesh()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_make_rectangular_mesh ( int  meshKernelId,
const meshkernel::MakeGridParameters makeGridParameters 
)

Makes a rectangular mesh.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]makeGridParametersThe structure containing the make grid parameters
Returns
Error code

◆ mkernel_mesh2d_make_rectangular_mesh_from_polygon()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_make_rectangular_mesh_from_polygon ( int  meshKernelId,
const meshkernel::MakeGridParameters makeGridParameters,
const GeometryList geometryList 
)

Makes a rectangular mesh from a polygon.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]makeGridParametersThe structure containing the make grid parameters
[in]geometryListThe polygons to account for
Returns
Error code

◆ mkernel_mesh2d_make_rectangular_mesh_on_extension()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_make_rectangular_mesh_on_extension ( int  meshKernelId,
const meshkernel::MakeGridParameters makeGridParameters 
)

Makes a rectangular mesh on a defined extension.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]makeGridParametersThe structure containing the make grid parameters
Returns
Error code

◆ mkernel_mesh2d_make_triangular_mesh_from_polygon()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_make_triangular_mesh_from_polygon ( int  meshKernelId,
const GeometryList polygonPoints 
)

Generates a triangular mesh2d grid within a polygon. The size of the triangles is determined from the length of the polygon edges.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonPointsThe polygon where to triangulate
Returns
Error code

◆ mkernel_mesh2d_make_triangular_mesh_from_samples()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_make_triangular_mesh_from_samples ( int  meshKernelId,
const GeometryList samples 
)

Makes a triangular mesh from a set of samples, triangulating the sample points.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]samplesThe samples where to triangulate
Returns
Error code

◆ mkernel_mesh2d_merge_nodes()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_merge_nodes ( int  meshKernelId,
const GeometryList geometryListIn 
)

Merges the mesh2d nodes within a distance of 0.001 m, effectively removing all small edges.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]geometryListInThe polygon defining the area where the operation will be performed
Returns
Error code

◆ mkernel_mesh2d_merge_nodes_with_merging_distance()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_merge_nodes_with_merging_distance ( int  meshKernelId,
const GeometryList geometryListIn,
double  mergingDistance 
)

Merges the mesh2d nodes within a distance of 0.001 m, effectively removing all small edges.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]geometryListInThe polygon defining the area where the operation will be performed
[in]mergingDistanceThe distance below which two nodes will be merged
Returns
Error code

◆ mkernel_mesh2d_merge_two_nodes()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_merge_two_nodes ( int  meshKernelId,
int  firstNode,
int  secondNode 
)

Merges two mesh2d nodes into one.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]firstNodeThe index of the first node to merge
[in]secondNodeThe index of the second node to merge
Returns
Error code

◆ mkernel_mesh2d_move_node()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_move_node ( int  meshKernelId,
double  xCoordinate,
double  yCoordinate,
int  nodeIndex 
)

Moves a mesh2d node to a new position.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]xCoordinateThe new x coordinate of the node to move
[in]yCoordinateThe new y coordinate of the node to move
[in]nodeIndexThe index of the mesh2d node to be moved
Returns
Error code

◆ mkernel_mesh2d_prepare_outer_iteration_orthogonalization()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_prepare_outer_iteration_orthogonalization ( int  meshKernelId)

Prepares an outer orthogonalization iteration, computing the new orthogonalization and smoothing weights from the modified mesh geometry (in interactive mode).

mkernel_mesh2d_initialize_orthogonalization function must be called before.

Parameters
[in]meshKernelIdThe id of the mesh state
Returns
Error code

◆ mkernel_mesh2d_refine_based_on_gridded_samples()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_refine_based_on_gridded_samples ( int  meshKernelId,
const GriddedSamples griddedSamples,
const meshkernel::MeshRefinementParameters meshRefinementParameters,
bool  useNodalRefinement 
)

Refine based on gridded samples.

The number of successive splits is indicated on the sample value. For example a value of 0 means no split and hence no refinement, a value of 1 a single split (a quadrilateral face generates 4 faces), a value of 2 two splits (a quadrilateral face generates 16 faces).

Parameters
[in]meshKernelIdThe id of the mesh state
[in]griddedSamplesThe gridded samples
[in]meshRefinementParametersThe mesh refinement parameters
[in]useNodalRefinementUse nodal refinement
Returns
Error code

◆ mkernel_mesh2d_refine_based_on_polygon()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_refine_based_on_polygon ( int  meshKernelId,
const GeometryList geometryList,
const meshkernel::MeshRefinementParameters meshRefinementParameters 
)

Refines a mesh2d within a polygon. Refinement is achieved by splitting the edges contained in the polygon by two.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]geometryListThe closed polygon where to perform the refinement
[in]meshRefinementParametersThe mesh refinement parameters
Returns
Error code

◆ mkernel_mesh2d_refine_based_on_samples()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_refine_based_on_samples ( int  meshKernelId,
const GeometryList samples,
double  relativeSearchRadius,
int  minimumNumSamples,
const meshkernel::MeshRefinementParameters meshRefinementParameters 
)

Refines a mesh2d based on samples. Refinement is achieved by successive splits of the face edges.

The number of successive splits is indicated on the sample value. For example a value of 0 means no split and hence no refinement, a value of 1 a single split (a quadrilateral face generates 4 faces), a value of 2 two splits (a quadrilateral face generates 16 faces).

Parameters
[in]meshKernelIdThe id of the mesh state
[in]samplesThe sample set
[in]relativeSearchRadiusThe relative search radius relative to the face size, used for some interpolation algorithms
[in]minimumNumSamplesThe minimum number of samples used for some averaging algorithms
[in]meshRefinementParametersThe mesh refinement parameters
Returns
Error code

◆ mkernel_mesh2d_refine_ridges_based_on_gridded_samples()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_refine_ridges_based_on_gridded_samples ( int  meshKernelId,
const GriddedSamples griddedSamples,
double  relativeSearchRadius,
int  minimumNumSamples,
int  numberOfSmoothingIterations,
const meshkernel::MeshRefinementParameters meshRefinementParameters 
)

Refines a mesh2d based on samples with ridge refinement. This method automatically detects the ridges in a sample set.

The number of successive splits is indicated on the sample value. For example a value of 0 means no split and hence no refinement, a value of 1 a single split (a quadrilateral face generates 4 faces), a value of 2 two splits (a quadrilateral face generates 16 faces).

Parameters
[in]meshKernelIdThe id of the mesh state
[in]griddedSamplesThe gridded samples
[in]relativeSearchRadiusThe relative search radius relative to the face size, used for some interpolation algorithms
[in]minimumNumSamplesThe minimum number of samples used for some averaging algorithms
[in]numberOfSmoothingIterationsThe number of smoothing iterations to apply to the input sample set
[in]meshRefinementParametersThe mesh refinement parameters
Returns
Error code

◆ mkernel_mesh2d_remove_disconnected_regions()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_remove_disconnected_regions ( int  meshKernelId)

Remove any disconnected regions from a mesh2d.

The assumption is that the main region of interest has the largest number of elements. Regions with fewer elements that this will be removed.

Parameters
[in]meshKernelIdThe id of the mesh state

◆ mkernel_mesh2d_rotate()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_rotate ( int  meshKernelId,
double  centreX,
double  centreY,
double  theta 
)

Rotate a mesh2d about a point.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]centreXX-coordinate of the centre of rotation
[in]centreYY-coordinate of the centre of rotation
[in]thetaAngle of rotation
Returns
Error code

◆ mkernel_mesh2d_set()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_set ( int  meshKernelId,
const Mesh2D mesh2d 
)

Sets the meshkernel::Mesh2D state.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]mesh2dThe Mesh2D data
Returns
Error code

◆ mkernel_mesh2d_snap_to_landboundary()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_snap_to_landboundary ( int  meshKernelId,
const GeometryList selectingPolygon,
const GeometryList landBoundaries 
)

Snaps a mesh to a land boundary.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]selectingPolygonThe polygon where to perform the snapping
[in]landBoundariesThe input land boundaries
Returns
Error code

◆ mkernel_mesh2d_split_row()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_split_row ( int  meshKernelId,
int  firstNode,
int  secondNode 
)

An-isotropically refines the elements along a row or column, given a starting edge.

Only quadrilateral elements will be refined. Refinement will continue upto the boundary of the domain or when a non-quadrilateral element is encountered.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]firstNodeThe first node of the edge
[in]secondNodeThe second node of the edge
Returns
Error code

◆ mkernel_mesh2d_translate()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_translate ( int  meshKernelId,
double  translationX,
double  translationY 
)

Translate a mesh2d.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]translationXX-component of the translation vector
[in]translationYY-component of the translation vector
Returns
Error code

◆ mkernel_mesh2d_triangulation_interpolation()

MKERNEL_API int meshkernelapi::mkernel_mesh2d_triangulation_interpolation ( int  meshKernelId,
const GeometryList samples,
int  locationType,
GeometryList results 
)

Triangle interpolation (ec_module)

See also
meshkernel::TriangulationInterpolation
Parameters
[in]meshKernelIdThe id of the mesh state
[in]samplesThe samples coordinates and values
[in]locationTypeThe location type (see meshkernel::Location enum)
[in]resultsThe interpolation results with x and y coordinates
Returns
Error code

◆ mkernel_network1d_compute_fixed_chainages()

MKERNEL_API int meshkernelapi::mkernel_network1d_compute_fixed_chainages ( int  meshKernelId,
double *  fixedChainages,
int  sizeFixedChainages,
double  minFaceSize,
double  fixedChainagesOffset 
)

Compute the network chainages from fixed point locations.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]fixedChainagesThe fixed chainages for each polyline. Chunks are separated by the separator, each chunk corresponds to a polyline
[in]sizeFixedChainagesThe size of fixed chainages vector
[in]minFaceSizeThe minimum face size. The distance between two chainages must be no less than this length
[in]fixedChainagesOffsetThe offset to use for fixed chainages
Returns
Error code

◆ mkernel_network1d_compute_offsetted_chainages()

MKERNEL_API int meshkernelapi::mkernel_network1d_compute_offsetted_chainages ( int  meshKernelId,
double  offset 
)

Compute the network chainages at a regular offset.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]offsetThe offset between points
Returns
Error code

◆ mkernel_network1d_set()

MKERNEL_API int meshkernelapi::mkernel_network1d_set ( int  meshKernelId,
const GeometryList polylines 
)

Sets the meshkernel::Network1D state.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polylinesThe polylines describing the network
Returns
Error code

◆ mkernel_network1d_to_mesh1d()

MKERNEL_API int meshkernelapi::mkernel_network1d_to_mesh1d ( int  meshKernelId,
double  minFaceSize 
)

Convert network chainages to mesh1d nodes and edges.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]minFaceSizeThe minimum face size below which two nodes will be merged
Returns
Error code

◆ mkernel_polygon_count_linear_refine()

MKERNEL_API int meshkernelapi::mkernel_polygon_count_linear_refine ( int  meshKernelId,
const GeometryList polygonToRefine,
int  firstIndex,
int  secondIndex,
int &  numberOfPolygonNodes 
)

Counts the number of polygon nodes resulting from polygon refinement with mkernel_polygon_linear_refine.

This function should be used by clients before mkernel_polygon_linear_refine for allocating GeometryList containing the refinement result.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonToRefineThe input polygon to refine
[in]firstIndexThe first index of the refinement interval
[in]secondIndexThe second index of the refinement interval
[out]numberOfPolygonNodesThe number of nodes after refinement
Returns
Error code
Note
Refined polygon values are cached, so that they can be copied in the mkernel_polygon_linear_refine

◆ mkernel_polygon_count_offset()

MKERNEL_API int meshkernelapi::mkernel_polygon_count_offset ( int  meshKernelId,
const GeometryList geometryListIn,
int  innerPolygon,
double  distance,
int &  numberOfPolygonNodes 
)

Counts the number of polygon nodes resulting from polygon offset.

This function should be used by clients before mkernel_polygon_get_offset for allocating the GeometryList containing the offset result.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]geometryListInThe polygon to offset
[in]innerPolygonWhether to compute inner (1) or outer offset (0)
[in]distanceThe offset distance
[out]numberOfPolygonNodesThe number of nodes in the offset polygon
Returns
Error code

◆ mkernel_polygon_count_refine()

MKERNEL_API int meshkernelapi::mkernel_polygon_count_refine ( int  meshKernelId,
const GeometryList polygonToRefine,
int  firstIndex,
int  secondIndex,
double  distance,
int &  numberOfPolygonNodes 
)

Counts the number of polygon nodes resulting from polygon refinement with mkernel_polygon_refine.

This function should be used by clients before mkernel_polygon_refine for allocating GeometryList containing the refinement result.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonToRefineThe input polygon to refine
[in]firstIndexThe first index of the refinement interval
[in]secondIndexThe second index of the refinement interval
[in]distanceThe target interval edge length
[out]numberOfPolygonNodesThe number of nodes after refinement
Returns
Error code
Note
Refined polygon values are cached, so that they can be copied in the mkernel_polygon_refine

◆ mkernel_polygon_get_included_points()

MKERNEL_API int meshkernelapi::mkernel_polygon_get_included_points ( int  meshKernelId,
const GeometryList selectingPolygon,
const GeometryList polygonToSelect,
GeometryList selectionResults 
)

Selects the polygon nodes within another polygon.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]selectingPolygonThe selecting polygon (num_coordinates = 0 for an empty polygon)
[in]polygonToSelectThe polygon to select
[out]selectionResultsThe selection result, contained in the in the values field of GeometryList (0.0 not selected, 1.0 selected). Note that the selection selectionResults variable must be allocated by the client.
Returns
Error code

◆ mkernel_polygon_get_offset()

MKERNEL_API int meshkernelapi::mkernel_polygon_get_offset ( int  meshKernelId,
const GeometryList geometryListIn,
int  inWard,
double  distance,
GeometryList geometryListOut 
)

Generate a new polygon from an existing one by offsetting the perimeter by a given distance.

Offsetting can be done inward or outward the existing polygon.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]geometryListInThe polygon to offset
[in]inWardCompute the inner offset (1) or outer offset offset (0)
[in]distanceThe offset distance
[out]geometryListOutThe resulting offset polygon
Returns
Error code

◆ mkernel_polygon_linear_refine()

MKERNEL_API int meshkernelapi::mkernel_polygon_linear_refine ( int  meshKernelId,
const GeometryList polygonToRefine,
int  firstNodeIndex,
int  secondNodeIndex,
GeometryList refinedPolygon 
)

Linear refines the polygon perimeter between two nodes.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonToRefineThe input polygon to refine
[in]firstNodeIndexThe first index of the refinement interval
[in]secondNodeIndexThe second index of the refinement interval
[out]refinedPolygonThe refined polygon
Returns
Error code
Note
Values are retrieved from the cache, cached values are cleared after copying

◆ mkernel_polygon_refine()

MKERNEL_API int meshkernelapi::mkernel_polygon_refine ( int  meshKernelId,
const GeometryList polygonToRefine,
int  firstNodeIndex,
int  secondNodeIndex,
double  targetEdgeLength,
GeometryList refinedPolygon 
)

Refines the polygon perimeter between two nodes. This interval is refined to achieve a target edge length.

The function is often used before mkernel_mesh2d_make_triangular_mesh_from_polygon, for generating a triangular mesh where edges have a desired length.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]polygonToRefineThe input polygon to refine
[in]firstNodeIndexThe first index of the refinement interval
[in]secondNodeIndexThe second index of the refinement interval
[in]targetEdgeLengthThe target interval edge length
[out]refinedPolygonThe refined polygon
Returns
Error code
Note
Values are retrieved from the cache, cached values are cleared after copying

◆ mkernel_polygon_snap_to_landboundary()

MKERNEL_API int meshkernelapi::mkernel_polygon_snap_to_landboundary ( int  meshKernelId,
const GeometryList land,
GeometryList polygon,
int  startIndex,
int  endIndex 
)

Snaps the polygon to the land boundary.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]landThe land boundary
[in]polygonThe polygon values to be snapped
[in]startIndexThe start index of the polygon points to be snapped
[in]endIndexThe end index of the polygon points to be snapped
Returns
Error code

◆ mkernel_redo_state()

MKERNEL_API int meshkernelapi::mkernel_redo_state ( bool &  redone,
int &  meshKernelId 
)

Attempt to redo by one undo-action.

Parameters
[out]redoneIndicates if the redo action was actually redone
[out]meshKernelIdThe mesh kernel id related to the undo action
Returns
Error code

◆ mkernel_set_undo_size()

MKERNEL_API int meshkernelapi::mkernel_set_undo_size ( int  undoStackSize)

Set the maximum size of the undo stack.

Setting the size to zero will disable the undo.

Parameters
[in]undoStackSizeThe maximum size of the undo stack
Returns
Error code

◆ mkernel_splines_snap_to_landboundary()

MKERNEL_API int meshkernelapi::mkernel_splines_snap_to_landboundary ( int  meshKernelId,
const GeometryList land,
GeometryList splines,
int  startSplineIndex,
int  endSplineIndex 
)

Snaps the spline (or splines) to the land boundary.

Parameters
[in]meshKernelIdThe id of the mesh state
[in]landThe land boundary
[in]splinesThe spline values to be snapped
[in]startSplineIndexThe start index of the splines to be snapped
[in]endSplineIndexThe end index of the splines to be snapped
Returns
Error code

◆ mkernel_undo_state()

MKERNEL_API int meshkernelapi::mkernel_undo_state ( bool &  undone,
int &  meshKernelId 
)

Attempt to undo by one undo-action.

Parameters
[out]undoneIndicates if the undo action was actually undone
[out]meshKernelIdThe mesh kernel id related to the undo action
Returns
Error code

◆ mkernel_undo_state_count()

MKERNEL_API int meshkernelapi::mkernel_undo_state_count ( int &  committedCount,
int &  restoredCount 
)

Count the number of undo actions.

Parameters
[out]committedCountThe number of undo actions.
[out]restoredCountThe number of restored undo actions.
Returns
Error code

◆ mkernel_undo_state_count_for_id()

MKERNEL_API int meshkernelapi::mkernel_undo_state_count_for_id ( int  meshKernelId,
int &  committedCount,
int &  restoredCount 
)

Count the number of undo actions for a particular meshKernelId.

Parameters
[in]meshKernelIdThe id of the mesh state
[out]committedCountThe number of undo actions.
[out]restoredCountThe number of restored undo actions.
Returns
Error code