-
Notifications
You must be signed in to change notification settings - Fork 31
Enhance material views with iterators to traverse zone id/vf data. #1715
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
base: develop
Are you sure you want to change the base?
Conversation
…et view iterators.
…t inside ElviraAlgorithm.
…ture/whitlock/material_view_iterators
…:LLNL/axom into feature/whitlock/material_view_iterators
kennyweiss
left a comment
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.
Thanks @BradWhitlock -- the only question I had was about the documentation (and perhaps naming) of the iterator since it appears to offer read-only access to the data
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.
👍
| std::cout << "test_matset_traversal: vf1=" << vf1 << ", vf2=" << vf2 | ||
| << ", nzones=" << matsetView.numberOfZones() << std::endl; |
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.
It looks like vf1 and vf2 are supposed to be (nearly) the same -- should this function compare them? or at least indicate that they are supposed to be (nearly) the same
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.
I added a comparison and changed to SLIC_INFO.
| /*! | ||
| * \brief An iterator class for iterating over the mat/vf data in a zone. | ||
| */ |
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.
Please document what can be done with these iterators.
Are these more like const iterators, in the sense that they can only be used to access the values of the volume fractions/indexes, but cannot modify the materials in each zone or the volume fractions of the materials in the zone?
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.
I renamed these classes to const_iterator and tried to improve the documentation.
…d a small comparison in mir_concentric_circles.
…:LLNL/axom into feature/whitlock/material_view_iterators
…:LLNL/axom into feature/whitlock/material_view_iterators
Material views in Axom take a MAXMATS template argument that sets their IDList and VFList types' sizes. These are used to get ids and volume fractions for a zone. In real applications the MAXMATS argument might need to be large O(100+). This could make kernels that call a material view's
zoneMaterials()method require a fair amount of stack space or GPU registers.This PR:
zoneMaterials()overload that takesArrayView.zoneMaterials()so they use iterators instead.ElviraAlgorithmso it uses const_iterators orzoneMaterials(ArrayView)where possibleElviraAlgorithmto work around a clipping problemHeavily mixed
