Skip to content

Commit 03dbeab

Browse files
committed
fix: restore frontend CI after dividing streamline changes
Remove the unsupported dividing streamline WASM imports that broke the frontend build, fall back to the existing contour-based streamline path, and update deployment actions to current major versions. Made-with: Cursor
1 parent 7063af7 commit 03dbeab

4 files changed

Lines changed: 8 additions & 70 deletions

File tree

.github/workflows/deploy-foil.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
PUBLIC_URL: https://foil.flexcompute.com/flexfoil/
3030
steps:
3131
- name: Checkout
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@v5
3333

3434
- name: Setup Rust
3535
uses: dtolnay/rust-toolchain@stable
@@ -43,7 +43,7 @@ jobs:
4343
wasm-pack build --target web --release --out-dir ../../pkg
4444
4545
- name: Setup Node
46-
uses: actions/setup-node@v4
46+
uses: actions/setup-node@v5
4747
with:
4848
node-version: 20
4949
cache: npm

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v5
2323

2424
- name: Setup Rust
2525
uses: dtolnay/rust-toolchain@stable
@@ -33,7 +33,7 @@ jobs:
3333
wasm-pack build --target web --release --out-dir ../../pkg
3434
3535
- name: Setup Node
36-
uses: actions/setup-node@v4
36+
uses: actions/setup-node@v5
3737
with:
3838
node-version: 20
3939
cache: npm

flexfoil-ui/src/components/AirfoilCanvas.tsx

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { useRouteUiStore } from '../stores/routeUiStore';
2323
import { useTheme } from '../contexts/ThemeContext';
2424
import { useLayout } from '../contexts/LayoutContext';
2525
import type { Point, ViewportState, AirfoilPoint } from '../types';
26-
import { computeDividingStreamline, computeStreamlines, computePsiGrid, createSmokeSystem, isWasmReady, analyzeAirfoil, computeGamma, getBLVisualizationData, type BLVisualizationData, type WasmSmokeSystem } from '../lib/wasm';
26+
import { computeStreamlines, computePsiGrid, createSmokeSystem, isWasmReady, analyzeAirfoil, computeGamma, getBLVisualizationData, type BLVisualizationData, type WasmSmokeSystem } from '../lib/wasm';
2727
import { useMorphingAnimation, getCpColor, computeForceVectors } from '../hooks/useMorphingAnimation';
2828
import { generateCamberSplineCurve } from '../lib/airfoilGeometry';
2929
import { WebGPURenderer, checkWebGPUSupport } from '../lib/webgpu';
@@ -870,25 +870,8 @@ export function AirfoilCanvas() {
870870
}
871871
}
872872

873-
let psi0Lines: [number, number][][] = [];
874-
const dividingResult = computeDividingStreamline(
875-
panels,
876-
displayAlpha,
877-
reynolds,
878-
bounds,
879-
mach,
880-
ncrit,
881-
maxIterations,
882-
solverMode
883-
);
884-
885-
if (dividingResult.success && dividingResult.streamline.length >= 2) {
886-
psi0Lines = [dividingResult.streamline];
887-
} else {
888-
// Fall back to the contour-derived branch if the streamline bracketing fails.
889-
const psi0Segments = marchingSquares(grid, nx, ny, psi_0, bounds[0], bounds[2], dx, dy);
890-
psi0Lines = connectSegments(psi0Segments).filter(line => line.length >= 2);
891-
}
873+
const psi0Segments = marchingSquares(grid, nx, ny, psi_0, bounds[0], bounds[2], dx, dy);
874+
let psi0Lines = connectSegments(psi0Segments).filter(line => line.length >= 2);
892875

893876
// Filter out parts of dividing streamline that are inside the airfoil
894877
// Split lines at airfoil boundary and keep only exterior segments
@@ -912,10 +895,7 @@ export function AirfoilCanvas() {
912895
}
913896
psi0Lines = filteredPsi0Lines;
914897

915-
if (!(dividingResult.success && dividingResult.streamline.length >= 2)) {
916-
// Only use the contour cleanup path for the marching-squares fallback.
917-
psi0Lines = extrapolateDividingStreamline(psi0Lines, panels);
918-
}
898+
psi0Lines = extrapolateDividingStreamline(psi0Lines, panels);
919899

920900
setPsiContours({
921901
grid,

flexfoil-ui/src/lib/wasm.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import init, {
1414
analyze_airfoil_faithful,
1515
compute_streamlines as compute_streamlines_inviscid_wasm,
1616
compute_streamlines_faithful,
17-
compute_dividing_streamline as compute_dividing_streamline_inviscid_wasm,
18-
compute_dividing_streamline_faithful,
1917
compute_psi_grid as compute_psi_grid_inviscid_wasm,
2018
compute_psi_grid_faithful,
2119
get_bl_distribution_faithful,
@@ -505,12 +503,6 @@ export interface StreamlineResult {
505503
error?: string;
506504
}
507505

508-
export interface DividingStreamlineResult {
509-
streamline: [number, number][];
510-
success: boolean;
511-
error?: string;
512-
}
513-
514506
/**
515507
* Compute streamlines for flow visualization.
516508
*
@@ -555,40 +547,6 @@ export function computeStreamlines(
555547
) as StreamlineResult;
556548
}
557549

558-
export function computeDividingStreamline(
559-
coordinates: { x: number; y: number }[],
560-
alphaDeg: number,
561-
reynolds: number = 1e6,
562-
bounds: [number, number, number, number] = [-0.5, 2.0, -0.5, 0.5],
563-
mach: number = 0,
564-
ncrit: number = 9,
565-
maxIterations: number = 100,
566-
solverMode: 'inviscid' | 'viscous' = 'viscous'
567-
): DividingStreamlineResult {
568-
if (!initialized) {
569-
throw new Error('WASM not initialized. Call initWasm() first.');
570-
}
571-
572-
const coordsFlat = pointsToFlat(coordinates);
573-
if (solverMode === 'inviscid') {
574-
return compute_dividing_streamline_inviscid_wasm(
575-
coordsFlat,
576-
alphaDeg,
577-
new Float64Array(bounds)
578-
) as DividingStreamlineResult;
579-
}
580-
581-
return compute_dividing_streamline_faithful(
582-
coordsFlat,
583-
alphaDeg,
584-
reynolds,
585-
mach,
586-
ncrit,
587-
maxIterations,
588-
new Float64Array(bounds)
589-
) as DividingStreamlineResult;
590-
}
591-
592550
/**
593551
* Stream function grid result from WASM.
594552
*/

0 commit comments

Comments
 (0)