Correct cart_grid fields face_nodepos for 2D/3D and facepos for 2D.
This commit is contained in:
parent
dd4c0c2b1b
commit
355f9ebee7
@ -269,6 +269,7 @@ fill_cart_topology_3d(struct UnstructuredGrid *G, int nx, int ny, int nz)
|
||||
fnodes = G->face_nodes;
|
||||
fnodepos = G->face_nodepos;
|
||||
fcells = G->face_cells;
|
||||
fnodepos[0] = 0;
|
||||
|
||||
/* Faces with x-normal */
|
||||
for (k=0; k<nz; ++k) {
|
||||
@ -547,6 +548,7 @@ create_cart_grid(int nx, int ny, int nz)
|
||||
fnormals = G->face_normals;
|
||||
fcentroids = G->face_centroids;
|
||||
fareas = G->face_areas;
|
||||
fnodepos[0] = 0;
|
||||
|
||||
/* Faces with x-normal */
|
||||
for (k=0; k<nz; ++k) {
|
||||
@ -761,12 +763,13 @@ fill_cart_topology_2d(struct UnstructuredGrid *G, int nx, int ny)
|
||||
fnodes = G->face_nodes;
|
||||
fnodepos = G->face_nodepos;
|
||||
fcells = G->face_cells;
|
||||
fnodepos[0] = 0;
|
||||
|
||||
/* Faces with x-normal */
|
||||
for (j=0; j<ny; ++j) {
|
||||
for (i=0; i<nx+1; ++i) {
|
||||
*fnodes++ = i+Nx*j;
|
||||
*fnodes++ = i+Nx*j+1;
|
||||
*fnodes++ = i+Nx*(j+1);
|
||||
fnodepos[1] = fnodepos[0] + 2;
|
||||
++fnodepos;
|
||||
if (i==0) {
|
||||
@ -787,8 +790,8 @@ fill_cart_topology_2d(struct UnstructuredGrid *G, int nx, int ny)
|
||||
/* Faces with y-normal */
|
||||
for (j=0; j<ny+1; ++j) {
|
||||
for (i=0; i<nx; ++i) {
|
||||
*fnodes++ = i+ Nx*j;
|
||||
*fnodes++ = i+1 + Nx*j;
|
||||
*fnodes++ = i+ Nx*j;
|
||||
fnodepos[1] = fnodepos[0] + 2;
|
||||
++fnodepos;
|
||||
if (j==0) {
|
||||
|
Loading…
Reference in New Issue
Block a user