Skip to content

Commit e90b659

Browse files
committed
Describe the mesh that importGmshMesh returns
importGmshMesh returns the mesh as read from the file: its elements are grouped by shape (nodalNumbering.quadElements or triangleElements) and its boundaries are still the Gmsh physical groups. setMesh converts it to the mesh object of the generators, with the boundaries keyed by name. The pages, and llms.txt, said that importGmshMesh returns that mesh object already. Signed-off-by: Nikos Chamakos <nikoscham@gmail.com>
1 parent 80d0df4 commit e90b659

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

‎docs/api/gmsh-import.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ const mesh = await importGmshMesh(file);
1111
model.setMesh(mesh);
1212
```
1313

14-
Reads a 2D mesh generated by [Gmsh](https://gmsh.info/) (`.msh` format version 4.1, ASCII) and returns a mesh
15-
for `model.setMesh(mesh)`, with its boundaries keyed by the names of the physical groups. See
16-
[Mesh](../fundamentals/mesh.md#gmsh-meshes) for the supported element types and for how boundaries are defined.
14+
Reads a 2D mesh generated by [Gmsh](https://gmsh.info/) (`.msh` format version 4.1, ASCII) and returns it for
15+
`model.setMesh(mesh)`, which keys its boundaries by the names of the physical groups. See
16+
[Mesh](../fundamentals/mesh.md#gmsh-meshes) for the supported element types and for how boundaries are defined,
17+
and [Meshes as objects](../fundamentals/mesh.md#meshes-as-objects) for the form of the returned mesh.
1718

1819
| Parameter | Type | Description |
1920
| --------- | -------- | --------------------------------------------------------------------------------------------------------------- |

‎docs/fundamentals/mesh.md‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,13 +291,18 @@ elements.
291291

292292
## Meshes as objects
293293

294-
`importGmshMesh`, [`generateTriangleMesh` and `generateQuadrilateralMesh`](../api/mesh-generators.md) all return
295-
a mesh object, and `setMesh` takes one. The object holds the nodes (`nodesXCoordinates`, `nodesYCoordinates`),
296-
the elements (`nodalNumbering`, the node numbers of each element, from 1), the element sides on each boundary
294+
[`generateTriangleMesh` and `generateQuadrilateralMesh`](../api/mesh-generators.md) return a mesh object, and
295+
`setMesh` takes one. The object holds the nodes (`nodesXCoordinates`, `nodesYCoordinates`), the elements
296+
(`nodalNumbering`, the node numbers of each element, from 1), the element sides on each boundary
297297
(`boundaryElements`, keyed by name), the aliases of the names, and `meshDimension`, `elementOrder` and
298298
`elementShape`. A model's own mesh is available through `model.getMesh()`, which generates it from the geometry
299299
and the mesh configuration if needed, so a mesh can be inspected, plotted or reused in another model.
300300

301+
[`importGmshMesh`](../api/gmsh-import.md) returns the mesh as read from the file, with the same nodes but the
302+
elements grouped by shape (`nodalNumbering.quadElements` or `nodalNumbering.triangleElements`) and the boundaries
303+
still given by the Gmsh physical groups. `setMesh` converts it to the mesh object above, with the boundaries keyed
304+
by name; call `model.getMesh()` after `setMesh` to get the converted mesh.
305+
301306
## Mesh settings of FEAScript 0.3
302307

303308
`setMeshConfig({ meshDimension, elementOrder, numElementsX, maxX, numElementsY, maxY, angleLeft, angleRight })`

‎static/llms.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ model.setMesh(triMesh); // The geometry and mesh configuration are then not used
264264

265265
- Gmsh: `.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. Element dimension and order are detected from the file.
266266
- The boundaries of a Gmsh mesh are named after its 1D physical groups, e.g. `Physical Line("top") = {3};` gives the boundary `"top"`. Add a `Physical Surface` too, or Gmsh saves no 2D elements.
267-
- A mesh object holds `nodesXCoordinates`, `nodesYCoordinates`, `nodalNumbering` (node numbers of each element, from 1), `boundaryElements` (keyed by name), `meshDimension`, `elementOrder` and `elementShape`.
267+
- The generators return a mesh object: `nodesXCoordinates`, `nodesYCoordinates`, `nodalNumbering` (node numbers of each element, from 1), `boundaryElements` (keyed by name), `meshDimension`, `elementOrder` and `elementShape`. `importGmshMesh` returns the mesh as read from the file (elements in `nodalNumbering.quadElements` or `.triangleElements`), which `setMesh` converts; read the converted mesh with `model.getMesh()` after `setMesh`.
268268

269269
## Boundary condition rules
270270

0 commit comments

Comments
 (0)