Commit 6f832140 authored by sfritschi's avatar sfritschi
Browse files

Refactor

parent 7a1c2af5
......@@ -15,7 +15,7 @@ def main():
print("Min. number of throats per pore: %d" % min(pore_throat_counts))
print("Avg. number of throats per pore: %f" % (sum(pore_throat_counts) / len(pore_throat_counts)))
target = [2, 2, 2]
target = [5, 5, 5]
print("Target size: {}".format(target))
cutoff = 0.5 * max([basenet.ub[i] - basenet.lb[i] \
for i in range(len(basenet.ub))])
......
......@@ -210,13 +210,12 @@ class CellList:
def nbor_indices(self, poreIdx: int) -> List[int]:
cellIdx = self.pore_to_triplet(poreIdx)
# i, j, k; i +- 1, j, k; i, j +- 1, k; i, j, k +- 1;
neighborhood = [self.flatten(*cellIdx)] # Cell containing the pore
neighborhood += [self.flatten(cellIdx[0] + i * (n == 0), \
cellIdx[1] + i * (n == 1), \
cellIdx[2] + i * (n == 2))
for n in range(self.dim) for i in [-1, 1]]
return neighborhood
base = self.flatten(*cellIdx)
widthx = self.nCells[0]
widthy = widthx * self.nCells[1]
return [base, base - 1, base + 1, \
base - widthx, base + widthx, \
base - widthy, base + widthy]
def nbor_cell_counts(self, neighborhood: List[int]) -> List[int]:
return [len(self.poresSorted[i]) for i in neighborhood]
......
Supports Markdown
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