Newer
Older
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
"""
This is an empty docstring.
"""
import numpy as np
class Force:
"""
This is a missing docstring.
"""
def __init__(self, components):
self.components = np.array(components, dtype='float64')
def get_component(self, c_component):
"""
Docstrig missing.
"""
return self.components[c_component]
def print(self):
"""
Docstrig missing.
"""
print('{}'.format(self.components))
class Constraint:
"""
This is a missing docstring.
"""
def __init__(self, free):
self.free = free
def is_free(self, c_component):
"""
Docstrig missing.
"""
return self.free[c_component]
def print(self):
"""
Docstrig missing.
"""
print('{}'.format(self.free))
class Node:
"""
This is a missing docstring.
"""
def __init__(self, position):
self.position = np.array(position, dtype='float64')
self.displacement = np.array((3, 1), dtype='float64')
self.constraint = Constraint()
self.force = Force()
self.dof_numbers = np.array((3, 1), dtype='float64')
def get_position(self):
return self.position
def get_displacement(self):
return self.displacement
def set_displacement(self, new_displacement):
self.displacement = new_displacement
def set_constraint(self, new_constraint):
self.constraint = new_constraint
def get_constraint(self, c_component):
return self.constraint
def set_force(self, new_force):
self.force = new_force
def get_force(self):
return self.force
if not self.constraint:
self.dof_numbers = [current_dof, current_dof+1, current_dof+2]
else:
for i in range(2):
if not self.constraint.is_free(i):
self.dof_numbers[i] = -1
else:
self.dof_numbers[i] = current_dof
current_dof = current_dof + 1
def get_dof_numbers(self):
return self.dof_numbers
def print(self):
print('{}'.format(self.position))
def __init__(self, elastic_modulus, area, node_1, node_2):
self.elastic_modulus = elastic_modulus
self. area = area
self.node_1 = node_1
self.node_2 = node_2
self.dof_numbers = np.array((6, 1), dtype='float64')
"""
def compute_stiffness_matrix(self):
K =