Skip to content

Commit

Permalink
fix periodic mesh.line
Browse files Browse the repository at this point in the history
If a periodic `mesh.line` is created, the basis that is used to build the
geometry should be nonperiodic. Since the topology is a `StructuredTopology`,
the basis accepts a *list* of periodic dimension indices for parameter
`periodic`, not a boolean. This patch fixes the mistake by passing an empty
list to `topo.basis` instead of `False`.
  • Loading branch information
joostvanzwieten committed Aug 18, 2021
1 parent 7b91b2c commit ec5af23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nutils/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def line(nodes, periodic=False, bnames=None):
uniform = numpy.equal(nodes, offset + numpy.arange(nelems+1) * scale).all()
root = transform.Identifier(1, 'line')
domain = topology.StructuredLine(root, 0, nelems, periodic=periodic, bnames=bnames)
geom = function.rootcoords(1) * scale + offset if uniform else domain.basis('std', degree=1, periodic=False).dot(nodes)
geom = function.rootcoords(1) * scale + offset if uniform else domain.basis('std', degree=1, periodic=[]).dot(nodes)
return domain, geom

def newrectilinear(nodes, periodic=None, bnames=[['left','right'],['bottom','top'],['front','back']]):
Expand Down

0 comments on commit ec5af23

Please sign in to comment.