Skip to main content

Quick start

Build a simply supported beam, apply a load, run analysis, and read results.

Example: simply supported beam with point load

using SamLabs.Armatura.Core;
using SamLabs.Armatura.Core.DesignCodes.Eurocode;
using SamLabs.Armatura.Core.Geometry;
using SamLabs.Armatura.Core.Structural;
using SamLabs.Armatura.Core.Structural.Loads;
using SamLabs.Armatura.Core.Structural.Loads.Applied;
using SamLabs.Armatura.Core.Structural.Materials;
using SamLabs.Armatura.Core.Structural.Member;
using SamLabs.Armatura.Core.Structural.Sections.Definitions;

// 1. Create a project and model
var project = new ArmaturaProject("Quick Start");
project.ActiveDesignCode = new EN1993();
var model = project.CreateNewModel("Simply Supported Beam");

// 2. Add nodes (coordinates in metres)
var n1 = model.AddNode(0, 0, 0);
var n2 = model.AddNode(5, 0, 0); // midpoint
var n3 = model.AddNode(10, 0, 0);

// 3. Set supports
model.SetSupport(n1, DoF.Pinned);
model.SetSupport(n3, DoF.Pinned);

// 4. Add members
var section = new RectangularSection(0.20, 0.30);
var beam1 = model.AddMember(n1, n2, SteelLibrary.S355, section, MemberType.Beam);
model.AddMember(n2, n3, SteelLibrary.S355, section, MemberType.Beam);

// 5. Add a load case and load
var dead = new DeadLoadCase("G");
model.AddLoadCase(dead);
model.AddPointLoad(new PointLoad
{
Member = beam1,
Case = dead,
Position = 1.0, // end of beam1 = node n2
PositionMode = PositionMode.Relative,
Force = new Point3D(0, 0, -20_000)
});

// 6. Run analysis
var result = model.RunAnalysis(dead);

// 7. Read results
var resultSet = model.BuildResultSet();
var midDisplacement = resultSet.GetDisplacements(n2.Id);
Console.WriteLine($"Midpoint vertical displacement: {midDisplacement[0].Dz:E3} m");

var reactions = resultSet.GetReactions(n1.Id);
Console.WriteLine($"Left support reaction Fz: {reactions[0].Fz:F1} N");

// 8. Envelope across all load cases
var envelope = resultSet.GetDisplacementEnvelope(n2.Id);
Console.WriteLine($"Max vertical displacement: {envelope.Dz.Min:E3} m");

What's happening

  1. ProjectArmaturaProject is the top-level container. Analysis requires a model to be attached to a project.
  2. Nodes define points in 3D space. Coordinates are in metres. Z is vertical (positive upward).
  3. Supports constrain degrees of freedom at nodes — DoF.Pinned fixes translations but allows rotations.
  4. Members connect two nodes with a material and cross-section.
  5. Load cases group loads by type (dead, live, wind, etc.). Each load case is solved independently.
  6. Analysis assembles the global stiffness matrix, applies boundary conditions, and solves for displacements. The load in this example is a 20 kN downward point load at midspan (negative Z).
  7. Results are queried from an AnalysisResultSet — per node, per member, per load case, or as envelopes.

Next steps