diff --git a/src/atlas/mesh/actions/BuildEdges.cc b/src/atlas/mesh/actions/BuildEdges.cc index eb6461e91..08a568a17 100644 --- a/src/atlas/mesh/actions/BuildEdges.cc +++ b/src/atlas/mesh/actions/BuildEdges.cc @@ -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()) { @@ -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); diff --git a/src/atlas/meshgenerator/detail/DelaunayMeshGenerator.cc b/src/atlas/meshgenerator/detail/DelaunayMeshGenerator.cc index 4ab849ba0..7004d6725 100644 --- a/src/atlas/meshgenerator/detail/DelaunayMeshGenerator.cc +++ b/src/atlas/meshgenerator/detail/DelaunayMeshGenerator.cc @@ -197,6 +197,9 @@ void DelaunayMeshGenerator::generate(const Grid& grid, const grid::Distribution& element_nodes_uncertainty.insert(g_node_connectivity(jelem,2)); element_uncertainty.insert(jelem); } + else if (elem_ownership != GHOST && elem_ownership != CERTAIN) { + ATLAS_NOTIMPLEMENTED; + } } // Log::info() << "element_uncertainty" << std::endl; // for( auto& jelem: element_uncertainty ) { @@ -291,6 +294,9 @@ void DelaunayMeshGenerator::generate(const Grid& grid, const grid::Distribution& else if (e2 != UNCERTAIN) { elem_part = e2; } + if (elem_part == UNCERTAIN) { + elem_part = elem_node_partition(jelem,0); + } if (elem_part == part_) { collect_element(jelem); }