Fast Auxiliary Space Preconditioning 2.7.7 Aug/28/2022
Loading...
Searching...
No Matches
AuxGraphics.c
Go to the documentation of this file.
1
14#include <math.h>
15
16#include "fasp.h"
17#include "fasp_grid.h"
18#include "fasp_functs.h"
19
20/*---------------------------------*/
21/*-- Declare Private Functions --*/
22/*---------------------------------*/
23
24static void put_byte (FILE *fp, const int c);
25static void put_word (FILE *fp, const int w);
26static void put_dword (FILE *fp, const int d);
27static int write_bmp16 (const char *fname, int m, int n, const char map[]);
28
29/*---------------------------------*/
30/*-- Public Functions --*/
31/*---------------------------------*/
32
58 const char *filename,
59 int size)
60{
61 INT m = A->row, n = A->col, minmn = MIN(m,n);
62 int i, j, k;
63 char *map;
64
65 if ( size>minmn ) size = minmn;
66 map = (char *)fasp_mem_calloc(size * size, sizeof(char));
67
68 printf("Writing matrix pattern to `%s'...\n",filename);
69
70 memset((void *)map, 0x0F, size * size);
71
72 for (i = 0; i < size; ++i) {
73 for (j = A->IA[i]; j < A->IA[i+1]; ++j) {
74 if (A->JA[j]<size) {
75 k = size*i + A->JA[j];
76 if (map[k] != 0x0F)
77 map[k] = 0x0F;
78 else if (A->val[j] > 1e-20)
79 map[k] = 0x09; /* bright blue */
80 else if (A->val[j] < -1e-20)
81 map[k] = 0x0C; /* bright red */
82 else
83 map[k] = 0x06; /* brown */
84 } // end if
85 } // end for j
86 } // end for i
87
88 write_bmp16(filename, size, size, map);
89
90 fasp_mem_free(map); map = NULL;
91}
92
117void fasp_dcsr_plot (const dCSRmat *A,
118 const char *fname)
119{
120 FILE *fp;
121 INT offset, bmsize, i, j, b;
122 INT n = A->col, m = A->row;
123 INT size;
124
125 INT col;
126 REAL val;
127 char *map;
128
129 size = ( (n+7)/8 )*8;
130
131 map = (char *)fasp_mem_calloc(size, sizeof(char));
132
133 memset(map, 0x0F, size);
134
135 if (!(1 <= m && m <= 32767))
136 printf("### ERROR: Invalid num of rows %d! [%s]\n", m, __FUNCTION__);
137
138 if (!(1 <= n && n <= 32767))
139 printf("### ERROR: Invalid num of cols %d! [%s]\n", n, __FUNCTION__);
140
141 fp = fopen(fname, "wb");
142 if (fp == NULL) {
143 printf("### ERROR: Unable to create `%s'! [%s]\n", fname, __FUNCTION__);
144 goto FINISH;
145 }
146
147 offset = 14 + 40 + 16 * 4;
148 bmsize = (4 * n + 31) / 32;
149 /* struct BMPFILEHEADER (14 bytes) */
150 /* UINT bfType */ put_byte(fp, 'B'); put_byte(fp, 'M');
151 /* DWORD bfSize */ put_dword(fp, offset + bmsize * 4);
152 /* UINT bfReserved1 */ put_word(fp, 0);
153 /* UNIT bfReserved2 */ put_word(fp, 0);
154 /* DWORD bfOffBits */ put_dword(fp, offset);
155 /* struct BMPINFOHEADER (40 bytes) */
156 /* DWORD biSize */ put_dword(fp, 40);
157 /* LONG biWidth */ put_dword(fp, n);
158 /* LONG biHeight */ put_dword(fp, m);
159 /* WORD biPlanes */ put_word(fp, 1);
160 /* WORD biBitCount */ put_word(fp, 4);
161 /* DWORD biCompression */ put_dword(fp, 0 /* BI_RGB */);
162 /* DWORD biSizeImage */ put_dword(fp, 0);
163 /* LONG biXPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
164 /* LONG biYPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
165 /* DWORD biClrUsed */ put_dword(fp, 0);
166 /* DWORD biClrImportant */ put_dword(fp, 0);
167 /* struct RGBQUAD (16 * 4 = 64 bytes) */
168 /* CGA-compatible colors: */
169 /* 0x00 = black */ put_dword(fp, 0x000000);
170 /* 0x01 = blue */ put_dword(fp, 0x000080);
171 /* 0x02 = green */ put_dword(fp, 0x008000);
172 /* 0x03 = cyan */ put_dword(fp, 0x008080);
173 /* 0x04 = red */ put_dword(fp, 0x800000);
174 /* 0x05 = magenta */ put_dword(fp, 0x800080);
175 /* 0x06 = brown */ put_dword(fp, 0x808000);
176 /* 0x07 = light gray */ put_dword(fp, 0xC0C0C0);
177 /* 0x08 = dark gray */ put_dword(fp, 0x808080);
178 /* 0x09 = bright blue */ put_dword(fp, 0x0000FF);
179 /* 0x0A = bright green */ put_dword(fp, 0x00FF00);
180 /* 0x0B = bright cyan */ put_dword(fp, 0x00FFFF);
181 /* 0x0C = bright red */ put_dword(fp, 0xFF0000);
182 /* 0x0D = bright magenta */put_dword(fp, 0xFF00FF);
183 /* 0x0E = yellow */ put_dword(fp, 0xFFFF00);
184 /* 0x0F = white */ put_dword(fp, 0xFFFFFF);
185 /* pixel data bits */
186 b = 0;
187
189 // for(i=((m+7)/8)*8 - 1; i>=m; i--){
190 // memset(map, 0x0F, size);
191 // for (j = 0; j < size; ++j) {
192 // b <<= 4;
193 // b |= (j < n ? map[j] & 15 : 0);
194 // if (j & 1) put_byte(fp, b);
195 // }
196 // }
198
199 for ( i = A->row-1; i >=0; i-- ) {
200 memset(map, 0x0F, size);
201
202 for ( j = A->IA[i]; j < A->IA[i+1]; j++ ) {
203 col = A->JA[j];
204 val = A->val[j];
205 if (map[col] != 0x0F)
206 map[col] = 0x0F;
207 else if ( val > 1e-20)
208 map[col] = 0x09; /* bright blue */
209 else if ( val < -1e-20)
210 map[col] = 0x0C; /* bright red */
211 else if (val == 0)
212 map[col] = 0x00; /* bright red */
213 else
214 map[col] = 0x06; /* brown */
215 } // for j
216
217 for (j = 0; j < size; ++j) {
218 b <<= 4;
219 b |= (j < n ? map[j] & 15 : 0);
220 if (j & 1) put_byte(fp, b);
221 }
222 }
223
224 fflush(fp);
225 if (ferror(fp)) {
226 printf("### ERROR: Write error on `%s'! [%s]\n", fname, __FUNCTION__);
227 }
228
229FINISH: if (fp != NULL) fclose(fp);
230
231 fasp_mem_free(map); map = NULL;
232}
233
260 const char *filename,
261 int size)
262{
263 INT m = A->ROW;
264 INT n = A->COL;
265 INT nb = A->nb;
266 INT nb2 = nb*nb;
267 INT offset;
268 INT row, col, i, j, k, l, minmn=nb*MIN(m,n);
269 REAL val;
270 char *map;
271
272 if (size>minmn) size=minmn;
273
274 printf("Writing matrix pattern to `%s'...\n",filename);
275
276 map = (char *)fasp_mem_calloc(size * size, sizeof(char));
277
278 memset((void *)map, 0x0F, size * size);
279
280 for ( i = 0; i < size/nb; i++ ) {
281
282 for ( j = A->IA[i]; j < A->IA[i+1]; j++ ) {
283 for ( k = 0; k < A->nb; k++ ) {
284 for ( l = 0; l < A->nb; l++ ) {
285
286 row = i*nb + k;
287 col = A->JA[j]*nb + l;
288 val = A->val[ A->JA[j]*nb2 + k*nb + l];
289
290 if (col<size) {
291
292 offset = size*row + col;
293
294 if (map[offset] != 0x0F)
295 map[offset] = 0x0F;
296 else if ( val > 1e-20)
297 map[offset] = 0x09; /* bright blue */
298 else if ( val < -1e-20)
299 map[offset] = 0x0C; /* bright red */
300 else if (val == 0)
301 map[offset] = 0x00; /* bright red */
302 else
303 map[offset] = 0x06; /* brown */
304 } // end if
305 }
306 }
307 }
308 }
309
310 write_bmp16(filename, size, size, map);
311
312 fasp_mem_free(map); map = NULL;
313}
314
339void fasp_dbsr_plot (const dBSRmat *A,
340 const char *fname)
341{
342 FILE *fp;
343 INT offset, bmsize, i, j, b;
344 INT size;
345 INT nb = A->nb;
346 INT nb2 = nb*nb;
347 INT n = A->COL*A->nb, m = A->ROW*A->nb;
348 INT col,k,l;
349 REAL val;
350 char *map;
351
352 size = ( (n+7)/8 )*8;
353
354 map = (char *)fasp_mem_calloc(size, sizeof(char));
355
356 memset((void *)map, 0x0F, size);
357
358 if (!(1 <= m && m <= 32767))
359 printf("### ERROR: Invalid num of rows %d! [%s]\n", m, __FUNCTION__);
360
361 if (!(1 <= n && n <= 32767))
362 printf("### ERROR: Invalid num of cols %d! [%s]\n", n, __FUNCTION__);
363
364 fp = fopen(fname, "wb");
365 if (fp == NULL) {
366 printf("### ERROR: Unable to create `%s'! [%s]\n", fname, __FUNCTION__);
367 goto FINISH;
368 }
369
370 offset = 14 + 40 + 16 * 4;
371 bmsize = (4 * n + 31) / 32;
372 /* struct BMPFILEHEADER (14 bytes) */
373 /* UINT bfType */ put_byte(fp, 'B'); put_byte(fp, 'M');
374 /* DWORD bfSize */ put_dword(fp, offset + bmsize * 4);
375 /* UINT bfReserved1 */ put_word(fp, 0);
376 /* UNIT bfReserved2 */ put_word(fp, 0);
377 /* DWORD bfOffBits */ put_dword(fp, offset);
378 /* struct BMPINFOHEADER (40 bytes) */
379 /* DWORD biSize */ put_dword(fp, 40);
380 /* LONG biWidth */ put_dword(fp, n);
381 /* LONG biHeight */ put_dword(fp, m);
382 /* WORD biPlanes */ put_word(fp, 1);
383 /* WORD biBitCount */ put_word(fp, 4);
384 /* DWORD biCompression */ put_dword(fp, 0 /* BI_RGB */);
385 /* DWORD biSizeImage */ put_dword(fp, 0);
386 /* LONG biXPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
387 /* LONG biYPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
388 /* DWORD biClrUsed */ put_dword(fp, 0);
389 /* DWORD biClrImportant */ put_dword(fp, 0);
390 /* struct RGBQUAD (16 * 4 = 64 bytes) */
391 /* CGA-compatible colors: */
392 /* 0x00 = black */ put_dword(fp, 0x000000);
393 /* 0x01 = blue */ put_dword(fp, 0x000080);
394 /* 0x02 = green */ put_dword(fp, 0x008000);
395 /* 0x03 = cyan */ put_dword(fp, 0x008080);
396 /* 0x04 = red */ put_dword(fp, 0x800000);
397 /* 0x05 = magenta */ put_dword(fp, 0x800080);
398 /* 0x06 = brown */ put_dword(fp, 0x808000);
399 /* 0x07 = light gray */ put_dword(fp, 0xC0C0C0);
400 /* 0x08 = dark gray */ put_dword(fp, 0x808080);
401 /* 0x09 = bright blue */ put_dword(fp, 0x0000FF);
402 /* 0x0A = bright green */ put_dword(fp, 0x00FF00);
403 /* 0x0B = bright cyan */ put_dword(fp, 0x00FFFF);
404 /* 0x0C = bright red */ put_dword(fp, 0xFF0000);
405 /* 0x0D = bright magenta */put_dword(fp, 0xFF00FF);
406 /* 0x0E = yellow */ put_dword(fp, 0xFFFF00);
407 /* 0x0F = white */ put_dword(fp, 0xFFFFFF);
408 /* pixel data bits */
409 b = 0;
410
412 // for(i=size-1; i>=m; i--){
413 // memset(map, 0x0F, size);
414 // for (j = 0; j < size; ++j) {
415 // b <<= 4;
416 // b |= (j < n ? map[j] & 15 : 0);
417 // if (j & 1) put_byte(fp, b);
418 // }
419 // }
421
422 for ( i = A->ROW-1; i >=0; i-- ) {
423
424 for ( k = A->nb-1; k >=0; k-- ) {
425
426 memset(map, 0x0F, size);
427
428 for ( j = A->IA[i]; j < A->IA[i+1]; j++ ) {
429 for ( l = 0; l < A->nb; l++ ) {
430
431 col = A->JA[j]*nb + l;
432 val = A->val[ A->JA[j]*nb2 + k*nb + l];
433
434 if (map[col] != 0x0F)
435 map[col] = 0x0F;
436 else if ( val > 1e-20)
437 map[col] = 0x09; /* bright blue */
438 else if ( val < -1e-20)
439 map[col] = 0x0C; /* bright red */
440 else if (val == 0)
441 map[col] = 0x00; /* bright red */
442 else
443 map[col] = 0x06; /* brown */
444 } // for l
445 } // for j
446
447
448 for (j = 0; j < size; ++j) {
449 b <<= 4;
450 b |= (j < n ? map[j] & 15 : 0);
451 if (j & 1) put_byte(fp, b);
452 }
453
454 }
455 }
456
457 fflush(fp);
458 if (ferror(fp)) {
459 printf("### ERROR: Write error on `%s'! [%s]\n", fname, __FUNCTION__);
460 }
461
462FINISH: if (fp != NULL) fclose(fp);
463
464 fasp_mem_free(map); map = NULL;
465}
466
479 int level)
480{
481 FILE *datei;
482 char buf[120];
483 INT i;
484 REAL xmid,ymid,xc,yc;
485
486 sprintf(buf,"Grid_ref_level%d.eps",level);
487 datei = fopen(buf,"w");
488 if(datei==NULL) {
489 printf("Opening file %s fails!\n", buf);
490 return;
491 }
492
493 fprintf(datei, "%%!PS-Adobe-2.0-2.0 EPSF-2.0\n");
494 fprintf(datei, "%%%%BoundingBox: 0 0 550 550\n");
495 fprintf(datei, "25 dup translate\n");
496 fprintf(datei, "%f setlinewidth\n",0.2);
497 fprintf(datei, "/Helvetica findfont %f scalefont setfont\n",64.0*pow(0.5,level));
498 fprintf(datei, "/b{0 setgray} def\n");
499 fprintf(datei, "/r{1.0 0.6 0.6 setrgbcolor} def\n");
500 fprintf(datei, "/u{0.1 0.7 0.1 setrgbcolor} def\n");
501 fprintf(datei, "/d{0.1 0.1 1.0 setrgbcolor} def\n");
502 fprintf(datei, "/cs{closepath stroke} def\n");
503 fprintf(datei, "/m{moveto} def\n");
504 fprintf(datei, "/l{lineto} def\n");
505
506 fprintf(datei,"b\n");
507 for (i=0; i<pg->triangles; ++i) {
508 xc = (pg->p[pg->t[i][0]][0]+pg->p[pg->t[i][1]][0]+pg->p[pg->t[i][2]][0])*150.0;
509 yc = (pg->p[pg->t[i][0]][1]+pg->p[pg->t[i][1]][1]+pg->p[pg->t[i][2]][1])*150.0;
510
511 xmid = pg->p[pg->t[i][0]][0]*450.0;
512 ymid = pg->p[pg->t[i][0]][1]*450.0;
513 fprintf(datei,"%.1f %.1f m ",0.9*xmid+0.1*xc,0.9*ymid+0.1*yc);
514 xmid = pg->p[pg->t[i][1]][0]*450.0;
515 ymid = pg->p[pg->t[i][1]][1]*450.0;
516 fprintf(datei,"%.1f %.1f l ",0.9*xmid+0.1*xc,0.9*ymid+0.1*yc);
517 xmid = pg->p[pg->t[i][2]][0]*450.0;
518 ymid = pg->p[pg->t[i][2]][1]*450.0;
519 fprintf(datei,"%.1f %.1f l ",0.9*xmid+0.1*xc,0.9*ymid+0.1*yc);
520 fprintf(datei,"cs\n");
521 }
522 fprintf(datei,"r\n");
523 for(i=0; i<pg->vertices; ++i) {
524 xmid = pg->p[i][0]*450.0;
525 ymid = pg->p[i][1]*450.0;
526 fprintf(datei,"%.1f %.1f m ",xmid,ymid);
527 fprintf(datei,"(%d) show\n ",i);
528 }
529 fprintf(datei,"u\n");
530 for(i=0; i<pg->edges; ++i) {
531 xmid = 0.5*(pg->p[pg->e[i][0]][0]+pg->p[pg->e[i][1]][0])*450.0;
532 ymid = 0.5*(pg->p[pg->e[i][0]][1]+pg->p[pg->e[i][1]][1])*450.0;
533 fprintf(datei,"%.1f %.1f m ",xmid,ymid);
534 fprintf(datei,"(%d) show\n ",i);
535
536 xmid = pg->p[pg->e[i][0]][0]*450.0;
537 ymid = pg->p[pg->e[i][0]][1]*450.0;
538 fprintf(datei,"%.1f %.1f m ",xmid,ymid);
539 xmid = pg->p[pg->e[i][1]][0]*450.0;
540 ymid = pg->p[pg->e[i][1]][1]*450.0;
541 fprintf(datei,"%.1f %.1f l ",xmid,ymid);
542 fprintf(datei,"cs\n");
543 }
544 fprintf(datei,"d\n");
545 for(i=0; i<pg->triangles; ++i) {
546 xmid = (pg->p[pg->t[i][0]][0]+pg->p[pg->t[i][1]][0]+pg->p[pg->t[i][2]][0])*150.0;
547 ymid = (pg->p[pg->t[i][0]][1]+pg->p[pg->t[i][1]][1]+pg->p[pg->t[i][2]][1])*150.0;
548 fprintf(datei,"%.1f %.1f m ",xmid,ymid);
549 fprintf(datei,"(%d) show\n ",i);
550 }
551 fprintf(datei, "showpage\n");
552 fclose(datei);
553}
554
555/*---------------------------------*/
556/*-- Private Functions --*/
557/*---------------------------------*/
558
568static void put_byte (FILE *fp,
569 const int c)
570{
571 fputc(c, fp);
572 return;
573}
574
584static void put_word (FILE *fp,
585 const int w)
586{ /* big endian */
587 put_byte(fp, w);
588 put_byte(fp, w >> 8);
589 return;
590}
591
601static void put_dword (FILE *fp,
602 const int d)
603{ /* big endian */
604 put_word(fp, d);
605 put_word(fp, d >> 16);
606 return;
607}
608
674static int write_bmp16 (const char *fname,
675 const int m,
676 const int n,
677 const char map[])
678{
679 FILE *fp;
680 int offset, bmsize, i, j, b, ret = 1;
681
682 if (!(1 <= m && m <= 32767))
683 printf("### ERROR: %s invalid height %d\n", __FUNCTION__, m);
684
685 if (!(1 <= n && n <= 32767))
686 printf("### ERROR: %s invalid width %d\n", __FUNCTION__, n);
687
688 fp = fopen(fname, "wb");
689 if (fp == NULL) {
690 printf("### ERROR: %s unable to create `%s'\n", __FUNCTION__, fname);
691 ret = 0;
692 goto FINISH;
693 }
694 offset = 14 + 40 + 16 * 4;
695 bmsize = (4 * n + 31) / 32;
696 /* struct BMPFILEHEADER (14 bytes) */
697 /* UINT bfType */ put_byte(fp, 'B'); put_byte(fp, 'M');
698 /* DWORD bfSize */ put_dword(fp, offset + bmsize * 4);
699 /* UINT bfReserved1 */ put_word(fp, 0);
700 /* UINT bfReserved2 */ put_word(fp, 0);
701 /* DWORD bfOffBits */ put_dword(fp, offset);
702 /* struct BMPINFOHEADER (40 bytes) */
703 /* DWORD biSize */ put_dword(fp, 40);
704 /* LONG biWidth */ put_dword(fp, n);
705 /* LONG biHeight */ put_dword(fp, m);
706 /* WORD biPlanes */ put_word(fp, 1);
707 /* WORD biBitCount */ put_word(fp, 4);
708 /* DWORD biCompression */ put_dword(fp, 0 /* BI_RGB */);
709 /* DWORD biSizeImage */ put_dword(fp, 0);
710 /* LONG biXPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
711 /* LONG biYPelsPerMeter */ put_dword(fp, 2953 /* 75 dpi */);
712 /* DWORD biClrUsed */ put_dword(fp, 0);
713 /* DWORD biClrImportant */ put_dword(fp, 0);
714 /* struct RGBQUAD (16 * 4 = 64 bytes) */
715 /* CGA-compatible colors: */
716 /* 0x00 = black */ put_dword(fp, 0x000000);
717 /* 0x01 = blue */ put_dword(fp, 0x000080);
718 /* 0x02 = green */ put_dword(fp, 0x008000);
719 /* 0x03 = cyan */ put_dword(fp, 0x008080);
720 /* 0x04 = red */ put_dword(fp, 0x800000);
721 /* 0x05 = magenta */ put_dword(fp, 0x800080);
722 /* 0x06 = brown */ put_dword(fp, 0x808000);
723 /* 0x07 = light gray */ put_dword(fp, 0xC0C0C0);
724 /* 0x08 = dark gray */ put_dword(fp, 0x808080);
725 /* 0x09 = bright blue */ put_dword(fp, 0x0000FF);
726 /* 0x0A = bright green */ put_dword(fp, 0x00FF00);
727 /* 0x0B = bright cyan */ put_dword(fp, 0x00FFFF);
728 /* 0x0C = bright red */ put_dword(fp, 0xFF0000);
729 /* 0x0D = bright magenta */put_dword(fp, 0xFF00FF);
730 /* 0x0E = yellow */ put_dword(fp, 0xFFFF00);
731 /* 0x0F = white */ put_dword(fp, 0xFFFFFF);
732 /* pixel data bits */
733 b = 0;
734 for (i = m - 1; i >= 0; i--) {
735 for (j = 0; j < ((n + 7) / 8) * 8; ++j) {
736 b <<= 4;
737 b |= (j < n ? map[i * n + j] & 15 : 0);
738 if (j & 1) put_byte(fp, b);
739 }
740 }
741 fflush(fp);
742
743 if (ferror(fp)) {
744 printf("### ERROR: %s write error on `%s'\n", __FUNCTION__, fname);
745 ret = 0;
746 }
747
748FINISH: if (fp != NULL) fclose(fp);
749 return ret;
750}
751
752/*---------------------------------*/
753/*-- End of File --*/
754/*---------------------------------*/
void fasp_dbsr_subplot(const dBSRmat *A, const char *filename, int size)
Write sparse matrix pattern in BMP file format.
Definition: AuxGraphics.c:259
void fasp_grid2d_plot(pgrid2d pg, int level)
Output grid to a EPS file.
Definition: AuxGraphics.c:478
void fasp_dcsr_subplot(const dCSRmat *A, const char *filename, int size)
Write sparse matrix pattern in BMP file format.
Definition: AuxGraphics.c:57
void fasp_dcsr_plot(const dCSRmat *A, const char *fname)
Write dCSR sparse matrix pattern in BMP file format.
Definition: AuxGraphics.c:117
void fasp_dbsr_plot(const dBSRmat *A, const char *fname)
Write dBSR sparse matrix pattern in BMP file format.
Definition: AuxGraphics.c:339
void fasp_mem_free(void *mem)
Free up previous allocated memory body and set pointer to NULL.
Definition: AuxMemory.c:152
void * fasp_mem_calloc(const unsigned int size, const unsigned int type)
Allocate, initiate, and check memory.
Definition: AuxMemory.c:65
Main header file for the FASP project.
#define MIN(a, b)
Definition: fasp.h:83
#define REAL
Definition: fasp.h:75
#define INT
Definition: fasp.h:72
Header file for FASP grid.
Block sparse row storage matrix of REAL type.
Definition: fasp_block.h:34
INT COL
number of cols of sub-blocks in matrix A, N
Definition: fasp_block.h:40
REAL * val
Definition: fasp_block.h:57
INT nb
dimension of each sub-block
Definition: fasp_block.h:46
INT * IA
integer array of row pointers, the size is ROW+1
Definition: fasp_block.h:60
INT ROW
number of rows of sub-blocks in matrix A, M
Definition: fasp_block.h:37
INT * JA
Definition: fasp_block.h:64
Sparse matrix of REAL type in CSR format.
Definition: fasp.h:151
INT col
column of matrix A, n
Definition: fasp.h:157
REAL * val
nonzero entries of A
Definition: fasp.h:169
INT row
row number of matrix A, m
Definition: fasp.h:154
INT * IA
integer array of row pointers, the size is m+1
Definition: fasp.h:163
INT * JA
integer array of column indexes, the size is nnz
Definition: fasp.h:166
Two dimensional grid data structure.
Definition: fasp_grid.h:24
INT edges
Definition: fasp_grid.h:38
REAL(* p)[2]
Definition: fasp_grid.h:26
INT triangles
Definition: fasp_grid.h:39
INT(* t)[3]
Definition: fasp_grid.h:28
INT(* e)[2]
Definition: fasp_grid.h:27
INT vertices
Definition: fasp_grid.h:37