-
Notifications
You must be signed in to change notification settings - Fork 63
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
Clean up templating in generate sides code #1138
Clean up templating in generate sides code #1138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - Small suggestion related to the accessor types, we want to uses the 64-bit ones (float64_accessor and int64_accessor)
This cleans things up nicely!
@cyrush are there any plans to allow
without a compiler warning (or was it an error? I don't remember) |
I got worried when I saw this:
|
It's your call - do you want me to remove a float64* to replace it with a float64_accessor at the cost of adding this warning to the build? Or should I leave as is? |
I see -- it looks like we need to add the assignment op to the Can you add this? We can follow the example from the
|
done |
Awesome! Extended thought exercise: What if we could write to a |
Do you mean a I thought about that. For vertex associated and volume dependent fields, we made the choice to always write to float64 since we need to do some extra calculations to figure out what the right values should be. Two years ago, we also made the choice that if a field was neither vertex associated nor volume dependent, we would make sure the new field honored the original field's type. While I was going through this earlier today, I considered changing it so that we always write out float64. Then we can do away with templating entirely. What do you think? |
Closes #1105
Now that we have data accessors and data arrays, a lot of the templating in the generate sides code was able to be removed/simplified.
Also adds the assignment operator to the data accessor.
The tests all pass.