From 4ff216f98441250ac903c6b35e55ac68b1a8aaaf Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 15 Nov 2021 09:43:56 +0100 Subject: [PATCH] Store edge topology in numdata --- src/compas_fd/numdata/fd_numerical_data.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/compas_fd/numdata/fd_numerical_data.py b/src/compas_fd/numdata/fd_numerical_data.py index b478a38e..19e7234d 100644 --- a/src/compas_fd/numdata/fd_numerical_data.py +++ b/src/compas_fd/numdata/fd_numerical_data.py @@ -31,7 +31,7 @@ def __init__(self, ): self.xyz = vertices self.fixed = fixed - self.connectivity_matrix = edges + self.edges = edges self.force_densities = force_densities self.loads = loads @@ -75,15 +75,22 @@ def free(self): return self._free @property - def connectivity_matrix(self): - return self._connectivity_matrix + def edges(self): + return self._edges - @connectivity_matrix.setter - def connectivity_matrix(self, edges): - self._connectivity_matrix = connectivity_matrix(edges, 'csr') + @edges.setter + def edges(self, edges): + self._edges = edges + self._connectivity_matrix = None self._connectivity_matrix_free = None self._connectivity_matrix_fixed = None + @property + def connectivity_matrix(self): + if self._connectivity_matrix is None: + self._connectivity_matrix = connectivity_matrix(self.edges, 'csr') + return self._connectivity_matrix + @property def connectivity_matrix_free(self): if self._connectivity_matrix_free is None: