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

TextMesh: Enable block membership capability for sidesets and sideblocks #432

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

tokusanya
Copy link
Collaborator

Propagated consistent EntityId (int64_t) through code

Added unit tests for various forms of sideset/sideblock creation

{
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) {
Copy link
Member

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);
Copy link
Member

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) {
Copy link
Member

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) {
Copy link
Member

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...

Copy link
Member

@gsjaardema gsjaardema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good.

@gsjaardema gsjaardema merged commit f7e50f3 into sandialabs:master Feb 2, 2024
51 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants