Skip to content

Commit 3f04bb6

Browse files
committed
Show the bottom, left, top, right Gmsh tag order
Update the Gmsh examples on the Mesh page, the importGmshMesh Node.js example and llms.txt, so Gmsh meshes get the same boundary keys as structured meshes.
1 parent 78a73ca commit 3f04bb6

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

‎docs/api/gmsh-import.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ const model = new FEAScriptModel();
6363
model.setModelConfig("heatConductionScript");
6464
model.setMeshConfig({ parsedMesh });
6565

66-
model.addBoundaryCondition("0", ["constantTemperature", 200]); // Physical curve with tag 1
67-
model.addBoundaryCondition("1", ["constantTemperature", 200]); // Physical curve with tag 2
68-
model.addBoundaryCondition("2", ["convection", 1, 20]); // Physical curve with tag 3
69-
model.addBoundaryCondition("3", ["symmetry"]); // Physical curve with tag 4
66+
model.addBoundaryCondition("0", ["constantTemperature", 200]); // Physical curve "bottom", tag 1
67+
model.addBoundaryCondition("1", ["symmetry"]); // Physical curve "left", tag 2
68+
model.addBoundaryCondition("2", ["convection", 1, 20]); // Physical curve "top", tag 3
69+
model.addBoundaryCondition("3", ["constantTemperature", 200]); // Physical curve "right", tag 4
7070

7171
const { solutionVector, nodesCoordinates } = model.solve();
7272
```

‎docs/fundamentals/mesh.md‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,20 @@ They are numbered in increasing order of their physical tag, starting from key `
135135
have the tags `1`, `2`, ..., the boundary key is the tag minus one. 2D physical groups (for example a
136136
`Physical Surface`) do not define boundaries.
137137

138-
For example, with the following `.geo` definitions:
138+
To get the same keys as a [structured mesh](#boundaries-of-a-structured-mesh), tag the sides in the order
139+
bottom, left, top, right. For a rectangle whose lines 1, 2, 3, 4 are the bottom, right, top and left sides:
139140

140141
```
141-
Physical Line("bottom") = {1}; // tag 1 → boundary key "0"
142-
Physical Line("right") = {2}; // tag 2 → boundary key "1"
143-
Physical Line("top") = {3}; // tag 3 → boundary key "2"
144-
Physical Line("left") = {4}; // tag 4 → boundary key "3"
145-
Physical Surface("domain") = {1};
142+
Physical Line("bottom", 1) = {1}; // tag 1 → boundary key "0"
143+
Physical Line("left", 2) = {4}; // tag 2 → boundary key "1"
144+
Physical Line("top", 3) = {3}; // tag 3 → boundary key "2"
145+
Physical Line("right", 4) = {2}; // tag 4 → boundary key "3"
146+
Physical Surface("domain", 5) = {1};
146147
```
147148

149+
The second argument of `Physical Line` sets the tag explicitly. Without it, Gmsh numbers the groups in the order they
150+
are defined.
151+
148152
Generate the mesh in the supported format with:
149153

150154
```bash

‎static/llms.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ model.setMeshConfig({ parsedMesh }); // meshDimension and elementOrder are detec
173173
```
174174

175175
- Supported: `.msh` version 4.1 ASCII (`gmsh model.geo -2 -format msh41 -o model.msh`), 2D only, all quadrilaterals or all triangles, all linear or all quadratic.
176-
- Boundary keys come from the 1D physical groups (`Physical Curve` / `Physical Line`), numbered in increasing tag order from `"0"`: tags 1, 2, 3, 4 → keys `"0"`, `"1"`, `"2"`, `"3"`.
176+
- Boundary keys come from the 1D physical groups (`Physical Curve` / `Physical Line`), numbered in increasing tag order from `"0"`: tags 1, 2, 3, 4 → keys `"0"`, `"1"`, `"2"`, `"3"`. Tag the sides bottom, left, top, right (e.g. `Physical Line("left", 2) = {4};`) to get the same keys as a structured mesh.
177177

178178
## Boundary condition rules
179179

0 commit comments

Comments
 (0)