Giter Site home page Giter Site logo

brieffiniteelementnet / brieffiniteelement.net Goto Github PK

View Code? Open in Web Editor NEW
148.0 25.0 57.0 16.89 MB

BriefFiniteElementDotNET (BFE.NET) is a library for linear-static Finite Element Method (FEM) analysis of solids and structures in .NET

License: GNU Lesser General Public License v3.0

C# 85.00% Smalltalk 0.01% Tcl 2.88% HTML 12.11%
finite-elements finite-element-analysis fem bfe finite-element-method fe-models finite civil-engineering

brieffiniteelement.net's People

Contributors

brlaney avatar epsi1on avatar peacelvirene avatar rubsy92 avatar wo80 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brieffiniteelement.net's Issues

GetExactInternalForceAt(position).Mz Bug

Describe the bug
GetExactInternalForceAt(position).Mz doesn't return the right value, but GetSupportReaction() works nice.

               var model = new BriefFiniteElementNet.Model();

                var n1 = new Node(-1, 0, 0) { Label = "n1", Constraints = BriefFiniteElementNet.Constraints.MovementFixed & BriefFiniteElementNet.Constraints.FixedRX };

                var n2 = new Node(1, 0, 0) { Label = "n2", Constraints = BriefFiniteElementNet.Constraints.MovementFixed };

                var loadPositionX = 0;

                var e1 = new BarElement(n1, n2) { Label = "e1" };
e1.Section = new BriefFiniteElementNet.Sections.UniformGeometric1DSection(SectionGenerator.GetRectangularSection(0.1d, 0.2d));
            e1.Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.3);
            model.Nodes.Add(n1, n2);
            model.Elements.Add(e1);
            var force = new Force(0, -1, 0, 0, 0, 0);
            var elementLoad = new BriefFiniteElementNet.Loads.ConcentratedLoad
            {
                CoordinationSystem = CoordinationSystem.Local,
                Force = force,
                ForceIsoLocation = new IsoPoint(loadPositionX)
            };
            e1.Loads.Add(elementLoad);
            model.Solve();

Expected behavior
Get momentum 0 when x = -0.99999999 or x=0.999999999

Additional context

When Load is in the middle (x=0):
image

When Load is in x=+0,5
image

Meshed shell model reactions.

I have a meshed plate with a single point load at a node. I am getting the summation of reactions greater than the point load magnitude.

Details:
I have built a meshed 2D slab using TriangleFlatShell elements. I have applied dx, dy, dz constraints to multiple nodes.
A single point load is applied like this:

feaModel.Nodes[20].Loads.Add(new NodalLoad(new Force(0, 0, -5000, 0, 0, 0)));

After I solve the model, I extract the reactions:

        var reactions= feaModel.Nodes.Select(n => n.GetSupportReaction()).ToList();
        var nonZero = reactions.Where(f => f.Fz > 0).ToList();
        var sum = nonZero.Sum(f => f.Fz);

The value of the sum is: 14414.46

Are there any known issues with TriangleFlatShell element? How can I troubleshoot this?

Correction: there's an error in the query above, since it filters out negative reactions

Referencing Issue

Good morning,
I have got an independent problem while adding the new Element-Type (#43).
I added the new class "ElementHelperExtensions.cs" to the BriefFiniteElements.CustomElements folder (code below).

//---------------------------------------------------------------------------------------
//
// Project: VIT-V
//
// Program: BriefFiniteElement.Net - ElementHelpersExtension.cs
//
// Revision History
//
// Date          Author          	            Description
// 11.06.2020    T.Thaler, M.Mischke     	    v1.0  
// 
//---------------------------------------------------------------------------------------
// Copyleft 2017-2020 by Brandenburg University of Technology. Intellectual proprerty 
// rights reserved in terms of LGPL license. This work is a research work of Brandenburg
// University of Technology. Use or copying requires an indication of the authors reference.
//---------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BriefFiniteElementNet.Elements;
using BriefFiniteElementNet.Integration;
using BriefFiniteElementNet.Common;


namespace BriefFiniteElementNet.Elements.ElementHelpers
{
    // not working so far
    public static class ElementHelperExtensions
    {
        public static Matrix CalcLocalKMatrix_Quad(IElementHelper helper, Element targetElement)    // function is not recognized 
        {
            var qq = targetElement as TriangleElement; 

            if (qq == null)
                throw new Exception();

            var trans = qq.GetLambdaMatrix().Transpose();

            var nb = helper.GetBMaxOrder(targetElement);
            var nd = qq.Material.GetMaxFunctionOrder();
            var nt = qq.Section.GetMaxFunctionOrder();
            var nj = helper.GetDetJOrder(targetElement);

            var sum = new int[3];

            foreach (var i in new int[][] { nb, nd, nb, nt, nj })
                for (int j = 0; j < 3; j++)
                    sum[j] += i[j];

            var nXi = sum[0] / 2 + 1;
            var nEta = sum[1] / 2 + 1;
            var nGama = sum[2] / 2 + 1;

            var intg = new GaussianIntegrator();

            intg.GammaPointCount = nGama;
            intg.XiPointCount = nXi;
            intg.EtaPointCount = nEta;

            intg.A2 = 1;
            intg.A1 = 0;

            intg.F2 = (gama => +1);
            intg.F1 = (gama => -1);

            intg.G2 = (eta, gama) => +1;
            intg.G1 = (eta, gama) => -1;   // formula 4.53 (Development of Membrane, Plate and Flat Shell Elements in Java) --> see GaussianIntegrator.cs for correct variable assignment

            intg.H = new FunctionMatrixFunction((xi, eta, gama) =>
            {
                var b = helper.GetBMatrixAt(qq, xi, eta);
                var d = helper.GetDMatrixAt(qq, xi, eta);
                var j = helper.GetJMatrixAt(qq, xi, eta);
                var detj = Math.Abs(j.Determinant());

                var buf = new Matrix(b.ColumnCount, b.ColumnCount); // result matrix

                CalcUtil.Bt_D_B(b, d, buf);                         // multiplicates three matrices

                buf.MultiplyByConstant(detj);

                return buf;
            });


            var res = intg.Integrate();

            return res;
        }
    }
}

My references on e.g. BriefFiniteElementNet.Common are not working, that is why the function I added (CalcLocalKMatrix_Quad) is not recognized by Visual Studio. Another file in the same folder (DKQHelper.cs) is working perfectly with identical references.
Do you have any idea why it is not working?

Thank you!

Internal moments in a beam

Describe the bug
I have a simple beam on two supports that has a distributed load applied to it. The solution gives incorrect results.

To Reproduce
This is the code We've used and caused wrong result/ runtime error

var model = new Model();
model.Nodes.Add(new Node(0, 0, 0) { Label = "n1" });
model.Nodes.Add(new Node(6, 0, 0) { Label = "n2" });
model.Nodes["n1"].Constraints = Constraints.FixedDZ & Constraints.FixedDY & Constraints.FixedRX & Constraints.FixedRZ;
model.Nodes["n2"].Constraints = Constraints.MovementFixed;
model.Elements.Add(new BarElement(model.Nodes["n1"], model.Nodes["n2"]) { Label = "r1" });
(model.Elements["r1"] as BarElement).Section = new BriefFiniteElementNet.Sections.UniformGeometric1DSection(SectionGenerator.GetRectangularSection(0.01, 0.01));
(model.Elements["r1"] as BarElement).Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210 * Math.Pow(10, 9), 0.3);
model.Elements["r1"].Loads.Add(new BriefFiniteElementNet.Loads.UniformLoad(LoadCase.DefaultLoadCase, new Vector(0, 0, 1), -10000, CoordinationSystem.Local));
model.Solve_MPC();

var iso = (model.Elements["r1"] as BarElement).LocalCoordsToIsoCoords(0.0001);
Console.WriteLine((model.Elements["r1"] as BarElement).GetExactInternalForceAt(iso[0], LoadCase.DefaultLoadCase).My.ToString());
for (int i = 1; i < 6; i++)
{
iso = (model.Elements["r1"] as BarElement).LocalCoordsToIsoCoords(i);
Console.WriteLine((model.Elements["r1"] as BarElement).GetExactInternalForceAt(iso[0], LoadCase.DefaultLoadCase).My.ToString());
}
iso = (model.Elements["r1"] as BarElement).LocalCoordsToIsoCoords(6 - 0.0001);
Console.WriteLine((model.Elements["r1"] as BarElement).GetExactInternalForceAt(iso[0], LoadCase.DefaultLoadCase).My.ToString());
Console.ReadKey();

Expected behavior
Every result along the beam has to be ~30kN less: near nodes it has to aim to zero, and in the middle it's supposed to be -45kN

Additional context
image

Non linear Analysis

Hello @epsi1on,
thank you for this powerfull library!
I study FEM for my phd programme so i found this great work. In particular I'm focusing on the fire resistance of the structures applying FSE and I think that I could use this library to perform a parametric analysis but I would know if it's possible to take in account second order effects and the material's non linearity.
I developed in C# a tool which build the moment-curvature diagram for steel-concrete composite sections in fire condition, I would use it to evaluate a "Young modulus" to perform a step by step analysis.
You think that is it possible ?

Making a Team on FEM programming (BriefFiniteElement.NET)

Hi people,
This is Ehsan M.A, coordinator of BriefFiniteElement.NET opensource project.
I thought that it would be nice to make a team on coding simple to use finite element analysis in .net. Current BriefFiniteElement.NET code is designed and developed and maintains mostly by one person that is me (except some important features like sparse matrix operations etc).
As it was my first experiences in such projects, i believe the BriefFiniteElement code is not a Clean Code enough, neither architecture is not a Clean Architecture enough. Some people messaged me that code is complicated also currently it is maintained mostly by one person!

Can you people please give me some advice on how to continue this BriefFiniteElement project, or any suggestion on this?

  • Do you think that source code is complicated? how to reduce complication and make it simple to understand?
  • What other features do you think would be good? do you contribute for it?

Sincerely,
Ehsan M.A

I would tag all users that starred this repository.
@celeong , @spolarbear , @BenKenoby , @FSharpCSharp , @Fasngtao , @ForNeVeR , @GuofaHuang , @JetBrains , @Jonesbr49424 , @Loceno , @McGum , @nioel , @RichardWhitfieldTTW , @Sivolday , @TyGLM , @YFS11013 , @a5rGithub , @abc126 , @aurimasmb , @bennywolf , @bigworld12 , @ceanwang , @cyberpunk2099 , @dimtsap , @ejhg , @epsi1on , @eykaraduman , @fmarrabal , @haplokuon , @houqinglin , @init6dev , @joc74pt , @kaananu , @lmingle , @loading00123 , @luisggc , @milosuen , @nil-is-lin , @rellfy , @samuto , @shishizhao1988 , @snox , @sorlik-tr , @squarewheel7 , @sunyongmark , @tdy211 , @tmgerard , @wuxiaod1987 , @xiaoxiongnpu , @xpgo , @yifengzhimo , @dimtsap

Help on "Matrix must be symmetric positive definite" error

Hi,

Tried to calculate a 2d truss with code below, but got a message saying "Matrix must be symmetric positive definite". What's wrong with the code?

Thanks for help.

Cean

    private static void Truss2D()
    {
        Console.WriteLine("Simple 2D truss with 3 members");
        
        var model = new Model();

        var n1 = new Node(0, 0, 0);
        n1.Label = "n1";//Set a unique label for node
        var n2 = new Node(1, 0, 1.732) { Label = "n2" };//using object initializer for assigning Label
        var n3 = new Node(1, 0, 0) { Label = "n3" };

        var e1 = new TrussElement2Node(n1, n2) { Label = "e1" };
        var e2 = new TrussElement2Node(n2, n3) { Label = "e2" };
        var e3 = new TrussElement2Node(n1, n3) { Label = "e3" };

        e1.A = e2.A = e3.A  = 0.001;
        e1.E = e2.E = e3.E  = 200e9;

        model.Nodes.Add(n1, n2, n3);
        model.Elements.Add(e1, e2, e3);

        n1.Constraints  = Constraints.Fixed;
        n2.Constraints = Constraints.RotationFixed;
        n3.Constraints = Constraints.RotationFixed;
        
        var force = new Force(10000, 0, 0, 0, 0, 0);
        n2.Loads.Add(new NodalLoad(force));//adds a load with LoadCase of DefaultLoadCase to node loads

        model.Solve();

        Console.ReadKey();

    }

Creating Mesh Analysis in Static/Material System

Hello. Is it possible to analyze by creating a mesh in the finite element method, I want to learn this.

The material identification section for 'Brief' is well described in the documentation section.

However, when material and material is defined, how can mesh analysis and discrete evaluation be performed for a static system?

'Brief' finds the moment diagram, shear forces, and support reactions very well in finite elements.

I want to use it also in mesh analysis? Could you help? Or, is it possible to add mesh example in documentation?

ExactInternalForces incorrect with partial BarElement end releases

Hi epsi1on,

First of all, a big thank-you for the work you have done on this project!

I was wondering if the BarElement Start/EndReleaseConditions were supposed to be working? Alternatively, it may be an issue with the internal forces (I am using GetExactInternalForceAt()).

In the problem below, I have defined a simply supported beam with 1kN/m uniformly distributed load. However, instead of fixing the Start/End NODES, I am setting the EndReleaseConditions. I have fixed the Rz of one of the beam ends so that the bar is fully constrained.

The internal forces are incorrect. The support reactions are correct.

image

I want to set the EndReleaseCondition on the bar, instead of the node constraint because I want to torsion ally restrain the beam in it's own axis. For example, if I had a diagonal beam in 3D, I cannot restrain the beam in pure torsion (local Rz) through nodal restraints - nodals restraints are in global coordinates.

Code is below:

        var l = 10;
        var model = new Model();
        model.Nodes.Add(new Node(0, 0, 0) { Label = "n0" });
        model.Nodes.Add(new Node(l, 0, 0) { Label = "n1" });
        //Fixed nodes
        model.Nodes["n0"].Constraints = Constraints.Fixed;
        model.Nodes["n1"].Constraints = Constraints.Fixed;

        var bar = new BarElement(model.Nodes["n0"], model.Nodes["n1"]) { Label = "e0" };
        //Pinned bar releases
        bar.StartReleaseCondition = Constraints.MovementFixed;
        bar.EndReleaseCondition = new Constraint(dx: DofConstraint.Released, dy: DofConstraint.Fixed, dz: DofConstraint.Fixed, rx: DofConstraint.Fixed, ry: DofConstraint.Released, rz: DofConstraint.Released);
        model.Elements.Add(bar);

        var sec = new UniformGeometric1DSection(SectionGenerator.GetISetion(0.24, 0.67, 0.01, 0.006));
        var mat = UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.3);

        (model.Elements["e0"] as BarElement).Material = mat;
        (model.Elements["e0"] as BarElement).Section = sec;

        var u1 = new UniformLoad(LoadCase.DefaultLoadCase, -Vector.K, 1, CoordinationSystem.Global);

        model.Elements["e0"].Loads.Add(u1);

        model.Solve_MPC();

        var n0Force = model.Nodes["n0"].GetSupportReaction();
        var n1Force = model.Nodes["n1"].GetSupportReaction();
        Console.WriteLine("support reaction of n0: {0}, n1: {1}", n0Force, n1Force);

        var elm = model.Elements[0] as BarElement;
        var fnc = new Func<double, double>(x =>
        {
            try
            {
                var xi = elm.LocalCoordsToIsoCoords(x);
                var frc = elm.GetExactInternalForceAt(xi[0]);
                return frc.My;
            }
            catch
            {

                return 0;
            }

        });

        FunctionVisualizer.VisualizeInNewWindow(fnc, 1E-6, l - 1E-6, 50);

Simply supported beam - simple example cant get internal forces

/*

           3 kN/m                           
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^              
 ----------------------------
/\           10m             /\

n1                         n2   

*/

public void SimplySupportedBeamUDL()
{
  var model = new BriefFiniteElementNet.Model();

  var pin = new Constraint(
    dx: DofConstraint.Fixed, dy: DofConstraint.Fixed, dz: DofConstraint.Fixed, 
    rx: DofConstraint.Fixed, ry: DofConstraint.Released, rz: DofConstraint.Fixed);

  Node n1, n2;

  model.Nodes.Add(n1 = new Node(x: 0.0, y: 0.0, z: 0.0) { Constraints = pin });
  model.Nodes.Add(n2 = new Node(x: 10000.0, y: 0.0, z: 0.0) { Constraints = pin });

  var elm1 = new BarElement(n1, n2);
  model.Elements.Add(elm1);

  double height = 200;
  double width = 50;
  double E = 7900; 
  var section = new UniformGeometric1DSection(SectionGenerator.GetRectangularSection(height, width));
  BaseMaterial material = UniformIsotropicMaterial.CreateFromYoungPoisson(E, 1);

  elm1.Section = section;
  elm1.Material = material;

  var u1 = new UniformLoad(LoadCase.DefaultLoadCase, new Vector(0, 0, 1), -3, CoordinationSystem.Local);
  elm1.Loads.Add(u1);

  model.Solve_MPC();

  double x;
  Force reaction1 = n1.GetSupportReaction();
  x = reaction1.Fz; //15000 = 3*10000/2 -> correct
  x = reaction1.My; // 0 -> correct

  Force f1_internal = elm1.GetInternalForceAt(-1);//-1 is start
  x = f1_internal.Fz; //bug: 0 should be -15000
  x = f1_internal.My; //bug: 25000000 should be 0, bug?
}

Status of shell elements

Hello eps1lon, thank you for the great work on BFE.net!

I am trying to use shell elements to model plate with bending.
Looks like TriangleElement is obsolete. Which shell element would be the "most developed" for it to use? I also tried using TriangleFlatShell but struggle to understand the way how the nodes of triangular element should be defined (propery Nodes is read only).

FrameElement2DNode-shear

Hi,

I noticed that that there is a small mistake in the shear notation in the "FrameElement2Node" class (under the GetLocalStiffnessMatrix method). You forgot your brackets for the denominator:
buf[3, 3] = gj/(el);
buf[3, 9] = -gj/(el);
buf[9, 9] = gj/(el);
instead of
buf[3, 3] = gj/el;
buf[3, 9] = -gj/el;
buf[9, 9] = gj/el;

Some questions

1. About coordinate system

My interpretation of the coordinate system is like this image
And the disp is positive if the disp's direction is the same as that of the coordinate axis.
it's correct?
And how to judge a force is positive or negative?
image

2. About the unit

The unit is m for length and N for force?

3. About the UniformGeometric1DSection

The UniformGeometric1DSection is so easy for use!
I improved the GetCrossSectionPropertiesAt method like this

        public override _1DCrossSectionGeometricProperties GetCrossSectionPropertiesAt(double xi)
        {
            var buf = new _1DCrossSectionGeometricProperties();

            {
                var lastPoint = this._geometry[this._geometry.Length - 1];

                if (lastPoint != _geometry[0])
                    throw new InvalidOperationException("First point and last point ot PolygonYz should put on each other");

                double a = 0, iy = 0, iz = 0, ixy = 0, sy = 0, sz = 0, yc = 0, zc = 0;

                var x = new double[this._geometry.Length];
                var y = new double[this._geometry.Length];

                for (int i = 0; i < _geometry.Length; i++)
                {
                    x[i] = _geometry[i].Y;
                    y[i] = _geometry[i].Z;
                }

                var l = _geometry.Length - 1;
                for (var i = 0; i < l; i++)
                {
                    a += (x[i] - x[i + 1]) * (y[i] + y[i + 1]) / 2.0;
                    iy += (y[i] * y[i] + y[i + 1] * y[i + 1]) * (x[i] - x[i + 1]) * (y[i] + y[i + 1]) / 12.0;
                    iz += (x[i] * x[i] + x[i + 1] * x[i + 1]) * (y[i + 1] - y[i]) * (x[i] + x[i + 1]) / 12.0;
                    ixy += (iy + iz);
                    sy += (x[i] - x[i + 1]) * (y[i] * y[i] + y[i] * y[i + 1] + y[i + 1] * y[i + 1]) / 6;
                    sz += -(y[i] - y[i + 1]) * (x[i] * x[i] + x[i] * x[i + 1] + x[i + 1] * x[i + 1]) / 6;
                }
                yc = sz / a;
                zc = sy / a;
                //if the base axis is not the centroid axis, all the point need move
                if (Math.Abs(yc) > 0.00001 || Math.Abs(zc) > 0.00001)
                {
                    for (int i = 0; i < _geometry.Length; i++)
                    {
                        x[i] = _geometry[i].Y - yc;
                        y[i] = _geometry[i].Z - zc;
                    }
                    iy = 0;
                    iz = 0;
                    ixy = 0;
                    for (var i = 0; i < l; i++)
                    {
                        iy += (y[i] * y[i] + y[i + 1] * y[i + 1]) * (x[i] - x[i + 1]) * (y[i] + y[i + 1]) / 12.0;
                        iz += (x[i] * x[i] + x[i + 1] * x[i + 1]) * (y[i + 1] - y[i]) * (x[i] + x[i + 1]) / 12.0;
                        ixy += (iy + iz);
                    }
                }
               

                buf.A = Math.Abs(a);
                buf.Iz = Math.Abs(iz);
                buf.Iy = Math.Abs(iy);
                buf.J = Math.Abs(ixy);
                buf.Ay = Math.Abs(a);//TODO: Ay is not equal to A, this is temporary fix
                buf.Az = Math.Abs(a);//TODO: Az is not equal to A, this is temporary fix
            }

            return buf;
        }

The new method will cal the location of the centroid axis. So almost all section will be supportted.
TIP:Why the method need the param double xi?

4. About PartialNonUniformLoad

It's so hard to deal with the PartialNonUniformLoad. The BriefFiniteElement is a huge project.
Now I deal with it like this way.
I add node nodes according to the load, and use uniformLoad in element to simulate the partialUniformLoad. Like this image, and the result is satisfying.
image

5.Thank you

Thank you for developing such an excellent project!

Inconsistent results when using BarElement (replaceing FrameElement2Node)

Describe the bug
I am trying to migrate some code using the FrameElement2Node to the BarElement. Since FrameElement2Node is obsolete.

My code is analyzing a simple portal frame same as in the example on code project. The problem I am faceing, if when using BarElement.element.GetInternalForceAt(x).My, I am getting inconsistent results in comparison to the same procedure applied to the old FrameElement2Node..GetInternalForceAt(x).My.

The issue can be reproduced by looking at example 3 on code project. If value for My at the end of e0 should be the same as at the start of e1, however this is not the case. Hence I think this could be potential bug.

If try the same code with FrameElement2Node, then I do not get the above results the results are as expected.

Initial nodal displacement

Hi,
Thanks very much for making this library publically available.

I would like to apply initial settlements to nodes as the feature list includes "Considering initial displacements (settlements)".

However when I include the code

model.Nodes[10].Settlements = new Displacement(0, 0, 0, 0, 0, 0);

I am being told that Node.Settlements is read-only.

Can you advise how I should apply initial nodal settlements ?

Thanks very much,
Darren.

BarElement InternalForce

Describe the bug
BarElement’s internal forces are inverted relative to the middle of the element.

Expected behavior and Current Behavior

Incorrect (with BarElement):
image

Correct (with FrameElement2Node):
image

Additional context
Reported by S.G.

Timoshenko beam

Hi,

I noticed that Timoshenko beams are not yet implemented. Do you have a timescale for when this would be available or can you give access to the used sources (more explanation) so I can implement them?

Thanks!

GetInternalForce from TriangleFlatShell

hi, how can i calculate stress (.GetInternalForce) for TriangleFlatShell elements after loading the Z direction? that s all be zero. (S11,S12, ... S33 = 0)
my code:

var model = new Model();

Node n0 = new Node(1, 4, 0);
n0.Label = "n0";

Node n1 = new Node(0, 4, 0);
n1.Label = "n1";

Node n2 = new Node(2, 4, 0);
n2.Label = "n2";

Node n3 = new Node(0, 0, 0);
n3.Label = "n3";

Node n4 = new Node(2, 0, 0);
n4.Label = "n4";

model.Nodes.Add(n0);
model.Nodes.Add(n1);
model.Nodes.Add(n2);
model.Nodes.Add(n3);
model.Nodes.Add(n4);

var ee = 3e7; // elastisite modulu 
var nu = 0.20;  //poissons ratio
var t = 0.20;  

TriangleFlatShell tr0 = new TriangleFlatShell();
tr0.Label = "tr0";
tr0.Behavior = FlatShellBehaviours.FullThinShell;
tr0.Nodes[0] = n0; 
tr0.Nodes[1] = n1; 
tr0.Nodes[2] = n3; 
tr0.PoissonRatio = nu;
tr0.ElasticModulus = ee;
tr0.Thickness = t;

TriangleFlatShell tr1 = new TriangleFlatShell();
tr1.Label = "tr1";
tr1.Behavior = FlatShellBehaviours.FullThinShell;
tr1.Nodes[0] = n3;
tr1.Nodes[1] = n4; 
tr1.Nodes[2] = n0; 
tr1.PoissonRatio = nu;
tr1.ElasticModulus = ee;
tr1.Thickness = t;

TriangleFlatShell tr2 = new TriangleFlatShell();
tr2.Label = "tr2";
tr2.Behavior = FlatShellBehaviours.FullThinShell;
tr2.Nodes[0] = n0; 
tr2.Nodes[1] = n2; 
tr2.Nodes[2] = n4; 
tr2.PoissonRatio = nu;
tr2.ElasticModulus = ee;
tr2.Thickness = t;

model.Elements.Add(tr0);
model.Elements.Add(tr1);
model.Elements.Add(tr2);

n3.Constraints = Constraints.Fixed;
n4.Constraints = Constraints.Fixed;

//var newCns = new Constraint(DofConstraint.Fixed, DofConstraint.Fixed, DofConstraint.Released,
//                            DofConstraint.Released, DofConstraint.Released, DofConstraint.Fixed);

//n0.Constraints = newCns;
//n1.Constraints = newCns;
//n2.Constraints = newCns;

n0.Constraints = Constraints.FixedDX;
n0.Constraints = Constraints.FixedDY;
n0.Constraints = Constraints.FixedRZ;

n1.Constraints = Constraints.FixedDX;
n1.Constraints = Constraints.FixedDY;
n1.Constraints = Constraints.FixedRZ;

n2.Constraints = Constraints.FixedDX;
n2.Constraints = Constraints.FixedDY;
n2.Constraints = Constraints.FixedRZ;

LoadCase d_case = new LoadCase();
d_case.CaseName = "d1";
d_case.LoadType = LoadType.Dead;

UniformLoadForPlanarElements f1_planerLoad = new UniformLoadForPlanarElements();
f1_planerLoad.Case = d_case;
f1_planerLoad.Ux = 0;
f1_planerLoad.Uy = 0;
f1_planerLoad.Uz = -1000;
f1_planerLoad.CoordinationSystem = CoordinationSystem.Global;

tr1.Loads.Add(f1_planerLoad);

LoadCombination comb1 = new LoadCombination(); 
comb1.Add(d_case, 1);

model.Solve_MPC(); 

var dep0 = n0.GetNodalDisplacement(comb1);
var dep1 = n1.GetNodalDisplacement(comb1);
var dep2 = n2.GetNodalDisplacement(comb1);
var dep3 = n3.GetNodalDisplacement(comb1);
var dep4 = n4.GetNodalDisplacement(comb1);

var s0 = tr0.GetInternalForce(0, 0, comb1);
var s1 = tr1.GetInternalForce(0, 0, comb1);
var s2 = tr2.GetInternalForce(0, 0, comb1);

var r0 = n0.GetSupportReaction(comb1);
var r1 = n1.GetSupportReaction(comb1);
var r2 = n2.GetSupportReaction(comb1);
var r3 = n3.GetSupportReaction(comb1);
var r4 = n4.GetSupportReaction(comb1);

3 Noded Plate bending and Membrane element

Hi,

I've been using this library for some time now, but mostly in structures comprised of nodes/bar elements.

In the last few days I've been trying to implement 3 Noded Plate Elements in a model but with no success. Is there any place where I can find an example of how to use these elements?

Kind Regards

Trapezoidal Load

Describe the bug
Cannot solve with trapezoidal forces included.
GetGlobalEquivalentNodalLoads() in helper classes is not implemented for PartialNonUniformLoad:

image

To Reproduce
Add a PartialNonUniformLoad into a BarElement.Loads

Expected behavior
Code should run without throwing NotImplementedException

Additional context
Reported by S.G.

GetExactInternalDisplacementAt

The method GetExactInternalDisplacementAt is like this

        public Displacement GetExactInternalDisplacementAt(double xi)
        {
            throw new NotImplementedException();
        }
        #endregion

so it's still not done?
and the GetInternalDisplacementAt is to get the dispacement by the Local CoordinationSystem?

Now I want to draw the dispacement of the structure, how can I get the dispacement?

Deformation loads applied on beam elements

Hello,

First thank you for this amazing library !

I would like to model concrete shrinkage for composite sections, to do so I would like to apply deformation load cases on the beams. For gradient temperature loads the approach would be the same.

At this stage would it be possible ?

Thanks
Best regards
Luc

Unexpected error based on element length

As always thank you for the most excellent library!!!

I have run across a strange problem where simply changing the length of an element causes the system to switch from correctly solving to throwing a “Matrix must be symmetric positive definite” exception.

It is very likely a "me" problem but I would love your insight as to why this is happening.

It is a simple cantilevered “PI” structure with hinged joints at the transverse arm attachment points (image is attached)

PI

If you call the attached code with a cantelever length of 13 it works fine and at 14 it throws.

` //runs (but results seem strange)
PI(13);
//Throws exception
PI(14);

    private static void PI(double canteleverDist)
    {

        var model = new Model();

        Node Leg1Base = null;
        Node Leg1Tip = null;
        Node Leg2Base = null;
        Node Leg2Tip = null;

        for (int l = 1; l < 3; l++)
        {
            int x = -100 + (l - 1) * 200;
            Node LegBase = new Node(x, 0, 0) { Label = "Leg" + l.ToString() + "Base" };
            LegBase.Constraints = Constraints.Fixed;
            model.Nodes.Add(LegBase);
            var LegTip = new Node(x, 0, 400) { Label = "Leg" + l.ToString() + "Tip" };
            model.Nodes.Add(LegTip);
            var beam = MakeBeam(LegBase, LegTip, "Leg" + l.ToString());
            model.Elements.Add(beam);

            var n = new Node(x, canteleverDist, 400) { Label = "T" + l.ToString() };
            model.Nodes.Add(n);
            var offsetArm = MakeBeam(LegTip, n, "Offset" + l.ToString());
            model.Elements.Add(offsetArm);

            offsetArm.HingedAtEnd = true;

            LegTip = n;

            if (l < 2)
            {
                Leg1Base = LegBase;
                Leg1Tip = LegTip;
            }
            else
            {
                Leg2Base = LegBase;
                Leg2Tip = LegTip;
            }
        }


        var TopOverhangL = new Node(-150, 5, 350) { Label = "TopOverhang1" };
        var TopOverhangR = new Node(150, 5, 350) { Label = "TopOverhang2" };
        model.Nodes.Add(TopOverhangL);
        model.Nodes.Add(TopOverhangR);

        var TopCant1 = MakeBeam(TopOverhangL, Leg1Tip, "TopCant1");
        var TopBetweenLegs = MakeBeam(Leg1Tip, Leg2Tip, "TopBetweenLegs");
        var TopCant2 = MakeBeam(Leg2Tip, TopOverhangR, "TopCant2");
        model.Elements.Add(TopCant1);
        model.Elements.Add(TopBetweenLegs);
        model.Elements.Add(TopCant2);

        var force = new Force(100, 10, 10, 0, 0, 0);
        TopOverhangL.Loads.Add(new NodalLoad(force));

        force = new Force(-100, -10, -10, 0, 0, 0);
        TopOverhangR.Loads.Add(new NodalLoad(force));

        model.Solve();

        //var wnd = new Window();
        //var ctrl = new ModelVisualizerControl();
        //ctrl.ModelToVisualize = model;
        //wnd.Content = ctrl;
        //wnd.ShowDialog();

        var d = Leg1Tip.GetNodalDisplacement();
        Console.WriteLine("displacement on leg1 X: " + d.DX.ToString() + " Y: " + d.DY.ToString() + " Z: " + d.DZ.ToString());
        d = Leg2Tip.GetNodalDisplacement();
        Console.WriteLine("displacement on leg2 X: " + d.DX.ToString() + " Y: " + d.DY.ToString() + " Z: " + d.DZ.ToString());

    }

    private static FrameElement2Node MakeBeam(Node pN1, Node pN2, string pName)
    {
        var frameBeam = new FrameElement2Node(pN1, pN2);
        frameBeam.Label = pName;
        frameBeam.A = 116;
        frameBeam.Ay = 105;
        frameBeam.Az = 105;
        frameBeam.J = 408;
        frameBeam.Iy = 1080;
        frameBeam.Iz = 1080;
        frameBeam.E = 1660;
        frameBeam.G = 0.620;
        frameBeam.MassDensity = 0.3;
        frameBeam.MassFormulationType = MassFormulation.Consistent;
        return frameBeam;
    }

`
Program.zip

Add element force

Hi, epsi1on, how to add these types of element forces?
image
for type C,I add like this

var u1 = new BriefFiniteElementNet.Loads.UniformLoad(
    LoadCase.DefaultLoadCase,
    -BriefFiniteElementNet.Vector.K,
    elmForce.QZ1 * 1000,
    CoordinationSystem.Global);
elm.Loads.Add(u1);

for type B, I add like this

var u1 = new BriefFiniteElementNet.Loads.UniformLoad(
    LoadCase.DefaultLoadCase,
    -BriefFiniteElementNet.Vector.K,
    elmForce.QZ1 * 1000,
    CoordinationSystem.Local);
elm.Loads.Add(u1);

that' right? and how to add the type A ?

Shell elements not positive definite exception

Hi, I'm trying to test the shell elements, but each time I run an analysis I get the "not positive definite" exception. I noticed that you always constrain all nodes in your examples, what's the reason for that? Correct me if I'm wrong but I would assume that you don't get any displacement when you constrain everything?

Partial Releases of Frame Elements

Hi @epsi1on,

Thanks for this great library!
I'm trying to model a structure where beam elements are fixed at one end, and pinned at their other end. In some situations I will have beam elements meeting at a connection where some of the beam elements are fixed with respect to that node, and others are pinned (for example, a continuous chord of a truss with pin-jointed web members connected to it).

Is this possible with the current implementation of BFE.net and if so, which is the recommended approach?

I have seen the FrameElement2Node.HingedAtStart and .HingedAtEnd properties but I'm not sure exactly how to interpret these.

Thanks!
Auri

How to get started

I am trying to figure out.. how to get started. there is no .DLL file or anything. how to reference.. what to reference to.
Kindly help in newbie how to start

Stresses in DKT elements + combination of stresses + pushing code

Hi,
I have been watching this repository for some time now and there are some interesting developments going on right now! I am planning on giving it a more up-close look and making some contributions depending on where I can help. For now I want to test and validate the shell elements since the quadrilateral one is being added as we speak. I started off with the TriangleFlatShell-element and the results of the membrane-element seem correct (both translations as stresses). The stresses are however not correct in the bending element, while the displacements are the same as in my validation package. I expect to get some values near 20 MPa, however I only get some kPa… Do you have any idea where the problem may lie?

Also: suppose you have both the bending and the membrane behavior and you would like to get the stress in the element. Based on the “GetInternalForce” method I get a stress from both elements types (GetInternalForce.BendingTensor and GetInternalForce. MembraneTensor). How do I combine these in a single Cauchystresstensor?

I’ve made a small addition to the CauchyStressTensor to get the principal stresses, but I can’t push it to the main branch (probably because I don’t have the correct rights/I cloned it immediately in Visual studio?). How should I clone it to be able to push code back?

PS: Good work so far!

can not use the model visualizer

I am having problem with visualizer
I am using this code to display viusalizer

ModelVisualizerControl ctrlVisualizer = new ModelVisualizerControl();
            ctrlVisualizer.ModelToVisualize = model;
            ctrlVisualizer.ShowElements = true;
            //ctrlVisualizer.ElementVisualThickness = 0.02;
            ctrlVisualizer.ShowNodes = true;
            ctrlVisualizer.ShowRigidElements = true;
            ctrlVisualizer.ShowConstraints = true;
            ctrlVisualizer.ShowNodalLoads = true;
            ctrlVisualizer.ShowNodalLoads_Force = true;
            ctrlVisualizer.ShowElements = true;
            ctrlVisualizer.DisableEditingProperties = true;
            ctrlVisualizer.ShowConstraints = true;

the message is
Could not load file or assembly 'HelixToolkit, Version=2011.7.1.0, Culture=neutral, PublicKeyToken=52aa3500039caf0d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

source is "BriefFiniteElementNet.Controls"

and the satck trace
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at BriefFiniteElementNet.Controls.ModelVisualizerControl.InitializeComponent()
at BriefFiniteElementNet.Controls.ModelVisualizerControl..ctor()
at WpfApp1.MainWindow.Button_Click(Object sender, RoutedEventArgs e) in C:\Users\a.maher\Desktop\BriefFiniteElement\Test\TestBriefFinite\WpfApp1\MainWindow.xaml.cs:line 302

and here is the references and packages
1
2

Rotational spring element

Hi epsi1on,

Is there a way of achieving a spring in rotation only? I.e. between 2 nodes:
Dx, Dy, Dz - fixed
Rx - kNm/rad
Ry - kNm/rad
Rz - kNm/rad

I see that there is already the spring1d element, but it seems like that is for translations, not rotations? Apologies, I am not familiar enough with FEM theory to know.

Examples of Spring1D usage?

Hello. I was wondering if you have any examples of Spring1D usage?

I have used Springs in Abaqus and am pretty familiar with their use but I can't for the life of me get them to work as I would expect in BFE.NET

Do you have any examples you could share?

Thank you.

GetExactInternalForcesAt() with multiple loads; Multiple loadcases with ElementalLoads - incorrect outcomes

Hello,

Firstly, as this is my first post here, I would like to thank you for this project. It's a grat job and it has great potential to use.

During my work, I've detected two errors:

First - GetExactInternalForcesAt() with multiple loads.
I've created a column with one fixed constraint at the "bottom node". It's loaded with two uniform loads - first of them simulates self-weight, the second one is perpendicular to the column.

            double h = 5;

            Node n1 = new Node(0, 0, 0);
            Node n2 = new Node(0, 0, h);
            n1.Constraints = Constraints.Fixed;

            var section = new UniformGeometric1DSection(SectionGenerator.GetRectangularSection(1, 0.5));
            var material = UniformIsotropicMaterial.CreateFromYoungShear(205e9, 81e9);
            
            BarElement e = new BarElement(n1, n2)
            {
                Section = section,
                Material = material
            };
            e.Behavior = BarElementBehaviours.FullFrame;

            
            var load = new UniformLoad()
            {
                Direction = Vector.FromXYZ(0, 0, -1),
                CoordinationSystem = CoordinationSystem.Global,
                Magnitude = 1
            };
            var load2 = new UniformLoad()
            {
                Direction = Vector.FromXYZ(1, 0, 0),
                CoordinationSystem = CoordinationSystem.Global,
                Magnitude = 10,
            };
            e.Loads.Add(load);
            e.Loads.Add(load2);

            Model model = new Model();
            model.Nodes.Add(n1);
            model.Nodes.Add(n2);
            model.Elements.Add(e);
            model.Solve();

Support reactions are correct, but forces at parameters seem to be reversed. if parameter -1 is a "starting parameter" of a beam, Fx at -0.99999 should be close to -5, Fz close to -50 and My close to 125. However, values of Fx are reversed - the one at -0.9999 should be the one at 0.9999 and so on.

2020-06-09_11h13_49


The second issue - Incorrect values of external forces in the case of multiple loadcases with elemental loads.

I've created a 3D structure and applied two loads to one of its bars - each load is in another load case. Loads are similar, just the amount of one is two times bigger than the other.

            double h = 5;
            double l = 10;
            double b = 2;

            Node n11 = new Node(0, 0, 0);
            Node n12 = new Node(l, 0, 0);
            Node n13 = new Node(l, 0, h);
            Node n14 = new Node(0, 0, h);

            Node n21 = new Node(0, b, 0);
            Node n22 = new Node(l, b, 0);
            Node n23 = new Node(l, b, h);
            Node n24 = new Node(0, b, h);

            List<Node> nodes = new List<Node>(){n11, n12, n13, n14, n21, n22, n23, n24};

            n11.Constraints = n12.Constraints = n21.Constraints = n22.Constraints = Constraints.MovementFixed;


            BarElement e11 = new BarElement(n11, n12);
            BarElement e12 = new BarElement(n12, n13);
            BarElement e13 = new BarElement(n13, n14);
            BarElement e14 = new BarElement(n14, n11);

            BarElement e21 = new BarElement(n21, n22);
            BarElement e22 = new BarElement(n22, n23);
            BarElement e23 = new BarElement(n23, n24);
            BarElement e24 = new BarElement(n24, n21);

            BarElement ec1 = new BarElement(n11, n21);
            BarElement ec2 = new BarElement(n12, n22);

            List<BarElement> bars = new List<BarElement>(){e11, e12, e13, e14, e21, e22, e23, e24, ec1, ec2 };

            var section = new UniformGeometric1DSection(SectionGenerator.GetRectangularSection(1, 0.5));
            var material = UniformIsotropicMaterial.CreateFromYoungShear(205e9, 81e9);

            foreach (BarElement e in bars)
            {
                e.Section = section;
                e.Material = material;
                e.Behavior = BarElementBehaviours.FullFrame;
            }

            LoadCase loadCase1 = new LoadCase("lc1", LoadType.Default);
            var load = new UniformLoad()
            {
                Direction = Vector.FromXYZ(0, 0, -1),
                CoordinationSystem = CoordinationSystem.Global,
                Magnitude = 1,
                Case = loadCase1
            };
            LoadCase loadCase2 = new LoadCase("lc2", LoadType.Default);
            var load2 = new UniformLoad()
            {
                Direction = Vector.FromXYZ(0, 0, -1),
                CoordinationSystem = CoordinationSystem.Global,
                Magnitude = 2,
                Case = loadCase2
            };
            e11.Loads.Add(load);
            e11.Loads.Add(load2);

            Model model = new Model();
            foreach(Node node in nodes) model.Nodes.Add(node);
            foreach (BarElement bar in bars) model.Elements.Add(bar);
            model.Solve();

Created structure:
2020-06-09_12h45_36

Model is solved with no errors, however, the values of bars forces are incorrect on the bars, where the loads are applied. Free of external loads bars values are correct.

2020-06-09_12h48_49

The problem doesn't appear with nodal loads.

Thank You in advance!

Concentrated load on bar element crashes

Thank you for your incredible package, great work!!

I tried modifying a simple example by placing a concentrated load on a bar element midspan.

Is this possible?
The code below crashes on Solve_MPC

public void SingleSpanBeamWithOverhang()
{
  var model = new BriefFiniteElementNet.Model();

  var pin = new Constraint(dx: DofConstraint.Fixed, dy: DofConstraint.Fixed, dz: DofConstraint.Fixed, rx: DofConstraint.Fixed, ry: DofConstraint.Fixed, rz: DofConstraint.Released);

  Node n1, n2;

  model.Nodes.Add(n1 = new Node(x: 0.0, y: 0.0, z: 0.0) { Constraints = pin });
  model.Nodes.Add(n2 = new Node(x: 10.0, y: 0.0, z: 0.0) { Constraints = pin });

  var elm1 = new BarElement(n1, n2);

  model.Elements.Add(elm1);

  elm1.Section = new BriefFiniteElementNet.Sections.UniformParametric1DSection(a: 0.01, iy: 8.3e-6, iz: 8.3e-6, j: 16.6e-6);//section's second area moments Iy and Iz = 8.3*10^-6, area = 0.01
  elm1.Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210e9, 0.3);//Elastic mudule is 210e9 and poisson ratio is 0.3

  var frc = new Force();
  frc.Fz = 1000;// 1kN force in Z direction

  var elementLoad = new BriefFiniteElementNet.ConcentratedLoad1D(frc, 5, CoordinationSystem.Local);
  elm1.Loads.Add(elementLoad);//is this possible?

  model.Solve_MPC();//crashes here

  var d2 = n2.GetNodalDisplacement();
}

Extract member force

Hi,

let me first congratulate you for such fantastic program.

on trial base i did analysis of steel tower using BEF.

The model is being analysed very quickly,

However, the extraction of forces and support reaction take too much time.

Pl. note that normally in transmission tower we have 200-300 nodes, 500-600 elements and 100 odd load cases and it takes too much time extract element force for all members for all load case.

Is there any way to extract forces of all elements in the model for all load cases in one stroke????

Regards,
Bhavin shah

Applying distributed moment to BarElement

Hi, is it possible to apply a moment as a uniform load along an element ? I want to analyse the effects of differential temperature through the depth of a beam. The BriefFiniteElementNet.Loads.UniformLoad only allows a XYZ vector, no moments.

Adding hinges to the frame

Greetings.
I don't think it's a bug, but rather myself misunderstanding the situation.
I have a simple 2d frame and I want to add a hinge near one of the nodes. The only tool I found for that is Partial End Release Condition.
My code:

var model = new Model();

model.Nodes.Add(new Node(0, 0, 0) { Label = "n1" });
model.Nodes.Add(new Node(0, 0, 6) { Label = "n2" });
model.Nodes.Add(new Node(6, 0, 6) { Label = "n3" });
model.Nodes.Add(new Node(6, 0, 0) { Label = "n4" });

model.Nodes["n1"].Constraints = Constraints.Fixed;
model.Nodes["n4"].Constraints = Constraints.Fixed;

model.Nodes["n2"].Loads.Add(new NodalLoad(new Force(10000, 0, 0, 0, 0, 0)));

model.Elements.Add(new BarElement(model.Nodes["n1"], model.Nodes["n2"]) { Label = "r1" });
model.Elements.Add(new BarElement(model.Nodes["n2"], model.Nodes["n3"]) { Label = "r2" });
model.Elements.Add(new BarElement(model.Nodes["n3"], model.Nodes["n4"]) { Label = "r3" });

(model.Elements["r1"] as BarElement).Section = new BriefFiniteElementNet.Sections.UniformGeometric1DSection(SectionGenerator.GetRectangularSection(0.01, 0.01));
(model.Elements["r2"] as BarElement).Section = new BriefFiniteElementNet.Sections.UniformGeometric1DSection(SectionGenerator.GetRectangularSection(0.01, 0.01));
(model.Elements["r3"] as BarElement).Section = new BriefFiniteElementNet.Sections.UniformGeometric1DSection(SectionGenerator.GetRectangularSection(0.01, 0.01));

(model.Elements["r1"] as BarElement).Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210 * Math.Pow(10, 9), 0.3);
(model.Elements["r2"] as BarElement).Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210 * Math.Pow(10, 9), 0.3);
(model.Elements["r3"] as BarElement).Material = BriefFiniteElementNet.Materials.UniformIsotropicMaterial.CreateFromYoungPoisson(210 * Math.Pow(10, 9), 0.3);

(model.Elements["r3"] as BarElement).StartReleaseCondition =
new Constraint(dx: DofConstraint.Fixed, dy: DofConstraint.Fixed, dz: DofConstraint.Fixed, rx: DofConstraint.Fixed, ry: DofConstraint.Released, rz: DofConstraint.Fixed);

model.Solve_MPC();

Console.WriteLine((model.Elements["r2"] as BarElement).GetInternalForceAt(1, LoadCase.DefaultLoadCase).My.ToString());
Console.WriteLine((model.Elements["r3"] as BarElement).GetInternalForceAt(-1, LoadCase.DefaultLoadCase).My.ToString());
Console.ReadKey();

My result:
image
I think, that even with the hinge there, the internal moments in two rods near the same node should be close to zero.

Polar Area Moment Of Inertia

The most recent version of the code removes the ability to add custom J (Polar Area Moment Of Inertia) to a section and instead uses J = Iz + Iy.

I believe being able to enter a custom value for J would help users design structures with different cross sections accurately.

image

Non-Linear Analysis

Hi Ehsan,

I noticed that your finite element analysis project is one of the few ones in C# on the web and you seem to have good knowledge in this field. Would i be able to contact you with a question?

I am working on a non-Linear Geometric Analysis package for 3D beams and i can share some of my code with you.

Regards,
Anthony

Adding new Elements

Hello there,
first of all I need to thank you for this great work. I actually need to implement a four-noded rectangular element to your library. Have you got any special hints or things I need to consider because I'm a relatively new BFE.Net-user but familiar with FEM.
Thank you!

CSparse does not install correctly with VS Community 2017

Describe the bug
I tried to follow https://bfenet.readthedocs.io/en/latest/gettingstarted/index.html.
The BriefFiniteElementNet.Common projects does not build due to a broken reference to CSparse.

Expected behavior
CSparse reference works correctly after adding the two mentioned .csproj files in a new solution.

Workaround
Deleting the broken CSparse reference and manually adding a new one to packages/CSparse.3.4.2/lib/net40/CSparse.dll helps.

-      <HintPath>..\packages\CSparse.3.4.2\lib\net40\CSparse.dll</HintPath>
+      <HintPath>..\..\packages\CSparse.3.4.2\lib\net40\CSparse.dll</HintPath>
`

PartialNonUniformLoad

Now the PartialNonUniformLoad is showed "still in development, have bugs", when will be done?
Thank you for your excellent project!

How to get Internal Force value in Tetrahedral elements?

Hi,

Please tell me how to get Internal Force value in Tetrahedral elements.
Developer told me about getting displacement.
I try to change the code to get Internal Force value but I can't do because I'm beginner at C#.
I guess that I should use 'GetInternalForce' method...
The code is as follows.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BriefFiniteElementNet;
using BriefFiniteElementNet.Elements;

namespace BfeTestApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            var model = new BriefFiniteElementNet.Model();

            var p = new Point[20];
            var ns = new Node[20];


            p[0] = new Point(x: 0, y: 1, z: 0);
            p[1] = new Point(x: 0, y: 0, z: 0);
            p[2] = new Point(x: 0.20, y: 0, z: 0);
            p[3] = new Point(x: 0.20, y: 0, z: 0.20);
            p[4] = new Point(x: 0.20, y: 1, z: 0);
            p[5] = new Point(x: 0.20, y: 1, z: 0.20);
            p[6] = new Point(x: 0, y: 1, z: 0.20);
            p[7] = new Point(x: 0, y: 0, z: 0.20);
            p[8] = new Point(x: 0, y: 0.50, z: 0);
            p[9] = new Point(x: 0.20, y: 0.50, z: 0);
            p[10] = new Point(x: 0, y: 0.50, z: 0.20);
            p[11] = new Point(x: 0.20, y: 0.50, z: 0.20);
            p[12] = new Point(x: 0.20, y: 0.25, z: 0.20);
            p[13] = new Point(x: 0, y: 0.25, z: 0.20);
            p[14] = new Point(x: 0, y: 0.25, z: 0);
            p[15] = new Point(x: 0.20, y: 0.25, z: 0);
            p[16] = new Point(x: 0.20, y: 0.75, z: 0.20);
            p[17] = new Point(x: 0.20, y: 0.75, z: 0);
            p[18] = new Point(x: 0, y: 0.75, z: 0);
            p[19] = new Point(x: 0, y: 0.75, z: 0.20);

            for (var i = 0; i < 20; i++)
            {
                model.Nodes.Add(ns[i] = new Node(p[i]));
                ns[i].Label = "n" + i.ToString();
                ns[i].Constraints = Constraints.RotationFixed;
            }

            


            var mesh = new int[24][];

            mesh[0] = new int[] { 0, 4, 16, 17 };
            mesh[1] = new int[] { 8, 15, 12, 14 };
            mesh[2] = new int[] { 8, 16, 17, 18 };
            mesh[3] = new int[] { 10, 8, 11, 12 };
            mesh[4] = new int[] { 5, 19, 0, 16 };
            mesh[5] = new int[] { 1, 15, 14, 12 };
            mesh[6] = new int[] { 8, 10, 11, 16 };
            mesh[7] = new int[] { 3, 13, 1, 7 };
            mesh[8] = new int[] { 3, 13, 12, 1 };
            mesh[9] = new int[] { 8, 12, 13, 14 };
            mesh[10] = new int[] { 1, 15, 12, 2 };
            mesh[11] = new int[] { 9, 8, 11, 16 };
            mesh[12] = new int[] { 10, 8, 12, 13 };
            mesh[13] = new int[] { 5, 0, 4, 16 };
            mesh[14] = new int[] { 5, 19, 6, 0 };
            mesh[15] = new int[] { 8, 19, 16, 18 };
            mesh[16] = new int[] { 8, 19, 10, 16 };
            mesh[17] = new int[] { 0, 19, 18, 16 };
            mesh[18] = new int[] { 1, 3, 2, 12 };
            mesh[19] = new int[] { 8, 15, 9, 12 };
            mesh[20] = new int[] { 13, 12, 1, 14 };
            mesh[21] = new int[] { 8, 9, 11, 12 };
            mesh[22] = new int[] { 9, 8, 16, 17 };
            mesh[23] = new int[] { 16, 0, 17, 18 };

            foreach (var elm in mesh)
            {
                var felm = new Tetrahedral();

                felm.Nodes[0] = ns[elm[0]];
                felm.Nodes[1] = ns[elm[1]];
                felm.Nodes[2] = ns[elm[2]];
                felm.Nodes[3] = ns[elm[3]];

                felm.E = 210e9;
                felm.Nu = 0.33;
                model.Elements.Add(felm);
            }


            var relm = new BriefFiniteElementNet.MpcElements.RigidElement_MPC();
            relm.Nodes = new NodeList() { ns[0], ns[4], ns[5], ns[6] };
            relm.UseForAllLoads = true;
            //model.MpcElements.Add(relm);

            ns[1].Constraints = ns[2].Constraints = ns[3].Constraints = ns[7].Constraints = Constraints.Fixed;
           
            

            var load = new BriefFiniteElementNet.NodalLoad();
            var frc = new Force();
            frc.Fz = 1000;// 1kN force in Z direction
            load.Force = frc;

            ns[5].Loads.Add(load);
            ns[6].Loads.Add(load);

            model.Solve_MPC();

            var d5 = ns[5].GetNodalDisplacement();
            var d6 = ns[6].GetNodalDisplacement();

            Console.WriteLine("Nodal displacement in Z direction is {0} meters (thus {1} mm)", d5.DZ, d5.DZ * 1000);
            Console.WriteLine("Nodal displacement in Z direction is {0} meters (thus {1} mm)", d6.DZ, d6.DZ * 1000);
        }
    }
}

tests

BarElements InternalForce with Hing

Describe the bug
If some of the BarElements have hinges sometimes internal forces are calculated incorrectly.

To Reproduce
?

Expected behavior

Incorrect (with BarElement):
image
Correct (with FrameElement2Node):
image

Additional context
Reported by S.G.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.