# Truncated Octrahedron Mesh

Not sure if this is the proper place fir this but here goes:

I'm trying to figure out a way to computationally construct a lattice such that each lattice point is the center of the faces of a truncated octahedron which is tesselated through out space. The main problem is that I need to be able to store values (e.g. pressure, temperature, gas concentration etc.) at each of these lattice points as well as being able to locate nearest neighbours and their respective values. I've looked around and I'm having difficulties find a good description of how to construct a lattice like this.

If anyone knows of where I can find any info it would be appreciated. Thanks.

Related Computing and Technology News on Phys.org
Are you having a problem figuring out a data structure to store the lattice points in? If so what language are you using to do the simulation? Or are you having a problem calculating the positions of the lattice points?

The physical coordinate of such lattice points are not the problem I suppose, that should be easily calculated. It's the data structure really. Language is not really important at the moment but c++ wiill probably be the language in. I think the data structure and it's relation to the physical lattice is my main problem. I've been trying to find some form of information or reference on techniques for generating non-cubic meshes (and non-cubic data structures related to physical lattice's) but I haven't had much luck at all. Obviously it can be done, I was really hoping for some pointers in the right direction though. Thanks

damgo
Is it a regular lattice, ie the points spaced according to some sort of pattern?

Yeah .... Essentially the lattice is constructed by setting each lattice point to the centre of a tesselated truncated octahedrons faces and then the bonds are placed so that two lattice points are connected according to which faces in the tesselated structure they are linked to. The structure is regular but trying to come up with a data structure given that some points have three links and others have four is proving a bit difficult. I assume that this can be done with pointers but I'm wondering what the simplest method might be. I assume that this has been explored in detail before (not necessarily this lattice) and so there are standard methods for this .......................

[?]

I've just had an idea ... tell me what you guys think about this. We have a rank 1 array which gives the coordinates of all the lattice points, doesn't matter if they are in any order.

We also have a rank 2 array which is square with a "side" the same as the size of the rank 1 array. In this case a row (or column) would represent the index (in the rank 1 array) of the current site whilst the column (or row) would represent the site to which the current one was connected. In this array we indicate which sites are linked to each other by setting the array element corresponding to the link to 1.

Of course this array would be symmetric and depending on the way the physical coordinates for each lattice site was generated there should be a specific pattern to the array. It should also mean that summing along any row or column with the same index number will have the same value i.e. the total number of sites that point is connected to. It should also have the property that all diagonal sites are 0 i.e. no lattice point links to itself

The main problem is then reduced to just being able to calculate the coordinates of all the vertices in the tesselated structure. This is not easy but I think it's managable. I think that should work. What do you guys think?

Last edited:
Hi again, so what you're thinking of is maybe having a table where you give an index for one lattice site a second index for another lattice sight and the table returns true or false based on whether or not they are connected to each other. If this is the what you mean then it would work fine for a small number of lattice sites, but say you had a cube of 100 on a side and you did some bit packing so you could hold 8 relations in a byte, then you would need (100^3)^2 / 8 bytes or 125 gigabytes of ram or hard disk space. So the look up table isn't very scalable if you are working on very big volumes of lattice sites.

I think the network made with the pointers like you mentioned is the most robust way to model the lattice. There are other ways to do it like figure out what the basis vectors are for this lattice. If your sites where at the vertices then it would be easy but since they're at the face centers its more difficult. Once you have them then you know that there are certain fixed ways you add up the basis vectors to arrive at a nearest neighbor, if you had a table that you could index with floating point numbers ( not hard to do ) then that would make this method complete I think. To go to the next nearest neighbor that has coordinates (3,2,4) in the lattice space assume you've got the 3 basis vectors and there's a 3-vector class you cooked up in C++:

Code:
class latticesite
{
public:
vec3 pos;
float temperature;
float pressure;
};

class lookuptable
{
latticesite crystal[ numberofsites ];
latticesite find( float x, float y, float z );
};

vec3 basisA;
vec3 basisB;
vec3 basisC;
vec3 lookupvector;
latticesite current;

lookupvector = current.pos + 3*basisA + 2*basisB + 4*basisC;
current = lookuptable.find( lookupvector.x, lookupvector.y, lookupvector.z );
. But I'm not sure you can find a set of basis vectors for face centers it might only work for vertices. Entropy might know though, he's a solid state guy I think.

Last edited: