Skip to content

Commit

Permalink
optimize the initialization of large tetrahedral tensor mesh (#1100)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinnala authored Jan 26, 2024
1 parent 2bf93b7 commit d098c6b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions skfem/mesh/mesh_tet_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,13 +381,13 @@ def init_tensor(cls: Type,
.copy()
.flatten())

T = np.zeros((4, 0))
T = np.hstack((T, t[[0, 1, 5, 7]]))
T = np.hstack((T, t[[0, 1, 4, 7]]))
T = np.hstack((T, t[[0, 2, 4, 7]]))
T = np.hstack((T, t[[0, 3, 5, 7]]))
T = np.hstack((T, t[[0, 2, 6, 7]]))
T = np.hstack((T, t[[0, 3, 6, 7]]))
T = np.zeros((4, 6 * ne))
T[:, :ne] = t[[0, 1, 5, 7]]
T[:, ne:(2 * ne)] = t[[0, 1, 4, 7]]
T[:, (2 * ne):(3 * ne)] = t[[0, 2, 4, 7]]
T[:, (3 * ne):(4 * ne)] = t[[0, 3, 5, 7]]
T[:, (4 * ne):(5 * ne)] = t[[0, 2, 6, 7]]
T[:, (5 * ne):] = t[[0, 3, 6, 7]]

return cls(p, T.astype(np.int64))

Expand Down

0 comments on commit d098c6b

Please sign in to comment.