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 |
Tuple[Dict[Any, Tuple[Any, ...]], Dict[Any, Tuple[Any, ...]]]
|
triangle returns |
_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. |
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 |
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 |
List[List[myInt64]]
|
element, in the same order as :meth: |
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
|
Returns:
| Type | Description |
|---|---|
Dict[myInt64, List[myInt64]] | List[myInt64]
|
|
Dict[myInt64, List[myInt64]] | List[myInt64]
|
|
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
|
unique
|
bool
|
When macroTags is provided, if |
False
|
Returns:
| Type | Description |
|---|---|
Dict[myInt64, List[Tuple[myInt64, myInt64]]] | List[Tuple[myInt64, myInt64]] | List[myInt64]
|
|
Dict[myInt64, List[Tuple[myInt64, myInt64]]] | List[Tuple[myInt64, myInt64]] | List[myInt64]
|
|
Dict[myInt64, List[Tuple[myInt64, myInt64]]] | List[Tuple[myInt64, myInt64]] | List[myInt64]
|
|
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
|
Returns:
| Type | Description |
|---|---|
Dict[myInt64, List[myInt64]] | List[myInt64]
|
|
Dict[myInt64, List[myInt64]] | List[myInt64]
|
|
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
|
Returns:
| Type | Description |
|---|---|
Dict[myInt64, List[myInt64]] | List[myInt64]
|
|
Dict[myInt64, List[myInt64]] | List[myInt64]
|
|
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
|
Returns:
| Type | Description |
|---|---|
Dict[myInt64, List[myInt64]] | List[myInt64]
|
|
Dict[myInt64, List[myInt64]] | List[myInt64]
|
|
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 |
nodesCoords()
staticmethod
Return the coordinates of all mesh nodes in the model.
Returns:
| Type | Description |
|---|---|
List[List[float]]
|
A list of |
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()
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.