How to generate the Unique Pairs of Adjacent Blocks within a Rubik's Cube with side length N? The title pretty much sums it up, even though the "Rubik's cube" is just an analogy: I am parallelizing a "periodic boundary particle sim" using a cell technique (for background--the details aren't too important though). 
In the particle sim, you have a 3D box $Q$ with sides length $n$. In order to effectively parallelize it, I split the box into what is essentially a giant Rubik's cube: a 3d grid of blocks with side length $d = \frac{n}{i}$, where $i$ is, say, $10$ (even though in practice it will be a float chosen so that the boxes overlap with the housing cube dimensions (which depend on a lot of values) as little as possible). 

Background aside, the problem is that I need to somehow generate the unique pairs of the $3\times 3$ rubiks cube surrounding each block (for each block in the box $Q$), wrapping the edges of the box for blocks on the border, with no repeats, such that I would have an array or list of block pairs that I  could use later. 
The trivial solution (off the top of my head really quick) is to use brute force to generate a big linked list of pairs, then sort (long time), stack uniques on another linked list ($n$ time), counting, then reading into array or something.  
But this seems like a really clean situation where there is some subset lattice math where I could just generate the unique pairs analytically. 

Here is a picture of the situation: 


My question in short:  
Ok, if there is an answer, awesome. 
But, if not, where can I go to find the math/reasoning/etc. to work this problem out?  What vocabulary do I need for effective searches? And is this something that is solvable?

 A: Right now, I have a pseudo answer, but not necessarily any extensible math: 
If, for each block $b \in C$, where $C$ is the set of all blocks in the cube, I grab the 13 adjacent neighbors such that the mirror image of the neighbor across $b$ is not chosen, then when I grab any of the chosen neighbors $n$, $b$ will occupy the mirrored position relative to one of the 13 chosen adjacent blocks relative to $n$.  
Therefore, $b$ will not be chosen again by any of its neighbors. 
Finally, for each of the 13 adjacent neighbors not chosen by $b$, $b$ will be in the set of chosen neighbors, since relative to each of them, $b$ is in one of the 13 chosen positions...

This makes sense when you visualize choosing the 13 correctly, shift either to one of the chosen blocks, or one of the non-chosen blocks, and repeat--everything lines up.  The important thing though, is to choose the blocks such that you aren't choosing two blocks which are in a line with $b$.  
So, my answer (for now) is that there are $13*|C|$ unique pairs of blocks in 3D when only the immediately adjacent neighbors are considered relative to the central block (as in a $3\times 3$ rubik's cube), and edges are wrapped around (such that a block at $(0,0,0)$ is adjacent to the block at $(\text{cube dim},\text{cube_dim},\text{cube_dim})$).  
