YYZVis: An Efficient Visualization Tool kit for Yin-Yang ...

19
YYZVis: An Efficient Visualization Toolkit for Yin-Yang-Zhong Grid Dataset Kaoru Uemori 1 , Naohisa Sakamoto 2* , Nobuaki Ohno 3 , Akira Kageyama 2 1 Department of Computer Science and System Engineering, Kobe University 2 Graduate School of System Informatics, Kobe University 3 Graduate School of Simulation Studies, University of Hyogo * [email protected] Abstract. In this paper, we develop a visualization toolkit called YYZVis, which can efficiently handle a new overset grid in a sphere composed of Yin, Yang, and Zhong grids. Conventionally, in order to visualize the overset grid dataset, it must be merged into a single uniform structured volume. However, this merging process may increase memory and time complexities, and some artifacts may occur owing to interpolation errors around the boundaries of the sphere. In YYZVis, the Yin-Yang-Zhong (YYZ) grid dataset can be visualized without any grid merging process. YYZVis provides basic visualization functionalities such as isosurfaces, slice planes, and volume rendering, as modules comprise the visualization pipeline. Therefore, YYZVis al- lows us to efficiently develop a visualization system by combining our proposed modules with existing modules. In the experiments, we applied YYZVis to a magnetohydrodynamics simu- lation result and confirmed its effectiveness. Keywords: Yin-Yang-Zhong grid dataset, Visualization pipeline, Volume rendering, Magnetohy- drodynamics 1. Introduction Many astronomical or celestial objects including the earth and sun have a structure that includes fluids with electrical conductivity such as liquid metals and plasma inside a spherical region. The fundamental behavior of such magnetic fluids can be described by using magnetohydro- dynamic (MHD) equations. However, many parts of the motion remain unclear owing to the complicated interactions with a magnetic field. Currently, for these problems, a significant amount of research has been actively conducted to clarify the mechanism of MHD motions by performing numerical simulations using supercomputing systems [1]. However, many MHD fluids that actually exist have complicated flow structures owing to the low electrical resistance © 2020 Japan Society for Simulation Technology 15 J. ADV. SIMULAT. SCI. ENG. Vol. 7, No. 1, 15-33. Received: January 10, 2020; Accepted: February 10, 2020; Published: March 12, 2020

Transcript of YYZVis: An Efficient Visualization Tool kit for Yin-Yang ...

Kaoru Uemori1, Naohisa Sakamoto2*, Nobuaki Ohno3, Akira Kageyama2
1Department of Computer Science and System Engineering, Kobe University 2Graduate School of System Informatics, Kobe University
3Graduate School of Simulation Studies, University of Hyogo *[email protected]
Abstract. In this paper, we develop a visualization toolkit called YYZVis, which can efficiently handle a new overset grid in a sphere composed of Yin, Yang, and Zhong grids. Conventionally, in order to visualize the overset grid dataset, it must be merged into a single uniform structured volume. However, this merging process may increase memory and time complexities, and some artifacts may occur owing to interpolation errors around the boundaries of the sphere. In YYZVis, the Yin-Yang-Zhong (YYZ) grid dataset can be visualized without any grid merging process. YYZVis provides basic visualization functionalities such as isosurfaces, slice planes, and volume rendering, as modules comprise the visualization pipeline. Therefore, YYZVis al- lows us to efficiently develop a visualization system by combining our proposed modules with existing modules. In the experiments, we applied YYZVis to a magnetohydrodynamics simu- lation result and confirmed its effectiveness.
Keywords: Yin-Yang-Zhong grid dataset, Visualization pipeline, Volume rendering, Magnetohy-
drodynamics
1. Introduction
Many astronomical or celestial objects including the earth and sun have a structure that includes fluids with electrical conductivity such as liquid metals and plasma inside a spherical region. The fundamental behavior of such magnetic fluids can be described by using magnetohydro- dynamic (MHD) equations. However, many parts of the motion remain unclear owing to the complicated interactions with a magnetic field. Currently, for these problems, a significant amount of research has been actively conducted to clarify the mechanism of MHD motions by performing numerical simulations using supercomputing systems [1]. However, many MHD fluids that actually exist have complicated flow structures owing to the low electrical resistance
© 2020 Japan Society for Simulation Technology
15
J. ADV. SIMULAT. SCI. ENG. Vol. 7, No. 1, 15-33.
Received: January 10, 2020; Accepted: February 10, 2020; Published: March 12, 2020
Journal of Advanced Simulation in Science and Engineering
and viscosity. Therefore, numerical simulations with higher-resolution models are required. As a result, output datasets represented as volume datasets calculated on supercomputing systems tend to be large in scale, and the demand for a technique to efficiently visualize and analyze the magnetic field generation mechanisms using such datasets has increased.
Generally, for numerical simulations based on MHD equations with a spherical structure, the latitude-longitude grid in spherical polar coordinates (called a spherical grid) is mostly used as a basic computational grid. However, the spherical grid involves several problems such as coordinate singularity around the north and south poles. In 2004, to overcome these problems, a new overset grid named the Yin-Yang (YY) grid [2] was proposed for numerical simulations based on a spherical structure. The YY grid is also suitable for parallel computing in large- scale MHD simulations. A geodynamo simulation based on the YY grid received the Gordon Bell prize in the category of Peak Performance at the International Conference for High Per- formance Computing, Networking, Storage and Analysis in 2004 [3]. In 2016, the Yin-Yang- Zhong (YYZ) grid [4] was proposed by Hayashi and Kageyama in order to solve the problem of the coordinate singularity around the center of the sphere in the YY grid.
The YYZ grid dataset is represented as an overset grid composed of two curvilinear grids named Yin and Yang, and a rectilinear grid named Zhong. So far, the YYZ grid dataset has been integrally visualized in a single scene by distinguishing each subgrid by using generic visualization tools such as ParaView [5] and VisIt [6]. In order to apply volume rendering tech- niques using common visualization tools, the YYZ grid dataset needs to be represented as a single-volume dataset by merging the Yin, Yang, and Zhong grids in preprocessing. Ohno and Kageyama proposed a volume rendering technique for a spherical grid dataset composed of the Yin and Yang grids without the grid merging process [7]. However, the Zhong grid has not been supported in this technique.
Generally, the grid merging process may increase memory and time complexities, and some artifacts may occur owing to interpolation errors around the boundaries of the sphere. In addition, when the YYZ grid dataset as a multiple-volume dataset without the grid merging process is rendered in a single scene by using the volume rendering technique, the artifacts might be especially prominent owing to visibility ordering errors in overlapping grid regions. In order to solve these problems, in this paper, we develop a visualization toolkit called YYZVis, which can efficiently visualize the YYZ grid dataset without the grid merging process. In ad- dition, we develop a new volume rendering technique that extends the particle-based rendering technique [8], which is a volume rendering technique without visibility ordering, to the YYZ grid dataset.
The reminder of this paper is organized as follows. In Section 2, we define the design requirements for our proposed visualization toolkit YYZVis. The details of the visualization techniques for the YYZ grid dataset are described, and several visualization modules imple- mented in YYZVis are introduced in Section 3. Then, the results of experiments that confirm
16
Journal of Advanced Simulation in Science and Engineering
the effectiveness of YYZVis are shown, and some application examples based on YYZVis are demonstrated in Section 4. Finally, we describe our conclusions and future works in Section 5.
2. Design Requirements
In this paper, we interviewed domain specialists who use the YYZ grid for their simulations to establish the design requirements for efficient visualization tools. By gathering feedback from them, the requirements can be summarized as follows:
R1 - Data Representation: In existing visualization tools, any data structures that can handle the YYZ grid efficiently have not been defined. Therefore, a new data structure for storing and processing the Yin, Yang, and Zhong grids without grid merging needs to be defined in our proposed visualization toolkit.
R2 - Expressiveness: For flexible and effective visualization of the YYZ grid dataset, a soft- ware development framework that can support the visualization pipeline construction is re- quired. In addition, basic visualization functionalities such as isosurfaces, slice planes, and vol- ume rendering need to be provided to users.
R3 - Interactivity: It is important to visualize the YYZ grid dataset interactively in terms of efficient data exploration. Therefore, the proposed visualization toolkit needs to support inter- active rendering with graphics hardware acceleration techniques.
3. Proposed Visualization Toolkit
3.1. Data Model
To address the requirement R1, we consider a new data structure for visualizing the YYZ grid dataset. The Yin and Yang grids can be both represented as a curvilinear grid. The Yin grid is a partial grid of the latitude-longitude grid in the range of π/4 ≤ θ ≤ 3π/4 and -3π/4 ≤ φ ≤ 3π/4 in the latitude and longitude directions, respectively. In addition, the Yang grid can be expressed as a partial grid in which the Yin grid is rotated by π/2 in the latitude direction and by π in the longitude direction (see Fig. 1). That is, the Yin and Yang grids can be defined as a data struc- ture in which the range information in the latitude, longitude, and radial directions is added to the basic data structure of the curvilinear grid. On the other hand, the Zhong grid can be ex- pressed as a rectilinear (cartesian) grid with the range information in the radial direction.
17
Figure 1: Yin-Yang-Zhong grid
In our visualization toolkit YYZVis, we define data structures in order to represent the Yin/Yang and Zhong grid data as follows:
struct YinYangVolumeObject { enum Type{ Yin, Yang }; struct Range{ float min, max; }; Type type; Range range[3]; int dims[3]; float values[]; }; struct ZhongVolumeObject { struct Range{ float min, max; }; Range range; int dim; float values[]; };
where, in the YinYangVolumeObject structure, type is a parameter used to distinguish the grid type of Yin or Yang, and ranges is an array of the Range structure that represents the grid ranges in the latitude, longitude, and radial directions. The Range structure has a data range of min and max values. The dims and values are the basic data information used to represent the curvilinear grid; numbers of grid points along the longitude, latitude, and radial directions; and the data values defined at each grid point. In the ZhongVolumeObject struc- ture, range represents a range in the radial direction, and dim is the number of grid points along each axis of the Zhong grid, represented as a cube in Cartesian coordinates.
Yin grid Yang grid
θ
3.2. Visualization Module
To address the requirements of R2 and R3, several visualization methods for the YYZ grid dataset are implemented as modules that can be used to construct the visualization pipelines. In this paper, the isosurface extraction, slicing plane extraction, and volume rendering modules are implemented as basic visualization functionalities in YYZVis.
3.2.1. Isosurface and Slice Plane
The extraction modules for isosurfaces and slicing planes from the YYZ grid dataset can be easily implemented by extending the existing implementations since the Yin/Yang grids and Zhong grid have almost the same structures as the curvilinear and rectilinear grids.
In YYZVis, although the proposed data structures described in the previous subsection do not include the coordinate values of grid points, the positions of each grid point at uniform intervals can be calculated by the following steps. First, the position (r, θ, φ) of a point repre- sented with the grid indices of (i, j, k) along the longitude, latitude, and radial directions in the spherical coordinate system can be calculated by
= #$% + *,
= #$% + .,
,
,
,
(2)
where (Nr, Nθ, Nφ) represents the number of grid points along the longitude, latitude, and radial directions, and [rmin, rmax], [θmin, θmax] and [φmin, φmax] denote the grid distribution ranges in each direction. These variables are described with our proposed data structure for the Yin/Yang grid data as follows:
Nr, Nθ, Nφ : dims[0], dims[1], dims[2] rmin, rmax : range[0].min, range[0].max θmin, θmax : range[1].min, range[1].max φmin, φmax : range[2].min, range[2].max
19
Journal of Advanced Simulation in Science and Engineering
Then, position (x, y, z) in the Cartesian coordinate system for (r, θ, φ) can be calculated as follows:
= sin cos , = sin sin , = cos .
(3)
In the spherical coordinate system, the position of a point in the Yang grid can be obtained by rotating the point in the Yin grid by π/2 in the latitude direction and then by π in the longitude direction. Therefore, the relationship between points (xn, yn, zn) and (xe, ye, ze) in the Yin and Yang grids, respectively, can be denoted by using the following equation:
@ A A A B = @
D D D B, (4)
where
= @ −1 0 0 0 0 1 0 1 0
B. (5)
On the other hand, in the case of the Zhong grid represented as a uniform Cartesian grid structure, the coordinate transformation from indices (i, j, k) of the Zhong grid to its position (x, y, z) in the Cartesian coordinate system can be denoted by
= FGD + H, = FGD + I, = FGD + J,
(6)
,
,
,
(7)
where (Nx, Ny, Nz) is the number of grid points along each axis in Cartesian coordinates, and [xmin, xmax], [ymin, ymax], and [zmin, zmax] represent the ranges for each axis. In the YYZ grid, since the Zhong grid is represented as a cubic grid, it is located inside the Yin-Yang grid within a range of [0, rmin] in the radial direction. The number of grid points N and the range [Rmin, Rmax] along each axis in Cartesian coordinates can be expressed as follows:
= H = I = J, (8)
20
Journal of Advanced Simulation in Science and Engineering
#$% = #$% = #$% = #$% = −#$%, #23 = #23 = #23 = #$% = #$%.
(9)
In addition, these variables are described with our proposed data structure for the Zhong grid data as follows:
N : dim Rmin, Rmax : range.min, range.max
In YYZVis, the isosurfaces and slice planes can be extracted from the Yin-Yang-Zhong
grid dataset by applying the marching cubes algorithm [9] to each grid defined in the Cartesian coordinate system. These methods are implemented as mapper modules, and the output data from these modules is represented as generic polygon data. Therefore, the rendering modules accelerated by using the graphics processing unit (GPU) can be utilized in order to achieve the interactive visualization required in R3.
3.2.2. Volume Rendering
The Yin, Yang, and Zhong grids are partially overlapped in the spherical coordinates. In volume rendering for each grid, the image composition technique cannot be applied to each rendering result. In this paper, we extend the GPU-accelerated particle-based rendering technique [10], which can efficiently render large and complex grid datasets without visibility ordering, to im- plement the volume rendering module for the YYZ grid. In particle-based rendering (PBR), a set of particles is generated in each grid by using the particle density function derived from the brightness equation [11]. This is projected onto the image plane with depth testing. A final image is obtained by averaging the rendering images, which are generated by repeating the particle generation and projection processes. In PBR, each image generated during the rendering process is called an ensemble image, and the averaging of the ensemble images is called ensemble averaging.
Particle Generation In the Yin-Yang-Zhong grid dataset, grid overlap occurs in some regions. In PBR, particles might be excessively generated in the regions owing to the grid overlap. As a result, the regions will be visualized with higher opacity than the correct value. To solve this problem, in this paper, we introduce a grid priority and generate particles based on this priority. In our proposed method, the priorities are set in the order of Yin, Yang, and Zhong, and particle generation is executed according to the following three grid overlapping patterns (see Fig. 2).
21
Journal of Advanced Simulation in Science and Engineering
(A) Full overlap: The entire unit grid completely overlaps with other grids (B) Non overlap: The unit grid does not overlap with other grids (C) Partial overlap: The unit grid partially overlaps with other grids
Figure 2: Grid overlapping patterns.
In the case of pattern A, particles are generated only in the high-priority grid according to the abovementioned grid priority. In the case of pattern B, since no grid overlap occurs, par- ticles are generated in both grids as usual. In pattern C, it is necessary to generate particles in consideration of the grid overlap. In our method, we generate particles in a nonoverlapping region of the grid with a low priority. For this pattern, the number of particles N’ generated in the nonoverlapping region is denoted by
L = (1 − ), (10)
where N represents the total number of particles generated in the grid, and S is the overlap ratio of the grid. Overlap Ratio We now explain the method of calculating the overlap ratio. In this method, we consider the following two overlapping patterns: (1) overlapping with the Yin and Yang grids, and (2) over- lapping with the Yin/Yang and Zhong grids. (1) Overlap with Yin and Yang Grids
In the case of overlapping with the Yin and Yang grids, the Yin grid is set as the priority grid. That is, when this overlap occurs, we generate particles in the Yin grid as usual, and generate particles in the nonoverlapping region in the Yang grid. Note that the number of par- ticles generated in this region needs to be estimated in consideration of the grid overlap ratio. In our method, the ratio of the volume of the grid to the volume of the overlapping region is calculated as the overlap ratio.
First, we consider the patterns of the overlapping with the Yin and Yang grids. Since the Yin grid is defined by rotating the Yang grid by π/2 and π in the latitude and longitude directions,
(A) Full (B) Non (C) Partial
Yin
Yang
22
Journal of Advanced Simulation in Science and Engineering
respectively, certain gaps in the grids occur in the θ and φ directions. Since there are no gaps in the r direction, the Yang grid cut into the Yin grid becomes a polygonal prism whose height is in the r direction. The volume ratio to be obtained is equal to the ratio of the bottom area between the cut-out polygonal prism and the grid.
Next, we focus on the θ-φ plane in order to obtain the area ratio of the bottom faces. A method of calculating the area of the overlapping region, which is the bottom area of the cut- out polygonal prism on this plane, will be described. There are three possible patterns of the grid overlap: (a) three of four grid points of the bottom face are included in the overlapping region, that is, the shape of the cut-out region on the side of the Yin grid is a pentagon; (b) two grid points are included in the region, that is, the shape is a trapezoid; and (c) a grid point is included in the region, that is, the shape is a right-shaped triangle (see Fig. 3).
Figure 3: Overlapping patterns of Yin and Yang grids.
Then, we consider the degree of penetration P, which is called the penetration rate, of a
point in the Yang grid into the Yin grid region. P is a variable with the range of [0,1] in the region and can be calculated as follows:
= | − 1|| − 1|, (11)
where s and t represent coordinates normalized in two-dimensional space. The variables of (s, t) can be calculated from the coordinates of the Yang grid point (θ, φ) by
= T − F U
T ,
T, (12)
v4
Lb
La
(a) Three points are included (b) Two points are included (c) A point is included
23
F = #23 + #$%
2 ,
(13)
where [θmin, θmax] and [φmin, φmax] are the Yin grid distribution ranges in the longitude and lati- tude directions, respectively.
Finally, we describe a calculation method for the overlap ratios Sa, Sb, and Sc for each pattern shown in Fig. 3. If three of the four Yang grid points are included in the Yin grid region [see Fig. 3 (a)], then overlap ratio Sa can be solved as follows by calculating the area of the nonoverlapping region represented as a triangle:
W = 1 − WY 2 , (14)
with
(15)
where Pvi denotes the penetration rate for grid point vi, which can be calculated by using Eq. (10). When two of the four grid points overlap [see Fig. 3 (b)], the overlap ratio Sb can be solved by calculating the area in consideration of the trapezoidal overlapping area as follows:
Y = W + Y
(17)
Then, when only one grid point is overlapped [see Fig. 3 (c)], the overlap ratio Sc can be cal- culated as follows by calculating the area of the overlapping triangular regions:
24
_ = WY 2 , (18)
(19)
(2) Overlap with Yin/Yang and Zhong Grids The calculation of the overlap ratio between the Yin/Yang grids represented as a spherical grid and the Zhong grid represented as a Cartesian grid is more complicated than the calculation of the overlap ratio between the Yin and Yang grids. Therefore, in our method, for simplicity, the overlap ratio Sz is calculated from the number of Zhong grid points included in the Yin/Yang grid region as follows:
J = J 8⁄ (20)
4. Experimental Results
In this paper, we implemented the visualization modules described in Section 2 by using the Kyoto Visualization System (KVS), which is a general-purpose visualization system [12]. In order to evaluate our proposed visualization toolkit, we used MHD simulation results of the relaxation of an electrically conducting fluid confined in a unit sphere [13]. The resolutions of the Yin, Yang, and Zhong grids used in the experiment were 201 × 204 × 608, 201 × 204 × 608, and 222 × 222 × 222, respectively. The performance evaluations were conducted on a PC equipped with an Intel Core i5 CPU (2.7 GHz), NVIDIA GeForce GT 640M GPU (512 MB), and 16 GB of RAM. All classes and structures provided by YYZVis are defined in the namespace of YYZVis, and all of the KVS classes are defined in the namespace of kvs.
4.1. Data Representation
In order to visualize the Yin-Yang-Zhong (YYZ) grid dataset without any rendering artifacts, the grid merging process was required as a preprocess. In this experiment, we measured the preprocessing time for the grid merging in order to confirm the effectiveness of the proposed data model related to the data representation (R1). As a result, the processing times of merging to a single spherical grid dataset and a single Cartesian grid dataset were 120 and 125 s, respec- tively. By using our proposed data model, the user can read the Yin, Yang, and Zhong grid datasets individually, and visualize these datasets without the preprocessing time for the grid merging process. Below is the pseudocode of the definition of the YYZ grid dataset using our
25
data model:
yang_vol = new YYZVis::YinYangVolumeObject(); yang_vol->type = YYZVis::YinYangVolumeObject::Yang; yang_vol->range[0] = { rmin, rmax }; yang_vol->range[1] = { θmin, θmax }; yang_vol->range[2] = { φmin, φmax }; yang_vol->dims = { Nx, Ny, Nz }; yang_vol->values = READ_VALUES( yang_data_file );
zhong_vol = new YYZVis::ZhongVolumeObject(); zhong_vol->range = { Rmin, Rmax }; zhong_vol->dim = N; zhong_vol->values = READ_VALUES( zhong_data_file );
In this code, YYZVis::YinYangVolumeObject and YYZVis::ZhongVolumeObject are
classes provided by our proposed tool, and READ_VALUES is a function that reads data values
from the specified file. In this experiment, we set [rmin, rmax] = [0.35, 1.0], [θmin, θmax] = [π/4, 3π/4] and [φmin, φmax] = [-3π/4, 3π/4], and (Nx, Ny, Nz) = (201 × 204 × 608) for the Yin and Yang grid data. For the Zhong grid data, we specified [Rmin, Rmax] = [-0.35, 0.35] and N = 222.
In common visualization systems such as ParaView and VisIt, the rendering images gen- erated by using the isosurface and slice plane modules can be integrated into a single final image without merging the YYZ grid dataset. However, the grid merging process into a single Cartsian grid dataset is required to use the volume rendering module. In YYZVis, the user can efficiently obtain the volume rendering image without the grid merging process by applying our proposed volume rendering module based on particle-based rendering for each grid dataset.
4.2. Expressiveness
In this paper, in order to satisfy the expressiveness (R2), the basic visualization methods for the YYZ grid dataset such as isosurface extraction, slice plane extraction, and volume rendering were implemented as modules in KVS [12]. In YYZVis, the Yin, Yang, and Zhong grids are processed independently, and the entire grid dataset can be efficiently visualized by integrating
26
Journal of Advanced Simulation in Science and Engineering
the rendering images separately generated by using the proposed modules and the rendering screen module provided by KVS.
Figure 4 shows the rendering results of the isosurfaces extracted from each grid dataset specified by the three thresholds of isoval1, isoval2, and isoval3, and the composite
image. Each of the isosurfaces can be extracted by using our isosurface extraction module YYZVis::Isosurface, and represents the polygon object defined as kvs::PolygonObject in KVS as follows:
kvs::PolygonObject* yin_iso1, yin_iso2, yin_iso3; yin_iso1 = new YYZVis::Isosurface(yin_vol, isoval1); yin_iso2 = new YYZVis::Isosurface(yin_vol, isoval2); yin_iso3 = new YYZVis::Isosurface(yin_vol, isoval3); kvs::PolygonObject* yang_iso1, yang_iso2, yang_iso3; yang_iso1 = new YYZVis::Isosurface(yang_vol, isoval1); yang_iso2 = new YYZVis::Isosurface(yang_vol, isoval2); yang_iso3 = new YYZVis::Isosurface(yang_vol, isoval3); kvs::PolygonObject* zhong_iso1, zhong_iso2, zhong_iso3; zhong_iso1 = new YYZVis::Isosurface(zhong_vol, isoval1); zhong_iso2 = new YYZVis::Isosurface(zhong_vol, isoval2); zhong_iso3 = new YYZVis::Isosurface(zhong_vol, isoval3);
Then, the composite image shown on the right side of Fig. 4 can be obtained by using the screen class kvs::glut::Screen provided by KVS as follows:
kvs::glut::Screen screen( app ); screen.registerObject( yin_iso1 ); screen.registerObject( yin_iso2 ); screen.registerObject( yin_iso3 ); screen.registerObject( yang_iso1 ); screen.registerObject( yang_iso2 ); screen.registerObject( yang_iso3 ); screen.registerObject( Zhong_iso1 ); screen.registerObject( Zhong_iso2 ); screen.registerObject( Zhong_iso3 ); screen.show();
Each polygon object can be integrally visualized by registering on the screen with the reg- isterObject method.
27
Figure 4: Visualization results of isosurfaces.
The visualization results of the extracted slice planes from the YYZ grid dataset are shown in Fig. 5. In this result, three slice planes perpendicular to each other are extracted by using our slice plane module named YYZVis::SlicePlane. Below is the pseudocode used for Fig.
5.
kvs::Vec3 p(0, 0, 0); // point on the planes kvs::Vec3 n1(1, 0, 0); // normal vector of plane1 kvs::Vec3 n2(0, 1, 0); // normal vector of plane2 kvs::Vec3 n3(0, 0, 1); // normal vector of plane3 kvs::PolygonObject* yin_pln1, yin_pln2, yin_pln3; yin_pln1 = new YYZVis::SlicePlane(yin_vol, p, n1); yin_pln2 = new YYZVis::SlicePlane(yin_vol, p, n2); yin_pln3 = new YYZVis::SlicePlane(yin_vol, p, n3); kvs::PolygonObject* yang_pln1, yang_pln2, yang_pln3; yang_pln1 = new YYZVis::SlicePlane(yang_vol, p, n1); yang_pln2 = new YYZVis::SlicePlane(yang_vol, p, n2); yang_pln3 = new YYZVis::SlicePlane(yang_vol, p, n3); kvs::PolygonObject* zhong_pln1, zhong_pln2, zhong_pln3; zhong_pln1 = new YYZVis::SlicePlane(zhong_vol, p, n1); zhong_pln2 = new YYZVis::SlicePlane(zhong_vol, p, n2); zhong_pln3 = new YYZVis::SlicePlane(zhong_vol, p, n3);
In the slice plane module, the plane used for slicing the grid data can be specified by a point on the plane and a normal vector of the plane. In the example code, the coordinates of the point and the normal vector of the plane are defined by using kvs::Vec3, which is a 3D vector
class provided by KVS. The extracted slice planes represented as the polygon object can be visualized by calling the method registerObject of the screen class the same as in the
case of isosurface visualization.
Figure 5: Visualization results of slice planes.
In this paper, we extended the particle-based rendering (PBR) technique in order to im-
plement the volume rendering module for the YYZ grid dataset. PBR is composed of the par- ticle generation process, particle projection process, and ensemble averaging process. There- fore, in our current implementation, a set of particles can be generated by using our proposed particle generation modules YYZVis::YinGridSampling, YYZVis::YangGridSam- pling, and YYZVis::ZhongGridSampling for each grid dataset. The generated parti-
cles can be visualized by using the KVS module of PBR, in which the projection process and the averaging process can be executed in the GPU, which is named the kvs::glsl::Par- ticleBasedRenderer.
int nr = 50; // number of repetitions kvs::TransferFunction tf; kvs::PointObject* yin_pnt, yang_pnt, zhong_pnt; yin_pnt = new YYZVis::YinGridSampling(yin_vol, nr, tf); yang_pnt = new YYZVis::YangGridSampling(yang_vol, nr, tf); zhong_pnt = new YYZVis::ZhongGridSampling(zhong_vol, n, tf); typedef kvs::glsl::ParticleBasedRenderer Renderer; kvs::glut::Screen screen( &app ); screen.registerObject( yin_pnt, new Renderer ); screen.registerObject( yang_pnt, new Renderer ); screen.registerObject( zhong_pnt, new Renderer ); screen.show(); kvs::StochasticRenderingCompositor compositor; compositor.setRepetitionLevel( nr ); compositor.enableLODControl(); screen.setEvent( &compositor );
where nr represents the number of repetitions, which is the number of images used for the ensemble averaging process in PBR, and tf is a transfer function. The compositor is a
particle compositor that integrally renders the particles generated from each grid dataset. The final image obtained by the abovementioned pseudocode is shown in Fig. 6.
yin_vol yang_vol
Figure 6: Visualization results of volume rendering.
From these figures, we can confirm that each grid can be individually visualized not only
for the isosurface and slice plane but also for volume rendering without the grid merging pro- cess. In addition, the visualization pipeline can be efficiently constructed using the modules provided by our tools and KVS integrally.
4.3. Interactivity
In order to confirm the interactivity (R3) of YYZVis, we measured the rendering speed and obtained the results of over 60 frames per second (fps) for the renderings of the extracted isosurfaces and slicing planes. With regard to the volume rendering, we implemented a new approach for the YYZ grid dataset based on PBR. Figure 7 shows the resulting images rendered by using our PBR module. In PBR, the final image can be obtained by averaging the ensemble images rendered with a set of particles. The image quality can be improved by increasing the number of ensemble images. In our experiment, the rendering speed obtained in high-quality mode, which is a rendering mode with a higher number of ensemble images, was 1.67 fps [see Fig. 7 (a)]. On the other hand, when rendering in low-quality mode, that is, with a low number of ensemble images, the dataset can be interactively rendered at 48.71 fps [see Fig. 7 (b)]. With the efficacy of PBR, the level-of-detail control can be applied effectively to the rendering pro- cess by dynamically changing the rendering quality [12].
Figure 7: Image quality of particle-based rendering.
yin_vol yang_vol
30
4.4. Application Examples
Since the modules in YYZVis are implemented as visualization modules for KVS, a visualiza- tion system for the YYZ grid dataset can be easily implemented by using these modules and the existing modules provided from KVS integrally.
Figure 8 shows an application example implemented by using the isosurface module and slice plane module in YYZVis. In this application, three orthogonal slice planes and a set of isosurfaces extracted from the x component of the velocity of the YYZ grid dataset are visual- ized. The useful information of the three-dimensional axes and the color map are additionally displayed using the KVS modules kvs::Axis3D and kvs::ColorMapBar, respectively. In
addition, the slider widget can be easily implemented by using the KVS module kvs::Slider, and the user can change the threshold for extracting the isosurfaces interac-
tively. Figure 9 shows an example of the volume visualization system for the YYZ grid dataset
based on our YYZVis and KVS. In this system, the result of the volume rendering can be shown in the rendering window by using our PBR-based volume rendering module, and the user can intuitively update the colors and opacities by using the transfer function editor widget kvs::TransferFunctionEditor. In addition, the axis information can be shown in the rendering window by using kvs::OrientationAxis. From these results, we can confirm
that YYZVis based on KVS allows for the efficient development of a visualization system for the YYZ grid dataset with high expressiveness (R2).
Figure 8: Visualization system based on isosurface and slice plane extraction modules.
31
Figure 9: Volume visualization system using PBR-based volume rendering module.
5. Conclusion
In this paper, we developed a visualization toolkit called YYZVis, which can efficiently visu- alize the YYZ grid without the grid merging process. In experiments, we confirmed the effec- tiveness of YYZVis by using MHD-based numerical simulation results. In addition, we demon- strated application examples developed by using YYZVis and KVS. In future work, we will investigate the improvement of visualization functionalities for the YYZ grid dataset by provid- ing more modules such as a streamline extraction module and glyph rendering module. We are also planning to develop an in-situ visualization system based on YYZVis for a more large- scale YYZ grid in high-performance computing systems.
Acknowledgement This work was partially supported by JSPS KAKENHI (Grant Number 17K00169).
References [1] A. Dedner, F. Kemm, D. Kröner, C-D Munz, T. Schnitzer, and M. Wesenberg, Hyper-
bolic divergence cleaning for the MHD equations. Journal of Computational Physics, Vol. 175, No. 2, pp. 645–673, 2002.
[2] A. Kageyama, and T. Sato, Yin-Yang grid: An overset grid in spherical geometry, Geo- chemistry, Geophysics, Geosystems, Q09005, 2004, doi:10.1029/2004GC000734.
32
Journal of Advanced Simulation in Science and Engineering
[3] A. Kageyama, M. Kameyama, S. Fujihara, M. Yoshida, M. Hyodo, and Y. Tsuda, A 15.2 Tflops Simulation of Geodynamo on the Earth Simulator, 15.2 TFlops on 4096 proces- sors of the Earth Simulator, 2004.
[4] H. Hayashi, and A. Kageyama, Yin-Yang-Zhong grid: An overset grid system for a sphere, Journal of Computational Physics, Vol. 305, No.15, pp. 895–905, 2016.
[5] J. Ahrens, B. Geveci, and C. Law, ParaView: An End-User Tool for Large Data Visuali- zation, Visualization Handbook, Elsevier, 2005, ISBN-13: 978-0123875822
[6] H. Childs et al., VisIt: An End-User Tool for Visualization and Analyzing Very Large Data, High Performance Visualization-Enabling Extreme-Scale Scientific Insight, pp. 357–372, CRC Press/Francis-Taylor Group, 2012.
[7] N. Ohno, and A. Kageyama, Visualization of spherical data by Yin-Yang grid, Computer Physics Communications, Vol. 180, Issue 9, pp. 1534–1538, 2009.
[8] N. Sakamoto, T. Kawamura, and K. Koyamada, Improvement of particle-based volume rendering for visualizing irregular volume data sets, Computer and Graphics, Vol. 34, No. 1, pp. 34–42, 2010.
[9] T. Newman, and H. Yi, A Survey of the marching cubes algorithm, Computer and Graphics, Vol. 30, No. 5, pp. 854–879, 2006.
[10] N. Sakamoto, and K. Koyamada, Stochastic Approach for Integrated Rendering of Vol- umes and Semi-transparent Surfaces, Proceedings of the 2012 SC Companion: High Per- formance Computing, Networking Storage and Analysis (Workshop on Ultrascale Visu- alization), pp. 176–185, 2012.
[11] N. Max, Optical models for direct volume rendering, IEEE Transactions of Visualization and Computer Graphics, Vol. 1, Issue 2, pp. 99–108, 1995.
[12] N. Sakamoto, and K. Koyamada, KVS: A simple and effective framework for scientific visualization, Journal of Advanced Simulation in Science and Engineering (JASSE), Vol. 2, Issue 1, pp. 76–95, 2015.
[13] K. Yamamoto, and A. Kageyama, MHD relaxation with flow in a unit sphere, In Pro- ceedings of the International Conference on Simulation Technology (JSST 2016), pp. 290–296, 2016.
33