Closed MovGP0 closed 1 year ago
Hi there, I think you should also define a section for your element like this:
var section = new UniformParametric1DSection() {A = 0.01*0.01};//for a 1cm by 1cm section
e1.Section = section;
The material property defines the mechanical properties of element, but section defines geometrical properties of bar. both are needed.
Can you please have a check? thanks
The following code works:
var sectionWidth = UnitsNet.Length.FromCentimeters(1).Meters;
var section = new UniformParametric1DSection() {A = sectionWidth * sectionWidth};
var e1 = new BarElement(n1, n5) { Label = "e1", Behavior = BarElementBehaviours.Truss, Material = carbonFibre, Section = section };
var e2 = new BarElement(n2, n5) { Label = "e2", Behavior = BarElementBehaviours.Truss, Material = carbonFibre, Section = section };
var e3 = new BarElement(n3, n5) { Label = "e3", Behavior = BarElementBehaviours.Truss, Material = carbonFibre, Section = section };
var e4 = new BarElement(n4, n5) { Label = "e4", Behavior = BarElementBehaviours.Truss, Material = carbonFibre, Section = section };
Guess the documentation needs an update in that regard.
actually documentation uses TrussElement2Node which is prior version. the BarElement is a little different. example needs to be updated with BarElement. Thanks anyways.
@MovGP0 are you using example from CodeProject article? this is newer version: https://bfenet.readthedocs.io/en/latest/example/truss3d/index.html
Describe the bug
Getting a
NullReferenceException
when trying the Small 3D Truss Example from the documentation.Note there seem to be serval errors in the documentation:
TrussElement2Node
as described in the documentation does not existnull
in the example. Maybe something else is missing in the documentation too?To Reproduce
Expected behavior
The reaction forces should be calculated.
Additional context
model.Solve();
throws aNullReferenceException
Stacktrace