Skip to content

Commit 7ab7854

Browse files
committed
after merge
2 parents c797198 + 8f73e9c commit 7ab7854

File tree

46 files changed

+5757
-1703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5757
-1703
lines changed

BriefFiniteElementNet.BenchmarkApplication/BriefFiniteElementNet.BenchmarkApplication.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
<WarningLevel>4</WarningLevel>
3535
</PropertyGroup>
3636
<ItemGroup>
37-
<Reference Include="CSparse, Version=3.4.7.0, Culture=neutral, processorArchitecture=MSIL">
38-
<HintPath>..\packages\CSparse.3.4.7\lib\net45\CSparse.dll</HintPath>
37+
<Reference Include="CSparse, Version=3.4.9.0, Culture=neutral, processorArchitecture=MSIL">
38+
<HintPath>..\packages\CSparse.3.4.9\lib\net45\CSparse.dll</HintPath>
3939
</Reference>
4040
<Reference Include="System" />
4141
<Reference Include="System.Core" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="CSparse" version="3.4.7" targetFramework="net45" />
3+
<package id="CSparse" version="3.4.9" targetFramework="net45" />
44
</packages>

BriefFiniteElementNet.CodeProjectExamples/BriefFiniteElementNet.CodeProjectExamples.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
<Prefer32Bit>false</Prefer32Bit>
3737
</PropertyGroup>
3838
<ItemGroup>
39-
<Reference Include="CSparse, Version=3.4.7.0, Culture=neutral, processorArchitecture=MSIL">
40-
<HintPath>..\packages\CSparse.3.4.7\lib\net45\CSparse.dll</HintPath>
39+
<Reference Include="CSparse, Version=3.4.9.0, Culture=neutral, processorArchitecture=MSIL">
40+
<HintPath>..\packages\CSparse.3.4.9\lib\net45\CSparse.dll</HintPath>
4141
</Reference>
4242
<Reference Include="PresentationCore" />
4343
<Reference Include="PresentationFramework" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="CSparse" version="3.4.7" targetFramework="net45" />
3+
<package id="CSparse" version="3.4.9" targetFramework="net45" />
44
</packages>

BriefFiniteElementNet.Common/BriefFiniteElementNet.Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</PropertyGroup>
2525

2626
<ItemGroup>
27-
<PackageReference Include="CSparse" Version="3.4.7" />
27+
<PackageReference Include="CSparse" Version="3.4.9" />
2828
</ItemGroup>
2929

3030
</Project>

BriefFiniteElementNet.Common/MathUtil.cs

Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@
22
///
33
using System;
44

5-
65
namespace BriefFiniteElementNet.Common
76
{
87
public static class MathUtil
98
{
109
/// <summary>
11-
/// Determines val1 equals val2 or not.
10+
/// The epsilon, threshold using for determining whether two mumbers are equal or not
1211
/// </summary>
13-
/// <param name="val1">The val1.</param>
14-
/// <param name="val2">The val2.</param>
15-
/// <returns>true if val1 == val2 else false</returns>
16-
public static bool Equals(double val1, double val2)
17-
{
18-
return Equals(val1, val2, Epsilon);
19-
}
12+
public static double Epsilon = 1e-8;
2013

2114
/// <summary>
2215
/// Determines val1 equals val2 or not.
@@ -34,48 +27,6 @@ public static bool Equals(double val1, double val2, double epsilon)
3427
return diff <= epsilon;
3528
}
3629

37-
38-
/// <summary>
39-
/// The epsilon, threshold using for determining whether two mumbers are equal or not
40-
/// </summary>
41-
public static double Epsilon = 1e-8;
42-
43-
44-
/// <summary>
45-
/// Fills the lower triangle from upper triangle.
46-
/// </summary>
47-
/// <param name="mtx">The Matrix (square matrix).</param>
48-
/// <remarks>In element stiffness matrix the lower triangle of matrix is symmetry of upper triangle of matrix (matrix is symmetric)
49-
/// For improving performance, it is suggested that only upper part (and diagonal) of member stiffness matrix be calculated and lower triangular be mirrored from upper part using this method</remarks>
50-
public static void FillLowerTriangleFromUpperTriangle(Matrix mtx)
51-
{
52-
var c = mtx.RowCount;
53-
54-
for (var i = 0; i < c; i++)
55-
for (var j = 0; j < i; j++)
56-
mtx[i, j] = mtx[j, i];
57-
58-
}
59-
60-
61-
/// <summary>
62-
/// Calculates the minus of two array (a-b)
63-
/// </summary>
64-
/// <param name="a">A.</param>
65-
/// <param name="b">B.</param>
66-
/// <returns>A-B</returns>
67-
public static double[] ArrayMinus(double[] a, double[] b)
68-
{
69-
var buf = (double[])a.Clone();
70-
71-
for (int i = 0; i < buf.Length; i++)
72-
buf[i] -= b[i];
73-
74-
return buf;
75-
}
76-
77-
78-
7930
/// <summary>
8031
/// Fills the array with specified value
8132
/// </summary>
@@ -91,7 +42,6 @@ public static void FillWith<T>(this T[] arr, T val)
9142

9243
public static int FirstIndexOf<T>(this T[] arr, T val)
9344
{
94-
9545
if (arr != null)
9646
for (var i = 0; i < arr.Length; i++)
9747
if (SafeEquals(arr[i], val))
@@ -100,9 +50,7 @@ public static int FirstIndexOf<T>(this T[] arr, T val)
10050
return -1;
10151
}
10252

103-
104-
105-
public static bool SafeEquals(object o1,object o2)
53+
private static bool SafeEquals(object o1,object o2)
10654
{
10755
if (ReferenceEquals(o1, o2))
10856
return true;
@@ -113,8 +61,57 @@ public static bool SafeEquals(object o1,object o2)
11361
return o1.Equals(o2);
11462
}
11563

64+
// TODO: LEGACY CODE - FillLowerTriangleFromUpperTriangle, move out of main assembly?
65+
66+
/// <summary>
67+
/// Fills the lower triangle from upper triangle.
68+
/// </summary>
69+
/// <param name="mtx">The Matrix (square matrix).</param>
70+
/// <remarks>
71+
/// In element stiffness matrix the lower triangle of matrix is symmetry of upper triangle
72+
/// of matrix (matrix is symmetric). For improving performance, it is suggested that only
73+
/// upper part (and diagonal) of member stiffness matrix be calculated and lower triangular
74+
/// be mirrored from upper part using this method
75+
/// </remarks>
76+
public static void FillLowerTriangleFromUpperTriangle(Matrix mtx)
77+
{
78+
var c = mtx.RowCount;
79+
80+
for (var i = 0; i < c; i++)
81+
for (var j = 0; j < i; j++)
82+
mtx[i, j] = mtx[j, i];
83+
84+
}
85+
86+
/* UNUSED
87+
88+
/// <summary>
89+
/// Determines val1 equals val2 or not.
90+
/// </summary>
91+
/// <param name="val1">The val1.</param>
92+
/// <param name="val2">The val2.</param>
93+
/// <returns>true if val1 == val2 else false</returns>
94+
public static bool Equals_(double val1, double val2)
95+
{
96+
return Equals(val1, val2, Epsilon);
97+
}
98+
99+
/// <summary>
100+
/// Calculates the minus of two array (a-b)
101+
/// </summary>
102+
/// <param name="a">A.</param>
103+
/// <param name="b">B.</param>
104+
/// <returns>A-B</returns>
105+
public static double[] ArrayMinus(double[] a, double[] b)
106+
{
107+
var buf = (double[])a.Clone();
116108
109+
for (int i = 0; i < buf.Length; i++)
110+
buf[i] -= b[i];
111+
112+
return buf;
113+
}
117114
118-
115+
//*/
119116
}
120117
}

BriefFiniteElementNet.Controls/BriefFiniteElementNet.Controls.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
<Prefer32Bit>false</Prefer32Bit>
3535
</PropertyGroup>
3636
<ItemGroup>
37-
<Reference Include="CSparse, Version=3.4.7.0, Culture=neutral, processorArchitecture=MSIL">
38-
<HintPath>..\packages\CSparse.3.4.7\lib\net45\CSparse.dll</HintPath>
37+
<Reference Include="CSparse, Version=3.4.9.0, Culture=neutral, processorArchitecture=MSIL">
38+
<HintPath>..\packages\CSparse.3.4.9\lib\net45\CSparse.dll</HintPath>
3939
</Reference>
4040
<Reference Include="HelixToolkit, Version=2.12.0.0, Culture=neutral, PublicKeyToken=52aa3500039caf0d, processorArchitecture=MSIL">
4141
<HintPath>..\packages\HelixToolkit.2.12.0\lib\netstandard1.1\HelixToolkit.dll</HintPath>

BriefFiniteElementNet.Controls/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="CSparse" version="3.4.7" targetFramework="net45" />
3+
<package id="CSparse" version="3.4.9" targetFramework="net45" />
44
<package id="HelixToolkit" version="2.12.0" targetFramework="net45" />
55
<package id="HelixToolkit.Wpf" version="2.12.0" targetFramework="net45" />
66
<package id="OxyPlot.Core" version="2.0.0" targetFramework="net45" />

BriefFiniteElementNet.CustomElements/BriefFiniteElementNet.CustomElements.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</ItemGroup>
3333

3434
<ItemGroup>
35-
<PackageReference Include="CSparse" Version="3.4.7" />
35+
<PackageReference Include="CSparse" Version="3.4.9" />
3636
</ItemGroup>
3737

3838
<ItemGroup>

BriefFiniteElementNet.CustomElements/ElementHelpers/HexaHedralHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,9 @@ public Force[] GetLocalEquivalentNodalLoads(Element targetElement, ElementalLoad
523523

524524
var shp2 = hex.MatrixPool.Allocate(3, shp.ColumnCount);
525525

526-
shp2.AssembleInside(shp, 0, 0);
527-
shp2.AssembleInside(shp, 1, 0);
528-
shp2.AssembleInside(shp, 2, 0);
526+
shp2.SetSubMatrix(0, 0, shp);
527+
shp2.SetSubMatrix(1, 0, shp);
528+
shp2.SetSubMatrix(2, 0, shp);
529529

530530

531531
var j = GetJMatrixAt(targetElement, xi, 0, 0);

0 commit comments

Comments
 (0)