From f8037239aed8a0a41fdb3f996a76c7ebb47c1f5c Mon Sep 17 00:00:00 2001 From: Dmitri Naumov <github@naumov.de> Date: Mon, 20 Sep 2021 20:40:47 +0200 Subject: [PATCH] [MeL] Rewrite use isBaseNode in isGhostNode query. Replace first part of the query with isBaseNode() as in previous commits. Use getNumberOfBaseNodes in calculation of "active" (regular) nodes. --- MeshLib/NodePartitionedMesh.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MeshLib/NodePartitionedMesh.h b/MeshLib/NodePartitionedMesh.h index 484b1f178d5..6a81cf06cf1 100644 --- a/MeshLib/NodePartitionedMesh.h +++ b/MeshLib/NodePartitionedMesh.h @@ -109,18 +109,21 @@ public: bool isGhostNode(const std::size_t node_id) const { if (node_id < _n_active_base_nodes) + { return false; - else if (node_id >= _n_base_nodes && node_id < getLargestActiveNodeID()) + } + if (!isBaseNode(*_nodes[node_id]) && node_id < getLargestActiveNodeID()) + { return false; - else - return true; + } + return true; } /// Get the largest ID of active nodes for higher order elements in a /// partition. std::size_t getLargestActiveNodeID() const { - return _n_base_nodes + _n_active_nodes - _n_active_base_nodes; + return getNumberOfBaseNodes() + _n_active_nodes - _n_active_base_nodes; } // TODO I guess that is a simplified version of computeSparsityPattern() -- GitLab