Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions components/omega/src/ocn/VertCoord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ VertCoord::VertCoord(const std::string &Name_, //< [in] Name for new VertCoord
NCellsSize = Decomp->NCellsSize;

NEdgesOwned = Decomp->NEdgesOwned;
NEdgesHalo0 = Decomp->NEdgesHaloH(0);
NEdgesAll = Decomp->NEdgesAll;
NEdgesSize = Decomp->NEdgesSize;

NVerticesOwned = Decomp->NVerticesOwned;
NVerticesHalo0 = Decomp->NVerticesHaloH(0);
NVerticesAll = Decomp->NVerticesAll;
NVerticesSize = Decomp->NVerticesSize;
VertexDegree = Decomp->VertexDegree;
Expand Down Expand Up @@ -626,6 +628,23 @@ void VertCoord::minMaxLayerEdge(Halo *MeshHalo) {
LocMaxLayerEdgeBot(LocNEdgesAll) = -1;
});

// Set the [MinLayerEdgeBot, MaxLayerEdgeTop] range to be invalid
// on the outermost edges of the halo layer.
OMEGA_SCOPE(LocNEdgesHalo0, NEdgesHalo0);
OMEGA_SCOPE(LocNCellsAll, NCellsAll);
// start from NEdgesHalo(0) to exclude any edges of the owned cells
parallelFor(
{NEdgesAll - NEdgesHalo0}, KOKKOS_LAMBDA(int EdgeOffset) {
const int IEdge = LocNEdgesHalo0 + EdgeOffset;

// Is any cell on this edge an invalid (remote) cell ?
if (LocCellsOnEdge(IEdge, 0) == LocNCellsAll ||
LocCellsOnEdge(IEdge, 1) == LocNCellsAll) {
LocMinLayerEdgeBot(IEdge) = LocNVertLayersP1;
LocMaxLayerEdgeTop(IEdge) = -1;
}
});

MinLayerEdgeTopH = createHostMirrorCopy(MinLayerEdgeTop);
MinLayerEdgeBotH = createHostMirrorCopy(MinLayerEdgeBot);
MaxLayerEdgeTopH = createHostMirrorCopy(MaxLayerEdgeTop);
Expand Down Expand Up @@ -708,6 +727,28 @@ void VertCoord::minMaxLayerVertex(Halo *MeshHalo) {
LocMaxLayerVertexBot(LocNVerticesAll) = -1;
});

// Set the [MinLayerVertexBot, MaxLayerVertexTop] range to be invalid
// on the outermost vertices of the halo layer.
OMEGA_SCOPE(LocNVerticesHalo0, NVerticesHalo0);
OMEGA_SCOPE(LocNCellsAll, NCellsAll);
// start from NVerticesHalo(0) to exclude any vertices of the owned cells
parallelFor(
{NVerticesAll - NVerticesHalo0}, KOKKOS_LAMBDA(int VertexOffset) {
const int IVertex = LocNVerticesHalo0 + VertexOffset;

// Is any cell on this vertex an invalid (remote) cell ?
bool IsOuterMost = LocCellsOnVertex(IVertex, 0) == LocNCellsAll;
for (int I = 1; I < LocVertexDegree; ++I) {
IsOuterMost =
IsOuterMost || LocCellsOnVertex(IVertex, I) == LocNCellsAll;
}

if (IsOuterMost) {
LocMinLayerVertexBot(IVertex) = LocNVertLayersP1;
LocMaxLayerVertexTop(IVertex) = -1;
}
});

MinLayerVertexTopH = createHostMirrorCopy(MinLayerVertexTop);
MinLayerVertexBotH = createHostMirrorCopy(MinLayerVertexBot);
MaxLayerVertexTopH = createHostMirrorCopy(MaxLayerVertexTop);
Expand Down
2 changes: 2 additions & 0 deletions components/omega/src/ocn/VertCoord.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ class VertCoord {
I4 NCellsAll;
I4 NCellsSize;
I4 NEdgesOwned;
I4 NEdgesHalo0;
I4 NEdgesAll;
I4 NEdgesSize;
I4 NVerticesOwned;
I4 NVerticesHalo0;
I4 NVerticesAll;
I4 NVerticesSize;
I4 VertexDegree;
Expand Down
Loading