Skip to content

Commit 882206f

Browse files
committed
refactor: introduce bc_dir_t type, strip BC payload from int_bounds_info
1 parent 04abf2a commit 882206f

5 files changed

Lines changed: 19 additions & 18 deletions

File tree

src/common/m_derived_types.fpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,28 @@ module m_derived_types
103103
integer :: end
104104
end type idx_bounds_info
105105

106-
!> Integer bounds for variables
106+
!> Integer beg/end bounds pair for loop index ranges and domain extents.
107107
type int_bounds_info
108-
integer :: beg
109-
integer :: end
110-
real(wp) :: vb1
111-
real(wp) :: vb2
112-
real(wp) :: vb3
113-
real(wp) :: ve1
114-
real(wp) :: ve2
115-
real(wp) :: ve3
108+
integer :: beg
109+
integer :: end
110+
end type int_bounds_info
111+
112+
!> Boundary condition parameters for one coordinate direction (beg/end faces + face data).
113+
type bc_dir_t
114+
integer :: beg, end
115+
real(wp) :: vb1, vb2, vb3
116+
real(wp) :: ve1, ve2, ve3
116117
real(wp) :: pres_in, pres_out
117118
real(wp), dimension(3) :: vel_in, vel_out
118119
real(wp), dimension(num_fluids_max) :: alpha_rho_in, alpha_in
119120
logical :: grcbc_in, grcbc_out, grcbc_vel_out
120121
logical :: isothermal_in, isothermal_out
121122
real(wp) :: Twall_in, Twall_out
122-
end type int_bounds_info
123+
end type bc_dir_t
123124

124-
!> Groups the x, y, z boundary condition begin/end codes for passing as a single argument.
125+
!> Groups the x, y, z boundary condition structs for passing as a single argument.
125126
type bc_xyz_info
126-
type(int_bounds_info) :: x, y, z
127+
type(bc_dir_t) :: x, y, z
127128
end type bc_xyz_info
128129

129130
!> QBMM moment index mappings - separate from bub beg/end so eqn_idx contains no allocatables.
@@ -137,7 +138,7 @@ module m_derived_types
137138
end type qbmm_idx_info
138139

139140
!> All conserved-variable equation indices, computed at startup from model_eqns and enabled features.
140-
!> Range indices (beg/end) use int_bounds_info; scalar indices are plain integers (0 = inactive).
141+
!> Range indices (beg/end) use idx_bounds_info; scalar indices are plain integers (0 = inactive).
141142
!> Contains no allocatable members - safe for GPU_DECLARE as a single struct.
142143
type eqn_idx_info
143144
type(idx_bounds_info) :: cont !< Partial densities (continuity equations)

src/post_process/m_global_parameters.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ module m_global_parameters
117117
logical :: bc_io
118118
!> @name Boundary conditions in the x-, y- and z-coordinate directions
119119
!> @{
120-
type(int_bounds_info) :: bc_x, bc_y, bc_z
120+
type(bc_dir_t) :: bc_x, bc_y, bc_z
121121
!> @}
122122

123123
integer :: shear_num !< Number of shear stress components

src/pre_process/m_global_parameters.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module m_global_parameters
8686

8787
! Cell indices (InDices With BUFFer): includes buffer except in pre_process
8888
type(int_bounds_info) :: idwbuff(1:3)
89-
type(int_bounds_info) :: bc_x, bc_y, bc_z !< Boundary conditions in the x-, y- and z-coordinate directions
89+
type(bc_dir_t) :: bc_x, bc_y, bc_z !< Boundary conditions in the x-, y- and z-coordinate directions
9090
integer :: shear_num !< Number of shear stress components
9191
integer, dimension(3) :: shear_indices !< Indices of the stress components that represent shear stress
9292
integer :: shear_BC_flip_num !< Number of shear stress components to reflect for boundary conditions

src/simulation/m_global_parameters.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ module m_global_parameters
202202
logical :: bc_io
203203
!> @name Boundary conditions (BC) in the x-, y- and z-directions, respectively
204204
!> @{
205-
type(int_bounds_info) :: bc_x, bc_y, bc_z
205+
type(bc_dir_t) :: bc_x, bc_y, bc_z
206206
!> @}
207207
!> @name Original boundary conditions preserved for immersed boundary code
208208
!> (bc_x/y/z get overwritten with MPI neighbor ranks during decomposition)
209209
!> @{
210-
type(int_bounds_info) :: ib_bc_x, ib_bc_y, ib_bc_z
210+
type(bc_dir_t) :: ib_bc_x, ib_bc_y, ib_bc_z
211211
!> @}
212212
#if defined(MFC_OpenACC)
213213
$:GPU_DECLARE(create='[bc_x%vb1, bc_x%vb2, bc_x%vb3, bc_x%ve1, bc_x%ve2, bc_x%ve3]')

src/simulation/m_weno.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ contains
182182
type(int_bounds_info), intent(in) :: is
183183
integer :: s
184184
real(wp), pointer, dimension(:) :: s_cb => null() !< Cell-boundary locations in the s-direction
185-
type(int_bounds_info) :: bc_s !< Boundary conditions (BC) in the s-direction
185+
type(bc_dir_t) :: bc_s !< Boundary conditions (BC) in the s-direction
186186
integer :: i !< Generic loop iterator
187187
real(wp) :: w(1:8) !< Intermediate var for ideal weights: s_cb across overall stencil
188188
real(wp) :: ys(1:4) !< Intermediate var for poly & beta: diff(s_cb) across sub-stencil

0 commit comments

Comments
 (0)