/*Translated by FOR_C, v3.4.2 (-), on 07/09/115 at 08:30:56 */ /*FOR_C Options SET: ftn=u io=c no=p op=aimnv s=dbov str=l x=f - prototypes */ #include #include "fcrt.h" #include "stgprg.h" #include #include #include void /*FUNCTION*/ stgprg( float x[], float y[], long np, long triang[], long b[][4], long nb, long nt) { long int bpr[20][5], i, i1, i2, index, ipr[14], j, k, len, limit, line, ni; static char label[5][9]={"INDEX ","FORWARD ","BACKWARD","VERTEX ", "TRIANGLE"}; /* OFFSET Vectors w/subscript range: 1 to dimension */ long *const Ipr = &ipr[0] - 1; float *const X = &x[0] - 1; float *const Y = &y[0] - 1; /* end of OFFSET VECTORS */ /* Copyright (c) 1996 California Institute of Technology, Pasadena, CA. * ALL RIGHTS RESERVED. * Based on Government Sponsored Research NAS7-03001. *>> 1997-07-01 STGPRG Krogh Remove MB (CLL suggestion) *>> 1997-06-15 STGPRG CLL Now assuming list in B() is circular. *>> 1996-06-24 STGPRG Krogh Format changes for conversion to C. *>> 1996-03-30 STGPRG Krogh MIN0 => MIN *>> 1996-02-02 STGPRG CLL *>> 1995-09-26 STGPRG CLL Editing for inclusion into MATH77. * * C.L.LAWSON, JPL, 1976 NOV 30 * This subroutine prints the (x,y) data from X() and Y(), and the * pointers defining the structure of a triangular grid from TRIANG(), * and the pointers defining the boundary of the convex hull of the * triangular grid from B(,). * All subroutine arguments are of INTENT IN. * ------------------------------------------------------------------ *--S replaces "?": ?TGPRG, ?TGGET * ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */ ni = np - nb; printf("\n DATA AND POINTERS DEFINING A TRIANGULAR GRID\n\n NP =%5ld, NB =%5ld, NI =%5ld, NT =%5ld\n\n\n (X,Y)-COORDINATES OF VERTICES..\n", np, nb, ni, nt); /* PRINT X(),Y() */ i1 = 1; for (i1 = 1; i1 <= np; i1 += 6) { i2 = min( i1 + 5, np ); len = i2 - i1 + 1; for (i = 1; i <= len; i++) { Ipr[i] = i1 - 1 + i; } printf("\n "); for (i = 1; i <= len; i++) { printf("%12ld", Ipr[i]); } printf("\n"); printf(" "); for (i = i1; i <= i2; i++) { printf("%12.5f", X[i]); } printf("\n"); printf(" "); for (i = i1; i <= i2; i++) { printf("%12.5f", Y[i]); } printf("\n"); } /* PRINT TRIANG() * */ printf("\n\n POINTERS DEFINING TRIANGLES..\n\n INDEX ADJACENT TRIANGLES *****VERTICES*****\n"); for (i = 1; i <= nt; i++) { Ipr[1] = i; stgget( i, &Ipr[2], triang ); printf(" "); for (j = 1; j <= 7; j++) { printf("%5ld", Ipr[j]); } printf(" \n"); } /* PRINT B() */ limit = nb + 5; printf("\n\n BOUNDARY LIST..\n\n"); index = 1; /* Begin loop to print boundary list. */ L_40: ; len = 0; for (i = 1; i <= 20; i++) { limit -= 1; if (limit <= 0) goto L_70; len = i; bpr[i - 1][0] = index; for (j = 1; j <= 4; j++) { bpr[i - 1][j] = b[index - 1][j - 1]; } index = b[index - 1][0]; if (index == 0 || index == 1) goto L_80; } L_70: ; L_80: ; if (len == 0) goto L_100; for (line = 1; line <= 5; line++) { printf(" %8.8s", label[line - 1]); printf(" "); for (k = 1; k <= len; k++) { printf("%5ld", bpr[k - 1][line - 1]); } printf("\n"); } if (limit <= 0) { printf("\n ERROR IN BOUNDARY LIST. QUITTING.\n"); goto L_110; } if (index != 0 && index != 1) goto L_40; /* End loop to print boundary list. */ L_100: ; L_110: ; return; } /* end of function */