Skip to content

Commit 8d0381e

Browse files
committed
minor change & rename
1 parent 7ab7854 commit 8d0381e

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

BriefFiniteElementNet.Common/MathUtil.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public static class MathUtil
99
/// <summary>
1010
/// The epsilon, threshold using for determining whether two mumbers are equal or not
1111
/// </summary>
12-
public static double Epsilon = 1e-8;
13-
12+
//public static double Epsilon = 1e-8;
13+
/*
1414
/// <summary>
1515
/// Determines val1 equals val2 or not.
1616
/// </summary>
@@ -21,6 +21,20 @@ public static class MathUtil
2121
/// true if val1 equals val2 else false
2222
/// </returns>
2323
public static bool Equals(double val1, double val2, double epsilon)
24+
{
25+
return FEquals(val1, val2, epsilon);
26+
}*/
27+
28+
/// <summary>
29+
/// Determines val1 equals val2 or not with fuzzy approach
30+
/// </summary>
31+
/// <param name="val1">The val1.</param>
32+
/// <param name="val2">The val2.</param>
33+
/// <param name="epsilon">The epsilon.</param>
34+
/// <returns>
35+
/// true if val1 equals val2 else false
36+
/// </returns>
37+
public static bool FEquals(double val1, double val2, double epsilon=0)
2438
{
2539
var diff = Math.Abs(val1 - val2);
2640

BriefFiniteElementNet.TestConsole/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ static void Main(string[] args)
3838

3939
Validation.GithubIssues.Issue96.Run1();
4040

41+
return;
4142
TestTet();
4243
//TestTriangle();
4344
//Validation.GithubIssues.Issue50.Run1();

BriefFiniteElementNet.Validation/GithubIssues/Issue96.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static void Run1()
2929

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

32-
m1.Solve();
32+
m1.Solve_MPC();
3333

3434
var r11 = m1.Nodes[0].GetSupportReaction();
3535

BriefFiniteElementNet/Elements/AnisotropicMaterialInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ public bool HasValidMechanizalProperties()
4747

4848
var flags = new bool[]
4949
{
50-
Common.MathUtil.Equals(nu_yz / ey, nu_zy / ez, tol),
51-
Common.MathUtil.Equals(nu_zx / ez, nu_xz / ex, tol),
52-
Common.MathUtil.Equals(nu_yx / ey, nu_xy / ex, tol),
50+
Common.MathUtil.FEquals(nu_yz / ey, nu_zy / ez, tol),
51+
Common.MathUtil.FEquals(nu_zx / ez, nu_xz / ex, tol),
52+
Common.MathUtil.FEquals(nu_yx / ey, nu_xy / ex, tol),
5353
};
5454

5555
return flags.All(i => i);

BriefFiniteElementNet/Utils/CalcUtil.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ public static void GetBarTransformationMatrix(Vector v, double _webRotation, Mat
850850

851851
//var v = this.EndNode.Location - this.StartNode.Location;
852852

853-
if (MathUtil.Equals(0, v.X) && MathUtil.Equals(0, v.Y))
853+
if (MathUtil.FEquals(0, v.X) && MathUtil.FEquals(0, v.Y))
854854
{
855855
if (v.Z > 0)
856856
{

0 commit comments

Comments
 (0)