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

common_fixes.jl: update iter_side_data* #9

Merged

Conversation

psanan
Copy link
Contributor

@psanan psanan commented Apr 30, 2021

These are changes that I needed to be able to use p4est_iterate() with a face callback.

The substantive change is changing a quad::Ptr{Cvoid} to a tuple quad::NTuple{S,Ptr{Cvoid}} in the definition of struct hanging{S}. This resolved incorrect data I encountered attempting to load these structs, prompting me to poke into the binary representations. The change also seems to correspond with the layout of p4est or p8est's hanging struct as described here and here, respectively.

I made what I think are a couple of other useful fixes, but please check these carefully if merging this PR, as these were mainly motivated by making things consistent between similar definitions in common_fixes.jl, not any deep understanding.

Note that there is a backwards incompatibility being introduced by replacing what I assume is a copy-paste error in accessing the hanging{S} data in by the symbol :user_long instead of :hanging.

My hope is that these changes will be useful to others in the short term, but I am aware of the open issue #1 - if progress has been made on that front, to allow automatic wrapping of these sorts of structures without the need for common_fixes.jl at all, that would of course be exciting!

(P.S. Thank you very much for making this wrapper public in the first place - I found it very helpful and will contribute to it as I can)

* Change hanging{S} to have an S-tuple of pointers for the quads
* Use "hanging" instead of "user_long" (probable copy-paste error) for field access
* Use the _union postfixed variants more consistently
@amartinhuertas
Copy link
Member

Hi @psanan ! Thanks for your PR (and sorry for the late reply). I would say that the changes that you propose are correct. Accepting the PR!

@amartinhuertas amartinhuertas merged commit dd7ef53 into gridap:master Sep 10, 2021
@psanan psanan deleted the psanan/fix-iter-side-data-fixes branch September 10, 2021 08:57
@psanan psanan restored the psanan/fix-iter-side-data-fixes branch September 20, 2021 17:54
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

Successfully merging this pull request may close these issues.

2 participants