Skip to content

Loads

Module: xfea.problem.loads

LoadBase(amplitude=None, **kwargs)

A load value at one place, with an optional amplitude: what a load field applies at each of its nodes or elements.

Abstract: use ScalarLoad or VectorLoad. Loads are usually made for you by a step’s add_* methods.

Parameters

Name Type Description
amplitude Amplitude, optional How the load varies through the step: None applies it as given.
name str, optional A name for the input file; one is generated if not given.

Attributes

Name Type Description
field LoadFieldBase The load field the load belongs to.
step, problem, model The step, problem and model the field belongs to.
Properties
amplituderead-only

The load’s amplitude, or None.

fieldread-only

The load field the load 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.

modelread-only

The model of the load’s problem.

namestr

The object’s name.

problemread-only

The problem of the load’s step.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

stepread-only

The step of the load’s field; raises ValueError if the load is in no field.

uidUUID | Noneread-only

The object’s unique id, a UUID.

ScalarLoad(scalar_load, amplitude=None, **kwargs)

A load given by one number, such as a temperature, with an optional amplitude.

Its unit is that of the quantity it stands for, in the model’s units. +, - and * with numbers or other scalar loads make new loads; two loads with different amplitudes cannot be added.

Parameters

Name Type Description
scalar_load int or float The value.
amplitude Amplitude, optional How the value varies through the step: None applies it as given.
Properties
amplituderead-only

The load’s amplitude, or None.

fieldread-only

The load field the load 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.

modelread-only

The model of the load’s problem.

namestr

The object’s name.

problemread-only

The problem of the load’s step.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

scalar_loadread-only

The value.

stepread-only

The step of the load’s field; raises ValueError if the load is in no field.

uidUUID | Noneread-only

The object’s unique id, a UUID.

VectorLoad(x=None, y=None, z=None, xx=None, yy=None, zz=None, frame=None, **kwargs)

A force and a moment at a node: three force components and three moment components, each optional.

Forces are in the model’s force unit (N for N and mm), moments in force times length (N mm). A positive component acts along the positive axis; a positive moment turns about it by the right-hand rule. A component left None is not loaded.

Parameters

Name Type Description
x, y, z float, optional The force components along the frame’s axes (the global X, Y, Z without a frame).
xx, yy, zz float, optional The moment components about the frame’s axes (the global axes without a frame).
frame Frame, optional A local frame the components are given in: None gives them in global axes.
amplitude Amplitude, optional How the load varies through the step: None applies it as given.
Properties
Xread-only

The force along the global X axis: None if no force component is given.

XXread-only

The moment about the global X axis: None if no moment component is given.

Yread-only

The force along the global Y axis: None if no force component is given.

YYread-only

The moment about the global Y axis: None if no moment component is given.

Zread-only

The force along the global Z axis: None if no force component is given.

ZZread-only

The moment about the global Z axis: None if no moment component is given.

amplituderead-only

The load’s amplitude, or None.

components

The components as given, in the load’s frame: {"x": ..., "zz": ...}, None where not loaded.

fieldread-only

The load field the load belongs to, or None.

force_magnitudefloat | Noneread-only

The force’s magnitude, in the model’s force unit: None if no force component is given.

force_vectorVector | Noneread-only

The force in global axes, a Vector: None if no force component is given.

frameFrame

The object’s local frame, or the global frame if it has none; set it to None to remove it.

global_componentsread-only

The components in global axes: {"X": ..., "ZZ": ...}, None where a whole triplet is not loaded.

has_local_frameboolread-only

Whether the object has a local frame of its own.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

magnituderead-only

Both magnitudes: {"force": force_magnitude, "moment": moment_magnitude}.

modelread-only

The model of the load’s problem.

moment_magnitudefloat | Noneread-only

The moment’s magnitude, in force times length: None if no moment component is given.

moment_vectorVector | Noneread-only

The moment in global axes, a Vector: None if no moment component is given.

namestr

The object’s name.

problemread-only

The problem of the load’s step.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

stepread-only

The step of the load’s field; raises ValueError if the load is in no field.

uidUUID | Noneread-only

The object’s unique id, a UUID.

x

The force along the frame’s x axis (global X without a frame), or None.

xx

The moment about the frame’s x axis (global X without a frame), or None.

y

The force along the frame’s y axis (global Y without a frame), or None.

yy

The moment about the frame’s y axis (global Y without a frame), or None.

z

The force along the frame’s z axis (global Z without a frame), or None.

zz

The moment about the frame’s z axis (global Z without a frame), or None.

Module: xfea.problem.fields

DisplacementField(
    displacements: Iterable[ForwardRef(GeneralDisplacement)],
    distribution: Iterable[ForwardRef(Node)],
    load_case=None,
    combination_rank: int = 1,
    **kwargs,
)

Prescribed displacements at nodes, such as a support settlement: one per node.

In a LoadFieldsCombination a displacement field without a load case, or with one the combination does not name, is applied unscaled.

Parameters

Name Type Description
displacements GeneralDisplacement | list[GeneralDisplacement] The displacements, one per node, or one for all of them.
distribution list[Node] | NodesGroup The nodes they are prescribed at.
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

displacementsread-only

The displacements, one per node, in the order of nodes.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

node_displacementread-only

(node, displacement) pairs, as an iterator.

nodesread-only

The nodes the loads act on, as a NodesGroup.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

ElementScalarFieldBase(
    scalars,
    distribution,
    load_case: str | None = None,
    combination_rank: int = 1,
    **kwargs,
)

Scalar values on elements: the base of the element scalar fields.

Abstract: subclass it for a concrete field.

Parameters

Name Type Description
scalars float | list[float] The values, one per element, or one for all of them.
distribution list[ElementBase] | ElementsGroup The elements.
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

elementsread-only

The elements the loads act on, as a ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

ElementVectorFieldBase(
    vectors,
    distribution,
    load_case: str | None = None,
    combination_rank: int = 1,
    **kwargs,
)

Vectors on elements, one force per element: the base of the line and gravity load fields.

Abstract: use a concrete field such as UniformLineLoadField.

Parameters

Name Type Description
vectors VectorLoad | list The vectors, one per element, or one for all of them.
distribution list[ElementBase] | ElementsGroup The elements.
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

elementsread-only

The elements the loads act on, as a ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

ElementsLoadFieldBase(
    loads,
    distribution,
    load_case: str | None = None,
    combination_rank: int = 1,
    **kwargs,
)

Loads on elements, one per element: the base of the element fields.

Two fields of the same class add element by element (a + b, a - b) and scale by a number (1.5 * a), each giving a new field. Abstract: use a concrete field such as UniformLineLoadField.

Parameters

Name Type Description
loads list | Any The loads, one per element, or one for all of them.
distribution list[ElementBase] | ElementsGroup The elements the loads act on (put in a ElementsGroup).
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
**kwargs dict Passed on to FEAData, e.g. name.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

elementsread-only

The elements the loads act on, as a ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

ForceField(
    loads: Iterable[ForwardRef(VectorLoad)],
    distribution: Iterable[ForwardRef(Node)],
    load_case: str | None = None,
    combination_rank: int = 1,
    **kwargs,
)

Concentrated forces and moments at nodes: one VectorLoad per node.

Parameters

Name Type Description
loads VectorLoad | list[VectorLoad] The loads, one per node, or one for all of them.
distribution list[Node] | NodesGroup The nodes they act at.
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

node_loadread-only

(node, load) pairs, as an iterator.

nodesread-only

The nodes the loads act on, as a NodesGroup.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

GravityLoadField(
    g=9.81,
    direction=(0, 0, -1),
    distribution=None,
    load_case=None,
    combination_rank: int = 1,
    **kwargs,
)

Self-weight: an acceleration g along a direction, acting on the mass of elements.

Use add_gravity_field() to add one to a step. Each element stores its weight, mass times g · direction (zero for an element without mass); the solver is given the acceleration itself.

Parameters

Name Type Description
g float, optional The acceleration, in the model’s units (9810 mm/s² with mm, t and N; 9.81 m/s² with m, kg and N).
direction sequence of 3 floats, optional The direction it acts along (global), not normalised; downward (0, 0, -1) by default.
distribution list[ElementBase] | ElementsGroup The elements it acts on; required, despite its default None.
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

directionread-only

The direction the acceleration acts along (global), as given.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

elementsread-only

The elements the loads act on, as a ElementsGroup.

gread-only

The acceleration, in the model’s units (e.g. 9810 mm/s²).

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

partsread-only

The parts the load acts on: not set by the field yet, so reading it raises AttributeError.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

LoadFieldBase(
    loads,
    distribution,
    load_case: str | None = None,
    combination_rank: int = 1,
    **kwargs,
)

Loads or prescribed values over a set of nodes or elements: the common base of the load fields.

Each location of the distribution has its own load; a single load is used at every location. Abstract: use a concrete field such as ForceField.

Parameters

Name Type Description
loads list | Any The loads, one per location of distribution, or one for all of them.
distribution NodesGroup | ElementsGroup The nodes or elements the loads act on.
load_case str, optional The load case the field belongs to (e.g. "G", "Q"), the name a LoadFieldsCombination factors it by, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 leading (primary, the default), 2 accompanying (secondary), 3 tertiary.
**kwargs dict, optional Passed on to FEAData, e.g. name.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

Methods
find_load_at_location(location)→Any | None
find_load_at_location(location: ElementBase | Node) -> Any | None

The load the field puts on a node or element; None if it is not in the field.

Parameters

Name Type Description
location Node | ElementBase The node or element to look up.

Returns

Name Type Description
Any | None Its load (a load object or a number), or None.
NodeScalarFieldBase(
    scalars,
    distribution,
    load_case: str | None = None,
    wrap: bool = False,
    amplitude=None,
    combination_rank: int = 1,
    **kwargs,
)

Scalar values at nodes, such as temperatures: the base of the nodal scalar fields.

Abstract: use a concrete field such as TemperatureField.

Parameters

Name Type Description
scalars float | list[float] The values, one per node, or one for all of them.
distribution list[Node] | NodesGroup The nodes.
load_case str, optional The load case the field belongs to, or None.
wrap bool, optional Wrap each number in a ScalarLoad (with amplitude), rather than keep the numbers.
amplitude Amplitude, optional The amplitude of the wrapped loads (only with wrap=True).
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

nodesread-only

The nodes the loads act on, as a NodesGroup.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

NodeVectorFieldBase(
    vectors,
    distribution,
    load_case: str | None = None,
    combination_rank: int = 1,
    **kwargs,
)

Vectors at nodes, forces or displacements: the base of the nodal vector fields.

Abstract: use a concrete field such as ForceField.

Parameters

Name Type Description
vectors VectorLoad | list The vectors, one per node, or one for all of them.
distribution list[Node] | NodesGroup The nodes.
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

nodesread-only

The nodes the loads act on, as a NodesGroup.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

NodesLoadFieldBase(
    loads,
    distribution: Node | Iterable[Node] | NodesGroup,
    load_case: str | None = None,
    combination_rank: int = 1,
    **kwargs,
)

Loads or prescribed values at nodes, one per node: the base of the nodal fields.

Two fields of the same class add node by node (a + b, a - b) and scale by a number (1.5 * a), each giving a new field. Abstract: use a concrete field such as ForceField.

Parameters

Name Type Description
loads list | Any The loads, one per node, or one for all of them.
distribution Node | list[Node] | NodesGroup The nodes the loads act on (put in a NodesGroup).
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
**kwargs dict Passed on to FEAData, e.g. name.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

nodesread-only

The nodes the loads act on, as a NodesGroup.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

TemperatureField(
    temperature: float | Iterable[float],
    distribution: Iterable[ForwardRef(Node)],
    load_case: str | None = None,
    combination_rank: int = 1,
    **kwargs,
)

Temperatures at nodes, a thermal load: the material expands with the change from its initial temperature.

The initial temperature is set on the model, with a InitialTemperatureField.

Parameters

Name Type Description
temperature float | list[float] The temperatures, one per node, or one for all of them, in the model’s temperature unit (that of the materials’ expansion coefficients).
distribution list[Node] | NodesGroup The nodes.
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

node_temperatureread-only

(node, temperature) pairs, as an iterator.

nodesread-only

The nodes the loads act on, as a NodesGroup.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

temperaturesread-only

The temperatures, one per node, in the order of nodes.

uidUUID | Noneread-only

The object’s unique id, a UUID.

UniformLineLoadField(
    load: float,
    distribution: Iterable[ForwardRef(Element1DBase)],
    direction: list[float],
    load_case: str | None = None,
    combination_rank: int = 1,
    **kwargs,
)

A uniform load along 1D elements (beams, trusses, struts, ties), force per length along a direction.

Use add_uniform_line_load() to add one to a step. Each element stores the total force it carries, q · L · direction; as_nodal_forces() turns it into forces and moments at the nodes, which is how it is written for a solver.

Parameters

Name Type Description
load float The load intensity q, force per length (N/mm for N and mm).
distribution list[Element1DBase] The elements it acts on; any other kind of element raises TypeError.
direction list[float] The direction it acts along (global), not normalised: its length scales the load.
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

directionlist[float]read-only

The direction the load acts along (global), as given.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

element_loadread-only

(element, total force) pairs, as an iterator: each element’s q · L · direction.

elementsread-only

The elements the loads act on, as a ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

loadfloatread-only

The load intensity q, force per length.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

Methods
as_nodal_forces()→dict

The load as forces and moments at the elements’ nodes, summed where elements share a node.

Each element’s total force F_el = q · L_el · direction is split equally between its nodes: F_el / 2 at each end of a 2-node element, a third at each node of a 3-node one. A 2-node element also gets its work-equivalent end moments, q⊥ L² / 12 from the part of the load across it, opposite at its two ends. Where elements share a node their contributions add, so an inner node of a uniform chain carries q · L_segment.

Returns

Name Type Description
dict[ class:xfea.model.Node, VectorLoad] Each node’s force (x, y, z) and, at 2-node elements, moments (xx, yy, zz, None where zero).
UniformSurfaceLoadField(
    load: float,
    surface: FacesGroup,
    direction: list[float] | None = None,
    load_case: str | None = None,
    combination_rank: int = 1,
    **kwargs,
)

A uniform pressure on a surface, applied as forces at the surface’s nodes.

Use add_surface_field() to add one to a step.

Parameters

Name Type Description
load float The pressure, force per area (MPa for N and mm).
surface FacesGroup The faces it acts on, each surface once: faces on the same nodes (a shell’s top and bottom faces, the faces where two solids meet) are loaded once.
direction list[float], optional The direction it acts along (global), not normalised: its length scales the load. None: the faces’ average normal, so a positive load pushes along it.
load_case str, optional The load case the field belongs to, or None.
combination_rank {1, 2, 3}, optional The field’s role in a combination: 1 primary (the default), 2 secondary, 3 tertiary.
Properties
combination_rankint

The field’s role in a combination: 1 primary (leading), 2 secondary, 3 tertiary.

distributionread-only

The nodes or elements the loads act on, as a NodesGroup or ElementsGroup.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

loadfloatread-only

The pressure, force per area.

load_casestr | None

The load case the field belongs to, or None; setting it to anything but a str or None raises TypeError.

loadsread-only

The loads (load objects or numbers), one per location of distribution, in the same order.

modelModel | Noneread-only

The model of the field’s problem; None if the field is not added to a step.

namestr

The object’s name.

nodesread-only

The nodes the loads act on, as a NodesGroup.

problemProblem | Noneread-only

The problem of the step the field is added to; None if it is not added to one.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

surfaceFacesGroupread-only

The faces the load acts on.

uidUUID | Noneread-only

The object’s unique id, a UUID.

Module: xfea.problem.displacements

GeneralDisplacement(
    x=False,
    y=False,
    z=False,
    xx=False,
    yy=False,
    zz=False,
    frame: Frame | None = None,
    amplitude=None,
    **kwargs,
)

Held or imposed displacements and rotations at nodes: per direction, free, held at zero, or moved by a value.

Each component is False or None (free), True (held at zero) or a number (moved by that much: a length for x, y, z, an angle in radians for xx, yy, zz). Usually made for you by add_uniform_displacement_field().

Parameters

Name Type Description
x, y, z bool or float, optional The translations along the frame’s axes (the global axes without a frame).
xx, yy, zz bool or float, optional The rotations about the frame’s axes (the global axes without a frame).
frame Frame, optional A local frame the components are given in: None gives them in global axes.
amplitude Amplitude, optional How an imposed value varies through the step (a settlement that grows): None applies it as given.
Properties
Xboolread-only

Whether the translation along the global X axis is held, given the frame.

XXboolread-only

Whether the rotation about the global X axis is held, given the frame.

Yboolread-only

Whether the translation along the global Y axis is held, given the frame.

YYboolread-only

Whether the rotation about the global Y axis is held, given the frame.

Zboolread-only

Whether the translation along the global Z axis is held, given the frame.

ZZboolread-only

Whether the rotation about the global Z axis is held, given the frame.

amplituderead-only

The amplitude of the imposed values, or None.

componentsdict[str, Any]read-only

The components as given, in the frame: {"x": ..., "zz": ...} (see x).

frameFrame

The object’s local frame, or the global frame if it has none; set it to None to remove it.

global_componentsdict[str, bool]read-only

Whether each global direction is held: {"X": ..., "ZZ": ...} (see X).

has_local_frameboolread-only

Whether the object has a local frame of its own.

keyAny | Noneread-only

The object’s key (its number) in what it is registered to; None until it is given one.

magnitudesdict[str, float]read-only

The value each direction is moved by, {"x": ..., "zz": ...} (see magnitude()).

namestr

The object’s name.

registrationAny | None

The object this one is registered to (a part, a model, a step, …), or None.

uidUUID | Noneread-only

The object’s unique id, a UUID.

xboolread-only

The translation along the frame’s x axis as given: False/None (free), True (held) or a number (imposed).

xxboolread-only

The rotation about the frame’s x axis as given: False/None (free), True (held) or a number (imposed).

yboolread-only

The translation along the frame’s y axis as given: False/None (free), True (held) or a number (imposed).

yyboolread-only

The rotation about the frame’s y axis as given: False/None (free), True (held) or a number (imposed).

zboolread-only

The translation along the frame’s z axis as given: False/None (free), True (held) or a number (imposed).

zzboolread-only

The rotation about the frame’s z axis as given: False/None (free), True (held) or a number (imposed).

Methods
global_constraint_equations()→list[tuple[dict[str, float], float]]

The held local translations as equations in the global translations: a UX + b UY + c UZ = 0.

One equation per held local axis (x, y, z), its coefficients the axis’s direction cosines. Rotations are not included, and an imposed value is treated as zero.

Returns

Name Type Description
list[tuple[dict, float]] ({"UX": a, "UY": b, "UZ": c}, 0.0) for each held local translation.
is_restrained(dof)→bool
is_restrained(dof: str) -> bool

Whether a direction is held (True or a number), in the displacement’s frame.

Parameters

Name Type Description
dof str The direction: "x", "y", "z", "xx", "yy" or "zz".

Returns

Name Type Description
bool True if it is held.
magnitude(dof)→float
magnitude(dof: str) -> float

The value a direction is moved by: the number given, or 0.0 if it is held at zero or free.

Parameters

Name Type Description
dof str The direction: "x", "y", "z", "xx", "yy" or "zz".

Returns

Name Type Description
float A length for a translation, an angle in radians for a rotation.

© 2026 Francesco Ranaudo · Text and pictures CC BY 4.0 · Code Elastic License 2.0 · how to reuse them