Skip to content

Commit bc84326

Browse files
committed
minor change & fix
1 parent a5f999a commit bc84326

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

BriefFiniteElementNet.Validation/BriefFiniteElementNet.Validation.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
<Compile Include="tetrahedronElementTester.cs" />
8181
<Compile Include="ValidationCaseAttribute.cs" />
8282
<Compile Include="ValidationResult.cs" />
83-
<Compile Include="ValidationUtil.cs" />
83+
<Compile Include="Util.cs" />
8484
<None Include="app.config" />
8585
<Compile Include="BarElementTester.cs" />
8686
<Compile Include="CustomMeshBuilder.cs" />

BriefFiniteElementNet.Validation/Case_02/Validator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public ValidationResult Validate()
308308

309309
}
310310

311-
writeDataTriangleElement(model, LoadCase.DefaultLoadCase);
311+
//writeDataTriangleElement(model, LoadCase.DefaultLoadCase);
312312

313313
return val;
314314
throw new NotImplementedException();

BriefFiniteElementNet.Validation/Case_03/Validator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace BriefFiniteElementNet.Validation.Case_03
1010
{
11-
[ValidationCase("Console beam with tetrahedron", typeof(TetrahedronElement))]
11+
//[ValidationCase("Console beam with tetrahedron", typeof(TetrahedronElement))]
1212
public class Validator : IValidationCase
1313
{
1414
public ValidationResult Validate()

BriefFiniteElementNet.Validation/Case_04/Validator.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,12 @@ public ValidationResult Validate()
8686
var diff = n1 - n2;
8787
//linear beam with loads -> rigid elements introduces rigid body -> Y and Z (translations perpendicular to the beam) are non zero and scaled. Set to zero to avoid confusion with result.
8888
diff.DY = diff.DZ = 0.0;
89-
span.Add("p").AddClass("bg-info").AppendHtml(string.Format(CultureInfo.CurrentCulture, "-Max ABSOLUTE Error: {0:e3}", diff));
89+
90+
//span.Add("p").AddClass("bg-info").Text(string.Format("-Max ABSOLUTE Error: {0:e3}", diff));//htmltags cannot encode the delta and teta chars so will use vector length
91+
span.Add("p").AddClass("bg-info")
92+
.Text(string.Format("-Max ABSOLUTE Error: Displacement:{0:e3} , Rotation:{1:e3}",
93+
diff.Displacements.Length, diff.Rotations.Length));
94+
9095
var buf = new ValidationResult();
9196
buf.Span = span;
9297
buf.Title = "Rigid element Validation";

BriefFiniteElementNet.Validation/ValidationUtil.cs renamed to BriefFiniteElementNet.Validation/Util.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,25 @@ namespace BriefFiniteElementNet.Validation
88
{
99
public static class Util
1010
{
11+
12+
public static string HtmlEncode(this string text)
13+
{
14+
char[] chars = System.Web.HttpUtility.HtmlEncode(text).ToCharArray();
15+
16+
StringBuilder result = new StringBuilder(text.Length + (int)(text.Length * 0.1));
17+
18+
foreach (char c in chars)
19+
{
20+
int value = Convert.ToInt32(c);
21+
if (value > 127)
22+
result.AppendFormat("&#{0};", value);
23+
else
24+
result.Append(c);
25+
}
26+
27+
return result.ToString();
28+
}
29+
1130
public static double GetErrorPercent(double test, double accurate)
1231
{
1332
var buf = Math.Abs(test - accurate) / Math.Abs(accurate);

0 commit comments

Comments
 (0)