# Real-Time Interactive Parallel Visualization of Large-Scale Flow-Field Data
## 3 Data-Partitioning Strategy Based on Grid Segmentation
### Grid Topology Reconstruction
#### 3.2.1 Coordinate-Mapping Algorithm  
In our research, we successfully construct the metadata of the geometric model file through precise operations such as pre-scanning and grid segmentation. The core function of this metadata is to create file viewports for each process, thereby creating conditions for parallel reading. Figure 4 shows the situation of each process reading the viewport. Each process opens the file separately and maintains its own file pointer. With the assistance of metadata, each process only reads the data within its own viewport, constructs the grid, and performs grid mapping. This process achieves more efficient data processing, and the content processed by each process does not interfere with each other. In EnSight Gold format files, each part shares the same set of coordinate points. Therefore, each process must maintain its own set of points. In this study, we propose a  
Figure 4: Geometric model file consisting of n parts, each containing multiple different types of elements. The blue frame diagram indicates the sub-grid portions of each part that process 0 is responsible for processing. Figure 3: Illustration of the partitioning of the mesh by processes. (**a**) Yellow, red, and blue represent the three components of the geometric model; (**b**) four processes sequentially partition the three components and store the sub-meshes separately; the final partitioning result is shown in (**c**). point-set mapping algorithm that enables the reconstruction of mesh topology for process mapping after partitioning the mesh into multiple parts and assigning them to different processes. This algorithm maps the point set in the geometric model part to each process through two mappings, ensuring the accuracy of key operations such as mesh construction and attribute-variable retrieval. Figure 5 illustrates these two mapping processes. Specifically, we abstract the algorithm as a function f, which maps the point set in the geometric model to the point set in the process, as demonstrated in Expression (5), where P\({}_{\text{model}}\) represents the point set in the geometric model file, and P\({}_{\text{process}}\) represents the point set in the process. To ensure the accuracy of key operations, the mapping function includes two steps: the first mapping and the second mapping. \[\text{f}:\text{P}_{\text{model}}\rightarrow\text{P}_{\text{process}} \tag{5}\]  
In the first mapping step, we maintain a coordinate-mapping table T\({}_{\text{point}}^{\text{i}}\), recording the mapping relationship between the ID of each point in the geometric model and the corresponding ID of the point in process i. First, we use the information in the metadata constructed by data preprocessing to calculate the byte length that process i should read. We then maintain a vector nodeIdList\({}_{\text{ijk}}\) with a length of processNumEleLen\({}_{\text{ijk}}\) to read all bytes of the topology of the cell under element\({}_{\text{k}}\) in part\({}_{\text{j}}\) that process i needs to process. According to nodeIdList\({}_{\text{ijk}}\), we obtain the ID of the coordinate as an index and use the value of pointsCnt (a counter with an initial value of 1, incrementing in a loop) as the value of the current coordinate in the mapping table T\({}_{\text{point}}^{\text{i}}\) to complete the mapping of a coordinate point. Whenever a new coordinate ID is obtained, we first check whether there is already a mapping in the mapping table T\({}_{\text{point}}^{\text{i}}\). If it does not exist, we perform mapping and use the mapping result to construct a sub-grid. If it already exists, we directly use the mapping result to construct a new cell topology structure. Finally, after all grid topologies are constructed, the mapping table T\({}_{\text{point}}^{\text{i}}\) also completes the mapping from the global coordinates to the local coordinates. In the second mapping stage, the point set is stored as an object for subsequent attribute data retrieval.