Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
epsi1on committed Nov 18, 2023
1 parent 9bee752 commit 98c46d4
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Sources/TestingConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ static void Main(string[] args)

//TimoshenkoBeamChecker.Test2();
//BriefFiniteElementNet.Validation.GithubIssues.Issue158.Run();
BriefFiniteElementNet.Validation.GithubIssues.Issue161.Run();
//BriefFiniteElementNet.Validation.GithubIssues.Issue161.Run();
BriefFiniteElementNet.Validation.GithubIssues.Issue174.Run();
//EulerBernouly2nodeChecker.TestConsoleBeam();

Console.Write("Done");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
<Compile Include="GithubIssues\Issue158.cs" />
<Compile Include="GithubIssues\Issue159.cs" />
<Compile Include="GithubIssues\Issue161.cs" />
<Compile Include="GithubIssues\Issue174.cs" />
<Compile Include="GithubIssues\Issue23.cs" />
<Compile Include="GithubIssues\Issue24.cs" />
<Compile Include="GithubIssues\Issue25.cs" />
Expand Down
72 changes: 72 additions & 0 deletions Validation/Validation/GithubIssues/Issue174.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using BriefFiniteElementNet.Elements;
using BriefFiniteElementNet.Loads;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BriefFiniteElementNet.Validation.GithubIssues
{
public static class Issue174
{
public static void Run()
{
var load = new PartialNonUniformLoad(); //creating new instance of load

var l = 6.5;

var model = new Model();

Node n1 = new Node(0, 0, 0) { Label = "n0" };
Node n2 = new Node(l, 0, 0) { Label = "n1" };

var bar = new BarElement(n1, n2) { Label = "e0" };

model.Nodes.Add(n1);
model.Nodes.Add(n2);
model.Elements.Add(bar);

var x1 = 2.0;
var x2 = 5.0;
var x3 = 6.5;

var xi1 = bar.LocalCoordsToIsoCoords(x1)[0];
var xi2 = bar.LocalCoordsToIsoCoords(x2)[0];

var p1 = 1.8 * 9806.65;//1.8 ton/m = 1.8 * 9806.65 N/m
var p2 = 2.3 * 9806.65;//2.3 ton/m = 1.8 * 9806.65 N/m

// For the case of a triangular load on a beam
load.SeverityFunction = BriefFiniteElementNet.Mathh.SingleVariablePolynomial.FromPoints(xi1, p1, xi2, p2);
load.StartLocation = new IsoPoint(xi1); //set locations of trapezoidal load
load.EndLocation = new IsoPoint(xi2);

load.Direction = -Vector.K;
load.CoordinationSystem = CoordinationSystem.Global;

n1.Constraints = Constraints.MovementFixed;
n2.Constraints = Constraints.MovementFixed & Constraints.FixedRX;

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

bar.Material = mat;
bar.Section = sec;

var u1 = load;

bar.Loads.Add(u1);

model.Solve_MPC();

var r1 = n1.GetSupportReaction();
var r2 = n2.GetSupportReaction();

Console.WriteLine("support reaction of n1: {0}", r1);
Console.WriteLine("support reaction of n2: {0}", r2);

//var frc = bar.GetGlobalEquivalentNodalLoads(u1);
}
}
}
2 changes: 1 addition & 1 deletion docs/example/UniformLoadCoordSystem/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Based on `toturial in www.learnaboutstructures.com <http://www.learnaboutstructu

So in this example we do not need theta value itself, but we need `Cos(θ)` or more precise absolute value of it `|Cos(θ)|`. Due to elementary trigonometry relations `Cos(θ)=Sin(90°-θ)`. So instead of `|Cos(θ)|` we can calculate `|Sin(α)|` where `α = 90°-θ` and `α` equals to angle between load direction and element direction. For finding `|Sin(α)|` we can use length of cross product of two unit vectors of element direction and load direction. This coefficient is always a non negative value and less than or equal to `1.0`. If element is horizontal then `|Cos(θ)| = 1.0` if element is vertical then `|Cos(θ)| = 0.0`.

.. hint:: Note that actually two vectors have to angles between them, a bigger one and a smaller one, but absolute value of cosine of them both are same i.e `|Cos(θ)| = |Cos(180°-θ)|`
.. hint:: Note that actually two vectors have tow angles between them, a bigger one and a smaller one, but absolute value of cosine of them both are same i.e `|Cos(θ)| = |Cos(180°-θ)|`



Expand Down

0 comments on commit 98c46d4

Please sign in to comment.