Skip to content

Commit

Permalink
Add coordinate syncs (Exawind#1204)
Browse files Browse the repository at this point in the history
  • Loading branch information
psakievich authored Aug 22, 2023
1 parent 722cd77 commit a7bcc39
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Realm.C
Original file line number Diff line number Diff line change
Expand Up @@ -2561,6 +2561,10 @@ Realm::set_current_coordinates(stk::mesh::Part* targetPart)
VectorFieldType* displacement = meta_data().get_field<VectorFieldType>(
stk::topology::NODE_RANK, "mesh_displacement");

modelCoords->sync_to_host();
currentCoords->sync_to_host();
displacement->sync_to_host();

stk::mesh::Selector s_all_nodes = stk::mesh::Selector(*targetPart);

stk::mesh::BucketVector const& node_buckets =
Expand All @@ -2578,6 +2582,7 @@ Realm::set_current_coordinates(stk::mesh::Part* targetPart)
cCoords[offSet + j] = mCoords[offSet + j] + dx[offSet + j];
}
}
currentCoords->modify_on_host();
}

//--------------------------------------------------------------------------
Expand Down Expand Up @@ -2643,6 +2648,8 @@ Realm::init_current_coordinates()
stk::topology::NODE_RANK, "mesh_displacement");

modelCoords->sync_to_host();
currentCoords->sync_to_host();
displacement->sync_to_host();

stk::mesh::Selector s_all_nodes =
(meta_data().locally_owned_part() | meta_data().globally_shared_part()) &
Expand Down

0 comments on commit a7bcc39

Please sign in to comment.