-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimulationBox.py
More file actions
56 lines (37 loc) · 1.5 KB
/
Copy pathSimulationBox.py
File metadata and controls
56 lines (37 loc) · 1.5 KB
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
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 27 02:44:37 2022
@author: Laura Stricker, laura.stricker@mat.ethz.ch
"""
import numpy as np
from importlib import reload
import Point
reload(Point)
from Point import Point
class SimulationBox:
def __init__(self,lengthX,lengthY,lengthZ):
self.lengthX = float(lengthX)
self.lengthY = float(lengthY)
self.lengthZ = float(lengthZ)
self.nodes = np.zeros(8, dtype=object)
self.fixedNodePair = np.zeros(2, dtype=object)
def findNodes(self):
node0 = Point(0.,0.,0.)
node1 = Point(self.lengthX,0.,0.)
node2 = Point(self.lengthX,self.lengthY,0.)
node3 = Point(0.,self.lengthY,0.)
node4 = Point(0.,0.,self.lengthZ)
node5 = Point(self.lengthX,0.,self.lengthZ)
node6 = Point(self.lengthX,self.lengthY,self.lengthZ)
node7 = Point(0.,self.lengthY,self.lengthZ)
# Front: Back:
# 7 6 3 2
# +_____+ +_____+
# | | | |
# | | | |
# +_____+ +_____+
# 4 5 0 1
self.nodes = (node0,node1,node2,node3,node4,node5,node6,node7)
def defineFixedNodesToSetBackboneExtremes(self,parameters):
self.fixedNodePair[0] = self.nodes[parameters.boxNodeStart]
self.fixedNodePair[1] = self.nodes[parameters.boxNodeEnd]