Skip to content

Commit 006906d

Browse files
committed
Remove unused resize event handlers and associated FEAScript model logic from multiple tutorial files
1 parent 818288f commit 006906d

File tree

4 files changed

+0
-195
lines changed

4 files changed

+0
-195
lines changed

tutorials/HeatConduction1DWall.html

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -268,54 +268,6 @@ <h2 id="results"><a name="Results"></a>Results</h2>
268268
);
269269
}
270270
});
271-
272-
window.addEventListener("resize", () => {
273-
if (window.innerHeight > window.innerWidth) {
274-
document.getElementById("orientation-message").style.display = "block";
275-
document.getElementById("solutionPlot").style.display = "none";
276-
} else {
277-
document.getElementById("orientation-message").style.display = "none";
278-
document.getElementById("solutionPlot").style.display = "block";
279-
280-
// Print FEAScript version
281-
printVersion();
282-
283-
// Create a new FEAScript model
284-
const model = new FEAScriptModel();
285-
286-
// Set solver configuration
287-
model.setSolverConfig("solidHeatTransferScript");
288-
289-
// Define mesh configuration
290-
model.setMeshConfig({
291-
meshDimension: "1D",
292-
elementOrder: "linear",
293-
numElementsX: 10,
294-
maxX: 0.15,
295-
});
296-
297-
// Define boundary conditions
298-
model.addBoundaryCondition("0", ["convection", 1, 25]);
299-
//model.addBoundaryCondition("0", ["constantTemp", 25]); // Temporary BC for testing
300-
model.addBoundaryCondition("1", ["constantTemp", 5]);
301-
302-
// Set solver method
303-
model.setSolverMethod("lusolve");
304-
305-
// Solve the problem and get the solution
306-
const { solutionVector, nodesCoordinates } = model.solve();
307-
308-
// Plot the solution as a 1D line plot
309-
plotSolution(
310-
solutionVector,
311-
nodesCoordinates,
312-
model.solverConfig,
313-
model.meshConfig.meshDimension,
314-
"line",
315-
"solutionPlot"
316-
);
317-
}
318-
});
319271
</script>
320272
<footer>
321273
<p>&#169; 2023-<span id="currentYear"></span> FEAScript</p>

tutorials/HeatConduction2DFin.html

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -299,48 +299,6 @@ <h2 id="results"><a name="Results"></a>Results</h2>
299299
} else {
300300
document.getElementById("orientation-message").style.display = "none";
301301
document.getElementById("solutionPlot").style.display = "block";
302-
303-
// Print FEAScript version
304-
printVersion();
305-
306-
// Create a new FEAScript model
307-
const model = new FEAScriptModel();
308-
309-
// Set solver configuration
310-
model.setSolverConfig("solidHeatTransferScript");
311-
312-
// Define mesh configuration
313-
model.setMeshConfig({
314-
meshDimension: "2D",
315-
elementOrder: "quadratic",
316-
numElementsX: 8,
317-
numElementsY: 4,
318-
maxX: 4,
319-
maxY: 2,
320-
});
321-
322-
// Define boundary conditions
323-
model.addBoundaryCondition("0", ["constantTemp", 200]);
324-
model.addBoundaryCondition("1", ["symmetry"]);
325-
model.addBoundaryCondition("2", ["convection", 1, 20]);
326-
model.addBoundaryCondition("3", ["constantTemp", 200]);
327-
328-
// Set solver method
329-
//model.setSolverMethod("jacobi");
330-
model.setSolverMethod("lusolve");
331-
332-
// Solve the problem and get the solution
333-
const { solutionVector, nodesCoordinates } = model.solve();
334-
335-
// Plot the solution as a 2D contour plot
336-
plotSolution(
337-
solutionVector,
338-
nodesCoordinates,
339-
model.solverConfig,
340-
model.meshConfig.meshDimension,
341-
"contour",
342-
"solutionPlot"
343-
);
344302
}
345303
});
346304
</script>

tutorials/HeatConduction2DFinWorker.html

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -261,70 +261,6 @@ <h2 id="results"><a name="Results"></a>Results</h2>
261261
model.terminate();
262262
}
263263
});
264-
265-
window.addEventListener("resize", async () => {
266-
if (window.innerHeight > window.innerWidth) {
267-
document.getElementById("orientation-message").style.display = "block";
268-
document.getElementById("solutionPlot").style.display = "none";
269-
document.getElementById("loading").style.display = "none";
270-
} else {
271-
document.getElementById("orientation-message").style.display = "none";
272-
document.getElementById("solutionPlot").style.display = "block";
273-
274-
// Show loading indicator
275-
document.getElementById("loading").style.display = "block";
276-
277-
// Print FEAScript version
278-
printVersion();
279-
280-
// Create a new FEAScriptWorker instance
281-
const model = new FEAScriptWorker();
282-
283-
// Ensure the worker is ready
284-
await model.ping();
285-
286-
// Set solver configuration
287-
await model.setSolverConfig("solidHeatTransferScript");
288-
289-
// Define mesh configuration
290-
await model.setMeshConfig({
291-
meshDimension: "2D",
292-
elementOrder: "quadratic",
293-
numElementsX: 8,
294-
numElementsY: 4,
295-
maxX: 4,
296-
maxY: 2,
297-
});
298-
299-
// Define boundary conditions
300-
await model.addBoundaryCondition("0", ["constantTemp", 200]);
301-
await model.addBoundaryCondition("1", ["symmetry"]);
302-
await model.addBoundaryCondition("2", ["convection", 1, 20]);
303-
await model.addBoundaryCondition("3", ["constantTemp", 200]);
304-
305-
// Set solver method
306-
await model.setSolverMethod("lusolve");
307-
308-
// Solve the problem and get the solution
309-
const { solutionVector, nodesCoordinates } = await model.solve();
310-
311-
// Hide loading indicator
312-
document.getElementById("loading").style.display = "none";
313-
314-
// Plot the solution as a 2D contour plot
315-
plotSolution(
316-
solutionVector,
317-
nodesCoordinates,
318-
"solidHeatTransferScript",
319-
"2D",
320-
"contour",
321-
"solutionPlot"
322-
);
323-
324-
// Terminate the worker
325-
model.terminate();
326-
}
327-
});
328264
</script>
329265

330266
<footer>

tutorials/SolidificationFront2D.html

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -295,47 +295,6 @@ <h2 id="results"><a name="Results"></a>Results</h2>
295295
} else {
296296
document.getElementById("orientation-message").style.display = "none";
297297
document.getElementById("solutionPlot").style.display = "block";
298-
299-
// Print FEAScript version
300-
printVersion();
301-
302-
// Create a new FEAScript model
303-
const model = new FEAScriptModel();
304-
305-
// Set solver configuration
306-
model.setSolverConfig("frontPropagationScript");
307-
308-
// Define mesh configuration
309-
model.setMeshConfig({
310-
meshDimension: "2D",
311-
elementOrder: "quadratic",
312-
numElementsX: 12,
313-
numElementsY: 8,
314-
maxX: 4,
315-
maxY: 2,
316-
});
317-
318-
// Define boundary conditions
319-
model.addBoundaryCondition("0", ["constantValue", 0]); // Βottom
320-
model.addBoundaryCondition("1", ["constantValue", 0]); // Left
321-
model.addBoundaryCondition("2", ["zeroGradient"]); // Top
322-
model.addBoundaryCondition("3", ["constantValue", 0]); // Right
323-
324-
// Set solver method
325-
model.setSolverMethod("lusolve");
326-
327-
// Solve the problem and get the solution
328-
const { solutionVector, nodesCoordinates } = model.solve();
329-
330-
// Plot the solution as a 2D contour plot
331-
plotSolution(
332-
solutionVector,
333-
nodesCoordinates,
334-
model.solverConfig,
335-
model.meshConfig.meshDimension,
336-
"contour",
337-
"solutionPlot"
338-
);
339298
}
340299
});
341300
</script>

0 commit comments

Comments
 (0)