Skip to main content

Quick start

Build a simply supported beam, apply a load, run analysis, and read results — all in under 30 lines.

Example: simply supported beam with point load

using SamLabs.Armatura.Core.Analysis.Nodes;
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 the model
var model = new StructuralModel("Simply Supported Beam");

// 2. Add nodes
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);
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("Dead");
model.AddLoadCase(dead);
model.AddNodalLoad(new NodalLoad(n2, new Point3D(0, -20_000, 0), dead));

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

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

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

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

What's happening

  1. Nodes define points in 3D space (coordinates in metres)
  2. Supports constrain degrees of freedom at nodes — DoF.Pinned fixes translations but allows rotations
  3. Members connect two nodes with a material and cross-section
  4. Load cases group loads by type (dead, live, wind, etc.)
  5. Analysis assembles the global stiffness matrix, applies boundary conditions, and solves for displacements
  6. Results are returned as an AnalysisResultSet containing flat lists of displacements, reactions, and member forces — queryable per node, per member, per load case, or as envelopes

Next steps