Gmsh operation reference
Generated from the current declarations. Do not edit this file by hand.
Types, limits and defaults below describe resolved values. Runtime expressions must produce these types. Unknown options are rejected; defaults apply only when omitted. Constructor options must be constant after document composition.
Index#
box#
Creates an axis-aligned rectangular solid with gmsh.model.occ.addBox from a minimum corner and three extents in millimetres, as the solid source for a tetrahedral node. Choose it for test domains, channel sections and mesh-size studies where no CAD file is needed; its exact volume and bounds let verification compare the mesh with analytic values. Use readSTEP for any other shape. The solid is not published by itself; only the tetrahedral node publishes files.
Common mistakes and assumptions:
- size holds extents, not the opposite corner; origin is the minimum corner.
- faceGroups coordinates are absolute, so moving origin moves the face planes they must match.
Native binding: gmsh.model.occ.addBox. Output kind: ["solid"].
Inputs: none.
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
origin |
World coordinates [x, y, z] of the box's minimum corner; the box extends from origin to origin + size along each positive axis. Schemaxis passes these as the x, y, z arguments of gmsh.model.occ.addBox. Moving the origin changes the coordinates of every box face, so faceGroups coordinates must move with it. | {"type":"array","items":{"type":"number","minimum":-100000,"maximum":100000},"minItems":3,"maxItems":3} |
[0,0,0] |
size |
Extents [dx, dy, dz] of the box along x, y and z, each positive. These are lengths, not the opposite corner. Verification checks that the CAD volume equals dx·dy·dz and that the mesh bounds equal origin and origin + size. Larger extents at the same element size mean more cells: planning rejects the document with RESOURCE_LIMIT when 6 × Π(extent / smallest element size + 1) exceeds 200000. | {"type":"array","items":{"type":"number","minimum":0.001,"maximum":100000},"minItems":3,"maxItems":3} |
[10,10,10] |
readSTEP#
Imports exactly one solid from a single-file STEP document with gmsh.model.occ.importShapes, converting its length unit to millimetres. Choose it to mesh a real CAD part, such as a FreeCAD STEP artifact in a workflow. The file bytes are captured (digest and retained copy) before meshing, and the volume and bounds measured by OpenCASCADE become the reference for verification. Feature history and STEP labels are not imported; name faces with the tetrahedral faceGroups.
Common mistakes and assumptions:
- The path must be absolute and end in .step or .stp, with at most 16 MiB; multi-solid files and assemblies fail during meshing.
- Native acceptance covers STEP parts exported by FreeCAD (20×10×5 and 20×10×7 mm); STEP from other CAD tools has not had a Schemaxis acceptance check.
Native binding: gmsh.model.occ.importShapes. Output kind: ["solid"].
Inputs: none.
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
file |
Absolute path of a single-file STEP (ISO 10303-21) document containing exactly one solid. The name must end in .step or .stp (any letter case); relative paths fail planning with INVALID_RESOURCE. Before meshing, Schemaxis checks that it is a regular file of at most 16 MiB that begins with "ISO-10303-21;", records its SHA-256 digest and meshes a retained copy (source.step) in the run directory. In a workflow the path can come from an upstream CAD artifact, such as {"$artifact": "cad", "index": 0}. | {"type":"string","minLength":1,"maxLength":4096} |
required |
tetrahedral#
Meshes the preceding solid with first-order (4-node) tetrahedra using Gmsh's Delaunay 3D algorithm at a global target size, optionally finer near named boundaries, and assigns one named physical volume plus named planar face groups and a remainder boundary. It publishes result.msh (ASCII MSH 2.2 with names), volume.vtu and boundary.vtu (numeric physicalTag per cell, with quality arrays on the volume) and mesh-summary.json (name and tag map, mm units, counts, CAD and mesh volume, quality distributions). Every mesh is reopened in a fresh Gmsh process and checked independently for positive volumes, a closed boundary, face membership and agreement with the CAD volume. Add the top-level refinement object to refine until measured requirements pass.
Common mistakes and assumptions:
- size is a target edge length in mm, not a guarantee of element count, maximum edge length or shape quality.
- The VTU files carry numeric tags only; keep mesh-summary.json for group names and units.
- Outputs are bounded to 50000 nodes and 200000 cells, linear elements only, and no boundary conditions are applied.
Native binding: gmsh.model.mesh.generate. Output kind: ["mesh"].
| Input port | Multiplicity | Required | Kind |
|---|---|---|---|
input |
one node | yes | solid |
| Option | Meaning | Type / constraints | Default |
|---|---|---|---|
size |
Global target edge length of the tetrahedra. Schemaxis passes it to Gmsh as Mesh.MeshSizeMax (and as Mesh.MeshSizeMin when no nearBoundaries rule is smaller) with sizes from CAD points, curvature and boundary extension disabled, and meshes with Gmsh's Delaunay 3D algorithm (Mesh.Algorithm3D = 1). Smaller values give more, smaller tetrahedra (the count grows roughly with the inverse cube of size) and follow curved faces more closely, because curvature-based sizing is off. | {"type":"number","minimum":0.001,"maximum":100000} |
3 |
volumeName |
Name of the physical volume group (tag 1) that contains every tetrahedron of the solid. The name is stored in result.msh and mesh-summary.json; the VTU files carry only the numeric physicalTag 1. Names start with an ASCII letter followed by letters, digits, underscores or hyphens, and must differ from boundaryName and every faceGroups name. | {"type":"string","minLength":1,"maxLength":64} |
"domain" |
boundaryName |
Name of the physical surface group (tag 2) that holds every boundary face not selected by faceGroups, or the entire exterior surface when faceGroups is empty. nearBoundaries and refinement boundary requirements can refer to it. The same naming rules as volumeName apply, and all group names must be distinct. | {"type":"string","minLength":1,"maxLength":64} |
"boundary" |
faceGroups |
Up to 12 named physical surface groups, each holding the whole CAD faces that lie flat on one axis-aligned plane (for example x = 0). Groups receive tags 3, 4, … in list order, and every face not selected goes to boundaryName (tag 2). Use them to name inlets, outlets, fixed or loaded faces for later setup. Each selector must match at least one face, selectors on the same axis must not overlap, and at least one face must remain for the remainder group. | {"type":"array","maxItems":12,"items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64,"required":true},"axis":{"type":"enum","values":["x","y","z"],"required":true},"coordinate":{"type":"number","minimum":-100000,"maximum":200000,"required":true},"tolerance":{"type":"number","minimum":1e-06,"maximum":0.001,"default":1e-06}}}} |
[] |
nearBoundaries |
Up to 13 rules that request a finer target size close to named boundary groups. For each rule Schemaxis builds a Gmsh Distance field to that group's surfaces and a Threshold field: the size equals the rule's size on the surface, grows linearly to the global size at the rule's distance, and stays at the global size beyond. Rules are combined with a Min field, so the smallest requested size wins where they overlap. The native field settings are read back and verified. | {"type":"array","maxItems":13,"items":{"type":"object","properties":{"boundary":{"type":"string","minLength":1,"maxLength":64,"required":true},"size":{"type":"number","minimum":0.001,"maximum":100000,"required":true},"distance":{"type":"number","minimum":0.001,"maximum":100000,"required":true}}}} |
[] |
volumeTolerance |
Largest allowed relative difference between the total tetrahedral volume and the CAD volume measured by OpenCASCADE: |Vmesh − Vcad| ≤ volumeTolerance × Vcad. Solids bounded only by planar faces, such as a box, are filled exactly by linear tetrahedra, so tiny values such as 1e-6 are appropriate; curved faces are approximated by flat triangles and the error shrinks as size decreases. A mesh outside the tolerance fails verification and is not published. | {"type":"number","minimum":1e-08,"maximum":0.02} |
0.01 |