-
Notifications
You must be signed in to change notification settings - Fork 5
/
bar-analysis.ts
59 lines (55 loc) · 1.43 KB
/
bar-analysis.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// An example of three bars loaded with a point load.
import { Node, Element, AnalysisInput, AnalysisOutputs } from "../src";
const nodes: Node[] = [
[0, 0, 0],
[0, 3, 0],
[3, 3, 0],
[3, 0, 0],
];
const elements: Element[] = [
[0, 1],
[0, 2],
[0, 3],
];
const analysisInputs: AnalysisInput[] = [
{
node: 1,
support: [true, true, false],
},
{
node: 2,
support: [true, true, false],
},
{
node: 3,
support: [true, true, false],
},
{
node: 0,
load: [0, -50, 0],
},
...elements.map((_, i) => ({
element: i,
area: 6e-4,
elasticity: 200e6,
})),
];
// An example of how to run an analysis. Check https://awatif.co/awatif-fem for more details
// const analysisOutputs = analyze(nodes, elements, analysisInputs);
const analysisOutputs: AnalysisOutputs = {
default: [
{
node: 0,
deformation: [0.00025888347648318446, -0.0009911165235168156, 0],
},
{ node: 1, deformation: [0, 0, 0] },
{ node: 1, reaction: [0, 39.644660940672615, 0] },
{ node: 2, deformation: [0, 0, 0] },
{ node: 2, reaction: [10.355339059327376, 10.355339059327376, 0] },
{ node: 3, deformation: [0, 0, 0] },
{ node: 3, reaction: [-10.355339059327376, 0, 0] },
{ element: 0, normal: [39.644660940672615, 39.644660940672615] },
{ element: 1, normal: [14.644660940672624, 14.644660940672624] },
{ element: 2, normal: [-10.355339059327376, -10.355339059327376] },
],
};