Skip to content

Commit

Permalink
Fixes errors in ghosting update for some overset mesh problems. (#1214)
Browse files Browse the repository at this point in the history
Instead of trying to modify the ghosting for overset problems with
relative motion, we now just rebuild the ghosting from scratch.
This appears to fix errors such as those reported in #936

Co-authored-by: dcdemen <[email protected]>
Co-authored-by: psakievich <[email protected]>
  • Loading branch information
3 people authored Dec 23, 2023
1 parent 8e8f4d5 commit 70e576b
Showing 1 changed file with 4 additions and 12 deletions.
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

0 comments on commit 70e576b

Please sign in to comment.