Supports and forces
Demonstrates how boundary conditions and force fields are defined on the core model, regardless of the active plugin implementations behind the scenes.

The model before it is solved: its parts, supports (red) and loads (blue).
![The result: the deformed shape coloured by reaction force (magnitude [N])](/examples/core-concepts/loads-and-bcs/supports-and-forces-results.webp)
The deformed shape, coloured by reaction force (magnitude [N]), in xfea’s 3D viewer.
Open in 3D turn it, cut it, pick any field: in xfea's viewer, in your browser
The script
Section titled “The script”examples/scripts/02_core_concepts/loads_and_bcs/supports_and_forces.py. Run it from the repository with uv run python examples/scripts/02_core_concepts/loads_and_bcs/supports_and_forces.py, or, with xfea-examples installed, xfea-examples run 02_core_concepts/loads_and_bcs/supports_and_forces.py.
from xfea.problem import Problemfrom xfea.problem import StaticStepfrom xfea.results import ReactionFieldResultsfrom xfea_examples import out_dirfrom xfea_examples.models import cantilever_beam_model
tip_force_y = 500 # [N] lateral tip forcetip_force_z = -1_000 # [N] downward tip force
model, _, tip_nodes, _, _, _ = cantilever_beam_model(name="supports_and_forces")
problem = model.add_problem(Problem(name="supports_problem"))step = problem.add_step(StaticStep(name="service"))step.add_uniform_forcefield(nodes=tip_nodes, y=tip_force_y, z=tip_force_z, load_case="service")
react = ReactionFieldResults()step.add_field_outputs([react])
problem.analyse_and_extract(path=out_dir(model.name), verbose=True)
print(f"Maximum reaction in y: {react.get_max_result('y').y}")print(f"Maximum reaction in z: {react.get_max_result('z').z}")© 2026 Francesco Ranaudo · Text and pictures CC BY 4.0 · Code Elastic License 2.0 · how to reuse them