From 8db7f7599ba7a0427a4a6f4a38c399f29d512b28 Mon Sep 17 00:00:00 2001 From: David Schneider Date: Wed, 24 Jan 2024 08:45:08 +0100 Subject: [PATCH] Fix connectivity definition in the adapter (#315) --- Interface.C | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Interface.C b/Interface.C index cd2aa0d5..55d59c53 100644 --- a/Interface.C +++ b/Interface.C @@ -249,10 +249,6 @@ void preciceAdapter::Interface::configureMesh(const fvMesh& mesh, const std::str { vertices[verticesIndex++] = faceNodes[i][d]; } - if (meshConnectivity_) - { - verticesMap.emplace(std::make_tuple(faceNodes[i][0], faceNodes[i][1], faceNodes[i][2]), -1); - } } } @@ -261,11 +257,9 @@ void preciceAdapter::Interface::configureMesh(const fvMesh& mesh, const std::str if (meshConnectivity_) { - // Build the map between OpenFOAM vertices and preCICE vertex IDs - verticesIndex = 0; - for (auto& key : verticesMap) + for (std::size_t i = 0; i < vertexIDs_.size(); ++i) { - key.second = vertexIDs_[verticesIndex++]; + verticesMap.emplace(std::make_tuple(vertices[3 * i], vertices[3 * i + 1], vertices[3 * i + 2]), vertexIDs_[i]); } for (uint j = 0; j < patchIDs_.size(); j++)