Skip to content
Snippets Groups Projects
Commit 674399dd authored by Ernesto Oquelis's avatar Ernesto Oquelis
Browse files

update and working on tetraeder model

parent 1de90418
No related branches found
No related tags found
No related merge requests found
"""
This is an empty docstring
"""
from oofem_classes import Constraint, Force, Node, Element, Structure, Visualizer
struct = Structure()
n1 = Node([0, 0, 0])
n2 = Node([1, 1, 0])
e1 = Element(1, 1, n1, n2)
c1 = Constraint([False, True, True])
n1.set_constraint(c1)
eqn = n1.enumerate_dofs(0)
eqn = n2.enumerate_dofs(eqn)
e1.enumerate_dofs()
A= n1.get_dof_numbers()
B=n2.get_dof_numbers()
print(e1.get_dofs())
\ No newline at end of file
...@@ -34,7 +34,7 @@ class Node: ...@@ -34,7 +34,7 @@ class Node:
self.displacement = None self.displacement = None
self.constraint = None self.constraint = None
self.forces = None self.forces = None
self.dof_numbers = None self.dof_numbers = np.zeros((3,1))
def set_displacement(self, new_displacement): def set_displacement(self, new_displacement):
self.displacement = np.array(new_displacement, dtype='float64') self.displacement = np.array(new_displacement, dtype='float64')
...@@ -65,7 +65,7 @@ class Node: ...@@ -65,7 +65,7 @@ class Node:
current_dof = start current_dof = start
if self.constraint == None: if self.constraint == None:
self.dof_numbers = [current_dof, current_dof + 1, current_dof + 2] self.dof_numbers = np.array([current_dof, current_dof + 1, current_dof + 2], dtype='int32').reshape(3,1)
else: else:
for i in range(3): for i in range(3):
...@@ -128,7 +128,7 @@ class Element: ...@@ -128,7 +128,7 @@ class Element:
def enumerate_dofs(self): def enumerate_dofs(self):
self.dof_numbers = np.concatenate([self.node_1.get_dof_numbers(), self.dof_numbers = np.concatenate([self.node_1.get_dof_numbers(),
self.node_1.get_dof_numbers()]) self.node_2.get_dof_numbers()])
def compute_force(self): def compute_force(self):
position_node_1 = self.get_node_1().get_position() position_node_1 = self.get_node_1().get_position()
......
...@@ -5,10 +5,9 @@ This is an empty docstring ...@@ -5,10 +5,9 @@ This is an empty docstring
from oofem_classes import Constraint, Force, Node, Element, Structure, Visualizer from oofem_classes import Constraint, Force, Node, Element, Structure, Visualizer
c1 = Constraint([True, False, True]) """
f1 = Force([1.2, -4, 0]) f1 = Force([1.2, -4, 0])
n1 = Node([1, 0, 0])
n2 = Node([0, 1, 0])
e1 = Element(2.1e8, 0.2, n1, n2) e1 = Element(2.1e8, 0.2, n1, n2)
n1.set_constraint(c1) n1.set_constraint(c1)
...@@ -19,6 +18,25 @@ n2.get_force().print_force() ...@@ -19,6 +18,25 @@ n2.get_force().print_force()
n1.print_node() n1.print_node()
n2.print_node() n2.print_node()
e1.print_element() e1.print_element()
"""
struct = Structure()
n1 = Node([0, 0, 0])
n2 = Node([1, 1, 0])
e1 = Element(1, 1, n1, n2)
c1 = Constraint([False, True, True])
n1.set_constraint(c1)
eqn = n1.enumerate_dofs(0)
eqn = n2.enumerate_dofs(eqn)
e1.enumerate_dofs()
A= n1.get_dof_numbers()
B=n2.get_dof_numbers()
struct = Structure() print(e1.get_dofs())
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment