Skip to content

Commit 4e19161

Browse files
authored
Merge branch 'master' into raw-directives
2 parents ebf6701 + 55b50a5 commit 4e19161

23 files changed

+183
-106
lines changed

README.md

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ They are organized below.
137137
* Acoustic wave generation (one- and two-way sound sources)
138138
* Magnetohydrodynamics (MHD)
139139
* Relativistic Magnetohydrodynamics (RMHD)
140-
</details>
141140

142141
### Numerics
143142

@@ -157,7 +156,6 @@ They are organized below.
157156
* RK4-5 operator splitting for Euler-Lagrange modeling
158157
* Interface sharpening (THINC-like)
159158

160-
161159
### Large-scale and accelerated simulation
162160

163161
* GPU compatible on NVIDIA ([P/V/A/H]100, GH200, etc.) and AMD (MI[1/2/3]00+) GPU and APU hardware
@@ -182,27 +180,20 @@ They are organized below.
182180

183181
## Citation
184182

185-
If you use MFC, consider citing it as:
186-
187-
<p align="center">
188-
<a href="https://doi.org/10.1016/j.cpc.2020.107396">
189-
S. H. Bryngelson, K. Schmidmayer, V. Coralic, K. Maeda, J. Meng, T. Colonius (2021) Computer Physics Communications <b>266</b>, 107396
190-
</a>
191-
</p>
183+
If you use MFC, consider citing it as below.
184+
Ref. 1 includes all modern MFC features, including GPU acceleration and many new physics features.
185+
If referencing MFC's (GPU) performance, consider citing ref. 1 and 2, which describe the solver and how it was crafted.
186+
The original open-source release of MFC is ref. 3, which should be cited for provenance as appropriate.
192187

193188
```bibtex
194-
@article{Bryngelson_2021,
195-
title = {{MFC: A}n open-source high-order multi-component, multi-phase, and multi-scale compressible flow solver},
196-
author = {S. H. Bryngelson and K. Schmidmayer and V. Coralic and J. C. Meng and K. Maeda and T. Colonius},
197-
journal = {Computer Physics Communications},
198-
year = {2021},
199-
volume = {266},
200-
pages = {107396},
201-
doi = {10.1016/j.cpc.2020.107396}
189+
@article{Wilfong_2025,
190+
author = {Wilfong, Benjamin and {Le Berre}, Henry and Radhakrishnan, Anand and Gupta, Ansh and Vaca-Revelo, Diego and Adam, Dimitrios and Yu, Haocheng and Lee, Hyeoksu and Chreim, Jose Rodolfo and {Carcana Barbosa}, Mirelys and Zhang, Yanjun and Cisneros-Garibay, Esteban and Gnanaskandan, Aswin and {Rodriguez Jr.}, Mauro and Budiardja, Reuben D. and Abbott, Stephen and Colonius, Tim and Bryngelson, Spencer H.},
191+
title = {{MFC 5.0: A}n exascale many-physics flow solver},
192+
journal = {arXiv preprint arXiv:2503.07953},
193+
year = {2025},
194+
doi = {10.48550/arXiv.2503.07953}
202195
}
203-
```
204196
205-
```bibtex
206197
@article{Radhakrishnan_2024,
207198
title = {Method for portable, scalable, and performant {GPU}-accelerated simulation of multiphase compressible flow},
208199
author = {A. Radhakrishnan and H. {Le Berre} and B. Wilfong and J.-S. Spratt and M. {Rodriguez Jr.} and T. Colonius and S. H. Bryngelson},
@@ -212,6 +203,16 @@ If you use MFC, consider citing it as:
212203
pages = {109238},
213204
doi = {10.1016/j.cpc.2024.109238}
214205
}
206+
207+
@article{Bryngelson_2021,
208+
title = {{MFC: A}n open-source high-order multi-component, multi-phase, and multi-scale compressible flow solver},
209+
author = {S. H. Bryngelson and K. Schmidmayer and V. Coralic and J. C. Meng and K. Maeda and T. Colonius},
210+
journal = {Computer Physics Communications},
211+
year = {2021},
212+
volume = {266},
213+
pages = {107396},
214+
doi = {10.1016/j.cpc.2020.107396}
215+
}
215216
```
216217

217218
## License
@@ -225,12 +226,7 @@ Federal sponsors have supported MFC development, including the US Department of
225226

226227
MFC computations have used many supercomputing systems. A partial list is below
227228
* OLCF Frontier and Summit, and testbeds Wombat, Crusher, and Spock (allocation CFD154, PI Bryngelson)
228-
* LLNL Tuolumne and Lassen, El Capitan early access system Tioga
229-
* PSC Bridges(1/2), NCSA Delta, SDSC Comet and Expanse, Purdue Anvil, TACC Stampede(1-3), and TAMU ACES via ACCESS-CI allocations from Bryngelson, Colonius, Rodriguez, and more.
230-
* DOD systems Onyx, Carpenter, Nautilus, and Narwhal via the DOD HPCMP program
229+
* LLNL El Capitan, Tuolumne, and Lassen; El Capitan early access system Tioga
230+
* NCSA Delta and DeltaAI, PSC Bridges(1/2), SDSC Comet and Expanse, Purdue Anvil, TACC Stampede(1-3), and TAMU ACES via ACCESS-CI allocations from Bryngelson, Colonius, Rodriguez, and more.
231+
* DOD systems Blueback, Onyx, Carpenter, Nautilus, and Narwhal via the DOD HPCMP program
231232
* Sandia National Labs systems Doom and Attaway and testbed systems Weaver and Vortex
232-
233-
234-
## Contributors
235-
236-
[![Contributors](https://contributors-img.web.app/image?repo=mflowcode/mfc)](https://github.com/mflowcode/mfc/graphs/contributors)

docs/documentation/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [Running MFC](running.md)
1010
- [Flow Visualization](visualization.md)
1111
- [Performance](expectedPerformance.md)
12+
- [GPU Parallelization](gpuParallelization.md)
1213
- [MFC's Authors](authors.md)
1314
- [References](references.md)
1415

src/common/include/macros.fpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@
9696
end if
9797
#:enddef
9898

99-
#define t_vec3 real(wp), dimension(1:3)
100-
#define t_mat4x4 real(wp), dimension(1:4,1:4)
101-
10299
#:def ASSERT(predicate, message = None)
103100
if (.not. (${predicate}$)) then
104101
call s_mpi_abort("${_FILE_.split('/')[-1]}$:${_LINE_}$: "// &

src/common/m_derived_types.fpp

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ module m_derived_types
141141
character(LEN=pathlen_max) :: filepath !<
142142
!! Path the STL file relative to case_dir.
143143

144-
t_vec3 :: translate !<
144+
real(wp), dimension(1:3) :: translate !<
145145
!! Translation of the STL object.
146146

147-
t_vec3 :: scale !<
147+
real(wp), dimension(1:3) :: scale !<
148148
!! Scale factor for the STL object.
149149

150-
t_vec3 :: rotate !<
150+
real(wp), dimension(1:3) :: rotate !<
151151
!! Angle to rotate the STL object along each cartesian coordinate axis,
152152
!! in radians.
153153

@@ -160,17 +160,17 @@ module m_derived_types
160160

161161
type :: t_triangle
162162
real(wp), dimension(1:3, 1:3) :: v ! Vertices of the triangle
163-
t_vec3 :: n ! Normal vector
163+
real(wp), dimension(1:3) :: n ! Normal vector
164164
end type t_triangle
165165

166166
type :: t_ray
167-
t_vec3 :: o ! Origin
168-
t_vec3 :: d ! Direction
167+
real(wp), dimension(1:3) :: o ! Origin
168+
real(wp), dimension(1:3) :: d ! Direction
169169
end type t_ray
170170

171171
type :: t_bbox
172-
t_vec3 :: min ! Minimum coordinates
173-
t_vec3 :: max ! Maximum coordinates
172+
real(wp), dimension(1:3) :: min ! Minimum coordinates
173+
real(wp), dimension(1:3) :: max ! Maximum coordinates
174174
end type t_bbox
175175

176176
type :: t_model
@@ -265,13 +265,13 @@ module m_derived_types
265265
character(LEN=pathlen_max) :: model_filepath !<
266266
!! Path the STL file relative to case_dir.
267267

268-
t_vec3 :: model_translate !<
268+
real(wp), dimension(1:3) :: model_translate !<
269269
!! Translation of the STL object.
270270

271-
t_vec3 :: model_scale !<
271+
real(wp), dimension(1:3) :: model_scale !<
272272
!! Scale factor for the STL object.
273273

274-
t_vec3 :: model_rotate !<
274+
real(wp), dimension(1:3) :: model_rotate !<
275275
!! Angle to rotate the STL object along each cartesian coordinate axis,
276276
!! in radians.
277277

@@ -303,13 +303,13 @@ module m_derived_types
303303
character(LEN=pathlen_max) :: model_filepath !<
304304
!! Path the STL file relative to case_dir.
305305

306-
t_vec3 :: model_translate !<
306+
real(wp), dimension(1:3) :: model_translate !<
307307
!! Translation of the STL object.
308308

309-
t_vec3 :: model_scale !<
309+
real(wp), dimension(1:3) :: model_scale !<
310310
!! Scale factor for the STL object.
311311

312-
t_vec3 :: model_rotate !<
312+
real(wp), dimension(1:3) :: model_rotate !<
313313
!! Angle to rotate the STL object along each cartesian coordinate axis,
314314
!! in radians.
315315

@@ -443,4 +443,10 @@ module m_derived_types
443443
444444
end type bubbles_lagrange_parameters
445445
446+
!> Max and min number of cells in a direction of each combination of x-,y-, and z-
447+
type cell_num_bounds
448+
integer :: mn_max, np_max, mp_max, mnp_max
449+
integer :: mn_min, np_min, mp_min, mnp_min
450+
end type cell_num_bounds
451+
446452
end module m_derived_types

src/common/m_helper.fpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ contains
319319
pure function f_create_transform_matrix(p, center) result(out_matrix)
320320
321321
type(ic_model_parameters), intent(in) :: p
322-
t_vec3, optional, intent(in) :: center
323-
t_mat4x4 :: sc, rz, rx, ry, tr, t_back, t_to_origin, out_matrix
322+
real(wp), dimension(1:3), optional, intent(in) :: center
323+
real(wp), dimension(1:4, 1:4) :: sc, rz, rx, ry, tr, t_back, t_to_origin, out_matrix
324324
325325
sc = transpose(reshape([ &
326326
p%scale(1), 0._wp, 0._wp, 0._wp, &
@@ -379,8 +379,8 @@ contains
379379
!! @param matrix Transformation matrix.
380380
pure subroutine s_transform_vec(vec, matrix)
381381
382-
t_vec3, intent(inout) :: vec
383-
t_mat4x4, intent(in) :: matrix
382+
real(wp), dimension(1:3), intent(inout) :: vec
383+
real(wp), dimension(1:4, 1:4), intent(in) :: matrix
384384
385385
real(wp), dimension(1:4) :: tmp
386386
@@ -395,7 +395,7 @@ contains
395395
pure subroutine s_transform_triangle(triangle, matrix, matrix_n)
396396
397397
type(t_triangle), intent(inout) :: triangle
398-
t_mat4x4, intent(in) :: matrix, matrix_n
398+
real(wp), dimension(1:4, 1:4), intent(in) :: matrix, matrix_n
399399
400400
integer :: i
401401
@@ -413,7 +413,7 @@ contains
413413
pure subroutine s_transform_model(model, matrix, matrix_n)
414414
415415
type(t_model), intent(inout) :: model
416-
t_mat4x4, intent(in) :: matrix, matrix_n
416+
real(wp), dimension(1:4, 1:4), intent(in) :: matrix, matrix_n
417417
418418
integer :: i
419419

src/common/m_helper_basic.fpp

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ module m_helper_basic
1616
f_is_default, &
1717
f_all_default, &
1818
f_is_integer, &
19-
s_configure_coordinate_bounds
19+
s_configure_coordinate_bounds, &
20+
s_update_cell_bounds
2021

2122
contains
2223

@@ -146,4 +147,24 @@ contains
146147

147148
end subroutine s_configure_coordinate_bounds
148149

150+
!> Updates the min and max number of cells in each set of axes
151+
!! @param bounds Min ans max values to update
152+
!! @param m Number of cells in x-axis
153+
!! @param n Number of cells in y-axis
154+
!! @param p Number of cells in z-axis
155+
pure elemental subroutine s_update_cell_bounds(bounds, m, n, p)
156+
type(cell_num_bounds), intent(out) :: bounds
157+
integer, intent(in) :: m, n, p
158+
159+
bounds%mn_max = max(m, n)
160+
bounds%np_max = max(n, p)
161+
bounds%mp_max = max(m, p)
162+
bounds%mnp_max = max(m, n, p)
163+
bounds%mn_min = min(m, n)
164+
bounds%np_min = min(n, p)
165+
bounds%mp_min = min(m, p)
166+
bounds%mnp_min = min(m, n, p)
167+
168+
end subroutine s_update_cell_bounds
169+
149170
end module m_helper_basic

src/common/m_mpi_common.fpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ contains
6767
& (m + 2*buff_size + 1)* &
6868
& (n + 2*buff_size + 1)* &
6969
& (p + 2*buff_size + 1)/ &
70-
& (min(m, n, p) + 2*buff_size + 1))
70+
& (cells_bounds%mnp_min + 2*buff_size + 1))
7171
else
7272
halo_size = -1 + buff_size*(v_size)* &
73-
& (max(m, n) + 2*buff_size + 1)
73+
& (cells_bounds%mn_max + 2*buff_size + 1)
7474
end if
7575
else
7676
halo_size = -1 + buff_size*(v_size)
@@ -1446,6 +1446,8 @@ contains
14461446
end if
14471447
end do
14481448
1449+
call s_update_cell_bounds(cells_bounds, m, n, p)
1450+
14491451
! Boundary condition at the beginning
14501452
if (proc_coords(1) > 0 .or. (bc_x%beg == BC_PERIODIC .and. num_procs_x > 1)) then
14511453
proc_coords(1) = proc_coords(1) - 1

src/common/m_variables_conversion.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ contains
637637
#ifdef MFC_SIMULATION
638638

639639
if (viscous) then
640-
@:ALLOCATE(Res(1:2, 1:maxval(Re_size)))
640+
@:ALLOCATE(Res(1:2, 1:Re_size_max))
641641
do i = 1, 2
642642
do j = 1, Re_size(i)
643643
Res(i, j) = fluid_pp(Re_idx(i, j))%Re(i)

src/post_process/m_global_parameters.fpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ module m_global_parameters
3838
integer :: p
3939
!> @}
4040

41+
!> @name Max and min number of cells in a direction of each combination of x-,y-, and z-
42+
type(cell_num_bounds) :: cells_bounds
43+
4144
integer(8) :: nGlobal ! Total number of cells in global domain
4245

4346
!> @name Cylindrical coordinates (either axisymmetric or full 3D)
@@ -336,6 +339,8 @@ contains
336339

337340
! Computational domain parameters
338341
m = dflt_int; n = 0; p = 0
342+
call s_update_cell_bounds(cells_bounds, m, n, p)
343+
339344
m_root = dflt_int
340345
cyl_coord = .false.
341346

src/post_process/m_start_up.f90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ impure subroutine s_read_input_file
111111
end if
112112

113113
close (1)
114+
115+
call s_update_cell_bounds(cells_bounds, m, n, p)
116+
114117
! Store m,n,p into global m,n,p
115118
m_glb = m
116119
n_glb = n

0 commit comments

Comments
 (0)