Cartesian grid generation

The grids are cartesian grids, all cells have the same size in all directions. The required parameters are the number of points per side for the grid paralellepiped.

_images/square.png

square from a

_images/rectangle.png

rectangle from a,b

Grid generation functions are:

square(i)

rectangle(i, j)

cube(i)

parallelepiped(i, j, k)

Each function returns a numpy [1] array with point coordinates, the whole is a cartesian grid (or mesh). Mesh dimensions are (3,i,j,k), the first dim is x,y,z, then each side of the paralellepiped is i,j and k. Any returned mesh has such a shape

The table hereafter summerize the function results w.r.t. parameters: les dimensions obtenues:

Mesh dimensions

mesh params i j k
square a a a 1
rectangle a,b a b 1
cube a a a a
parallelepiped a,b,c a b c
[1]see http://www.numpy.org

Grid generation

Cython Module

Fortran Module

gen3d(i,j,k,x,y,z)

int i,j,k: max dims (number of points) along i,j and k axis x,y,z: numpy arrays already allocated, function fills them

Warning

No dimension check

Table Of Contents

Previous topic

pyShift - Rigid Motion for 3D Grids

Next topic

gen3d(i,j,k,x,y,z)

This Page