Skip to content

Commit

Permalink
tests: fixed occasional None in substitution
Browse files Browse the repository at this point in the history
  • Loading branch information
EdCaunt committed Oct 26, 2023
1 parent 0eb8bb1 commit 21d8609
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions tests/test_subdomains.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,15 @@ def define(self, dimensions):
stop = tuple(dim.symbolic_max.subs(mM_map)
for dim in grid.subdomains['d0'].dimensions)

slices = []
for dim, sta, sto in zip(grid.subdomains['d0'].dimensions, start, stop):
print(dim, sta, sto)
print(type(dim), type(sta), type(sto))
if dim.is_Sub:
print(dim._thickness_map)
print()

slices = tuple(slice(sta.subs(dim._thickness_map),
sto.subs(dim._thickness_map)+1)
if dim.is_Sub else slice(sta, sto+1)
for dim, sta, sto in zip(grid.subdomains['d0'].dimensions,
start, stop))
t_map = {k: v for k, v in dim._thickness_map if v is not None}
slices.append(slice(int(sta.subs(t_map)),
int(sto.subs(t_map)+1)))
else:
slices.append(slice(int(sta), int(sto+1)))
slices = tuple(slices)

check[slices] = 1

Expand Down

0 comments on commit 21d8609

Please sign in to comment.