Skip to content

Commit 2b7917b

Browse files
committed
Update tutorial content for clarity and consistency, including Gmsh references and workflow notes
1 parent a09edd5 commit 2b7917b

2 files changed

Lines changed: 27 additions & 23 deletions

File tree

index.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,11 @@ <h2 id="gettingstarted"><a name="Getting Started"></a>Getting Started</h2>
236236
</div>
237237

238238
<p>
239-
<strong>Quick Start:</strong> To use FEAScript in your HTML, include it from our hosted build
240-
(<code>https://core.feascript.com/dist/feascript.esm.js</code>) or download it from
241-
<a href="https://github.com/FEAScript/FEAScript-core">GitHub</a> &#8594; add a canvas (e.g.,
242-
<code>&lt;div id="solutionPlot">&lt;/div&gt;</code>) &#8594; add a mesh file (e.g., "your.msh" from
239+
<strong>Quick Start:</strong> To use FEAScript in your HTML, include it from our hosted build (i.e.,
240+
<code>import { FEAScriptModel } from "https://core.feascript.com/dist/feascript.esm.js";</code>) or
241+
download it from <a href="https://github.com/FEAScript/FEAScript-core">GitHub</a> &#8594; add a canvas
242+
(e.g., <code>&lt;div id="solutionPlot">&lt;/div&gt;</code>) &#8594; add a mesh file (e.g., "your.msh"
243+
from
243244
<a href="https://gmsh.info/">
244245
Gmsh
245246
<img
@@ -252,8 +253,8 @@ <h2 id="gettingstarted"><a name="Getting Started"></a>Getting Started</h2>
252253
margin-left: 2px;
253254
margin-bottom: 4px;
254255
" /></a
255-
>) or use FEAScript mesh generation tools &#8594; create and run a simulation using the JavaScript API
256-
(see <a href="#tutorials">tutorials</a> for detailed examples):
256+
>) or use FEAScript mesh generation tools &#8594; create and run a simulation using the JavaScript API.
257+
Here is a simple example (see <a href="#tutorials">tutorials</a> for more details):
257258
</p>
258259

259260
<pre class="prettyprint">
@@ -289,8 +290,8 @@ <h2 id="gettingstarted"><a name="Getting Started"></a>Getting Started</h2>
289290
>
290291
<p>
291292
<em>
292-
The above code is an illustrative example. Adapt paths, solver types, and boundary conditions to your
293-
specific problem.
293+
The above code is an illustrative example of running FEAScript. Adapt paths, solver types, and
294+
boundary conditions to your specific problem.
294295
</em>
295296
</p>
296297
<p>

tutorials/HeatConduction2DFinGmsh.html

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,16 @@ <h1>Heat Conduction in a Two-Dimensional Fin Tutorial (Gmsh Mesh)</h1>
8484
<div class="highlight-container">
8585
<p>
8686
This page demonstrates solving the 2D heat conduction fin problem using a Gmsh-generated mesh.
87-
<a href="https://gmsh.info/">Gmsh</a> is a powerful mesh generation tool that can create complex
88-
geometries and meshes for finite element analysis. For the mathematical formulation and theory, see
89-
the <a href="HeatConduction2DFin.html">basic tutorial</a>.
87+
<a href="https://gmsh.info/">
88+
Gmsh
89+
<img
90+
src="https://upload.wikimedia.org/wikipedia/commons/4/44/Icon_External_Link.svg"
91+
alt="External Link Icon"
92+
style="width: 16px; height: 16px; vertical-align: middle; margin-left: 2px; margin-bottom: 4px"
93+
/></a>
94+
is a powerful mesh generation tool that can create complex geometries and meshes for finite element
95+
analysis. For the mathematical formulation and theory, see the
96+
<a href="HeatConduction2DFin.html">basic tutorial</a>.
9097
</p>
9198
</div>
9299

@@ -157,10 +164,8 @@ <h2 id="gmshfileimport"><a name="gmshfileimport"></a>Gmsh File Import</h2>
157164
&lt;/body&gt;</pre
158165
>
159166

160-
<p>
161-
<strong>Important notes about the Gmsh workflow:</strong>
162-
</p>
163-
<ol>
167+
<p>Here are some important notes about the Gmsh workflow:</p>
168+
<ul>
164169
<li>
165170
<strong>Physical Groups in Gmsh:</strong> In your ".geo" file, you need to define physical groups for
166171
boundaries using commands like <code>Physical Line("bottom") = {1};</code>. These are mapped to tags
@@ -169,16 +174,16 @@ <h2 id="gmshfileimport"><a name="gmshfileimport"></a>Gmsh File Import</h2>
169174
<li>
170175
<strong>Boundary Condition Mapping and Tag Indexing:</strong> When using Gmsh meshes in FEAScript, you
171176
need to subtract 1 from the Gmsh physical group tag numbers. For example, if your Gmsh file has
172-
physical groups with tags 1, 2, 3, and 4, you would reference them in FEAScript as "0", "1", "2", and
173-
"3" respectively:
177+
physical groups with tags "1", "2", "3", "4", you would reference them in FEAScript as "0", "1", "2",
178+
"3", respectively. For example:
174179
<code>model.addBoundaryCondition("0", ["constantTemp", 200]); // Gmsh physical group tag 1</code>.
175180
This conversion is necessary because Gmsh uses 1-based indexing while FEAScript uses 0-based indexing.
176181
</li>
177182
<li>
178183
<strong>Unstructured Plotting:</strong> When plotting results from a Gmsh mesh, add the "unstructured"
179184
parameter to the plotSolution function to ensure correct visualization.
180185
</li>
181-
</ol>
186+
</ul>
182187

183188
<p>
184189
You can create your own Gmsh files by writing ".geo" scripts or using Gmsh's GUI. For this example, we
@@ -193,9 +198,7 @@ <h3 id="gmshgeofile"><a name="gmshgeofile"></a>Example Gmsh ".geo" File</h3>
193198
</p>
194199

195200
<pre class="prettyprint">
196-
// 2D Rectangle: 4m (width) x 2m (height)
197-
// With Physical Lines for boundary labeling
198-
// Use the command "gmsh rect.geo -2" to generate the mesh
201+
// 2D Rectangle: 4m (width) x 2m (height) with physical lines for boundary labeling
199202

200203
lc = 0.7; // Characteristic length (mesh density)
201204

@@ -231,8 +234,8 @@ <h3 id="gmshgeofile"><a name="gmshgeofile"></a>Example Gmsh ".geo" File</h3>
231234
>
232235

233236
<p>
234-
Note how the physical line tags in the ".geo" file correspond to the boundary conditions in our FEAScript
235-
code:
237+
Note how the physical line tags in the ".geo" file correspond to the boundary conditions in our
238+
FEAScript code:
236239
</p>
237240
<ul>
238241
<li>

0 commit comments

Comments
 (0)