8000 Improve formatting in HeatConduction2DFin examples · FEAScript/FEAScript-core@b2cc5a6 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2cc5a6

Browse files
committed
Improve formatting in HeatConduction2DFin examples
1 parent 462a81c commit b2cc5a6

File tree

3 files changed

+31
-38
lines changed

3 files changed

+31
-38
lines changed

examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFin.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ <h1>Heat Conduction in a Two-Dimensional Fin Example</h1>
4545

4646
<!-- Import FEAScript library -->
4747
<script type="module">
48-
import {
49-
FEAScriptModel,
50-
plotSolution,
51-
printVersion,
52-
} from "https://core.feascript.com/src/index.js";
48+
import { FEAScriptModel, plotSolution, printVersion } from "https://core.feascript.com/src/index.js";
5349

5450
window.addEventListener("DOMContentLoaded", () => {
5551
// Print FEAScript version in the console

examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinGmsh.html

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
white-space: pre-wrap;
3737
font-family: monospace;
3838
}
39-
39+
4040
.experimental-badge {
4141
background-color: #ff4500;
4242
color: white;
@@ -46,16 +46,16 @@
4646
margin-left: 10px;
4747
vertical-align: middle;
4848
}
49-
49+
5050
h1 .experimental-badge {
5151
font-size: 0.5em;
5252
vertical-align: middle;
5353
}
54-
54+
5555
#inputForm {
5656
margin: 20px 0;
5757
}
58-
58+
5959
.file-input-container {
6060
margin: 20px 0;
6161
}
@@ -67,30 +67,26 @@ <h1>GMSH File Import Tool <span class="experimental-badge">EXPERIMENTAL</span></
6767

6868
<div class="highlight-container">
6969
<p>
70-
This is an experimental example for solving the two-dimensional fin case using mesh generated by <a href="https://gmsh.info/" target="_blank">GMSH</a> (.msh) files. GMSH is a powerful mesh generation tool
71-
that can create complex geometries and meshes for finite element analysis. Upload a GMSH (.msh) file using the form below. The parsed data will be displayed in JSON format.
70+
This is an experimental example for solving the two-dimensional fin case using mesh generated by
71+
<a href="https://gmsh.info/" target="_blank">GMSH</a> (.msh) files. GMSH is a powerful mesh generation
72+
tool that can create complex geometries and meshes for finite element analysis. Upload a GMSH (.msh)
73+
file using the form below. The parsed data will be displayed in JSON format.
7274
</p>
7375
</div>
7476

7577
<ul id="menu">
7678
<li>
77-
<a href="HeatConduction2DFin.html">Return to Standard Example</a>
79+
<a href="HeatConduction2DFin.html" target="_blank">Return to Standard Example</a>
7880
</li>
7981
</ul>
80-
82+
8183
<div class="file-input-container">
8284
<form id="inputForm">
8385
<label for="inputFile">Choose a .msh file:</label>
84-
<input
85-
type="file"
86-
id="inputFile"
87-
name="inputFile"
88-
accept=".msh"
89-
required
90-
/>
86+
<input type="file" id="inputFile" name="inputFile" accept=".msh" required />
9187
</form>
9288
</div>
93-
89+
9490
<h3>Parsed GMSH Data:</h3>
9591
<div id="resultOutput">No file uploaded yet. Please select a GMSH (.msh) file.</div>
9692

@@ -102,11 +98,11 @@ <h3>Parsed GMSH Data:</h3>
10298
<!-- GMSH File Import Script -->
10399
<script type="module">
104100
import { importGmshQuadTri } from "../../../src/readers/gmshQuadReader.js";
105-
101+
106102
document.getElementById("inputFile").addEventListener("change", async function (e) {
107103
const file = e.target.files[0];
108104
if (!file) return;
109-
105+
110106
try {
111107
document.getElementById("resultOutput").innerHTML = "Processing file...";
112108
const res = await importGmshQuadTri(file);
@@ -121,7 +117,7 @@ <h3>Parsed GMSH Data:</h3>
121117
<!-- Import FEAScript utilities -->
122118
<script type="module">
123119
import { printVersion } from "https://core.feascript.com/src/index.js";
124-
120+
125121
window.addEventListener("DOMContentLoaded", () => {
126122
// Print FEAScript version in the console
127123
printVersion();

examples/solidHeatTransferScript/HeatConduction2DFin/HeatConduction2DFinWorker.html

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,19 @@
2828
<body>
2929
<h1>Heat Conduction in a Two-Dimensional Fin Example (Worker)</h1>
3030
<div id="solutionPlot"></div>
31-
<div id="loading"><div class="spinner"></div>Solving...</div>
31+
<div id="loading">
32+
<div class="spinner"></div>
33+
Solving...
34+
</div>
3235

3336
<p>
34-
This is a worker-based implementation of the heat conduction in a two-dimensional fin example using a larger mesh (18x9). This implementation enables better performance for larger simulations.
35-
The mesh configuration and boundary conditions are defined directly within the JavaScript code. Detailed instructions for this example can be
36-
found in the corresponding
37-
<a href="https://feascript.com/tutorials/HeatConduction2DFinWorker.html" target="_blank">FEAScript tutorial</a>.
38-
If you need further assistance, you can visit the
37+
This is a worker-based implementation of the heat conduction in a two-dimensional fin example using a
38+
larger mesh (18x9). This implementation enables better performance for larger simulations. The mesh
39+
configuration and boundary conditions are defined directly within the JavaScript code. Detailed
40+
instructions for this example can be found in the corresponding
41+
<a href="https://feascript.com/tutorials/HeatConduction2DFinWorker.html" target="_blank"
42+
>FEAScript tutorial</a
43+
>. If you need further assistance, you can visit the
3944
<a href="https://feascript.com/" target="_blank">FEAScript website</a>.
4045
</p>
4146

@@ -46,16 +51,12 @@ <h1>Heat Conduction in a Two-Dimensional Fin Example (Worker)</h1>
4651

4752
<!-- Import FEAScript library -->
4853
<script type="module">
49-
import {
50-
FEAScriptWorker,
51-
plotSolution,
52-
printVersion,
53-
} from "https://core.feascript.com/src/index.js";
54+
import { FEAScriptWorker, plotSolution, printVersion } from "https://core.feascript.com/src/index.js";
5455

5556
window.addEventListener("DOMContentLoaded", async () => {
5657
// Print FEAScript version in the console
5758
printVersion();
58-
59+
5960
// Show loading indicator
6061
document.getElementById("loading").style.display = "block";
6162

@@ -90,7 +91,7 @@ <h1>Heat Conduction in a Two-Dimensional Fin Example (Worker)</h1>
9091

9192
// Solve the problem and get the solution
9293
const { solutionVector, nodesCoordinates } = await model.solve();
93-
94+
9495
// Hide loading indicator
9596
document.getElementById("loading").style.display = "none";
9697

@@ -103,7 +104,7 @@ <h1>Heat Conduction in a Two-Dimensional Fin Example (Worker)</h1>
103104
"contour",
104105
"solutionPlot"
105106
);
106-
107+
107108
// Terminate the worker when done
108109
model.terminate();
109110
} catch (error) {

0 commit comments

Comments
 (0)
0