FE-Project
Loading...
Searching...
No Matches
scale_meshutil_cubedsphere3d.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> module FElib / Mesh / utility for 3D cubed-sphere mesh
3!!
4!! @par Description
5!! A module useful for generating 3D cubed-sphere mesh
6!!
7!! @author Yuta Kawai, Team SCALE
8!<
9!-------------------------------------------------------------------------------
10#include "scaleFElib.h"
12 !-----------------------------------------------------------------------------
13 !
14 !++ used modules
15 !
16 use scale_const, only: &
17 pi => const_pi, &
18 eps => const_eps
19 use scale_precision
20 use scale_prc
21 use scale_io
22 use scale_prc
23
24 use scale_meshutil_3d, only: &
25 meshutilcubedsphere3d_gencubedomain => meshutil3d_gencubedomain, &
26 meshutilcubedsphere3d_genconnectivity => meshutil3d_genconnectivity, &
27 meshutilcubedsphere3d_buildinteriormap => meshutil3d_buildinteriormap, &
28 meshutilcubedsphere3d_genpatchboundarymap => meshutil3d_genpatchboundarymap, &
29 meshutilcubedsphere3d_genpatchboundarymap_wide => meshutil3d_genpatchboundarymap_wide
30 implicit none
31 private
32
33 !-----------------------------------------------------------------------------
34 !
35 !++ Public procedure
36 !
37 public :: meshutilcubedsphere3d_gencubedomain
38 public :: meshutilcubedsphere3d_genconnectivity
39 public :: meshutilcubedsphere3d_buildinteriormap
41 public :: meshutilcubedsphere3d_genpatchboundarymap
42 public :: meshutilcubedsphere3d_genpatchboundarymap_wide
43
44contains
45!OCL SERIAL
47 panelID_table, pi_table, pj_table, pk_table, &
48 tileID_map, tileFaceID_map, tilePanelID_map, &
49 Ntile, &
50 NeZ )
51
52 ! use scale_prc, only: PRC_isMaster
53 use scale_meshutil_3d, only: &
57 implicit none
58
59 integer, intent(in) :: ntile
60 integer, intent(out) :: panelid_table(ntile)
61 integer, intent(out) :: pi_table(ntile)
62 integer, intent(out) :: pj_table(ntile)
63 integer, intent(out) :: pk_table(ntile)
64 integer, intent(out) :: tileid_map(6,ntile)
65 integer, intent(out) :: tilefaceid_map(6,ntile)
66 integer, intent(out) :: tilepanelid_map(6,ntile)
67 integer, intent(in) :: nez
68
69 integer :: ntileperpanel
70 integer :: nex, ney, nvx, nvy, nvz
71 integer, allocatable :: nodesid_3d(:,:,:,:)
72 integer, allocatable :: etov(:,:)
73 integer, allocatable :: etoe(:,:)
74 integer, allocatable :: etof(:,:)
75 integer :: i, j, k, f
76 integer :: panelid
77 integer :: tileid, tileid_r
78 integer :: counter
79
80 integer :: pi_, pj_
81 !-----------------------------------------------------------------------------
82
83 ntileperpanel = ntile / 6
84 ney = int( sqrt(dble(ntileperpanel)) )
85 nex = ntileperpanel/ney
86 nvx = nex + 1
87 nvy = ney + 1
88 nvz = nez + 1
89 allocate( nodesid_3d(nvx,nvy,nvz,6) )
90 allocate( etov(ntile,8), etoe(ntile,6), etof(ntile,6) )
91
92 counter = 0
93 do panelid = 1, 6
94 do k = 1, nvz
95 do j = 1, nvy
96 do i = 1, nvx
97 counter = counter + 1
98 nodesid_3d(i,j,k,panelid) = counter
99 end do
100 end do
101 end do
102 end do
103
104 !----
105
106 tileid = 0
107 do panelid = 1, 6
108 do k = 1, nez
109 do j = 1, ney
110 do i = 1, nex
111 tileid = tileid + 1
112 panelid_table(tileid) = panelid
113 pi_table(tileid) = i; pj_table(tileid) = j; pk_table(tileid) = k
114 etov(tileid,:) = (/ nodesid_3d(i,j ,k ,panelid), nodesid_3d(i+1,j ,k ,panelid), &
115 nodesid_3d(i,j+1,k ,panelid), nodesid_3d(i+1,j+1,k ,panelid), &
116 nodesid_3d(i,j ,k+1,panelid), nodesid_3d(i+1,j ,k+1,panelid), &
117 nodesid_3d(i,j+1,k+1,panelid), nodesid_3d(i+1,j+1,k+1,panelid) /)
118 end do
119 end do
120 end do
121 end do
122
123 call meshutil3d_genconnectivity( etoe, etof, &
124 etov, ntile, 6 )
125 tileid_map(:,:) = transpose(etoe)
126 tilefaceid_map(:,:) = transpose(etof)
127
128 do tileid=1, ntile
129 do f=1, 6
130 tileid_r = tileid_map(f,tileid)
131 tilepanelid_map(f,tileid) = panelid_table(tileid_r)
132 end do
133 end do
134
136 tilepanelid_map, tileid_map, tilefaceid_map, & ! (inout)
137 panelid_table, pi_table, pj_table, nex, ney, ntile, 6 ) ! (in)
138
139 return
141
module FElib / Mesh / utility for 3D mesh
subroutine, public meshutil3d_buildinteriormap(vmapm, vmapp, mapm, mapp, pos_en, pos_ev, etoe, etof, etov, fmask_h, fmask_v, ne, nv, np, nfp_h, nfp_v, nfptot, nfaces_h, nfaces_v, nfaces)
subroutine, public meshutil3d_genpatchboundarymap_wide(vmapb2, vmapb, halosize_h, halosize_v, nex, ney, nez, nfp_h, nfp_v, nnode_h1d, nnode_v)
subroutine, public meshutil3d_genconnectivity(etoe, etof, etov, ne, nfaces)
subroutine, public meshutil3d_gencubedomain(pos_v, etov, ke_x, xmin, xmax, ke_y, ymin, ymax, ke_z, zmin, zmax, fz)
Calculate position of vertices and generate array to map element to vertices for 3D cubic mesh.
subroutine, public meshutil3d_genpatchboundarymap(vmapb, mapb, vmapp, pos_en, xmin, xmax, ymin, ymax, zmin, zmax, fmask_h, fmask_v, ne, nv, np, nfp_h, nfp_v, nfptot, nfaces_h, nfaces_v, nfaces)
module FElib / Mesh / utility for 2D cubed-sphere mesh
subroutine, public meshutilcubedsphere2d_modifyconnectivity(tilepanelid_map, tileid_map, tilefaceid_map, panelid_table, pi_table, pj_table, nex, ney, ntile, nface)
Modify the mesh connectivity with a cubic domain decomposition to support the cubed sphere mesh.
module FElib / Mesh / utility for 3D cubed-sphere mesh
subroutine, public meshutilcubedsphere3d_buildglobalmap(panelid_table, pi_table, pj_table, pk_table, tileid_map, tilefaceid_map, tilepanelid_map, ntile, nez)