Parralel elements bug
DirkKramer opened this issue · comments
Describe the bug
I am using BriefFiniteElement for simulating a model that consists of frame elements. I discovered that the .Solve() method of the model gives troubles when two elements are in line with each other. For example in the following code:
To Reproduce
Model model = new Model();
Node n1 = new Node(-1,0,0);
Node n2 = new Node(0,0,0);
Node n3 = new Node(1,0,0);
n1.Constraints = n3.Constraints = Constraint.Fixed;
n2.Constraints = Constraint.Released;
model.Nodes.Add(n1,n2,n3);
BarElement e1 = new BarElement(n1,n2);
BarElement e2 = new BarElement(n2,n3);
e1.Behavior = e2.Behavior = BarElementBehaviours.FullFrame;
model.Elements.Add(e1, e2);
var material = UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.3);
double r = .005; // element radius
double a = r * r * Math.PI;
double iyz = Math.PI*Math.Pow(r,4)/4;
var section = new UniformParametric1DSection(){A = a, Iy=iyz, Iz=iyz };
e1.Material = e2.Material = material;
e1.Section = e2.Section = section;
model.Solve();
Expected behavior
Model.Solve to run successfully.
Additional context
When I change the second node to:Node n2 = new Node(0,0.0000000001,0);
There are no problems.
When I set the constraints of n2 to RotationFixed, there are also no problems.
The case is that my model contains several elements that are in line with each other, but setting the nodes of these elements to RotationFixed is not a solution for me.
So I am wondering is this an error in the .Solve() method (dividing by zero or something like that) Or is this just a consequence of using FEM for simulating.
Hi,
I think doing these changes will solve the problem:
- Plus to
Iy
andIz
do define a nonzeroJ
for the section - Use
Model.Solve_MPC()
instead ofModel.Solve()
Can you please do a check?
Thanks
Hi,
I think doing these changes will solve the problem:
- Plus to
Iy
andIz
do define a nonzeroJ
for the section- Use
Model.Solve_MPC()
instead ofModel.Solve()
Can you please do a check?
Thanks
This did the trick. Thanks for your help!