From dc63328aa0540303ac19d9e043645b10c771367e Mon Sep 17 00:00:00 2001 From: Willem Deconinck Date: Thu, 18 Jan 2024 13:53:05 +0100 Subject: [PATCH 1/2] Fix for setting of nb_edges via BuildEdges action --- src/atlas/mesh/actions/BuildEdges.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); From b8f8a4dc481077fc8fc217ff630ff59e94b6965a Mon Sep 17 00:00:00 2001 From: Willem Deconinck Date: Thu, 18 Jan 2024 14:02:11 +0100 Subject: [PATCH 2/2] Fix for elements that might have unassigned partition via parallel Delaunay meshgenerator --- src/atlas/meshgenerator/detail/DelaunayMeshGenerator.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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); }