regular_square_mesh
regular_square_mesh(nx, ny=None)
Triangle mesh of a square
Generates a regular triangular mesh of a one by one square by dividing each grid square into two triangles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nx |
int
|
number of vertices on the x-axis |
required |
ny |
int, optional (default None)
|
number of vertices on the y-axis, default nx |
None
|
Returns:
Name | Type | Description |
---|---|---|
V |
numpy double array
|
Matrix of triangle mesh vertex coordinates |
F |
numpy int array
|
Matrix of triangle vertex indices into V |
See Also
regular_cube_mesh.
Notes
The ordering of the vertices is increasing by rows and then columns, so [0,0], [h,0], [2h,0],...,[h,h],[2h,h],...,[1-h,1],[1,1]
Examples:
# Generate a 10x10 triangle mesh
gs = 10
V, F = gpytoolbox.regular_square_mesh(gs)
Source code in src/gpytoolbox/regular_square_mesh.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|