Skip to content

Commit

Permalink
align periodic arg of mesh.newrectlin with rectlin
Browse files Browse the repository at this point in the history
  • Loading branch information
joostvanzwieten committed Sep 20, 2021
1 parent 596a39f commit 9e11150
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions nutils/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,8 @@ def line(nodes, periodic=False, bnames=None, *, space: str = 'X'):

def newrectilinear(nodes, periodic=None, bnames=[['left','right'],['bottom','top'],['front','back']]):
if periodic is None:
periodic = numpy.zeros(len(nodes), dtype=bool)
else:
periodic = numpy.asarray(periodic)
assert len(periodic) == len(nodes) and periodic.ndim == 1 and periodic.dtype == bool
dims = [line(nodesi, periodici, bnamesi) for nodesi, periodici, bnamesi, namei in zip(nodes, periodic, tuple(bnames)+(None,)*len(nodes))]
periodic = []
dims = [line(nodesi, i in periodic, bnamesi) for i, (nodesi, bnamesi) in zip(nodes, tuple(bnames)+(None,)*len(nodes))]
domain, geom = dims.pop(0)
for domaini, geomi in dims:
domain = domain * domaini
Expand Down

0 comments on commit 9e11150

Please sign in to comment.