Skip to main content

FEMur API Reference

FEMur's core library (FEMur.dll) can be called directly from a Grasshopper C# script component or from any .NET application. This reference documents its public .NET API.

The per-type pages are generated from the source and are English only.

A minimal analysis​

Solving a cantilever (2 m of H-200x100, 1 kN at the tip) and reading the tip deflection:

using System;
using System.Collections.Generic;
using FEMur.CrossSections;
using FEMur.Elements;
using FEMur.Geometry;
using FEMur.Loads;
using FEMur.Materials;
using FEMur.Models;
using FEMur.Nodes;
using FEMur.Solver;
using FEMur.Supports;

// 1. Create the nodes. Units are mm. The first argument is Node.Id
var n1 = new Node(0, 0.0, 0.0, 0.0);
var n2 = new Node(1, 2000.0, 0.0, 0.0);

// 2. Material and cross-section (arguments: name, b, h, t_f, t_w, r)
var steel = Material_Isotropic.Steel();
var section = new CrossSection_H("H-200x100", 100.0, 200.0, 8.0, 5.5, 8.0);

// 3. Element
var beam = new BeamElement(0, n1, n2, steel, section);

// 4. Support: fix the node whose Id is 0
var support = Support.Fixed(0);

// 5. Load: 1000 N in -Z at the node whose Id is 1
var load = new PointLoad(1, new Vector3(0.0, 0.0, -1000.0), new Vector3(0.0, 0.0, 0.0));

// 6. Assemble the model
var model = new Model(
new List<Node> { n1, n2 },
new List<ElementBase> { beam },
new List<Support> { support },
new List<Load> { load });

// 7. Solve. Solve does not modify the model; it returns a SolveOutcome
var outcome = new LinearStaticSolver().Solve(model);

// 8. Tip deflection, looked up by node Id
double uz = outcome.Combined.GetDisplacement(1).Uz;
Console.WriteLine($"Tip deflection UZ = {uz:F4} mm");

Output:

Tip deflection UZ = -0.7435 mm

This matches the Timoshenko beam result PL³/(3EIyy) + PL/(Asz·G).

What you need to know before using the API​

Some contracts cannot be read from the type signatures. Getting them wrong produces a wrong answer without raising an error.

Units are fixed to N and mm​

QuantityUnit
Length, coordinates, displacementmm
Force, axial force, shear forceN
MomentN·mm
Stress, Young's modulusN/mm²
Masskg

There is no mechanism for switching unit systems. Do not mix units.

An Id is not a list index​

The number in Support.Fixed(0) and new PointLoad(1, ...) is a Node.Id, not the position of the node in Model.Nodes.

In the example above the two happen to coincide because new Node(0, ...) and new Node(1, ...) set the Id explicitly. They will not coincide if you assign ids independently of creation order. Always address nodes by their Id.

Look up results by node Id or element Id​

Result.GetDisplacement(nodeId) returns the displacement of that node as a NodalDisplacement. Its components are the translations Ux, Uy, Uz (mm) and the rotations Rx, Ry, Rz (rad).

var d = result.GetDisplacement(nodeId);
double uz = d.Uz;

An Id that is not in the model throws KeyNotFoundException. Use TryGetDisplacement to check first. To visit every node, iterate Result.NodalDisplacements and identify each entry by its NodeId.

Reactions, element stresses, shell stresses and the stresses of axisymmetric and plane elements work the same way: GetReaction(nodeId), GetElementStress(elementId), GetShellStress(elementId), GetAxisymmetricStress(elementId) and GetPlaneElementStress(elementId). Mode shapes from an eigenvalue analysis are available through EigenResult.GetModeShape(modeIndex, nodeId).

Truss elements only use the three translational degrees of freedom, but results are always expanded to six degrees of freedom for compatibility.

Developing with an LLM​

Two plain-text files describe the whole API.

FileContentsUse
/llms.txtIndex of every public type with a one-line descriptionStart here; enough for most tasks
/llms-full.txtEvery public type and member with its exact C# signatureWhen you need completeness

Two ways to use them:

  1. Give the URL to your LLM — "Read https://femur.jp/llms-full.txt and write C# that solves a cantilever."
  2. Save the file locally — drop it into your project folder and the model can read it offline.

llms-full.txt states explicitly that anything not listed there does not exist in the public API, which discourages the model from inventing methods.

Namespaces​

The sidebar lists every namespace and type.

NamespaceContents
FEMur.ModelsModel — the analysis model container
FEMur.NodesNode
FEMur.ElementsBeamElement / TrussElement / ShellElement / AxisymmetricElement / PlaneElement (plane stress / plane strain)
FEMur.CrossSectionsH, box, circle, pipe, rectangle, T, L, channel, custom, shell thickness
FEMur.MaterialsMaterial_Isotropic / Material_Orthotropic
FEMur.SupportsSupport — boundary conditions and spring supports / SurfaceSpring — surface springs on shell elements
FEMur.LoadsPoint, distributed, line, surface, floor, edge pressure (axisymmetric and plane elements), self-weight, prescribed displacement, time-history loads (ground motion, time functions, damping) and more
FEMur.JointsJoint — semi-rigid connections via end springs
FEMur.ConstraintsRigidDiaphragm / DofCoupling — coupled degrees of freedom
FEMur.SolverLinearStaticSolver / EigenSolver / TimeHistorySolver / SolveOutcome
FEMur.ResultsResult / NodalDisplacement / ElementStress / ShellStress / AxisymmetricStress / PlaneElementStress / ReactionForce / EigenResult / TimeHistoryResult
FEMur.GeometryPoint3 / Vector3 / LocalFrame — local frames at nodes
FEMur.ExportMGT import and export
FEMur.Common.UnitsUnit definitions and conversion