Skip to content

Commit 65361e8

Browse files
authored
Merge branch 'MFlowCode:master' into Fixes
2 parents b86d073 + 22af239 commit 65361e8

File tree

15 files changed

+916
-13
lines changed

15 files changed

+916
-13
lines changed

.github/workflows/bench.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ jobs:
6262
device: gpu
6363
interface: acc
6464
build_script: "bash .github/workflows/frontier/build.sh gpu acc bench"
65+
- cluster: frontier
66+
name: Oak Ridge | Frontier (CCE)
67+
group: phoenix
68+
labels: frontier
69+
flag: f
70+
device: gpu
71+
interface: omp
72+
build_script: "bash .github/workflows/frontier/build.sh gpu omp bench"
6573
runs-on:
6674
group: ${{ matrix.group }}
6775
labels: ${{ matrix.labels }}

.github/workflows/deploy-tap.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
name: Deploy Homebrew Tap
22

33
on:
4+
# Test formula on PRs (audit only, don't deploy)
5+
pull_request:
6+
branches: [ master ]
7+
paths:
8+
- 'packaging/homebrew/mfc.rb'
9+
- 'packaging/homebrew/README.md'
10+
# Deploy to tap on push to master
411
push:
5-
branches: [ main, master, homebrew-formula ]
12+
branches: [ master, homebrew-new ]
613
paths:
714
- 'packaging/homebrew/mfc.rb'
815
- 'packaging/homebrew/README.md'
916
tags:
1017
- 'v*.*.*'
18+
# Allow manual trigger for testing
1119
workflow_dispatch:
1220

1321
permissions:
1422
contents: read
1523

1624
jobs:
1725
deploy-tap:
18-
name: Sync/bump formula in tap
26+
name: Audit and deploy formula
1927
runs-on: macos-14
2028
permissions:
2129
contents: write
@@ -41,6 +49,13 @@ jobs:
4149
echo "version=${VERSION}" >> $GITHUB_OUTPUT
4250
echo "url=${URL}" >> $GITHUB_OUTPUT
4351
echo "sha256=${SHASUM}" >> $GITHUB_OUTPUT
52+
echo "Event: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY
53+
echo "Version: ${VERSION}" >> $GITHUB_STEP_SUMMARY
54+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
55+
echo "Mode: Audit only (PR)" >> $GITHUB_STEP_SUMMARY
56+
else
57+
echo "Mode: Audit and deploy" >> $GITHUB_STEP_SUMMARY
58+
fi
4459
4560
- name: Update formula (for tag events)
4661
if: github.ref_type == 'tag'
@@ -61,6 +76,7 @@ jobs:
6176
brew untap mfc/local
6277
6378
- name: Clone or bootstrap tap repository
79+
if: github.event_name != 'pull_request'
6480
env:
6581
TAP_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
6682
run: |
@@ -81,12 +97,14 @@ jobs:
8197
fi
8298
8399
- name: Copy formula and README into tap
100+
if: github.event_name != 'pull_request'
84101
run: |
85102
mkdir -p tap-repo/Formula
86103
cp packaging/homebrew/mfc.rb tap-repo/Formula/mfc.rb
87104
cp packaging/homebrew/README.md tap-repo/README.md
88105
89106
- name: Commit & push if changed
107+
if: github.event_name != 'pull_request'
90108
env:
91109
TAP_TOKEN: ${{ secrets.TAP_REPO_TOKEN }}
92110
run: |

.github/workflows/homebrew.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@ name: Homebrew Formula Test
22

33
on:
44
push:
5-
branches:
6-
- master
7-
- homebrew-formula
85
paths:
96
- 'packaging/homebrew/**'
107
- '.github/workflows/homebrew.yml'
118
pull_request:
12-
branches:
13-
- master
149
paths:
1510
- 'packaging/homebrew/**'
1611
- '.github/workflows/homebrew.yml'
@@ -251,8 +246,8 @@ jobs:
251246
cp $(brew --prefix mfc)/examples/1D_sodshocktube/case.py "$TESTDIR/"
252247
253248
echo "Running with $(sysctl -n hw.ncpu) processors..."
254-
# Use absolute path since mfc wrapper creates its own tmpdir
255-
mfc run "$TESTDIR/case.py" -j $(sysctl -n hw.ncpu)
249+
# Use absolute path and shorthand syntax (mfc auto-detects and prepends 'run')
250+
mfc "$TESTDIR/case.py" -j $(sysctl -n hw.ncpu)
256251
257252
echo "Test case completed successfully!"
258253

.github/workflows/test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,6 @@ jobs:
111111
- device: 'cpu'
112112
interface: 'none'
113113
lbl: 'frontier'
114-
exclude:
115-
- device: 'gpu'
116-
interface: 'omp'
117-
lbl: 'frontier'
118114
runs-on:
119115
group: phoenix
120116
labels: ${{ matrix.lbl }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env python3
2+
import json
3+
import math
4+
5+
# Case for smooth Alfven waves from section 6.3.1 of:
6+
# The ∇·B=0 Constraint in Shock-Capturing Magnetohydrodynamics Codes
7+
# Gábor Tóth
8+
9+
print(
10+
json.dumps(
11+
{
12+
# Logistics
13+
"run_time_info": "T",
14+
# Computational Domain Parameters
15+
"x_domain%beg": 0.0,
16+
"x_domain%end": 1.0,
17+
"m": 1023,
18+
"n": 0,
19+
"p": 0,
20+
"dt": 1.0e-5,
21+
"t_step_start": 0,
22+
"t_step_stop": 100000,
23+
"t_step_save": 10000,
24+
# Simulation Algorithm Parameters
25+
"num_patches": 1,
26+
"model_eqns": 2,
27+
"alt_soundspeed": "F",
28+
"num_fluids": 1,
29+
"mpp_lim": "F",
30+
"mixture_err": "F",
31+
"time_stepper": 3,
32+
"weno_order": 3,
33+
"weno_eps": 1e-7,
34+
"null_weights": "F",
35+
"mp_weno": "F",
36+
"riemann_solver": 4,
37+
"wave_speeds": 1,
38+
"avg_state": 2,
39+
"bc_x%beg": -1,
40+
"bc_x%end": -1,
41+
# Formatted Database Files Structure Parameters
42+
"format": 1,
43+
"precision": 2,
44+
"prim_vars_wrt": "T",
45+
"rho_wrt": "T",
46+
"parallel_io": "F",
47+
# MHD
48+
"mhd": "T",
49+
"Bx0": 1.0,
50+
"patch_icpp(1)%geometry": 1,
51+
"patch_icpp(1)%hcid": 150,
52+
"patch_icpp(1)%x_centroid": 0.5,
53+
"patch_icpp(1)%length_x": 1.0,
54+
"patch_icpp(1)%vel(1)": 0.0,
55+
"patch_icpp(1)%vel(2)": 0.0,
56+
"patch_icpp(1)%vel(3)": 0.0,
57+
"patch_icpp(1)%pres": 0.1,
58+
"patch_icpp(1)%By": 0.0,
59+
"patch_icpp(1)%Bz": 0.0,
60+
"patch_icpp(1)%alpha_rho(1)": 1.0,
61+
"patch_icpp(1)%alpha(1)": 1.0,
62+
# Fluids Physical Parameters
63+
"fluid_pp(1)%gamma": 1.0e00 / (5.0 / 3.0 - 1.0e00),
64+
"fluid_pp(1)%pi_inf": 0.0,
65+
}
66+
)
67+
)
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/usr/bin/env python3
2+
import json
3+
import math
4+
5+
# Case for smoothmagnetic vortex from:
6+
# Implicit hybridized discontinuous Galerkin methods for
7+
# compressible magnetohydrodynamics
8+
# C. Ciuca, P. Fernandez, A. Christophe, N.C. Nguyen, J. Peraire
9+
10+
# A 2D magnetic vortex advects for a period of T=10 diagonally
11+
12+
# Configuring case dictionary
13+
print(
14+
json.dumps(
15+
{
16+
# Logistics
17+
"run_time_info": "T",
18+
# Computational Domain Parameters
19+
"x_domain%beg": -5.0,
20+
"x_domain%end": 5.0,
21+
"y_domain%beg": -5.0,
22+
"y_domain%end": 5.0,
23+
"m": 1024,
24+
"n": 1024,
25+
"p": 0,
26+
"dt": 1.0e-4,
27+
"t_step_start": 0,
28+
"t_step_stop": 100000,
29+
"t_step_save": 1000,
30+
# Simulation Algorithm Parameters
31+
"num_patches": 1,
32+
"model_eqns": 2,
33+
"alt_soundspeed": "F",
34+
"num_fluids": 1,
35+
"mpp_lim": "F",
36+
"mixture_err": "F",
37+
"time_stepper": 3,
38+
"weno_order": 5,
39+
"weno_eps": 1.0e-12,
40+
"null_weights": "F",
41+
"mp_weno": "F",
42+
"riemann_solver": 4,
43+
"wave_speeds": 1,
44+
"avg_state": 2,
45+
"bc_x%beg": -1,
46+
"bc_x%end": -1,
47+
"bc_y%beg": -1,
48+
"bc_y%end": -1,
49+
# Formatted Database Files Structure Parameters
50+
"format": 1,
51+
"precision": 2,
52+
"prim_vars_wrt": "T",
53+
"rho_wrt": "T",
54+
"parallel_io": "T",
55+
# MHD
56+
"mhd": "T",
57+
"patch_icpp(1)%hcid": 252,
58+
"patch_icpp(1)%geometry": 3,
59+
"patch_icpp(1)%x_centroid": 0.0,
60+
"patch_icpp(1)%y_centroid": 0.0,
61+
"patch_icpp(1)%length_x": 10.0,
62+
"patch_icpp(1)%length_y": 10.0,
63+
"patch_icpp(1)%vel(1)": 0.0,
64+
"patch_icpp(1)%vel(2)": 0.0,
65+
"patch_icpp(1)%vel(3)": 0.0,
66+
"patch_icpp(1)%pres": 5.0 / (12 * math.pi),
67+
"patch_icpp(1)%Bx": 0.0,
68+
"patch_icpp(1)%By": 0.0,
69+
"patch_icpp(1)%Bz": 0.0,
70+
"patch_icpp(1)%alpha_rho(1)": 25.0 / (36.0 * math.pi),
71+
"patch_icpp(1)%alpha(1)": 1.0,
72+
# Fluids Physical Parameters
73+
"fluid_pp(1)%gamma": 1.0e00 / (5.0 / 3.0 - 1.0e00),
74+
"fluid_pp(1)%pi_inf": 0.0,
75+
}
76+
)
77+
)

examples/3D_IGR_33jet/case.py

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#!/usr/bin/env python3
2+
import math
3+
import json
4+
5+
# Domain parameters
6+
D = 2.5 # Jet diameter
7+
Nd = 711 # Cells per jet diameter
8+
9+
x0 = 0 # x_beg coordinate
10+
x1 = 19 * D # x_end coordinate
11+
y0 = -22 * D / 2 # y_beg coordinate
12+
y1 = 22 * D / 2 # y_end coordinate
13+
z0 = -22 * D / 2 # y_beg coordinate
14+
z1 = 22 * D / 2 # y_end coordinate
15+
Nx = int(Nd * (x1 - x0) / D) - 1
16+
Ny = int(Nd * (y1 - y0) / D) - 1
17+
Nz = int(Nd * (z1 - z0) / D) - 1
18+
19+
time_end = 5
20+
igrIters = 5
21+
22+
dx = D / Nd
23+
dt = dx / 36
24+
25+
Nt = int(time_end / dt)
26+
27+
# Configuring case dictionary
28+
print(
29+
json.dumps(
30+
{
31+
# Logistics
32+
"run_time_info": "T",
33+
# Computational Domain Parameters
34+
"x_domain%beg": x0,
35+
"x_domain%end": x1,
36+
"y_domain%beg": y0,
37+
"y_domain%end": y1,
38+
"z_domain%beg": z0,
39+
"z_domain%end": z1,
40+
"m": int(Nx),
41+
"n": int(Ny),
42+
"p": int(Nz),
43+
"dt": dt,
44+
"t_step_start": 0,
45+
"t_step_stop": 10, # Nt,
46+
"t_step_save": 10, # int(Nt/50),
47+
# Simulation Algorithm Parameters
48+
"num_patches": 1,
49+
"num_bc_patches": 0,
50+
"model_eqns": 2,
51+
"alt_soundspeed": "F",
52+
"num_fluids": 1,
53+
"mpp_lim": "F",
54+
"time_stepper": 3,
55+
"igr": "T",
56+
"igr_order": 3,
57+
"igr_pres_lim": "T",
58+
"igr_iter_solver": 1,
59+
"num_igr_iters": igrIters,
60+
"num_igr_warm_start_iters": 10 * igrIters,
61+
"alf_factor": 10,
62+
"bc_x%beg": -17,
63+
"bc_x%end": -3,
64+
"bc_y%beg": -3,
65+
"bc_y%end": -3,
66+
"bc_z%beg": -3,
67+
"bc_z%end": -3,
68+
# Formatted Database Files Structure Parameters
69+
"format": 1,
70+
"precision": 1,
71+
"prim_vars_wrt": "T",
72+
"file_per_process": "T",
73+
"parallel_io": "T",
74+
"down_sample": "T",
75+
# Patch
76+
"patch_icpp(1)%geometry": 9,
77+
"patch_icpp(1)%x_centroid": (x1 + x0) / 2,
78+
"patch_icpp(1)%y_centroid": (y1 + y0) / 2,
79+
"patch_icpp(1)%z_centroid": (z1 + z0) / 2,
80+
"patch_icpp(1)%length_x": 2 * (x1 - x0),
81+
"patch_icpp(1)%length_y": 2 * (y1 - y0),
82+
"patch_icpp(1)%length_z": 2 * (z1 - z0),
83+
"patch_icpp(1)%hcid": 303,
84+
"patch_icpp(1)%vel(1)": 0.0e00,
85+
"patch_icpp(1)%vel(2)": 0.0e00,
86+
"patch_icpp(1)%vel(3)": 0.0e00,
87+
"patch_icpp(1)%pres": 1.0e00,
88+
"patch_icpp(1)%alpha_rho(1)": 1.0,
89+
"patch_icpp(1)%alpha(1)": 1.0,
90+
# Perturbation of velocity field
91+
"simplex_perturb": "T",
92+
"simplex_params%perturb_vel(1)": "T",
93+
"simplex_params%perturb_vel_freq(1)": 3,
94+
"simplex_params%perturb_vel_scale(1)": 0.02,
95+
"simplex_params%perturb_vel_offset(1,1)": 12.3,
96+
"simplex_params%perturb_vel_offset(1,2)": -11.3,
97+
"simplex_params%perturb_vel_offset(1,3)": 34.6,
98+
"simplex_params%perturb_vel(2)": "T",
99+
"simplex_params%perturb_vel_freq(2)": 2,
100+
"simplex_params%perturb_vel_scale(2)": 0.02,
101+
"simplex_params%perturb_vel_offset(2,1)": -70.3,
102+
"simplex_params%perturb_vel_offset(2,2)": 33.4,
103+
"simplex_params%perturb_vel_offset(2,3)": -34.6,
104+
"simplex_params%perturb_vel(3)": "T",
105+
"simplex_params%perturb_vel_freq(3)": 2,
106+
"simplex_params%perturb_vel_scale(3)": 0.02,
107+
"simplex_params%perturb_vel_offset(3,1)": 123.3,
108+
"simplex_params%perturb_vel_offset(3,2)": -654.3,
109+
"simplex_params%perturb_vel_offset(3,3)": -64.5,
110+
# Fluids Physical Parameters
111+
"fluid_pp(1)%gamma": 1.0e00 / (1.4e00 - 1.0e00),
112+
"fluid_pp(1)%pi_inf": 0.0,
113+
"viscous": "T",
114+
"fluid_pp(1)%Re(1)": 5e5,
115+
},
116+
indent=4,
117+
)
118+
)

examples/3D_IGR_33jet/njet.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
33

0 commit comments

Comments
 (0)