Rapid elimination method for isolated water points in ocean numerical model grid

By using a greedy algorithm to quickly locate and remove isolated water points, the problem of excessive computation time in traditional methods is solved, achieving efficient processing of isolated water points and ensuring the accuracy and stability of numerical simulation.

CN118965736AActive Publication Date: 2024-11-15OCEAN UNIV OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411004884.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-15
Estimated Expiration
2044-07-25

AI Technical Summary

Technical Problem

Traditional methods take too long to locate and remove isolated water points in high-resolution grids, affecting research efficiency and the accuracy and stability of numerical simulations.

Method used

A greedy algorithm is adopted to find the nearest connected computation region to the starting computation unit. Combining the core idea of ​​the greedy algorithm, isolated water points are quickly located and eliminated, avoiding the problem of excessive computation caused by the fixed search endpoint in traditional methods.

Benefits of technology

It significantly reduces computation time, improves the efficiency of locating and eliminating isolated water points, and ensures the accuracy and stability of numerical simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004962727740000051
    Figure BDA0004962727740000051
  • Figure FDA0004962727730000011
    Figure FDA0004962727730000011
  • Figure FDA0004962727730000012
    Figure FDA0004962727730000012
Patent Text Reader

Abstract

The invention discloses a method for quickly eliminating isolated water points in an ocean numerical model grid, and belongs to the field of ocean numerical simulation. In order to solve the problem that the calculation time is too long when a traditional depth-first algorithm or breadth-first algorithm is used for eliminating isolated water points, before the connectivity of an initial calculation unit and a final calculation unit is calculated, a connectivity calculation area closest to the initial calculation unit is preferentially searched; and the connectivity test is completed based on the core idea of the greedy algorithm, so that the search time is greatly reduced. According to the method, all isolated water points in a topographic data matrix can be quickly positioned, and the optimal adjacent non-isolated water point is searched as a search end point before the connectivity of a calculation unit is searched, so that the defects of overlarge calculation amount and overlarge calculation time caused by the fact that only a fixed search end point can be adopted in a traditional search algorithm are overcome; through testing, the algorithm is suitable for all ocean numerical model grids, and the calculation time is shortened in a leap manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for positioning and eliminating isolated water points in an ocean numerical model, and belongs to the field of ocean numerical simulation. Background Art

[0002] Ocean numerical simulation methods are of great significance in marine scientific research. Numerical simulation can supplement and verify observational data, especially in remote or difficult-to-reach sea areas, and improve the reliability of ocean data. Secondly, ocean numerical simulation helps to deeply understand ocean dynamic processes, such as ocean currents, tides, and seawater temperature and salinity distribution, and reveal the mechanisms of these processes and their interactions. In terms of disaster warning, simulating the occurrence and spread of natural disasters such as tsunamis and storm surges helps to provide early warning and reduce losses. Finally, the simulation results provide a scientific basis for governments and decision makers, and support the formulation of scientific marine policies and management measures.

[0003] With the continuous development of ocean numerical simulation, the requirements for simulation content and simulation accuracy are gradually increasing, which requires high-resolution grids to provide basic support for simulation content and phenomena. For the analysis of ocean dynamics in traditional oceans, high-resolution grids can characterize mesoscale and sub-mesoscale ocean processes, while for dynamic processes such as offshore tidal waves and estuarine sediment transport, high-resolution grids can distinguish more accurate coastlines, making the simulation results closer to the real ocean. In the process of terrain interpolation of grids, isolated water points refer to water units that are not connected to the surrounding grids. They may be caused by interpolation errors or by the existence of "inland lakes" in the original data. Eliminating isolated water points is a key step to ensure the stability and accuracy of numerical simulations.

[0004] Traditional methods for removing isolated water spots include manual removal by "visual inspection" and automatic removal by "breadth-first algorithm (BFS)" and "depth-first algorithm (DFS)". However, with the increase in grid resolution, the number of grid computing units can reach millions. The manual removal process will consume a lot of scientific researchers' energy, while the traditional BFS algorithm will consume a lot of computing time. Therefore, developing an algorithm that can quickly locate and remove isolated water spots will greatly reduce the energy and time in numerical simulation preparation and improve the work efficiency of scientific researchers. Summary of the invention

[0005] In order to make up for the problem of long calculation time in traditional isolated water point elimination methods when searching grids with more calculation units, the purpose of the present invention is to provide a method for locating isolated water points in ocean numerical model grids more quickly and accurately and automatically eliminating the located isolated water points, so as to achieve quality control of the grid after terrain interpolation, thereby ensuring the accuracy and stability of numerical simulation.

[0006] Aiming at the problems existing in the traditional depth-first algorithm (DFS) or breadth-first algorithm (BFS): the connectivity of all computing units in the grid can be searched, but a fixed search end point must be specified when applying it to the location and elimination of isolated water points. As the grid resolution increases, the time consumed by this search method will increase exponentially, resulting in excessively long search time. The method of the present invention prioritizes finding the connected calculation area closest to the starting computing unit before calculating the connectivity between the starting computing unit and the final computing unit, and completes the connectivity check based on the core idea of ​​the greedy algorithm, thereby greatly reducing the search time.

[0007] The specific technical solutions of the present invention are as follows:

[0008] (1) Use any form of grid production method to complete the production of numerical model calculation grids, and interpolate the original terrain data onto the model grid to form the initial terrain grid matrix Depto ori ;

[0009] (2) Normalization Depto ori The terrain data in the image is converted into 1 and 0 respectively, and the normalized data matrix Mask is obtained. ori ;

[0010] (3) Definition and Mask ori Zero matrix Mask with the same dimensions 0 , used to store the updated position of isolated water points, 0 represents an isolated water point;

[0011] (4) Enter the first-level loop and search the entire Depto according to the row priority principle. ori , the starting point of each cycle is defined as Calculate the column position set of non-isolated water points in the previous row Calculated Define the minimum position as

[0012] (5)Judgment Is it a land point? If it is a land point, proceed to the next first-level loop point;

[0013] (6) Define the search index value set search_id, the initial value is

[0014] (7) Enter the secondary while loop to determine whether the set search_id is an empty set. If it is empty, locate it It is an isolated water point;

[0015] (8) Enter the third-level loop, search all points in the set search_id, search in four directions, define the search relay value set search_id_mid, whose initial value is an empty set, find out whether the points in the four directions are water points, and obtain the water point set valid_neighbors. If the set valid_neighbors is an empty set, set search_id = set search_id_mid, and return to step (7);

[0016] (9) Determine whether there is a point equal to any one of the valid_neighbors sets If it exists, exit the secondary while loop and define is a non-isolated water point; if the set valid_neighbors does not contain Then define the set search_id_mid to be equal to the set valid_neighbors;

[0017] (10) Define the set search_id to be equal to the set search_id_mid, and return to step (7).

[0018] In step (1), the grid production method is MATLAB, Python or Gmsh, etc., and the model grid type is a rectangular grid, an orthogonal grid or a curved grid, etc.

[0019] If there are two minimum values ​​in step (4), take the first point as

[0020] In step (8), if the set search_id contains points at the boundary position, boundary correction is performed, that is, the points beyond the boundary are defined as an empty set.

[0021] In step (9), if there is a point in the set valid_neighbors The search point is defined as a connected point, and the search process is exited, and the connectivity check of the next search point is performed until the check of all search points is completed.

[0022] The present invention adopts the core idea of ​​the greedy algorithm, can quickly locate all isolated water points in the terrain data matrix, and find the optimal adjacent non-isolated water point as the search end point before searching the connectivity of the calculation unit, avoiding the defects of the traditional search algorithm that can only use a fixed search end point and cause excessive calculation amount and calculation time. The algorithm is suitable for all ocean numerical model grids after testing, and the calculation time is greatly reduced. In addition, the method of the present invention realizes the quality control of the grid after terrain interpolation, thereby ensuring the accuracy and stability of the numerical simulation. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a flow chart of the present invention.

[0024] Figure 2 It is the original terrain data grid of the ocean numerical model and the terrain data grid map after removing isolated water points.

[0025] Among them, (a) represents the terrain data grid before processing, and the black boxes represent the locations of some isolated water points; (b) represents the terrain data results after processing; the different colors in the figure represent the water depth.

[0026] Figure 3 It is a schematic diagram of the locally enlarged normalized terrain matrix.

[0027] Among them, (a, b), (c, d), and (e, f) represent the results before and after processing in three different cases, respectively, and (g) is the result of the entire local area after the processing is completed. DETAILED DESCRIPTION

[0028] In order to facilitate understanding of the overall content, implementation process and technical effects of the invention, the present invention is further analyzed and explained below in conjunction with the accompanying drawings and specific implementation cases.

[0029] Embodiment 1:

[0030] The following specific implementation case is the process of building an ocean numerical model grid covering the entire South China Sea. Figure 1 shown.

[0031] (1) Create the original terrain grid using MATLAB, interpolate the original terrain data onto the model grid, the grid type is a regular rectangular grid, the grid contains 1056*1156 computing units, and form the initial terrain grid matrix Depto ori The original terrain data used is from the GEBCO_2023 (https: / / www.gebco.net / ) ocean terrain dataset. Figure 2 (a) shows the locations of some isolated water spots.

[0032] (2) Normalization Depto ori The terrain data in the normalized data matrix Mask is obtained ori :The following is based on Figure 3 The screening process of isolated water points is described in detail. Figure 3 is a locally enlarged normalized terrain matrix. The gray box represents the search starting point (i, j) in the first-level loop, where * represents land points, i.e., impassable paths; ○ represents connected points that have been searched; and 1 represents water points that have not been searched. Figure 3 As shown in (a), the water points in the gray box are located.

[0033] (3) Definition and Mask ori Zero matrix Mask with the same dimensions 0 , used to store the updated position of isolated water points, 0 represents isolated water points.

[0034] (4) Define the search starting point (i, j) as Start_loc, and calculate the column position set of non-isolated water points in the previous row Depend on Get the search end point is the point (i-1, j+2).

[0035] (5) Starting search point It is a water point, not a land point.

[0036] (6) Define the search index value set search_id, the initial value is

[0037] (7) Determine the situation of search_id, search_id is a non-empty set.

[0038] (8) Perform a four-directional search on Start_loc. If there is only one adjacent connected point (i+1, j), then the set search_id_mid only contains the point (i+1, j).

[0039] (9) Since search_id_mid does not contain the search end point, set search_id = search_id_mid and continue searching search_id in four directions.

[0040] The search results include three adjacent connected areas. After deduplication, the set search_id_mid is updated to points (i+2, j) and (i+1, j+1), and the set search_id_mid does not include the search endpoint.

[0041] (10) Let search_id = search_id_mid, and continue to search search_id in four directions. After deduplication, there is no adjacent connected area, so the value of Start_loc returned is 0, that is, the point is an isolated water point. Update the location information of the point. The result is as follows: Figure 3 (b) as shown.

[0042] Embodiment 2:

[0043] Steps (1)-(2) are the same as in Example 1, such as Figure 3 As shown in (c), the water points in the gray box are located.

[0044] Step (3) is the same as in Example 1.

[0045] (4) Define the search starting point (i, j) as Start_loc, and calculate the column position set of non-isolated water points in the previous row Depend on Get the search end point is the point (i-1, j).

[0046] Steps (5)-(7) are the same as in Example 1.

[0047] (8) Perform a four-directional search on the search starting point. If there are two adjacent connected areas, the set search_id_mid contains the points (i-1, j) and (i+1, j).

[0048] (9) Since the search end point is included in the set search_id_mid, the value of Start_loc is returned as 1. This point is a connected point. The location information of this point is updated. The result is Figure 3 (d) as shown.

[0049] Embodiment 3:

[0050] Steps (1)-(2) are the same as in Example 1, such as Figure 3 As shown in (e), the water points in the gray box are located.

[0051] Step (3) is the same as in Example 1.

[0052] (4) Define the search starting point (i, j) as Start_loc, and calculate the column position set of non-isolated water points in the previous row Depend on Get the search end point is the point (i-1, j+1).

[0053] Steps (5)-(7) are the same as in Example 1.

[0054] (8) Perform a four-directional search on the search starting point. There is no adjacent connected area, so the value of Start_loc is returned to 0. This point is an isolated water point. Update the location information of this point. The result is as follows: Figure 3 (f) as shown.

[0055] After searching all points in the local area, update the location information of all points to include only connected points. The result is as follows Figure 3 After searching the entire terrain data matrix, the location of the isolated water point and the terrain data after removing the isolated water point can be obtained. The result is as follows: Figure 2 (b) As shown in the figure, the terrain data obtained by eliminating isolated water points can be directly used as the calculation grid of the numerical model, ensuring the stability and accuracy of the numerical calculation process.

[0056] In order to highlight the advantages of the present invention, the time taken by the Dijkstra algorithm in the depth-first algorithm to locate and remove isolated water points is compared. The comparison results are shown in Table 1.

[0057] Table 1 Comparison of the time consumed by the present invention and the Dijkstra algorithm in processing Example 1

[0058]

[0059] Table Note: The parallel mode is Matlab Parallel Toolbox accelerated computing, and the number of logical processor cores of the parallel CPU is 10 cores.

[0060] By comparing the present invention with the traditional screening method, it can be seen that the method of the present invention can greatly reduce the time for processing the terrain data matrix, quickly locate the position of isolated water points and process them as land points. After obtaining the processed terrain data matrix, the method of the present invention is continued to perform connectivity checks on all grid points. All water points except land points are connectable water points, ensuring the accuracy of the present invention.

Claims

1. A method for quickly removing isolated water points in an ocean numerical model grid, characterized in that: The following steps are involved: (1) Use any form of grid production method to complete the production of numerical model calculation grid, and interpolate the original terrain data onto the model grid to form the initial terrain grid matrix Dtpto ori ; (2) Normalization Depto ori The terrain data in the image is converted into 1 and 0 respectively, and the normalized data matrix Mas is obtained. ori ; (3) Definition and Mask ori A zero matrix Mask0 with the same dimension is used to store the updated positions of isolated water points, where 0 represents an isolated water point; (4) Enter the first-level loop and search the entire Depto according to the row priority principle. ori , the starting point of each cycle is defined as Calculate the column position set of non-isolated water points in the previous row Calculated Define the minimum position as (5)Judgment Is it a land point? If it is a land point, proceed to the next first-level loop point; (6) Define the search index value set search_id, the initial value is (7) Enter the secondary while loop to determine whether the set search_id is an empty set. If it is empty, locate it It is an isolated water point; (8) Enter the third-level loop, search all points in the set search_id, search in four directions, define the search relay value set search_id_mid, whose initial value is an empty set, find out whether the points in the four directions are water points, and get the water point set valid{neighbors. If the set valid{neighbors is an empty set, set search_id = set search_id_mid, and return to step (7); (9) Determine whether there is a point equal to in the set valid{neighbors If it exists, exit the secondary while loop and define is a non-isolated water point; if the set valid_neightbors does not contain Then define the set search_id_mid to be equal to the set valid_neighbors; (10) Define the set search_id to be equal to the set search_id_mid, and return to step (7).

2. The rapid elimination method according to claim 1, characterized in that: The grid production method described in step (1) is MATLAB, Python or Gmsh.

3. The fast elimination method according to claim 1, characterized in that: The model grid type described in step (1) is a rectangular grid, an orthogonal grid or a curved grid.

4. The rapid elimination method according to claim 1, characterized in that: If there are two minimum values ​​in step (4), take the first point as 5. The fast elimination method according to claim 1, characterized in that: In step (8), if the set search_id contains points at the boundary position, boundary correction is performed, that is, the points beyond the boundary are defined as an empty set.

6. The fast elimination method according to claim 1, characterized in that: In step (9), if there is a point in the set valid_neighbors The search point is defined as a connected point, and the search process is exited, and the connectivity check of the next search point is performed until the check of all search points is completed.

Citation Information

Patent Citations

  • Image processing device and image processing method

    CN104081159A

  • Pipeline network spatial analysis method based on breadth-first search algorithm

    CN105225187A

  • Method for searching isolated zone when casting solidification

    CN1845092A