-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add one-sided integration example as example of custom integration #158
Comments
I am trying this out on dolfinx=0.8.0 and running into the error I believe that the line |
@molel-gt I've updated the code to take this into account. Thanks for the feedback. |
I was wondering if there is not a neater way of doing this. Beyond all the code needed above to find pairs of cells and local facets from the given facets, how this special way of defining tags (without a In my opinion, it would be just simpler to use However, removing this filter has a (non-minor) downside: if |
I am not sure what you are getting at here. The last of the try excepts: https://github.com/FEniCS/dolfinx/blob/4627a17522e73020dc7982e1a030da5297605f09/python/dolfinx/fem/forms.py#L359C1-L361C56 is due to the fact that ufl accepts both integer subdomain markers and tuples of integers as subdomain markers (which is very convenient when wanting to integrate over many subdomains, i.e. For the first try except: This is how it has been decided to handle multiple type inputs in DOLFINx to functions (to avoid having duplicate signatures all around). One could have used: if isinstance(subdomain, MeshTags):
# do something
elif isinstance(subdomain, list):
# do other thing
else:
raise RuntimeError("Unknown input") but some of the developers do not like the "isinstance" handling, as one doesn't want to strongly type Python interface,
I am not sure how you would do that for an interior integral? In the example above I do a one-sided facet integration on an interior boundary. This will always be connected to two cells, and one has to decide what cell one would like the integral to be over. Sending in a facet index by itself cannot determine this, it has to be a (cell, local_index) tuple.
Adding it to the metadata seems to me as a more hacky way of doing it. Please note that this is a discussion that could be elevated into DOLFINx itself, and not the tutorial. |
Running your example above with the debugger brings me to that line. My guess is that
Wouldn't be my choice, but I understand this is an agreed decision.
Yes, I agree that finding the right side of interior facets may not be straightforward, but once found that side is uniquely identified by an index that can be fed directly to
I agree this solution may be far from ideal.
You're right, it came natural to write here, just below the example. |
Source: https://fenicsproject.discourse.group/t/wrong-facetnormal-vector-on-internal-boundaries/12887/2?u=dokken
The text was updated successfully, but these errors were encountered: