Skip to content

Commit

Permalink
Fix for setting of nb_edges via BuildEdges action
Browse files Browse the repository at this point in the history
  • Loading branch information
wdeconinck committed Jan 19, 2024
1 parent 8435757 commit dc63328
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/atlas/mesh/actions/BuildEdges.cc
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ void build_edges(Mesh& mesh, const eckit::Configuration& config) {

for (int halo = 0; halo <= mesh_halo; ++halo) {
edge_start = edge_end;
edge_end += (edge_halo_offsets[halo + 1] - edge_halo_offsets[halo]);
if (halo+1 < edge_halo_offsets.size()) {
edge_end += (edge_halo_offsets[halo + 1] - edge_halo_offsets[halo]);
}

if (/*sort edges based on lowest node local index = */ sort_edges) {
if (sorted_edge_nodes_data.empty()) {
Expand Down Expand Up @@ -552,6 +554,11 @@ void build_edges(Mesh& mesh, const eckit::Configuration& config) {
ss << "nb_edges_including_halo[" << i << "]";
mesh.metadata().set(ss.str(), nb_edges_including_halo[i]);
}
for (int i = max_halo + 1; i <= mesh_halo; ++i) {
std::stringstream ss;
ss << "nb_edges_including_halo[" << i << "]";
mesh.metadata().set(ss.str(), nb_edges_including_halo.back());
}

mesh.metadata().set("built_edges_for_halo", mesh_halo);

Expand Down

0 comments on commit dc63328

Please sign in to comment.