Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/Numos.CoreSim/Solvers/AdvectionSolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,8 +1072,8 @@ private static bool IsBoundary(AtmosChunk chunk, Int3 position)
return position.X == 0 ||
position.X == chunk.Width - 1 ||
position.Y == 0 ||
position.Y == chunk.Height - 1 ||
chunk.Depth > 1 && (position.Z == 0 || position.Z == chunk.Depth - 1);
position.Z == 0 ||
position.Z == chunk.Depth - 1;
}

/// <summary>
Expand Down
3 changes: 0 additions & 3 deletions src/Numos.CoreSim/Solvers/BoundaryFlowSolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@ private static void ProcessBoundaryFlow(
TryFlowToNeighbor(context, sourceChunk, sourcePosition, localPosition + Int3.PosX, Int3.PosX, injectionBuffer);
TryFlowToNeighbor(context, sourceChunk, sourcePosition, localPosition + Int3.NegY, Int3.NegY, injectionBuffer);
TryFlowToNeighbor(context, sourceChunk, sourcePosition, localPosition + Int3.PosY, Int3.PosY, injectionBuffer);
if (sourceChunk.Depth <= 1)
return;

TryFlowToNeighbor(context, sourceChunk, sourcePosition, localPosition + Int3.NegZ, Int3.NegZ, injectionBuffer);
TryFlowToNeighbor(context, sourceChunk, sourcePosition, localPosition + Int3.PosZ, Int3.PosZ, injectionBuffer);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Numos.CoreSim/Solvers/DefaultAtmosSolvers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private static int GetBoundaryVoxelCount(int width, int height, int depth)
int voxelCount = checked(width * height * depth);
int interiorWidth = Math.Max(0, width - 2);
int interiorHeight = Math.Max(0, height - 2);
int interiorDepth = depth > 1 ? Math.Max(0, depth - 2) : 1;
int interiorDepth = Math.Max(0, depth - 2);
int interiorVoxelCount = checked(interiorWidth * interiorHeight * interiorDepth);
return voxelCount - interiorVoxelCount;
}
Expand Down
Loading