> For the example I gave above, which is 3x2x2, the example points are: > .... > ... > 2 0 0 > 3 0 0 > 0 1 0 > ... > ... > > Each coordinate above represents a voxel. So, essentially, each voxel is a > cell !?!
So let's assume that each voxel in your mesh has its front bottom left corner at the coordinates you give above (I don't know if that's what you want, but let's assume; it shouldn't be hard to make these points the center of the cell, or multiply all of this by a certain factor Delta x to account for the proper size of voxels). For simplicity allow me to also forget about the z-coordinate and assume that we are only dealing with a 2d mesh. Then the first of your cells has vertices 2 0 2 1 3 0 3 1 The second of the cells above has vertices 3 0 3 1 4 0 4 1 And so on, and so forth. So you will want to create all of these vertices in one big array, and everytime you add one to the array you should check whether you already have it. In the example above, the first two vertices of the second cell you already have, so in the end for these two cells, you only need the following six vertices: 2 0 2 1 3 0 3 1 4 0 4 1 At the same time as you add, you need to record for each cell which vertices they are composed of. For the first cell you will find the following: 0 1 2 3 because none of the vertices of this cell were already in the array. For the second cell you will find 2 3 4 5 This way, as you loop over your set of MRI points, you will build up a global list of vertices and a list of 4-tuples indicating the four vertices of each cell. Best W. -- ------------------------------------------------------------------------- Wolfgang Bangerth email: [email protected] www: http://www.math.tamu.edu/~bangerth/ _______________________________________________ dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
