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

Fixes errors in ghosting update for some overset mesh problems. #1214

Merged
merged 4 commits into from
Dec 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions src/overset/TiogaSTKIface.C
Original file line number Diff line number Diff line change
Expand Up @@ -208,27 +208,19 @@ TiogaSTKIface::reset_data_structures()
void
TiogaSTKIface::update_ghosting()
{
stk::mesh::Ghosting* ovsetGhosting = oversetManager_.oversetGhosting_;
std::vector<stk::mesh::EntityKey> recvGhostsToRemove;

if (ovsetGhosting != nullptr) {
stk::mesh::EntityProcVec currentSendGhosts;
ovsetGhosting->send_list(currentSendGhosts);

sierra::nalu::compute_precise_ghosting_lists(
bulk_, elemsToGhost_, currentSendGhosts, recvGhostsToRemove);
}

size_t local[2] = {elemsToGhost_.size(), recvGhostsToRemove.size()};
size_t global[2] = {0, 0};
stk::all_reduce_sum(bulk_.parallel(), local, global, 2);

if ((global[0] > 0) || (global[1] > 0)) {
bulk_.modification_begin();
if (ovsetGhosting == nullptr) {
const std::string ghostName = "nalu_overset_ghosting";
oversetManager_.oversetGhosting_ = &(bulk_.create_ghosting(ghostName));
if (oversetManager_.oversetGhosting_ != nullptr) {
bulk_.destroy_ghosting(*oversetManager_.oversetGhosting_);
}
const std::string ghostName = "nalu_overset_ghosting";
oversetManager_.oversetGhosting_ = &(bulk_.create_ghosting(ghostName));
bulk_.change_ghosting(
*(oversetManager_.oversetGhosting_), elemsToGhost_, recvGhostsToRemove);
bulk_.modification_end();
Expand Down
Loading