Skip to content

Commit 0a21dab

Browse files
Merge branch 'add-hard-coded-patched-for-tests' of github.com:danieljvickers/MFC into add-hard-coded-patched-for-tests
2 parents 506856c + 03622a1 commit 0a21dab

17 files changed

+131
-52
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)

src/common/m_derived_types.fpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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_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

src/pre_process/m_global_parameters.fpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ module m_global_parameters
4040
integer :: n
4141
integer :: p
4242

43+
!> @name Max and min number of cells in a direction of each combination of x-,y-, and z-
44+
type(cell_num_bounds) :: cells_bounds
45+
4346
integer(8) :: nGlobal !< Global number of cells in the domain
4447

4548
integer :: m_glb, n_glb, p_glb !< Global number of cells in each direction
@@ -306,6 +309,8 @@ contains
306309
! Computational domain parameters
307310
m = dflt_int; n = 0; p = 0
308311

312+
call s_update_cell_bounds(cells_bounds, m, n, p)
313+
309314
cyl_coord = .false.
310315

311316
x_domain%beg = dflt_real

src/pre_process/m_patches.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ contains
255255
pi_inf = fluid_pp(1)%pi_inf
256256
gamma = fluid_pp(1)%gamma
257257
lit_gamma = (1._wp + gamma)/gamma
258-
j = 0.0_wp
259-
k = 0.0_wp
258+
j = 0
259+
k = 0
260260

261261
! Transferring the line segment's centroid and length information
262262
x_centroid = patch_icpp(patch_id)%x_centroid

src/pre_process/m_start_up.fpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ contains
169169
'likely due to a datatype mismatch. Exiting.')
170170
end if
171171
close (1)
172+
173+
call s_update_cell_bounds(cells_bounds, m, n, p)
174+
172175
! Store m,n,p into global m,n,p
173176
m_glb = m
174177
n_glb = n

0 commit comments

Comments
 (0)