Commit 5629e2d6 authored by Anthony's avatar Anthony
Browse files

Improvement of the truncate

parent 318c7152
......@@ -72,6 +72,7 @@ class trunc:
if self.max_ops_num_core == self.numop:
self.step2(hydrosuper, part, "core")
hydrosuper.killbas(self.tokill, self.totakeover, self.numops)
#print("Step 2,iter {0} Rank {1}, maxops : {2}".format(i,part.rank,np.max(self.numops)))
max_bas = part.domainmax(np.max(self.basin_count))
if part.rank == 0:
......@@ -90,7 +91,7 @@ class trunc:
comm.Barrier()
i += 1
# Step 3 : HTUs with the same ID
i = 1
self.max_ops_num_halo = self.numop; self.max_ops_num_core = self.numop
......@@ -131,7 +132,7 @@ class trunc:
comm.Barrier()
i += 1
# Step 5 : Brutal method
self.step5(hydrosuper, part)
hydrosuper.killbas(self.tokill, self.totakeover, self.numops)
......@@ -330,7 +331,13 @@ class trunc:
if len(A)>1:
B = self.fetch[npt][A]
changes.append([A[k]+1 for k in np.argsort(B)])
# We are working on core, it's ok to check outflow_grid = 0
A = np.where(self.outflow_grid[npt] == 0)[0]
if len(A)>1:
B = self.fetch[npt][A]
changes.append([A[k]+1 for k in np.argsort(B)])
return changes
def get_changes_step2(self, npt, neigh_domain):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment