Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug(?) with topology tags #756

Open
daanvdwoude opened this issue Dec 14, 2022 · 1 comment
Open

Bug(?) with topology tags #756

daanvdwoude opened this issue Dec 14, 2022 · 1 comment

Comments

@daanvdwoude
Copy link

daanvdwoude commented Dec 14, 2022

Say I create a simple 1d mesh
topo, geom = mesh.rectilinear([[0,1,2]])
this then has the default boundary tags 'left' and 'right', these can then be called by
domain.boundary['right']
which returns
StructuredTopology<>
If I make a typo and e.g. call
domain.boundary['rigth']
or would call any non-existent boundary, this returns the error message
KeyError: ('right',)
So far so good, but if I would now call both boundaries, including the typo,
domain.boundary['left,rigth']
this throws no error message, and it simply returns the correctly spelled boundary, ignoring the typo-related boundary. This means I can also do operations like
domain.boundary['left,rigth,SomeBoundaryThatDoesNotExist'].integral(myfunction,degree=1234)
and the only way for me to figure out that I have made the typo is by hoping the simulation will not crash and returns a solution where the error is observable near the correct boundary.

I'm using nutils version 6.2, in case that's relevant.

I think this is a bug.

@gertjanvanzwieten
Copy link
Contributor

While this is indeed unfortunate behaviour, there are reasons why it is difficult to raise the appropriate exception if a group does not exists, related to the topology's current design. A planned redesign should fix this and other problems but is a long term programming effort. Until that is completed we will keep this issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants