Skip to content

Mesh

_FEMeshMixin

_elementConnectivity(dimension, elTag=-1) staticmethod

Return a connectivity dictionary for mesh elements of a given dimension.

Parameters:

Name Type Description Default
dimension Dim

Spatial dimension of the elements to query (0D, 1D, 2D, or 3D).

required
elTag myInt64

GMSH entity tag to restrict the query to. -1 queries all entities of the given dimension.

-1

Returns:

Type Description
Dict[Any, Tuple[Any, ...]]

A dict mapping each mesh element tag to a tuple of its node tags.

Dict[Any, Tuple[Any, ...]]

For example, a line element returns (node_i, node_j) and a

Tuple[Dict[Any, Tuple[Any, ...]], Dict[Any, Tuple[Any, ...]]]

triangle returns (node_i, node_j, node_k).

_elementsNodeTags(dimension) staticmethod

Return node tags for every mesh element of a given dimension.

Parameters:

Name Type Description Default
dimension Dim

Spatial dimension of the elements to query.

required

Returns:

Type Description
List[List[myInt64]]

A list of lists, where each inner list contains the node tags of

List[List[myInt64]]

one mesh element (ordered as returned by GMSH).

clear() staticmethod

Clear all GMSH data and finalise the GMSH session.

Calls gmsh.clear() to remove all models and then gmsh.finalize() to shut down the library. The :class:FEModel instance should not be used after this call.

elementsTags(dimension) staticmethod

Return a flat list of all mesh element tags for a given dimension.

Parameters:

Name Type Description Default
dimension Dim

Spatial dimension of the elements to query (e.g. Dim.DIM_1D for frames, Dim.DIM_2D for plates).

required

Returns:

Type Description
List[myInt64]

A flat list of mesh element tags across all entities of the

List[myInt64]

requested dimension.

framesConnectivity(frameTag=-1) staticmethod

Return connectivity for 1D (frame/beam) mesh elements.

Parameters:

Name Type Description Default
frameTag myInt64

GMSH entity tag to restrict the query to. -1 queries all 1D entities.

-1

Returns:

Type Description
Dict[Any, Tuple[Any, ...]]

A dict mapping each frame mesh element tag to a 2-tuple of its

Dict[Any, Tuple[Any, ...]]

node tags (node_i, node_j).

framesGroups() staticmethod

Return the physical groups associated with each 1D (line) entity.

Returns:

Type Description

A dict mapping each line entity tag to the list of physical group

tags it belongs to.

framesNodeTags() staticmethod

Return node tags for every 1D (frame/beam) mesh element.

Returns:

Type Description
List[List[myInt64]]

A list of 2-element lists [node_i, node_j], one per frame

List[List[myInt64]]

element, in the same order as :meth:framesTags.

framesTags() staticmethod

Return a flat list of all 1D (frame/beam) mesh element tags.

Returns:

Type Description
List[myInt64]

A flat list of mesh element tags for every frame element in the model.

getElementsFromMacroTags(dimension, macroTags=None) staticmethod

Resolve macro-element tags to their underlying mesh element tags.

A macro element is a geometric object (a GMSH entity) that typically corresponds to one or more mesh elements after meshing.

Parameters:

Name Type Description Default
dimension Dim

Spatial dimension of the elements to query.

required
macroTags List[myInt64] | None

If None or empty, return the full mapping dict {macro_tag: [mesh_tag, ...]}. If a non-empty list of macro-element tags, return a flat list of all their mesh tags.

None

Returns:

Type Description
Dict[myInt64, List[myInt64]] | List[myInt64]
  • Full dict {macro_tag: [mesh_tag, ...]} when macroTags is empty.
Dict[myInt64, List[myInt64]] | List[myInt64]
  • Flat list of mesh element tags for the specified macro-elements.

Raises:

Type Description
EXAExceptions

If macroTags is not a list.

getFrameNodesFromMacro(macroTags=None, unique=False) staticmethod

Return node-tag pairs for all mesh frames belonging to macro-elements.

A macro element is a geometric object (a GMSH entity) that typically corresponds to one or more underlying mesh entities after meshing.

Parameters:

Name Type Description Default
macroTags List[myInt64] | List[List[myInt64]] | None

Controls which macro-elements to query.

  • None or empty list — return the full connectivity dict {macro_tag: [(n1, n2), ...]}.
  • A flat List[myInt64] — return a flat list of (node_i, node_j) pairs for those macro-elements.
  • A List[List[myInt64]] — lists are merged into a single flat list before querying.
None
unique bool

When macroTags is provided, if True return a flat deduplicated list of individual node tags instead of pairs. Default is False.

False

Returns:

Type Description
Dict[myInt64, List[Tuple[myInt64, myInt64]]] | List[Tuple[myInt64, myInt64]] | List[myInt64]
  • Full dict {macro_tag: [(n1, n2), ...]} when no macroTags are given.
Dict[myInt64, List[Tuple[myInt64, myInt64]]] | List[Tuple[myInt64, myInt64]] | List[myInt64]
  • List of (node_i, node_j) tuples when macroTags are given and unique is False.
Dict[myInt64, List[Tuple[myInt64, myInt64]]] | List[Tuple[myInt64, myInt64]] | List[myInt64]
  • Flat list of unique node tags when macroTags are given and unique is True.

getFramesByPhysicalGroup(tagGroup) staticmethod

Return the entity tags of 1D entities belonging to a physical group by tag.

Parameters:

Name Type Description Default
tagGroup int

Physical group tag to search for.

required

Returns:

Type Description
List[int]

List of 1D entity (curve) tags in the matching group,

List[int]

or an empty list if the tag is not found.

getFramesFromMacroTags(macroTags=None) staticmethod

Retrieve mesh frame element tags from macro-element tags.

A macro element is a geometric object (a GMSH entity) that typically corresponds to one or more mesh elements after meshing.

Parameters:

Name Type Description Default
macroTags List[myInt64] | None

If None or empty, return a dict mapping every 1D macro-element tag to its list of mesh frame tags. If a non-empty list, return a flat list of mesh frame tags for those macro-elements only.

None

Returns:

Type Description
Dict[myInt64, List[myInt64]] | List[myInt64]
  • Full dict {macro_tag: [mesh_tag, ...]} when macroTags is empty.
Dict[myInt64, List[myInt64]] | List[myInt64]
  • Flat list of mesh frame tags for the specified macro-elements.

getFramesPhysicalName() staticmethod

Return the names of all physical groups defined on 1D (curve) entities.

Returns:

Type Description
List[str]

A list of physical group name strings for all 1D groups,

List[str]

preserving duplicates if multiple groups share the same name.

getMacroFramesByPhysicalName(name) staticmethod

Return macro-element (curve entity) tags belonging to a named physical group.

A macro element is a geometric object (a GMSH entity) that typically corresponds to one or more mesh elements after meshing.

Parameters:

Name Type Description Default
name str

Physical group name to search for.

required

Returns:

Type Description
List[myInt64]

List of 1D entity (curve) tags in the matching group,

List[myInt64]

or an empty list if the name is not found.

getNodesByPhysicalGroup(tagGroup) staticmethod

Return the entity tags of 0D entities belonging to a physical group by tag.

Parameters:

Name Type Description Default
tagGroup int

Physical group tag to search for.

required

Returns:

Type Description
List[int]

List of 0D entity (point) tags in the matching group,

List[int]

or an empty list if the tag is not found.

getNodesByPhysicalName(name) staticmethod

Return the entity tags of 0D entities belonging to a named physical group.

Parameters:

Name Type Description Default
name str

Physical group name to search for.

required

Returns:

Type Description
List[int]

List of 0D entity (point) tags in the matching group,

List[int]

or an empty list if the name is not found.

getNodesFromMacroTags(macroTags=None) staticmethod

Retrieve mesh frame element tags from macro-element tags.

A macro element is a geometric object (a GMSH entity) that typically corresponds to one or more mesh elements after meshing.

Parameters:

Name Type Description Default
macroTags List[myInt64] | None

If None or empty, return a dict mapping every 1D macro-element tag to its list of mesh frame tags. If a non-empty list, return a flat list of mesh frame tags for those macro-elements only.

None

Returns:

Type Description
Dict[myInt64, List[myInt64]] | List[myInt64]
  • Full dict {macro_tag: [mesh_tag, ...]} when macroTags is empty.
Dict[myInt64, List[myInt64]] | List[myInt64]
  • Flat list of mesh frame tags for the specified macro-elements.

getNodesPhysicalName() staticmethod

Return the names of all physical groups defined on 0D (point) entities.

Returns:

Type Description
List[str]

A list of physical group name strings for all 0D groups,

List[str]

preserving duplicates if multiple groups share the same name.

getPhisicalNames() staticmethod

Get unique physical names defined. If many groups exist with same name returns unique values

Returns:

Type Description
List[str]

List of unique group names

getPlatesFromMacroTags(macroTags=None) staticmethod

Retrieve mesh plate element tags from macro-element tags.

A macro element is a geometric object (a GMSH entity) that typically corresponds to one or more mesh elements after meshing.

Parameters:

Name Type Description Default
macroTags List[myInt64] | None

If None or empty, return a dict mapping every 2D macro-element tag to its list of mesh plate tags. If a non-empty list, return a flat list of mesh plate tags for those macro-elements only.

None

Returns:

Type Description
Dict[myInt64, List[myInt64]] | List[myInt64]
  • Full dict {macro_tag: [mesh_tag, ...]} when macroTags is empty.
Dict[myInt64, List[myInt64]] | List[myInt64]
  • Flat list of mesh plate tags for the specified macro-elements.

nodeCoords(nodeTags) staticmethod

Return the (x, y, z) coordinates of a single mesh node.

Parameters:

Name Type Description Default
nodeTags myInt64

Tag of the mesh node to query.

required

Returns:

Type Description
Tuple[float, float, float]

A 3-tuple (x, y, z) with the node coordinates.

nodesCoords() staticmethod

Return the coordinates of all mesh nodes in the model.

Returns:

Type Description
List[List[float]]

A list of [x, y, z] coordinate lists, one per mesh node,

List[List[float]]

across all entities and dimensions.

nodesGroups() staticmethod

Return the physical groups associated with each 0D (point) entity.

Returns:

Type Description
Dict[Any, List[int]]

A dict mapping each point entity tag to the list of physical group

Dict[Any, List[int]]

tags it belongs to.

nodesTags() staticmethod

Return a flat list of all mesh node tags in the model.

Returns:

Type Description
List[myInt64]

A flat list of node tags across all entities and dimensions.

platesConnectivity(plateTag=-1) staticmethod

Return connectivity for 2D (plate/shell) mesh elements.

Parameters:

Name Type Description Default
plateTag myInt64

GMSH entity tag to restrict the query to. -1 queries all 2D entities.

-1

Returns:

Type Description
Dict[Any, Tuple[Any, ...]]

A dict mapping each plate mesh element tag to a tuple of its node

Dict[Any, Tuple[Any, ...]]

tags (3 values for triangles, 4 for quads).

platesNodeTags() staticmethod

Return node tags for every 2D (plate/shell) mesh element.

Returns:

Type Description
List[List[myInt64]]

A list of 3- or 4-element lists of node tags, one per plate

List[List[myInt64]]

element, in the same order as :meth:platesTags.

platesTags() staticmethod

Return a flat list of all 2D (plate/shell) mesh element tags.

Returns:

Type Description
List[myInt64]

A flat list of mesh element tags for every plate element in the model.

printElements() staticmethod

Print all mesh element types, tags, node tags, and physical groups to stdout.

Iterates over every entity in the model (all dimensions) and prints element types, element tags, node tags per element, and the physical groups they belong to. Intended for debugging purposes.

printFrames() staticmethod

Print all 1D mesh element types, tags, node tags, and physical groups to stdout.

Iterates over every 1D entity in the model and prints element types, element tags, node tags per element, and the physical groups they belong to. Intended for debugging purposes.

printNodes() staticmethod

Print all mesh node tags, coordinates, and physical groups to stdout.

Iterates over every entity in the model and prints the node tags, their coordinates, and the physical groups they belong to. Intended for debugging purposes.

show() staticmethod

Open the GMSH FLTK graphical interface to visualise the current model.