From 7dfd207ebb7ad0e841314e87e8bb1f44dd2a08f2 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Wed, 8 Oct 2025 15:18:31 -0400 Subject: [PATCH] Need to protect pole operatoins to only take place on IcosahedralVertices mesh --- Grid/cartesian/CartesianCrossIcosahedron.h | 2 ++ Grid/cartesian/Cartesian_base.h | 2 ++ Grid/lattice/Lattice_coordinate.h | 6 ++++-- Grid/lattice/Lattice_peekpoke.h | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Grid/cartesian/CartesianCrossIcosahedron.h b/Grid/cartesian/CartesianCrossIcosahedron.h index 76b17a3e..c3e6702d 100644 --- a/Grid/cartesian/CartesianCrossIcosahedron.h +++ b/Grid/cartesian/CartesianCrossIcosahedron.h @@ -108,6 +108,8 @@ public: int southPoleOsites; virtual int Icosahedral(void) override { return 1;} + virtual int IcosahedralVertices(void) override { return meshType==IcosahedralVertices;} + virtual int IcosahedralEdges (void) override { return meshType==IcosahedralEdges;} virtual int ownsNorthPole(void) const override { return hasNorthPole; }; virtual int NorthPoleOsite(void) const override { return northPoleOsite; }; virtual int NorthPoleOsites(void) const override { return northPoleOsites; }; diff --git a/Grid/cartesian/Cartesian_base.h b/Grid/cartesian/Cartesian_base.h index f825011c..c9480cf6 100644 --- a/Grid/cartesian/Cartesian_base.h +++ b/Grid/cartesian/Cartesian_base.h @@ -88,6 +88,8 @@ public: // Icosahedral decisions virtual int Icosahedral(void) { return 0;} + virtual int IcosahedralVertices(void) { return 0;} + virtual int IcosahedralEdges (void) { return 0;} virtual int ownsNorthPole(void) const { return 0; }; virtual int ownsSouthPole(void) const { return 0; }; virtual int NorthPoleOsite(void) const { return 0; }; diff --git a/Grid/lattice/Lattice_coordinate.h b/Grid/lattice/Lattice_coordinate.h index e08019a1..b4292ef6 100644 --- a/Grid/lattice/Lattice_coordinate.h +++ b/Grid/lattice/Lattice_coordinate.h @@ -58,7 +58,7 @@ template inline void LatticeCoordinate(Lattice &l,int mu) }); } - if (grid->Icosahedral()) { + if (grid->IcosahedralVertices()) { uint64_t psites=1; Coordinate perpdims; typename iobj::scalar_object ss; @@ -95,7 +95,9 @@ template inline void LatticePole(Lattice &l,NorthSouth pole) l=Zero(); - if (grid->Icosahedral()) { + assert(grid->IcosahedralVertices()); + + if (grid->IcosahedralVertices()) { uint64_t psites=1; Coordinate perpdims; sobj ss; diff --git a/Grid/lattice/Lattice_peekpoke.h b/Grid/lattice/Lattice_peekpoke.h index 422d28f1..42446a13 100644 --- a/Grid/lattice/Lattice_peekpoke.h +++ b/Grid/lattice/Lattice_peekpoke.h @@ -160,6 +160,7 @@ void peekPole(sobj &s,const Lattice &l,const Coordinate &orthog,NorthSouth GridBase *grid=l.Grid(); assert(grid->Icosahedral()); + assert(grid->IcosahedralVertices()); int Nsimd = grid->Nsimd(); @@ -220,6 +221,7 @@ void pokePole(const sobj &s,Lattice &l,const Coordinate &orthog,NorthSouth GridBase *grid=l.Grid(); assert(grid->Icosahedral()); + assert(grid->IcosahedralVertices()); grid->Broadcast(grid->BossRank(),s);