Elements
Module: xfea.model.elements
BeamElement
Section titled “BeamElement”BeamElement(
nodes: list[ForwardRef(Node)],
section: Section1DBase,
orientation: Vector | list[float] | None = None,
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
**kwargs,
)
A straight beam between two nodes: it carries axial force, shear, bending and torsion.
Its stiffness comes from the deformation of its axis: stretching,
bending and twisting. The local frame is described in
Element1DBase.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The two end nodes, start then end. |
| section | Section1DBase |
A beam section (RectangularSection, ISection, …). |
| orientation | Vector or list[float], optional |
Direction of the local y axis, the axis of the section’s Ixx (default global Z, or Y for a beam along Z). |
| implementation, rigid, heat | str, bool, bool, optional | Solver element type, rigid, heat transfer. Defaults: the backend’s type (None), False, False. |
Guidance (elements)
- For slender members (length over depth above about 10).
orientationsets the local y axis, the axis the section’sIxxis about: with[0, 1, 0]on a beam along x, vertical loads bend it about y.
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
curveLineread-only
The element’s axis, a line from its first node to its last.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
Distance between the two nodes, in the model’s length unit.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in the order its type defines.
Setting them checks that they are all registered to the same part.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMeshread-only
The section’s shape swept from the start node to the end node, as a closed mesh (for drawing).
The shape’s local x axis lies along the element’s local y axis, and its plane is perpendicular to the element.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint
A point that stands for the element: the one set, or else the average of its nodes’ positions.
For a rigid element it is the control point that all its nodes are tied to.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionSection1DBase | Noneread-only
The cross-section assigned to the element, or None.
shapeForwardRef(Shape) | Noneread-only
The shape stored on the element (set when it is read from data), or None; the section has its own.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloat | Noneread-only
Section area times length, in the model’s units (mm³ for mm); None without a section.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
CompressionOnlyMembraneElement
Section titled “CompressionOnlyMembraneElement”CompressionOnlyMembraneElement(
nodes: list[ForwardRef(Node)],
section: ForwardRef(Section2DBase) | None = None,
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
frame: Frame | None = None,
**kwargs,
)
A membrane that carries in-plane compression only: it goes slack under tensile principal stress.
Built as MembraneElement, with a CompressionOnlyMembraneSection.
The 2D counterpart of StrutElement. The material law carries the
nonlinearity (no tension), not the element: the class is
a marker that backends read through _unilateral. Meant for plain
(unreinforced) concrete shear panels, one element per panel instead of
a truss of bars.
See Also
StrutElement : 1D compression-only counterpart.
Guidance (elements)
- The 2D counterpart of
StrutElement: a panel that carries only compressive principal stresses, for plain (unreinforced) concrete shear panels, one element per panel. Pair withCompressionOnlyMembraneSection.
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
edge_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each edge’s tag and the indices of its nodes ({"s1": (0, 1), ...}), or None.
edgeslist[Edge] | Noneread-only
The element’s edges, or None where its type builds none.
face_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each face’s tag and the indices of its nodes, or None.
faceslist[Face] | Noneread-only
The element’s faces, or None where its type builds none.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in order round it; setting them rebuilds its faces.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMesh | Noneread-only
The element as a Mesh of its faces (for drawing), or None without faces.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint | Noneread-only
Average of its faces’ centroids (the average of its nodes), or None without faces.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionSection2DBase | None
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloat | Noneread-only
Area of its first face times the section thickness, in the model’s units (mm³ for mm).
None without faces or a section.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
Edge(nodes: list[ForwardRef(Node)], tag: str, **kwargs)
An edge of an element: its nodes along one side, with a tag ("s1", "e1"…).
Elements build their edges; the element is set as the edge’s
registration after it is made.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The edge’s nodes, end to end. |
| tag | str | The edge’s tag in its element. |
Attributes
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The edge’s nodes. |
| tag | str | The edge’s tag. |
| element | ElementBase | None |
The element the edge belongs to. |
| part | PartBase | None |
That element’s part. |
| model | Model | None |
That element’s model. |
| centroid | Point |
Average of the edge’s node positions. |
| nodes_key | list[int] | Part keys of the edge’s nodes. |
| points | list[Point] |
Positions of the edge’s nodes. |
| line | Line |
Line from the edge’s first node to its second. |
Properties
centerPointread-only
Same as centroid (named like Part.center).
centroidPointread-only
Average of the edge’s node positions: its midpoint for a straight edge.
elementForwardRef(ElementBase) | Noneread-only
The element the edge belongs to, or None.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lineLine | Noneread-only
Line from the edge’s first node to its second.
modelModel | Noneread-only
The model of the edge’s element, or None.
namestr
The object’s name.
nodeslist[ForwardRef(Node)]read-only
The edge’s nodes, end to end.
nodes_keylistread-only
Part keys of the edge’s nodes.
outward_normalVectorread-only
Unit vector perpendicular to the edge, pointing away from its element’s centre.
It is the part of the vector from the element’s centre (the average of its nodes) to the edge’s midpoint that is perpendicular to the edge. For a flat 2D element it lies in the element’s plane: the edge’s outward normal. Use it to pick boundary edges by direction (edges whose normal points down: a fire-exposed underside).
partPartBase | Noneread-only
The part of the edge’s element, or None.
pointslist[ForwardRef(Point)]read-only
Positions of the edge’s nodes.
registrationAny | None
The object this one is registered to (a part, a model, a step, …), or None.
tagstrread-only
The edge’s tag in its element.
uidUUID | Noneread-only
The object’s unique id, a UUID.
Element0DBase
Section titled “Element0DBase”Element0DBase(
nodes: list[ForwardRef(Node)],
section=None,
frame: Frame | None = None,
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
**kwargs,
)
A point-like (0D) element, such as a spring or a link, oriented by a frame.
Abstract base class; do not instantiate directly.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The nodes the element joins. |
| section | SectionBase, optional |
The element’s section, such as a SpringSection. |
| frame | Frame, optional |
The frame its directions are taken in; None for the global axes. |
| implementation | str, optional | Solver element type. None: the backend’s default. |
| rigid, heat | bool, optional | Rigid, heat transfer. Default False. |
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in the order its type defines.
Setting them checks that they are all registered to the same part.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint
A point that stands for the element: the one set, or else the average of its nodes’ positions.
For a rigid element it is the control point that all its nodes are tied to.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionUnion[SectionBase, Section1DBase, Section2DBase, Section3DBase, None]
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloatread-only
The element’s volume in the model’s units (mm³ for mm); 0.0 where its type does not define one.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
Element1DBase
Section titled “Element1DBase”Element1DBase(
nodes: list[ForwardRef(Node)],
section: Section1DBase,
orientation: Vector | list[float] | None = None,
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
**kwargs,
)
A straight line element between two nodes, with a section: the base of beams and bars.
Abstract base class; do not instantiate directly.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The two end nodes, start then end; they must not coincide. |
| section | Section1DBase |
The cross-section. |
| orientation | Vector or list[float], optional |
Direction of the local y axis (the axis of the section’s Ixx), made perpendicular to the element. Defaults to global Z, or global Y for an element within about 8 degrees of Z. |
| implementation | str, optional | Solver element type. None: the backend’s default. |
| rigid | bool, optional | Make the element rigid (no deformation). Defaults to False. |
| heat | bool, optional | Make it a heat transfer element. Defaults to False. |
Attributes
| Name | Type | Description |
|---|---|---|
| frame | Frame |
The local frame, at the start node. |
| length | float | Distance between the two nodes. |
| volume | float | None | Section area times length. |
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
curveLineread-only
The element’s axis, a line from its first node to its last.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
Distance between the two nodes, in the model’s length unit.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in the order its type defines.
Setting them checks that they are all registered to the same part.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMeshread-only
The section’s shape swept from the start node to the end node, as a closed mesh (for drawing).
The shape’s local x axis lies along the element’s local y axis, and its plane is perpendicular to the element.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint
A point that stands for the element: the one set, or else the average of its nodes’ positions.
For a rigid element it is the control point that all its nodes are tied to.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionSection1DBase | Noneread-only
The cross-section assigned to the element, or None.
shapeForwardRef(Shape) | Noneread-only
The shape stored on the element (set when it is read from data), or None; the section has its own.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloat | Noneread-only
Section area times length, in the model’s units (mm³ for mm); None without a section.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
Methods
forces(step)→dict[ForwardRef(Node), ForwardRef(Vector)]
forces(step: StepBase) -> dict[ForwardRef(Node), ForwardRef(Vector)]
The force vector at each end of the element in a solved step.
Parameters
| Name | Type | Description |
|---|---|---|
| step | StepBase |
A solved step with a section_forces_field. |
Returns
| Name | Type | Description |
|---|---|---|
| dict[ | class:xfea.model.Node, Vector] |
The force at each end node. |
moments(step)→dict[ForwardRef(Node), ForwardRef(Vector)]
moments(step: StepBase) -> dict[ForwardRef(Node), ForwardRef(Vector)]
The moment vector at each end of the element in a solved step.
Parameters
| Name | Type | Description |
|---|---|---|
| step | StepBase |
A solved step with a section_forces_field. |
Returns
| Name | Type | Description |
|---|---|---|
| dict[ | class:xfea.model.Node, Vector] |
The moment at each end node. |
plot_section()
Draw the element’s section (with matplotlib), if it has one.
plot_stress_distribution(step, end='end_1', nx=100, ny=100, *args, **kwargs)
plot_stress_distribution(
step: StepBase,
end: str = 'end_1',
nx: int = 100,
ny: int = 100,
*args,
**kwargs,
)
Plot the axial stress over the section at one end of the element, from a step’s section forces.
Parameters
| Name | Type | Description |
|---|---|---|
| step | StepBase |
A solved step with a section_forces_field. |
| end | str, optional | Not passed on at present: the plot uses *args and **kwargs only. |
| nx, ny | int, optional | Not passed on at present, as end. |
| *args, **kwargs | Passed to plot_stress_distribution() (end: "end_1" or "end_2"; nx, ny: the plot’s resolution). |
section_forces_result(step)→SectionForcesResult
section_forces_result(step: StepBase) -> SectionForcesResult
The element’s section forces (forces and moments at both ends) in a solved step.
Parameters
| Name | Type | Description |
|---|---|---|
| step | StepBase |
A solved step with a section_forces_field. |
Returns
| Name | Type | Description |
|---|---|---|
class:xfea.results.results.SectionForcesResult |
The section forces at the element’s two ends. |
Element2DBase
Section titled “Element2DBase”Element2DBase(
nodes: list[ForwardRef(Node)],
section: ForwardRef(Section2DBase) | None = None,
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
frame: Frame | None = None,
**kwargs,
)
A surface element (shell, membrane, plane), its nodes in order round it: the base of 2D elements.
Abstract base class; do not instantiate directly.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The element’s nodes, in order round it. |
| section | Section2DBase, optional |
The section, with its thickness t. |
| implementation, rigid, heat | str, bool, bool, optional | Solver element type, rigid, heat transfer. Defaults: the backend’s type (None), False, False. |
| frame | Frame, optional |
Local frame, for the directions of an anisotropic material; None means the global frame. |
Attributes
| Name | Type | Description |
|---|---|---|
| faces | list[Face] | None |
The element’s faces, where its type builds them. |
| face_indices | dict[str, tuple[int, …]] | None | Each face’s tag and the indices of its nodes, {"SPOS": (0, 1, 2, 3), ...}. |
| edges | list[Edge] | None |
The element’s edges, where its type builds them. |
| edge_indices | dict[str, tuple[int, …]] | None | Each edge’s tag and the indices of its nodes, {"s1": (0, 1), ...}. |
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
edge_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each edge’s tag and the indices of its nodes ({"s1": (0, 1), ...}), or None.
edgeslist[Edge] | Noneread-only
The element’s edges, or None where its type builds none.
face_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each face’s tag and the indices of its nodes, or None.
faceslist[Face] | Noneread-only
The element’s faces, or None where its type builds none.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in order round it; setting them rebuilds its faces.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMesh | Noneread-only
The element as a Mesh of its faces (for drawing), or None without faces.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint | Noneread-only
Average of its faces’ centroids (the average of its nodes), or None without faces.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionSection2DBase | None
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloat | Noneread-only
Area of its first face times the section thickness, in the model’s units (mm³ for mm).
None without faces or a section.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
Methods
stress_results(step)→Result
stress_results(step: StepBase) -> Result
The element’s stress result in a solved step.
Parameters
| Name | Type | Description |
|---|---|---|
| step | StepBase |
A solved step with a stress_field. |
Returns
| Name | Type | Description |
|---|---|---|
class:xfea.results.Result |
The element’s stress result. |
Element3DBase
Section titled “Element3DBase”Element3DBase(
nodes: list[ForwardRef(Node)],
section: Section3DBase,
implementation: str | None = None,
frame: Frame | None = None,
rigid=False,
heat: bool = False,
**kwargs,
)
A solid (continuum) element, the base of tetrahedra and bricks.
For linear analyses and nonlinear ones with contact, plasticity or large deformations. Its faces and edges are built when first asked for.
Abstract base class; do not instantiate directly.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The element’s nodes, in the order its type defines. |
| section | SolidSection |
The solid section. |
| implementation | str, optional | Solver element type. None: the backend’s default. |
| frame | Frame, optional |
Ignored at present: the frame is set to world XY. |
| rigid, heat | bool, optional | Rigid element, heat transfer element (both False by default). |
Properties
areafloatread-only
The element’s surface area: its faces’ areas added up, in the model’s units (mm² for mm).
centerPointread-only
Same as centroid (named like Part.center).
centroidPointread-only
Average of all the element’s node positions (midside nodes included).
edgeslist[Edge] | Noneread-only
The element’s edges, built when first asked for.
face_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each face’s tag and the indices of its nodes ({"s1": (0, 1, 2), ...}).
faceslist[Face] | Noneread-only
The element’s faces, each with its normal out of the element; built when first asked for.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes; setting them drops the faces and edges built so far.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMesh | Noneread-only
The element’s surface as a Mesh (for drawing), or None without face indices.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPointread-only
The reference point set, or else centroid.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
results_clsdict[str, type]read-only
The result class for each field the element has: {"s": SolidStressResult}.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionUnion[SectionBase, Section1DBase, Section2DBase, Section3DBase, None]
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloatread-only
The element’s volume in the model’s units (mm³ for mm); 0.0 where its type does not define one.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
Methods
face(tag)→Face
face(tag: str) -> Face
One face by its tag ("s1"…), built once and kept: the same object faces lists.
Parameters
| Name | Type | Description |
|---|---|---|
| tag | str | The face’s tag, a key of face_indices. |
Returns
| Name | Type | Description |
|---|---|---|
class:Face |
The face, its normal out of the element. |
ElementBase
Section titled “ElementBase”ElementBase(
nodes: list[ForwardRef(Node)],
section: Union[SectionBase, Section1DBase, Section2DBase, Section3DBase, None],
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
frame: Frame | None = None,
**kwargs,
)
What every finite element has: its nodes, its section, and its solver element type.
Abstract base class; do not instantiate directly.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The element’s nodes, in the order its type defines; all registered to the same part (or none). |
| section | SectionBase or None |
The section, which carries the material. |
| implementation | str, optional | The solver’s element type ("C3D8I", for instance), if not the backend’s default (None). |
| rigid | bool, optional | Make the element rigid (no deformation). Defaults to False. |
| heat | bool, optional | Make it a heat transfer element. Defaults to False. |
| frame | Frame, optional |
Local frame; None means the global frame. |
Attributes
| Name | Type | Description |
|---|---|---|
| part_key | int | None, read-only | Key of the element in its part. |
| nodes | list[Node] |
Nodes to which the element is connected. |
| section | SectionBase | None |
The section. |
| material | MaterialBase | None, read-only |
The section’s material. |
| implementation | str | None, read-only | The solver’s element type. |
| part | Part | None, read-only |
The part the element is registered to. |
| model | Model | None, read-only |
The model of that part. |
| on_boundary | bool | None | True if the element has a face on the boundary of its part’s mesh; None until known. |
| length, area, volume | float, read-only | Size of the element in the model’s units; each element type defines those that apply. |
| mass | float | None, read-only | Volume times the material’s density. |
| rigid | bool, read-only | Whether the element is rigid. |
| heat | bool, read-only | Whether it is a heat transfer element. |
When an element is added to a part, its nodes are added and registered to that part too: this changes the registration of nodes registered elsewhere.
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in the order its type defines.
Setting them checks that they are all registered to the same part.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint
A point that stands for the element: the one set, or else the average of its nodes’ positions.
For a rigid element it is the control point that all its nodes are tied to.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionUnion[SectionBase, Section1DBase, Section2DBase, Section3DBase, None]
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloatread-only
The element’s volume in the model’s units (mm³ for mm); 0.0 where its type does not define one.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
Face(
nodes: list[ForwardRef(Node)],
tag: str,
element: ForwardRef(ElementBase) | None = None,
**kwargs,
)
A face of an element: its nodes round one side, with a tag ("s1", "SPOS"…), its plane and area.
The face’s normal is Newell’s (the best-fit plane’s, so a warped quad has one too), at the average of its nodes. On a solid element it points out of the element, whatever the nodes’ order; on a shell it follows the nodes’ order by the right-hand rule.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The face’s nodes, in order round it (at least 3). |
| tag | str | The face’s tag in its element. |
| element | ElementBase, optional |
The element the face belongs to: for a solid, it turns the normal outwards. |
Attributes
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The face’s nodes. |
| tag | str | The face’s tag. |
| element | ElementBase | None |
The element the face belongs to. |
| plane | Plane |
Plane through the average of the nodes, with the face’s unit normal. |
| normal | Vector |
The face’s unit normal. |
| polygon | Polygon |
Polygon through the face’s nodes. |
| area | float | Area of the face. |
Properties
areafloatread-only
Area of the face’s surface in the model’s units (mm² for mm), a warped quad’s included.
It integrates the face’s shape functions (linear triangle, bilinear
quad, or their quadratic forms), so it takes a face of 3, 4, 6 or 8
nodes and raises ValueError for others.
centerPointread-only
Same as centroid (named like Part.center).
centroidPointread-only
Average of the face’s node positions (the area centroid only for a triangle or a parallelogram).
elementForwardRef(ElementBase) | Noneread-only
The element the face belongs to, or None.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
meshMeshread-only
The face as a one-face Mesh.
modelModel | Noneread-only
The model of the face’s element, or None.
namestr
The object’s name.
node_areaIterator[tuple[ForwardRef(Node), float]]read-only
(node, area) pairs: each node’s consistent share of the face’s area.
A node’s share is its shape function integrated over the face
(face_shares()): what it carries of a
uniform load on the face, as xfea’s surface loads apply. The shares
sum to the face’s area. On a quadratic face the corners get nothing
(6-node triangles) or a negative share (8-node quads) and the
midsides the rest, which is right for a load but not an area to draw.
nodeslist[ForwardRef(Node)]read-only
The face’s nodes, in order round it.
nodes_keylistread-only
Part keys of the face’s nodes.
normalVectorread-only
The face’s unit normal: out of the element for a solid’s face.
partPartBase | Noneread-only
The part of the face’s element, or None.
planePlaneread-only
Plane through the average of the face’s nodes, with its unit normal.
pointslist[ForwardRef(Point)]read-only
Positions of the face’s nodes.
polygonPolygonread-only
Polygon through the face’s nodes.
registrationAny | None
The object this one is registered to (a part, a model, a step, …), or None.
tagstrread-only
The face’s tag in its element.
uidUUID | Noneread-only
The object’s unique id, a UUID.
HexahedronElement
Section titled “HexahedronElement”HexahedronElement(
nodes: list[ForwardRef(Node)],
section: Section3DBase,
implementation: str | None = None,
rigid=False,
heat: bool = False,
**kwargs,
)
A brick: a solid of 8 corner nodes, any hexahedron, not only a cuboid (C3D8).
Faces: s1 (0, 1, 2, 3), s2 (4, 5, 6, 7), s3 (0, 1, 5, 4),
s4 (1, 2, 6, 5), s5 (2, 3, 7, 6), s6 (3, 0, 4, 7), the node
sets of the solver’s faces S1 to S6; each face’s normal points out of the brick.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The 8 corners, in C3D8 order. Four going round one face, then the four opposite them in the same order. |
| section | SolidSection |
The solid section. |
| implementation, rigid, heat | str, bool, bool, optional | Solver element type ("C3D8I": incompatible modes), rigid, heat transfer. Defaults: the backend’s type (None), False, False. |
Guidance (solids)
- Nodes: four corners going round one face, then the four opposite corners in the same order.
- With few bricks through a thickness (a plate), use
implementation="C3D8I": plain bricks are far too stiff in bending.
Properties
areafloatread-only
The element’s surface area: its faces’ areas added up, in the model’s units (mm² for mm).
centerPointread-only
Same as centroid (named like Part.center).
centroidPointread-only
Average of all the element’s node positions (midside nodes included).
edgeslist[Edge] | Noneread-only
The element’s edges, built when first asked for.
face_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each face’s tag and the indices of its nodes ({"s1": (0, 1, 2), ...}).
faceslist[Face] | Noneread-only
The element’s faces, each with its normal out of the element; built when first asked for.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes; setting them drops the faces and edges built so far.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMesh | Noneread-only
The element’s surface as a Mesh (for drawing), or None without face indices.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPointread-only
The reference point set, or else centroid.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
results_clsdict[str, type]read-only
The result class for each field the element has: {"s": SolidStressResult}.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionUnion[SectionBase, Section1DBase, Section2DBase, Section3DBase, None]
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloatread-only
The brick’s volume: its Jacobian determinant integrated at 2 x 2 x 2 Gauss points.
Exact for any trilinear brick, warped faces included: the determinant is at most quadratic in each reference coordinate. Nodes in C3D8 order (bottom 0-3, top 4-7).
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
LinkElement
Section titled “LinkElement”LinkElement(
nodes: list[ForwardRef(Node)],
section: Section2DBase,
implementation: str | None = None,
rigid: bool = False,
**kwargs,
)
A link element between nodes of one part.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The nodes the link joins, all in one part. |
| section | SectionBase |
The link’s section. |
| implementation | str, optional | Solver element type. None: the backend’s default. |
| rigid | bool, optional | Make the link rigid. Defaults to False. |
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in the order its type defines.
Setting them checks that they are all registered to the same part.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint
A point that stands for the element: the one set, or else the average of its nodes’ positions.
For a rigid element it is the control point that all its nodes are tied to.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionUnion[SectionBase, Section1DBase, Section2DBase, Section3DBase, None]
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloatread-only
The element’s volume in the model’s units (mm³ for mm); 0.0 where its type does not define one.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
MembraneElement
Section titled “MembraneElement”MembraneElement(
nodes: list[ForwardRef(Node)],
section: ForwardRef(Section2DBase) | None = None,
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
frame: Frame | None = None,
**kwargs,
)
A membrane: a surface element that carries in-plane forces only, no bending.
For thin surfaces with no bending stiffness, such as a balloon’s rubber sheet, or a thin stiffening layer in a solid.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
Corner nodes, in order round the element. |
| section | MembraneSection |
The membrane section, with its thickness. |
| implementation, rigid, heat | str, bool, bool, optional | Solver element type, rigid, heat transfer. Defaults: the backend’s type (None), False, False. |
| frame | Frame, optional |
Local frame, for the directions of an anisotropic material. |
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
edge_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each edge’s tag and the indices of its nodes ({"s1": (0, 1), ...}), or None.
edgeslist[Edge] | Noneread-only
The element’s edges, or None where its type builds none.
face_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each face’s tag and the indices of its nodes, or None.
faceslist[Face] | Noneread-only
The element’s faces, or None where its type builds none.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in order round it; setting them rebuilds its faces.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMesh | Noneread-only
The element as a Mesh of its faces (for drawing), or None without faces.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint | Noneread-only
Average of its faces’ centroids (the average of its nodes), or None without faces.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionSection2DBase | None
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloat | Noneread-only
Area of its first face times the section thickness, in the model’s units (mm³ for mm).
None without faces or a section.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
PlaneHeatTransferElement
Section titled “PlaneHeatTransferElement”PlaneHeatTransferElement(
nodes: list[ForwardRef(Node)],
section: Section2DBase,
implementation: str | None = None,
**kwargs,
)
A plane heat transfer element: temperature only, no gradient out of its plane.
Pair it with PlaneHeatTransferSection. Backends map
it to DC2D{n} or DCPS{n}, by solver. It has one face,
"S", and an edge "s1", "s2"… from each node to the next:
surface fluxes (convection, radiation) go on its edges, not its face.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The element’s nodes, in order round it. |
| section | PlaneHeatTransferSection |
The section, with its thickness. |
| implementation | str, optional | Solver element type. None: the backend’s default. |
| **kwargs | Passed on; heat is ignored (always True). |
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
edge_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each edge’s tag and the indices of its nodes ({"s1": (0, 1), ...}), or None.
edgeslist[Edge] | Noneread-only
The element’s edges, or None where its type builds none.
face_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each face’s tag and the indices of its nodes, or None.
faceslist[Face] | Noneread-only
The element’s faces, or None where its type builds none.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in order round it; setting them rebuilds its faces.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMesh | Noneread-only
The element as a Mesh of its faces (for drawing), or None without faces.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint | Noneread-only
Average of its faces’ centroids (the average of its nodes), or None without faces.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionSection2DBase | None
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloat | Noneread-only
Area of its first face times the section thickness, in the model’s units (mm³ for mm).
None without faces or a section.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
ShellElement
Section titled “ShellElement”ShellElement(
nodes: list[ForwardRef(Node)],
section: Section2DBase,
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
**kwargs,
)
A shell: a surface element that carries in-plane forces, bending and transverse shear.
For structures whose thickness is much smaller than their other
dimensions. It has two faces, "SPOS" (its normal by the right-hand
rule round the nodes) and "SNEG" (the opposite), and an edge
"s1", "s2"… from each node to the next.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
Corner nodes, in order round the element. |
| section | ShellSection |
The shell section, with its thickness. |
| implementation, rigid, heat | str, bool, bool, optional | Solver element type, rigid, heat transfer. Defaults: the backend’s type (None), False, False. |
Guidance (elements)
- For plates and thin walls: thickness well below the span.
Properties
areafloatread-only
Area of the shell’s midsurface, in the model’s units (mm² for mm).
edge_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each edge’s tag and the indices of its nodes ({"s1": (0, 1), ...}), or None.
edgeslist[Edge] | Noneread-only
The element’s edges, or None where its type builds none.
face_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each face’s tag and the indices of its nodes, or None.
faceslist[Face] | Noneread-only
The element’s faces, or None where its type builds none.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in order round it; setting them rebuilds its faces.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMesh | Noneread-only
The element as a Mesh of its faces (for drawing), or None without faces.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint | Noneread-only
Average of its faces’ centroids (the average of its nodes), or None without faces.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
results_clsdict[str, type]read-only
The result class for each field the element has: {"s": ShellStressResult}.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionSection2DBase | None
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloat | Noneread-only
Area of its first face times the section thickness, in the model’s units (mm³ for mm).
None without faces or a section.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
SpringElement
Section titled “SpringElement”SpringElement(
nodes: list[ForwardRef(Node)],
section: SpringSection,
implementation: str | None = None,
**kwargs,
)
A spring element between nodes of one part, with the stiffnesses of a SpringSection.
For springs in a model, use Model.add_spring_links (springs between
nodes) or Model.add_spring_supports (springs to the ground).
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The nodes the spring joins, all in one part. |
| section | SpringSection |
The spring’s axial, lateral and rotational stiffnesses. |
| implementation | str, optional | Solver element type. None: the backend’s default. |
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in the order its type defines.
Setting them checks that they are all registered to the same part.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint
A point that stands for the element: the one set, or else the average of its nodes’ positions.
For a rigid element it is the control point that all its nodes are tied to.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionUnion[SectionBase, Section1DBase, Section2DBase, Section3DBase, None]
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloatread-only
The element’s volume in the model’s units (mm³ for mm); 0.0 where its type does not define one.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
StrutElement
Section titled “StrutElement”StrutElement(
nodes: list[ForwardRef(Node)],
section: Section1DBase,
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
orientation=None,
**kwargs,
)
A bar that carries axial compression only: it goes slack in tension.
Built as TrussElement, with a StrutSection. Backends read
the class attribute _unilateral: "nt" gives the material no
tensile stiffness.
See Also
CompressionOnlyMembraneElement : The 2D counterpart, a panel that carries only compressive principal stresses.
Guidance (elements)
- For members that carry only compression: masonry, props, bracing that would buckle in tension.
Pair with
StrutSection. A one-sided member: the step becomes nonlinear (see springs).
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
curveLineread-only
The element’s axis, a line from its first node to its last.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
Distance between the two nodes, in the model’s length unit.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in the order its type defines.
Setting them checks that they are all registered to the same part.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMeshread-only
The section’s shape swept from the start node to the end node, as a closed mesh (for drawing).
The shape’s local x axis lies along the element’s local y axis, and its plane is perpendicular to the element.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint
A point that stands for the element: the one set, or else the average of its nodes’ positions.
For a rigid element it is the control point that all its nodes are tied to.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionSection1DBase | Noneread-only
The cross-section assigned to the element, or None.
shapeForwardRef(Shape) | Noneread-only
The shape stored on the element (set when it is read from data), or None; the section has its own.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloat | Noneread-only
Section area times length, in the model’s units (mm³ for mm); None without a section.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
TetrahedronElement
Section titled “TetrahedronElement”TetrahedronElement(
nodes: list[ForwardRef(Node)],
section: Section3DBase,
implementation: str | None = None,
frame: Frame | None = None,
**kwargs,
)
A tetrahedral solid of 4 nodes (linear, C3D4) or 10 (quadratic, C3D10).
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The 4 corners, then for 10 nodes the 6 edge midsides. The edges in order: 0-1, 1-2, 2-0, 0-3, 1-3, 2-3. |
| section | SolidSection |
The solid section. |
| implementation | str, optional | Solver element type. None: the backend’s default. |
| frame | Frame, optional |
Ignored at present. The material frame is world XY until set_material_orientation() sets one. |
Attributes
| Name | Type | Description |
|---|---|---|
| is_quadratic | bool | True for a 10-node tetrahedron. |
| corner_nodes | list[Node] |
The first 4 nodes. |
| midside_nodes | dict[str, Node] | None |
Each edge’s tag ("e1"…) and its midside node, for 10 nodes; None for 4. |
| material_frame | Frame |
The frame of the directions of an anisotropic material. |
Guidance (solids)
- Use quadratic tetrahedra (10 nodes;
element_order=2when meshing): linear ones are far too stiff in bending.
Properties
areafloatread-only
The element’s surface area: its faces’ areas added up, in the model’s units (mm² for mm).
centerPointread-only
Same as centroid (named like Part.center).
centroidPointread-only
Average of all the element’s node positions (midside nodes included).
corner_nodeslist[ForwardRef(Node)]read-only
The tetrahedron’s 4 corner nodes (its first 4).
edgeslist[Edge] | Noneread-only
The element’s edges, built when first asked for.
face_indicesdict[str, tuple[int, Ellipsis]] | Noneread-only
Each face’s tag and the indices of its nodes ({"s1": (0, 1, 2), ...}).
faceslist[Face] | Noneread-only
The element’s faces, each with its normal out of the element; built when first asked for.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
is_quadraticboolread-only
True for a quadratic tetrahedron (10 nodes, C3D10), False for a linear one (4 nodes, C3D4).
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
The element’s length in the model’s length unit; 0.0 where its type does not define one.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
material_frameFrameread-only
The frame of the directions of an anisotropic material: the element’s frame.
midside_nodesdict[str, ForwardRef(Node)] | Noneread-only
Each edge’s tag ("e1"…) and its midside node, for a 10-node tetrahedron; None for a 4-node one.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes; setting them drops the faces and edges built so far.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMesh | Noneread-only
The element’s surface as a Mesh (for drawing), or None without face indices.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPointread-only
The reference point set, or else centroid.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
results_clsdict[str, type]read-only
The result class for each field the element has: {"s": SolidStressResult}.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionUnion[SectionBase, Section1DBase, Section2DBase, Section3DBase, None]
The section assigned to the element, or None.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloatread-only
The tetrahedron’s volume, from its corners, in the model’s units (mm³ for mm).
A sixth of the absolute triple product of three edges. Exact for 10 nodes too: their midside nodes must sit at the edges’ midpoints.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
Methods
set_material_orientation(primary, secondary=None, origin=None, enforce=True)→Frame
set_material_orientation(
primary: Vector | tuple[float, float, float] | list[float],
secondary: Vector | tuple[float, float, float] | list[float] | None = None,
origin: Point | None = None,
enforce: bool = True,
) -> Frame
Set the element’s material frame from a primary direction and a helper, like *ORIENTATION.
The frame’s x axis is primary; its y axis is secondary with
its component along x removed; z = x × y.
Parameters
| Name | Type | Description |
|---|---|---|
| primary | Vector or sequence of 3 floats |
The material’s 1-direction, not zero. |
| secondary | Vector or sequence of 3 floats, optional |
A direction towards the material’s 2-direction, not necessarily perpendicular to primary. None, or one (nearly) parallel to primary, takes a global axis instead. |
| origin | Point, optional |
The frame’s origin; None takes the average of the 4 corner nodes. |
| enforce | bool, optional | True (the default) raises on a degenerate input. False returns the default geometric frame instead, without setting it. |
Returns
| Name | Type | Description |
|---|---|---|
class:xfea.geometry.Frame |
The frame set. |
TieElement
Section titled “TieElement”TieElement(
nodes: list[ForwardRef(Node)],
section: Section1DBase,
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
orientation=None,
**kwargs,
)
A bar that carries axial tension only: it goes slack in compression.
Built as TrussElement, with a TieSection. Backends read
the class attribute _unilateral: "nc" gives the material no
compressive stiffness.
Guidance (elements)
- For members that carry only tension: cables, hangers, bolts as bars. Pair with
TieSection. A one-sided member: the step becomes nonlinear (see springs).
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
curveLineread-only
The element’s axis, a line from its first node to its last.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
Distance between the two nodes, in the model’s length unit.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in the order its type defines.
Setting them checks that they are all registered to the same part.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMeshread-only
The section’s shape swept from the start node to the end node, as a closed mesh (for drawing).
The shape’s local x axis lies along the element’s local y axis, and its plane is perpendicular to the element.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint
A point that stands for the element: the one set, or else the average of its nodes’ positions.
For a rigid element it is the control point that all its nodes are tied to.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionSection1DBase | Noneread-only
The cross-section assigned to the element, or None.
shapeForwardRef(Shape) | Noneread-only
The shape stored on the element (set when it is read from data), or None; the section has its own.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloat | Noneread-only
Section area times length, in the model’s units (mm³ for mm); None without a section.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
TrussElement
Section titled “TrussElement”TrussElement(
nodes: list[ForwardRef(Node)],
section: Section1DBase,
implementation: str | None = None,
rigid: bool = False,
heat: bool = False,
orientation=None,
**kwargs,
)
A straight bar between two nodes: it carries axial force only, no bending.
Parameters
| Name | Type | Description |
|---|---|---|
| nodes | list[Node] |
The two end nodes. |
| section | Section1DBase |
A section with an area, such as TrussSection. |
| implementation, rigid, heat | str, bool, bool, optional | Solver element type, rigid, heat transfer. Defaults: the backend’s type (None), False, False. |
| orientation | optional | Ignored: a bar has no bending axes. |
Properties
areafloatread-only
The element’s area in the model’s units (mm² for mm); 0.0 where its type does not define one.
curveLineread-only
The element’s axis, a line from its first node to its last.
frameFrame
The object’s local frame, or the global frame if it has none; set it to None to remove it.
gfloatread-only
The gravitational acceleration of the element’s model.
has_local_frameboolread-only
Whether the object has a local frame of its own.
heatboolread-only
Whether the element is a heat transfer element.
implementationstr | Noneread-only
The solver’s element type ("C3D8I", for instance), or None for the backend’s default.
keyAny | Noneread-only
The object’s key (its number) in what it is registered to; None until it is given one.
lengthfloatread-only
Distance between the two nodes, in the model’s length unit.
massfloat | Noneread-only
The element’s mass: its volume times its material’s density (t for t/mm³ and mm).
None without a section, a material, a volume or a density. A
material with density = 0 gives 0.0, not None: “no mass” is
not “not known”, and GravityLoadField relies on that to keep one
load per element of its distribution.
materialUnion[None, MaterialBase]read-only
The material of the element’s section, or None without a section.
modelModel | Noneread-only
The model of the element’s part, or None.
namestr
The object’s name.
ndimintread-only
The element’s dimension: 0 (springs), 1 (beams, bars), 2 (shells, membranes) or 3 (solids).
nodal_masslist[float] | Noneread-only
The element’s mass shared equally between its nodes, one value per node; None if the mass is None or zero.
nodeslist[ForwardRef(Node)]
The element’s nodes, in the order its type defines.
Setting them checks that they are all registered to the same part.
nodes_inputkeystrread-only
The keys of the element’s nodes, sorted and joined by - ("1-2-5").
nodes_partkeylist[int]read-only
The part keys of the element’s nodes, in order.
on_boundarybool | None
True if the element has a face on the boundary of its part’s mesh, False if not, None until known.
outermeshMeshread-only
The section’s shape swept from the start node to the end node, as a closed mesh (for drawing).
The shape’s local x axis lies along the element’s local y axis, and its plane is perpendicular to the element.
partPartBase | Noneread-only
The part the element is registered to, or None.
part_keyint | Noneread-only
The element’s key in its part (from 0), or None before it is added to one.
pointslist[ForwardRef(Point)]read-only
The points of the element’s nodes, in order.
reference_pointPoint
A point that stands for the element: the one set, or else the average of its nodes’ positions.
For a rigid element it is the control point that all its nodes are tied to.
registrationForwardRef(PartBase) | ForwardRef(Part) | ForwardRef(RigidPart) | None
The part the element is registered to.
Setting it registers the element’s nodes to the same part; it raises
ValueError if a node is registered to another part.
rigidboolread-only
Whether the element is rigid (no deformation).
sectionSection1DBase | Noneread-only
The cross-section assigned to the element, or None.
shapeForwardRef(Shape) | Noneread-only
The shape stored on the element (set when it is read from data), or None; the section has its own.
uidUUID | Noneread-only
The object’s unique id, a UUID.
volumefloat | Noneread-only
Section area times length, in the model’s units (mm³ for mm); None without a section.
weightfloatread-only
The element’s weight: its mass times the model’s gravitational acceleration.
© 2026 Francesco Ranaudo · Text and pictures CC BY 4.0 · Code Elastic License 2.0 · how to reuse them