Skip to content

Commit 916d3a5

Browse files
committed
Show schematics as frameless SVGs and align Gmsh boundary keys
- Show the tutorial schematics as SVGs without a frame, larger, and inverted in dark mode (new .schematic CSS class). - Draw the two Gmsh meshes as SVGs from their .msh files, with boundary names and keys, replacing the mesh screenshots. - Tag the Gmsh physical groups bottom, left, top, right in rect.geo and rhom.geo, regenerate rect_quad.msh and rhom_quad.msh, and swap the left/right boundary conditions in the two Gmsh tutorials, so all fin tutorials use the same boundary keys. - Add rect_with_hole.msh (the homepage mesh, previously on a Gist) with the physical groups renumbered bottom, left, top, right, hole, renumber rect_with_hole_quad.msh the same way, and fetch the homepage mesh from feascript.com.
1 parent f437e1e commit 916d3a5

22 files changed

Lines changed: 965 additions & 80 deletions

‎assets/cantilever-beam-1d.svg‎

Lines changed: 0 additions & 1 deletion
Loading

‎assets/gmsh_rect_quad.svg‎

Lines changed: 67 additions & 0 deletions
Loading

‎assets/gmsh_rhom_quad.svg‎

Lines changed: 61 additions & 0 deletions
Loading

‎assets/heat-conduction-1d-wall.svg‎

Lines changed: 0 additions & 1 deletion
Loading

‎assets/heat-conduction-2d-fin.svg‎

Lines changed: 0 additions & 1 deletion
Loading

‎assets/solidification-front-2d.svg‎

Lines changed: 0 additions & 1 deletion
Loading

‎assets/stokes-2d-lid-driven.svg‎

Lines changed: 0 additions & 1 deletion
Loading

‎feascript-website.css‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,16 @@ html[data-theme="dark"] .theme-toggle .icon-moon {
18061806
background: #fff;
18071807
}
18081808

1809+
/* Tutorial schematics: line art without a frame, inverted in dark mode */
1810+
.doc .center-image img.schematic {
1811+
border: none;
1812+
background: none;
1813+
}
1814+
1815+
html[data-theme="dark"] .doc .center-image img.schematic {
1816+
filter: invert(0.88);
1817+
}
1818+
18091819
.doc .image-caption {
18101820
margin: 0.5rem auto 0;
18111821
font-size: 0.8125rem;

‎index.html‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -447,25 +447,21 @@ <h2 data-reveal>Run a simulation with <span class="accent">a few lines.</span></
447447
} from "https://core.feascript.com/dist/feascript.esm.js";
448448

449449
window.addEventListener("DOMContentLoaded", async () => {
450-
// Fetch mesh from GitHub Gist (swap the URL for any other hosted .msh file)
451-
const response = await fetch(
452-
"https://gist.githubusercontent.com/nikoscham/0c5a78922a16111ceef42de54fc631ea/raw/aeadcd2808f5531fd0ca1ca16d198f7d1e7f8e96/rect_with_hole.msh"
453-
);
450+
// Fetch the Gmsh mesh from feascript.com (swap the URL for any other hosted .msh file)
451+
const response = await fetch("https://feascript.com/tutorials/rect_with_hole.msh");
454452
const meshFile = new File([await response.text()], "rect_with_hole.msh");
455453

456454
// Create and configure model
457455
const model = new FEAScriptModel();
458456
model.setModelConfig("heatConductionScript");
459-
model.setMeshConfig({
460-
parsedMesh: await importGmshMesh(meshFile),
461-
});
457+
model.setMeshConfig({ parsedMesh: await importGmshMesh(meshFile) });
462458

463459
// Apply boundary conditions (Gmsh physical group tag - 1)
464460
model.addBoundaryCondition("0", ["constantTemperature", 200]); // Bottom
465-
model.addBoundaryCondition("1", ["constantTemperature", 200]); // Right
466-
model.addBoundaryCondition("2", ["convection", 1, 20]); // Top
467-
model.addBoundaryCondition("3", ["symmetry"]); // Left
468-
model.addBoundaryCondition("4", ["convection", 1, 20]); // Hole surface
461+
model.addBoundaryCondition("1", ["symmetry"]); // Left
462+
model.addBoundaryCondition("2", ["convection", 1, 20]); // Top
463+
model.addBoundaryCondition("3", ["constantTemperature", 200]); // Right
464+
model.addBoundaryCondition("4", ["convection", 1, 20]); // Hole surface
469465

470466
// Solve
471467
model.setSolverMethod("lusolve");

‎tutorials/cantilever-beam-1d.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ <h1>Cantilever Beam Under <span class="accent">a Tip Load Tutorial</span></h1>
219219
</p>
220220

221221
<div class="center-image">
222-
<img src="../assets/cantilever-beam-1d.png" alt="Cantilever beam schematic" width="460" />
222+
<img class="schematic" src="../assets/cantilever-beam-1d.svg" alt="Cantilever beam schematic" width="600" />
223223
<p class="image-caption">
224224
Schematic of the cantilever beam: clamped support at x=0 (w=0, &theta;=0) and a downward tip
225225
point load P at x=L

0 commit comments

Comments
 (0)