Skip to content

Commit bd0bc6d

Browse files
committed
Switch from JuliaFormatter to Runic.jl for code formatting
- Update CI workflow to use fredrikekre/runic-action@v1 - Remove .JuliaFormatter.toml configuration - Format all source files with Runic.jl 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1d5b79f commit bd0bc6d

File tree

22 files changed

+1389
-900
lines changed

22 files changed

+1389
-900
lines changed

.JuliaFormatter.toml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/FormatCheck.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
name: "Format Check"
1+
name: format-check
22

33
on:
44
push:
55
branches:
66
- 'master'
7+
- 'main'
8+
- 'release-'
79
tags: '*'
810
pull_request:
911

10-
concurrency:
11-
# Skip intermediate builds: always.
12-
# Cancel intermediate builds: only if it is a pull request build.
13-
group: ${{ github.workflow }}-${{ github.ref }}
14-
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
15-
1612
jobs:
17-
format-check:
18-
name: "Format Check"
19-
uses: "SciML/.github/.github/workflows/format-check.yml@v1"
13+
runic:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: fredrikekre/runic-action@v1
18+
with:
19+
version: '1'

lib/BVProblemLibrary/src/BVProblemLibrary.jl

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,26 @@ function flat_moon_f!(du, u, p, t)
1515
du[4] = (A * sin(u[5]) - g)
1616
du[5] = -u[6] * cos(u[5])
1717
du[6] = (u[6])^2 * sin(u[5])
18-
du[7] = 0
18+
return du[7] = 0
1919
end
2020
function flat_moon_bca!(res_a, u_a, p)
2121
res_a[1] = u_a[1]
2222
res_a[2] = u_a[2]
2323
res_a[3] = u_a[3]
24-
res_a[4] = u_a[4]
24+
return res_a[4] = u_a[4]
2525
end
2626
function flat_moon_bcb!(res_b, u_b, p)
2727
h = 185.2
2828
Vc = 1627
2929
res_b[1] = u_b[5] - h
3030
res_b[2] = u_b[6] - Vc
31-
res_b[3] = u_b[7]
31+
return res_b[3] = u_b[7]
3232
end
3333
flat_moon_tspan = (0, 700)
34-
flat_moon_function = BVPFunction(flat_moon_f!, (flat_moon_bca!, flat_moon_bcb!),
35-
bcresid_prototype = (zeros(4), zeros(3)), twopoint = Val(true))
34+
flat_moon_function = BVPFunction(
35+
flat_moon_f!, (flat_moon_bca!, flat_moon_bcb!),
36+
bcresid_prototype = (zeros(4), zeros(3)), twopoint = Val(true)
37+
)
3638
@doc raw"""
3739
flat_moon
3840
@@ -90,21 +92,23 @@ function flat_earth_f!(du, u, p, t)
9092
du[4] = (acc * (u[6] / (abs(Vc) * sqrt(1 + u[6]^2))) - (g / Vc))
9193
du[5] = 0
9294
du[6] = (-u[5] * (Vc / h))
93-
du[7] = 0
95+
return du[7] = 0
9496
end
9597
function flat_earth_bca!(res_a, u_a, p)
9698
res_a[1] = u_a[1]
9799
res_a[2] = u_a[2]
98100
res_a[3] = u_a[3]
99-
res_a[4] = u_a[4]
101+
return res_a[4] = u_a[4]
100102
end
101103
function flat_earth_bcb!(res_b, u_b, p)
102104
res_b[1] = u_b[2] - 1
103105
res_b[2] = u_b[3] - 1
104-
res_b[3] = u_b[4]
106+
return res_b[3] = u_b[4]
105107
end
106-
flat_earth_function = BVPFunction(flat_earth_f!, (flat_earth_bca!, flat_earth_bcb!),
107-
bcresid_prototype = (zeros(4), zeros(3)), twopoint = Val(true))
108+
flat_earth_function = BVPFunction(
109+
flat_earth_f!, (flat_earth_bca!, flat_earth_bcb!),
110+
bcresid_prototype = (zeros(4), zeros(3)), twopoint = Val(true)
111+
)
108112
flat_earth_tspan = (0, 700)
109113
@doc raw"""
110114
flat_earth
@@ -160,24 +164,28 @@ function flat_earth_drag_f!(du, u, p, t)
160164
eta = 1.225 * 0.5 * 7.069 / 2
161165
xbardot = u[3] * (vc / h)
162166
ybardot = u[4] * (vc / h)
163-
Vxbardot = (fr / vc * (-u[6] / sqrt(u[6]^2.0 + u[7]^2.0)) -
164-
eta * exp(-u[2] * beta) * u[3] * sqrt(u[3]^2.0 + u[4]^2.0) * vc) / m
165-
Vybardot = (fr / vc * (-u[7] / sqrt(u[6]^2.0 + u[7]^2.0)) -
166-
eta * exp(-u[2] * beta) * u[4] * sqrt(u[3]^2.0 + u[4]^2.0) * vc) / m -
167-
g_accel / vc
167+
Vxbardot = (
168+
fr / vc * (-u[6] / sqrt(u[6]^2.0 + u[7]^2.0)) -
169+
eta * exp(-u[2] * beta) * u[3] * sqrt(u[3]^2.0 + u[4]^2.0) * vc
170+
) / m
171+
Vybardot = (
172+
fr / vc * (-u[7] / sqrt(u[6]^2.0 + u[7]^2.0)) -
173+
eta * exp(-u[2] * beta) * u[4] * sqrt(u[3]^2.0 + u[4]^2.0) * vc
174+
) / m -
175+
g_accel / vc
168176
if sqrt(u[3]^2.0 + u[4]^2.0) == 0.0
169177
lambda_2_bar = 0.0
170178
lambda_3_bar = 0.0
171179
lambda_4_bar = -u[5] * (vc / h)
172180
else
173181
lambda_2_bar = -(u[6] * u[3] + u[7] * u[4]) * eta * beta *
174-
sqrt(u[3]^2.0 + u[4]^2.0) * exp(-u[2] * beta) * vc / m
182+
sqrt(u[3]^2.0 + u[4]^2.0) * exp(-u[2] * beta) * vc / m
175183
lambda_3_bar = eta * exp(-u[2] * beta) * vc *
176-
(u[6] * (2 * u[3]^2.0 + u[4]^2.0) + u[7] * u[3] * u[4]) /
177-
sqrt(u[3]^2.0 + u[4]^2.0) / m
184+
(u[6] * (2 * u[3]^2.0 + u[4]^2.0) + u[7] * u[3] * u[4]) /
185+
sqrt(u[3]^2.0 + u[4]^2.0) / m
178186
lambda_4_bar = eta * exp(-u[2] * beta) * vc *
179-
(u[7] * (u[3]^2.0 + 2.0 * u[4]^2.0) + u[6] * u[3] * u[4]) /
180-
sqrt(u[3]^2.0 + u[4]^2.0) / m
187+
(u[7] * (u[3]^2.0 + 2.0 * u[4]^2.0) + u[6] * u[3] * u[4]) /
188+
sqrt(u[3]^2.0 + u[4]^2.0) / m
181189
end
182190
du[1] = xbardot
183191
du[2] = ybardot
@@ -186,13 +194,13 @@ function flat_earth_drag_f!(du, u, p, t)
186194
du[5] = lambda_2_bar
187195
du[6] = lambda_3_bar
188196
du[7] = lambda_4_bar
189-
du[8] = 0
197+
return du[8] = 0
190198
end
191199
function flat_earth_drag_bca!(res_a, u_a, p)
192200
res_a[1] = u_a[1]
193201
res_a[2] = u_a[2]
194202
res_a[3] = u_a[3]
195-
res_a[4] = u_a[4]
203+
return res_a[4] = u_a[4]
196204
end
197205
function flat_earth_drag_bcb!(res_b, u_b, p)
198206
fr = 2100000
@@ -205,13 +213,16 @@ function flat_earth_drag_bcb!(res_b, u_b, p)
205213
res_b[1] = u_b[2] - 1
206214
res_b[2] = u_b[3] - 1
207215
res_b[3] = u_b[4]
208-
res_b[4] = (-sqrt(u_b[6]^2.0 + u_b[7]^2.0) * fr / m / vc -
209-
(u_b[6] * u_b[3]) * eta * exp(-beta) * sqrt(u_b[3]^2.0) * vc / m -
210-
u_b[7] * g_accel / vc) * u_b[8] + 1.0
216+
return res_b[4] = (
217+
-sqrt(u_b[6]^2.0 + u_b[7]^2.0) * fr / m / vc -
218+
(u_b[6] * u_b[3]) * eta * exp(-beta) * sqrt(u_b[3]^2.0) * vc / m -
219+
u_b[7] * g_accel / vc
220+
) * u_b[8] + 1.0
211221
end
212222
flat_earth_drag_function = BVPFunction(
213223
flat_earth_drag_f!, (flat_earth_drag_bca!, flat_earth_drag_bcb!),
214-
bcresid_prototype = (zeros(4), zeros(4)), twopoint = Val(true))
224+
bcresid_prototype = (zeros(4), zeros(4)), twopoint = Val(true)
225+
)
215226
flat_earth_drag_tspan = (0, 100)
216227
@doc raw"""
217228
flat_earth_drag
@@ -254,9 +265,11 @@ No analytical solution
254265
255266
[Reference](https://archimede.uniba.it/~bvpsolvers/testsetbvpsolvers/?page_id=544)
256267
"""
257-
flat_earth_drag = BVProblem(flat_earth_drag_function,
268+
flat_earth_drag = BVProblem(
269+
flat_earth_drag_function,
258270
[0, 0, 0, 0, 0, 0, 0, 0],
259-
flat_earth_drag_tspan)
271+
flat_earth_drag_tspan
272+
)
260273

261274
################### measles ############################
262275
function measles_f!(du, u, p, t)
@@ -268,13 +281,13 @@ function measles_f!(du, u, p, t)
268281

269282
du[1] = mu - (bt * u[1] * u[3])
270283
du[2] = (bt * u[1] * u[3]) - (u[2] / lambda)
271-
du[3] = (u[2] / lambda) - (u[3] / eta)
284+
return du[3] = (u[2] / lambda) - (u[3] / eta)
272285
end
273286

274287
function measles_bc!(res, u, p, t)
275288
res[1] = u[1][1] - u[end][1]
276289
res[2] = u[1][2] - u[end][2]
277-
res[3] = u[1][3] - u[end][3]
290+
return res[3] = u[1][3] - u[end][3]
278291
end
279292
measles_function = BVPFunction(measles_f!, measles_bc!)
280293
measles_tspan = (0, 1)
@@ -311,21 +324,21 @@ measles = BVProblem(measles_function, [0, 0, 0], measles_tspan)
311324

312325
# Linear BVP Example Problems
313326
export prob_bvp_linear_1, prob_bvp_linear_2, prob_bvp_linear_3, prob_bvp_linear_4,
314-
prob_bvp_linear_5,
315-
prob_bvp_linear_6, prob_bvp_linear_7, prob_bvp_linear_8, prob_bvp_linear_9,
316-
prob_bvp_linear_10,
317-
prob_bvp_linear_11, prob_bvp_linear_12, prob_bvp_linear_13, prob_bvp_linear_14,
318-
prob_bvp_linear_15,
319-
prob_bvp_linear_16, prob_bvp_linear_17, prob_bvp_linear_18
327+
prob_bvp_linear_5,
328+
prob_bvp_linear_6, prob_bvp_linear_7, prob_bvp_linear_8, prob_bvp_linear_9,
329+
prob_bvp_linear_10,
330+
prob_bvp_linear_11, prob_bvp_linear_12, prob_bvp_linear_13, prob_bvp_linear_14,
331+
prob_bvp_linear_15,
332+
prob_bvp_linear_16, prob_bvp_linear_17, prob_bvp_linear_18
320333

321334
# Nonlinear BVP Example Problems
322335
export prob_bvp_nonlinear_1, prob_bvp_nonlinear_2, prob_bvp_nonlinear_3,
323-
prob_bvp_nonlinear_4, prob_bvp_nonlinear_5,
324-
prob_bvp_nonlinear_6, prob_bvp_nonlinear_7, prob_bvp_nonlinear_8,
325-
prob_bvp_nonlinear_9,
326-
prob_bvp_nonlinear_10,
327-
prob_bvp_nonlinear_11, prob_bvp_nonlinear_12, prob_bvp_nonlinear_13,
328-
prob_bvp_nonlinear_14, prob_bvp_nonlinear_15
336+
prob_bvp_nonlinear_4, prob_bvp_nonlinear_5,
337+
prob_bvp_nonlinear_6, prob_bvp_nonlinear_7, prob_bvp_nonlinear_8,
338+
prob_bvp_nonlinear_9,
339+
prob_bvp_nonlinear_10,
340+
prob_bvp_nonlinear_11, prob_bvp_nonlinear_12, prob_bvp_nonlinear_13,
341+
prob_bvp_nonlinear_14, prob_bvp_nonlinear_15
329342

330343
export flat_moon, flat_earth, flat_earth_drag, measles
331344

0 commit comments

Comments
 (0)