From 628a6ce705cedddda561bb26b89bbb8f66534701 Mon Sep 17 00:00:00 2001 From: David Bold Date: Mon, 13 Jan 2025 11:13:59 +0100 Subject: [PATCH] Calculate valid for the general case --- src/mesh/parallel/fci.hxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mesh/parallel/fci.hxx b/src/mesh/parallel/fci.hxx index 7085a71535..f993812a43 100644 --- a/src/mesh/parallel/fci.hxx +++ b/src/mesh/parallel/fci.hxx @@ -100,7 +100,6 @@ public: field_line_maps.emplace_back(mesh, dy, options, -offset, backward_boundary_xin, backward_boundary_xout, zperiodic); } - ASSERT0(mesh.ystart == 1); std::shared_ptr bndries[]{ forward_boundary_xin, forward_boundary_xout, backward_boundary_xin, backward_boundary_xout}; @@ -109,9 +108,13 @@ public: if (bndry->dir == bndry2->dir) { continue; } - for (bndry->first(); !bndry->isDone(); bndry->next()) { - if (bndry2->contains(*bndry)) { - bndry->setValid(0); + for (auto pnt : *bndry) { + for (auto pnt2 : *bndry2) { +#warning this could likely be done faster + if (pnt.ind() == pnt2.ind()) { + pnt.setValid( + static_cast(std::abs((pnt2.offset() - pnt.offset())) - 2)); + } } } }