A REAL PROGRESS

This commit is contained in:
Frank14f
2024-08-18 22:50:50 +08:00
parent c6f607dd8d
commit fb1efcd441
6 changed files with 165 additions and 85 deletions
Binary file not shown.
+7 -1
View File
@@ -90,7 +90,7 @@ class FlowField:
# Initialize memory
self.ddf = np.zeros(self.FIELD_SIZE * self.LATTICE, dtype=self.DATA_TYPE)
# self.velo = np.zeros(self.FIELD_SIZE * self.DIM, dtype=self.DATA_TYPE)
self.ddf_save = np.zeros(self.FIELD_SIZE * self.LATTICE, dtype=self.DATA_TYPE)
self.flag = np.ones(self.FIELD_SIZE, dtype=np.uint8)
self.indx = np.zeros(self.FIELD_SIZE, dtype=np.int32)
@@ -278,5 +278,11 @@ class FlowField:
def get_ddf(self):
cuda.memcpy_dtoh(self.ddf, self.ddf_gpu)
def save_ddf(self):
self.ddf_save = self.ddf.copy()
def restore_ddf(self):
self.ddf = self.ddf_save.copy()
def __del__(self):
self.context.pop()