diff --git a/fem_2d.py b/fem_2d.py index 8cb3bc313ae4db42110e15804a0e65b3a076f8f7..f1e1c5049a53c9d278f6de1407faeb2ab3cb540f 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.