-
Notifications
You must be signed in to change notification settings - Fork 80
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
TextMesh: Enable block membership capability for sidesets and sideblocks #432
TextMesh: Enable block membership capability for sidesets and sideblocks #432
Conversation
{ | ||
int64_t count = 0; | ||
|
||
const SidesetData *sideset = m_data.sidesets.get_group_data(id); | ||
int myProc = m_myProcessor; | ||
if (nullptr != sideset) { | ||
for (const std::pair<int64_t, int> &elemSidePair : sideset->data) { | ||
int64_t elemId = elemSidePair.first; | ||
for (const std::pair<EntityId, int> &elemSidePair : sideset->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.
This might be better as const auto &elemSidePair
int64_t count = 0; | ||
const std::set<int64_t> &myNodes = m_data.nodes_on_proc(m_myProcessor); | ||
int64_t count = 0; | ||
const std::set<EntityId> &myNodes = m_data.nodes_on_proc(m_myProcessor); |
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.
Maybe another const auto &myNodes
int64_t elemId = elemSidePair.first; | ||
int side = elemSidePair.second; | ||
auto iter = std::find(m_data.elementDataVec.begin(), m_data.elementDataVec.end(), elemId); | ||
for (const std::pair<EntityId, int> &elemSidePair : sideset->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.
Maybe another const auto &elemSidePair
or even a structured binding...
for (const auto [elemId, side] : sideset->data
(or whatever correct syntax is)
for (const std::pair<int64_t, int> &elemSidePair : sideset->data) { | ||
int64_t elemId = elemSidePair.first; | ||
auto iter = std::find(m_data.elementDataVec.begin(), m_data.elementDataVec.end(), elemId); | ||
for (const std::pair<EntityId, int> &elemSidePair : sideset->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.
const auto &elemSidePair
or structured binding, but don't use .seconds
, so may get unused variable warning...
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, looks good.
Propagated consistent EntityId (int64_t) through code
Added unit tests for various forms of sideset/sideblock creation