Skip to content

Commit d49805c

Browse files
committed
Enhance performance testing features and update styles in FEAScript website
- Adjusted margin-top for mjx-container to improve layout. - Added new badge for performance test in tutorials list. - Styled tutorials list for better presentation. - Increased priority for HeatConduction2DFinWorker in sitemap. - Added new performance test tutorial page for 2D heat conduction. - Removed obsolete HeatConduction2DSpeedTest.html file.
1 parent d4ef4be commit d49805c

File tree

4 files changed

+44
-12
lines changed

4 files changed

+44
-12
lines changed

FEAScript-website.css

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ mjx-container {
216216
padding: 0.2em 0.8em;
217217
border-radius: 8px;
218218
margin-right: 0.5em;
219-
margin-top: 0.3em;
219+
margin-top: 0;
220220
vertical-align: middle;
221221
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
222222
font-weight: 500;
@@ -249,13 +249,28 @@ mjx-container {
249249
color: #f7e7b7;
250250
}
251251

252+
.tutorials-list .badge-performance {
253+
background-color: #c62828;
254+
color: white;
255+
}
256+
252257
.tutorial-name {
253258
display: inline-block;
254259
vertical-align: middle;
255260
font-weight: 550;
256261
margin-right: 10px;
257262
}
258263

264+
.tutorials-list li {
265+
margin-bottom: 1em;
266+
border-bottom: 1px solid #ddd;
267+
padding-bottom: 0.5em;
268+
}
269+
270+
.tutorials-list {
271+
list-style: none; /* Remove bullets */
272+
}
273+
259274
/* Footer styles */
260275
footer {
261276
position: relative;

index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,11 @@ <h2 id="tutorials"><a name="Tutorials"></a>Tutorials</h2>
485485
<a href="https://feascript.com/tutorials/HeatConduction2DFinGmsh.html" class="badge badge-gmsh"
486486
>Gmsh mesh</a
487487
>
488+
<a
489+
href="https://feascript.com/tutorials/HeatConduction2DPerfomanceTest.html"
490+
class="badge badge-performance"
491+
>Performance Test</a
492+
>
488493
<a href="https://feascript.com/tutorials/HeatConduction2DFinPlatform.html" class="badge badge-visual"
489494
>Visual Editor</a
490495
>
@@ -549,4 +554,3 @@ <h2 id="licensing"><a name="Licensing"></a>Licensing</h2>
549554
</script>
550555
</body>
551556
</html>
552-

sitemap.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</url>
1111
<url>
1212
<loc>https://feascript.com/tutorials/HeatConduction2DFinWorker.html</loc>
13-
<priority>0.7</priority>
13+
<priority>0.8</priority>
1414
</url>
1515
<url>
1616
<loc>https://feascript.com/tutorials/HeatConduction1DWall.html</loc>
@@ -24,16 +24,20 @@
2424
<loc>https://feascript.com/tutorials/HeatConduction2DFinGmsh.html</loc>
2525
<priority>0.8</priority>
2626
</url>
27+
<url>
28+
<loc>https://feascript.com/tutorials/HeatConduction2DPerfomanceTest.html</loc>
29+
<priority>0.8</priority>
30+
</url>
2731
<url>
2832
<loc>https://feascript.com/tutorials/SolidificationFront2D.html</loc>
2933
<priority>0.8</priority>
3034
</url>
3135
<url>
3236
<loc>https://feascript.com/tutorials/SolidificationFront2DWorker.html</loc>
33-
<priority>0.7</priority>
37+
<priority>0.8</priority>
3438
</url>
3539
<url>
3640
<loc>https://feascript.com/tutorials/AdvectionDiffusion1D.html</loc>
37-
<priority>0.7</priority>
41+
<priority>0.8</priority>
3842
</url>
3943
</urlset>

tutorials/HeatConduction2DSpeedTest.html renamed to tutorials/HeatConduction2DPerfomanceTest.html

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<html>
1414
<head>
15-
<title>FEAScript Speed Test</title>
15+
<title>FEAScript Performance Test</title>
1616
<link rel="icon" type="image/x-icon" href="../assets/favicon.ico" />
1717
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
1818
<meta
@@ -43,23 +43,23 @@ <h1 class="top">
4343
/>
4444
</a>
4545
</h1>
46-
<h1>FEAScript Speed Test</h1>
46+
<h1>FEAScript Performance Test</h1>
4747

4848
<div class="highlight-container">
4949
<p>
50-
This page demonstrates a speed test for the FEAScript using a 2D heat conduction problem. You can
51-
select the solver and mesh size to benchmark performance. For the mathematical formulation and theory,
52-
see the
50+
This page presents a performance test of FEAScript using the Heat Conduction in a 2D Fin problem. You
51+
can choose the solver and mesh size to benchmark performance. For simplicity and speed, this test uses
52+
linear elements. For the mathematical formulation and theoretical background, refer to the
5353
<a href="HeatConduction2DFin.html">basic tutorial</a>.
5454
</p>
5555
</div>
5656

57-
<h2>Run Speed Test</h2>
57+
<h2>Run Performance Test</h2>
5858
<p>
5959
<label for="solverSelect">Select solver:</label>
6060
<select id="solverSelect">
6161
<option value="lusolve">LU Solve</option>
62-
<option value="jacobi">Jacobi</option>
62+
<!-- <option value="jacobi">Jacobi</option> -->
6363
<option value="frontal">Frontal</option>
6464
</select>
6565
<label for="numElementsX" style="margin-left: 1em">Elements X:</label>
@@ -69,6 +69,8 @@ <h2>Run Speed Test</h2>
6969
<button id="runBtn">Run</button>
7070
</p>
7171
<div id="resultsCanvas"></div>
72+
<!-- div to display the solving time -->
73+
<div id="timeDisplay" style="margin-top: 1em"></div>
7274

7375
<ul id="menu">
7476
<li><a href="https://feascript.com/index.html">Home</a></li>
@@ -107,7 +109,14 @@ <h2>Run Speed Test</h2>
107109

108110
model.setSolverMethod(selectedSolver);
109111

112+
// Measure the solving time
113+
const startTime = performance.now();
110114
const { solutionVector, nodesCoordinates } = model.solve();
115+
const endTime = performance.now();
116+
const solvingTime = ((endTime - startTime) / 1000).toFixed(3); // Convert to seconds and round to 3 decimal places
117+
118+
// Display the time in the HTML
119+
document.getElementById("timeDisplay").innerHTML = `Solving time: ${solvingTime} seconds`;
111120

112121
plotSolution(
113122
solutionVector,

0 commit comments

Comments
 (0)