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
Allow reference tags to list multiple arguments #3142
Conversation
@kidder The unit tests pass, but could you make sure I didn't majorly mess up the compute-item dependency tracking? I'll also add more tests. |
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. I would like to see this feature merged :)
Might be good to add a reference tag that depends on a reference tag? Something like if some bool is true
then choose tag Scalar1
otherwise Scalar2
where Scalar1
and Scalar2
are in two different Variables
. Then test that mutating the bool, or either of the Variables
tags has the tag be updated. I think this will test the new functionality. You could do something similar with compute tags + subitems to be extra sure since probably any bug in this will be horrible to track down in an executable.
633f898
to
ff39be7
Compare
@kidder I have rebased this PR, simplified it, and added some more tests. Could you take a look please? |
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.
you can squash
src/DataStructures/DataBox/Tag.hpp
Outdated
* a const reference to the sub-item | ||
* - type alias `argument_tags` that is `tmpl::list<parent_tag>` | ||
* - type alias `argument_tags` that lists tags needed to evaluate `get` | ||
* - static function `get` that, given the item fetched by `argument_tags`, |
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.
item -> items
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.
done
This actually simplifies the DataBox logic because reference tag dependencies are treated the same as compute item dependencies.
Proposed changes
Remove
parent_tag
s and useargument_tag
s instead. This removes the restriction that reference tags can only have a single argument. My use case for this is to store an elastic constitutive relation per block in the global cache and reference the correct one in the element's DataBox, which needs both the global cache tag and the element ID.Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ormajor new feature
if appropriate.Further comments