From 8e193940721a7f0bd7cd768ed41cf33e2c1e1bee Mon Sep 17 00:00:00 2001 From: Ernesto Oquelis <ernesto.oquelis@gmail.com> Date: Mon, 24 Sep 2018 19:55:18 +0200 Subject: [PATCH] update --- fem_2d.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/fem_2d.py b/fem_2d.py index 8cb3bc3..f1e1c50 100644 --- a/fem_2d.py +++ b/fem_2d.py @@ -174,9 +174,26 @@ class Structure2DPlaneStress: # Assembles stiffness matrix for element_id in range(self.num_elements): + k_e_indexes = list() node_ids = self.elements_list[element_id].node_ids k_e = self.elements_list[element_id].get_k_mat(self.thickness, self.c_mat) + for ix in node_ids: + k_e_indexes.append(ix * 2) + k_e_indexes.append(ix * 2 + 1) + + + + +''' + for (i, j) in [(i,j) for i in node_ids for j in node_ids]: + + + + + + + for (i, j) in ((0, 0), (0, 1), (1, 0), (1, 1)): k_global[node_ids[i], node_ids[j]] = (k_global[node_ids[i], node_ids[j]] + @@ -187,7 +204,7 @@ class Structure2DPlaneStress: -''' + def solve(self): """ Solves linear system of equations. -- GitLab