StructuralModel
The root container for a structural analysis model.
Creating a model
var model = new StructuralModel("Portal Frame");
Properties
| Property | Type | Description |
|---|---|---|
Name | string | Model name |
Nodes | List<Node> | All nodes in the model |
Members | List<Member> | All members |
Supports | List<Support> | All boundary conditions |
Materials | List<IMaterial> | Unique materials used |
Sections | List<SectionPropertiesBase> | Unique sections used |
NodalLoads | List<NodalLoad> | All nodal loads |
DistributedLoads | List<DistributedLoad> | All distributed loads |
LoadCases | List<LoadCaseBase> | All load cases |
LoadCombinations | List<LoadCombination> | All load combinations |
Results | AnalysisResultSet? | Analysis results, null until analysis is run |
Key methods
// Nodes
Node AddNode(double x, double y, double z);
Node? GetNodeById(int id);
Node? FindNodeAt(Point3D position);
// Members
Member AddMember(Node start, Node end, IMaterial material,
SectionPropertiesBase section, MemberType type);
Member? GetMemberById(int id);
void RemoveMember(Member member);
// Supports
void SetSupport(Node node, DoF degreeOfFreedom);
void ClearSupport(Node node);
// Loads
void AddNodalLoad(NodalLoad load);
void AddDistributedLoad(DistributedLoad load);
void AddLoadCase(LoadCaseBase loadCase);
// Analysis
AnalysisResultSet RunAnalysis();
void InvalidateResults(); // called automatically on mutation
Result invalidation
Any mutation to the model (adding/removing nodes, members, loads, changing supports) automatically calls InvalidateResults(), setting Results to null. This prevents reading stale data.
var results = model.RunAnalysis();
Console.WriteLine(model.Results != null); // true
model.AddNode(5, 0, 0); // mutation
Console.WriteLine(model.Results != null); // false — invalidated