Bug Summary

File:sys/classes/viewer/impls/draw/drawv.c
Warning:line 451, column 31
Dereference of null pointer (loaded from variable 'sviewer')

Annotated Source Code

[?] Use j/k keys for keyboard navigation

1
2#include <../src/sys/classes/viewer/impls/draw/vdraw.h> /*I "petscdraw.h" I*/
3#include <petscviewer.h> /*I "petscviewer.h" I*/
4
5static PetscErrorCode PetscViewerDestroy_Draw(PetscViewer v)
6{
7 PetscErrorCode ierr;
8 PetscInt i;
9 PetscViewer_Draw *vdraw = (PetscViewer_Draw*)v->data;
10
11 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 11; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
12 if (vdraw->singleton_made) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ORDER,"Destroying PetscViewer without first restoring singleton")return PetscError(((MPI_Comm)0x44000001),12,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,58,PETSC_ERROR_INITIAL,"Destroying PetscViewer without first restoring singleton"
)
;
13 for (i=0; i<vdraw->draw_max; i++) {
14 ierr = PetscDrawAxisDestroy(&vdraw->drawaxis[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),14,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
15 ierr = PetscDrawLGDestroy(&vdraw->drawlg[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),15,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
16 ierr = PetscDrawDestroy(&vdraw->draw[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),16,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
17 }
18 ierr = PetscFree(vdraw->display)((*PetscTrFree)((void*)(vdraw->display),18,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((vdraw->display) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),18,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
19 ierr = PetscFree(vdraw->title)((*PetscTrFree)((void*)(vdraw->title),19,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((vdraw->title) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),19,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
20 ierr = PetscFree3(vdraw->draw,vdraw->drawlg,vdraw->drawaxis)PetscFreeA(3,20,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,&(vdraw->draw),&(vdraw->drawlg),&(vdraw->
drawaxis))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),20,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
21 ierr = PetscFree(vdraw->bounds)((*PetscTrFree)((void*)(vdraw->bounds),21,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((vdraw->bounds) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),21,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
22 ierr = PetscFree(vdraw->drawtype)((*PetscTrFree)((void*)(vdraw->drawtype),22,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((vdraw->drawtype) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),22,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
23 ierr = PetscFree(v->data)((*PetscTrFree)((void*)(v->data),23,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((v->data) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),23,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
24 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
25}
26
27static PetscErrorCode PetscViewerFlush_Draw(PetscViewer v)
28{
29 PetscErrorCode ierr;
30 PetscInt i;
31 PetscViewer_Draw *vdraw = (PetscViewer_Draw*)v->data;
32
33 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 33; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
34 for (i=0; i<vdraw->draw_max; i++) {
35 if (vdraw->draw[i]) {ierr = PetscDrawFlush(vdraw->draw[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),35,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
36 }
37 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
38}
39
40/*@C
41 PetscViewerDrawGetDraw - Returns PetscDraw object from PetscViewer object.
42 This PetscDraw object may then be used to perform graphics using
43 PetscDrawXXX() commands.
44
45 Collective on PetscViewer
46
47 Input Parameters:
48+ viewer - the PetscViewer (created with PetscViewerDrawOpen())
49- windownumber - indicates which subwindow (usually 0)
50
51 Ouput Parameter:
52. draw - the draw object
53
54 Level: intermediate
55
56 Concepts: drawing^accessing PetscDraw context from PetscViewer
57 Concepts: graphics
58
59.seealso: PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen()
60@*/
61PetscErrorCode PetscViewerDrawGetDraw(PetscViewer viewer,PetscInt windownumber,PetscDraw *draw)
62{
63 PetscViewer_Draw *vdraw;
64 PetscErrorCode ierr;
65 PetscBool isdraw;
66
67 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 67; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
68 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),68
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),68,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),68,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),68,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
69 PetscValidLogicalCollectiveInt(viewer,windownumber,2)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -windownumber
; b1[1] = windownumber; _7_ierr = (PetscAllreduceBarrierCheck
(PetscObjectComm((PetscObject)viewer),2,69,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)viewer))),0) || MPI_Allreduce((b1),(b2),(2),(((
MPI_Datatype)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm
((PetscObject)viewer)))));do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),69,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)viewer),69
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,2); } while (0)
;
70 if (draw) PetscValidPointer(draw,3)do { if (!draw) return PetscError(((MPI_Comm)0x44000001),70,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if
(!PetscCheckPointer(draw,PETSC_CHAR)) return PetscError(((MPI_Comm
)0x44000001),70,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
71 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),71,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
72 if (!isdraw) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,"Must be draw type PetscViewer")return PetscError(((MPI_Comm)0x44000001),72,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Must be draw type PetscViewer")
;
73 if (windownumber < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Window number cannot be negative")return PetscError(((MPI_Comm)0x44000001),73,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,63,PETSC_ERROR_INITIAL,"Window number cannot be negative")
;
74 vdraw = (PetscViewer_Draw*)viewer->data;
75
76 windownumber += vdraw->draw_base;
77 if (windownumber >= vdraw->draw_max) {
78 /* allocate twice as many slots as needed */
79 PetscInt draw_max = vdraw->draw_max;
80 PetscDraw *tdraw = vdraw->draw;
81 PetscDrawLG *drawlg = vdraw->drawlg;
82 PetscDrawAxis *drawaxis = vdraw->drawaxis;
83
84 vdraw->draw_max = 2*windownumber;
85
86 ierr = PetscCalloc3(vdraw->draw_max,&vdraw->draw,vdraw->draw_max,&vdraw->drawlg,vdraw->draw_max,&vdraw->drawaxis)PetscMallocA(3,PETSC_TRUE,86,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,(size_t)(vdraw->draw_max)*sizeof(**(&vdraw->draw))
,(&vdraw->draw),(size_t)(vdraw->draw_max)*sizeof(**
(&vdraw->drawlg)),(&vdraw->drawlg),(size_t)(vdraw
->draw_max)*sizeof(**(&vdraw->drawaxis)),(&vdraw
->drawaxis))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),86,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
87
88 ierr = PetscMemcpy(vdraw->draw,tdraw,draw_max*sizeof(PetscDraw));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),88,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
89 ierr = PetscMemcpy(vdraw->drawlg,drawlg,draw_max*sizeof(PetscDrawLG));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),89,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
90 ierr = PetscMemcpy(vdraw->drawaxis,drawaxis,draw_max*sizeof(PetscDrawAxis));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),90,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
91
92 ierr = PetscFree3(tdraw,drawlg,drawaxis)PetscFreeA(3,92,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,&(tdraw),&(drawlg),&(drawaxis))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),92,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
93 }
94
95 if (!vdraw->draw[windownumber]) {
96 char *title = vdraw->title, tmp_str[128];
97 if (windownumber) {
98 ierr = PetscSNPrintf(tmp_str,sizeof(tmp_str),"%s:%d",vdraw->title?vdraw->title:"",windownumber);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),98,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
99 title = tmp_str;
100 }
101 ierr = PetscDrawCreate(PetscObjectComm((PetscObject)viewer),vdraw->display,title,PETSC_DECIDE-1,PETSC_DECIDE-1,vdraw->w,vdraw->h,&vdraw->draw[windownumber]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),101,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
102 ierr = PetscLogObjectParent((PetscObject)viewer,(PetscObject)vdraw->draw[windownumber]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),102,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
103 if (vdraw->drawtype) {
104 ierr = PetscDrawSetType(vdraw->draw[windownumber],vdraw->drawtype);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),104,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
105 }
106 ierr = PetscDrawSetPause(vdraw->draw[windownumber],vdraw->pause);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),106,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
107 ierr = PetscDrawSetOptionsPrefix(vdraw->draw[windownumber],((PetscObject)viewer)->prefix);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),107,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
108 ierr = PetscDrawSetFromOptions(vdraw->draw[windownumber]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),108,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
109 }
110 if (draw) *draw = vdraw->draw[windownumber];
111 if (draw) PetscValidHeaderSpecific(*draw,PETSC_DRAW_CLASSID,-1)do { if (!*draw) return PetscError(((MPI_Comm)0x44000001),111
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",-1); if
(!PetscCheckPointer(*draw,PETSC_OBJECT)) return PetscError((
(MPI_Comm)0x44000001),111,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,-1); if (((PetscObject)(*draw))->classid != PETSC_DRAW_CLASSID
) { if (((PetscObject)(*draw))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),111,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,-1); else return PetscError(((MPI_Comm)0x44000001),111,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,-1); } } while (0)
;
112 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
113}
114
115/*@C
116 PetscViewerDrawBaseAdd - add to the base integer that is added to the windownumber passed to PetscViewerDrawGetDraw()
117
118 Logically Collective on PetscViewer
119
120 Input Parameters:
121+ viewer - the PetscViewer (created with PetscViewerDrawOpen())
122- windownumber - how much to add to the base
123
124 Level: developer
125
126 Concepts: drawing^accessing PetscDraw context from PetscViewer
127 Concepts: graphics
128
129.seealso: PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen(), PetscViewerDrawGetDraw(), PetscViewerDrawBaseSet()
130@*/
131PetscErrorCode PetscViewerDrawBaseAdd(PetscViewer viewer,PetscInt windownumber)
132{
133 PetscViewer_Draw *vdraw;
134 PetscErrorCode ierr;
135 PetscBool isdraw;
136
137 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 137; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
138 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),138
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),138,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),138,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),138,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
139 PetscValidLogicalCollectiveInt(viewer,windownumber,2)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -windownumber
; b1[1] = windownumber; _7_ierr = (PetscAllreduceBarrierCheck
(PetscObjectComm((PetscObject)viewer),2,139,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)viewer))),0) || MPI_Allreduce((b1),(b2),(2),(((
MPI_Datatype)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm
((PetscObject)viewer)))));do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),139,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)viewer),139
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,2); } while (0)
;
140 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),140,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
141 if (!isdraw) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,"Must be draw type PetscViewer")return PetscError(((MPI_Comm)0x44000001),141,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Must be draw type PetscViewer")
;
142 vdraw = (PetscViewer_Draw*)viewer->data;
143
144 if (windownumber + vdraw->draw_base < 0) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Resulting base %D cannot be negative",windownumber+vdraw->draw_base)return PetscError(((MPI_Comm)0x44000001),144,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,63,PETSC_ERROR_INITIAL,"Resulting base %D cannot be negative"
,windownumber+vdraw->draw_base)
;
145 vdraw->draw_base += windownumber;
146 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
147}
148
149/*@C
150 PetscViewerDrawBaseSet - sets the base integer that is added to the windownumber passed to PetscViewerDrawGetDraw()
151
152 Logically Collective on PetscViewer
153
154 Input Parameters:
155+ viewer - the PetscViewer (created with PetscViewerDrawOpen())
156- windownumber - value to set the base
157
158 Level: developer
159
160 Concepts: drawing^accessing PetscDraw context from PetscViewer
161 Concepts: graphics
162
163.seealso: PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen(), PetscViewerDrawGetDraw(), PetscViewerDrawBaseAdd()
164@*/
165PetscErrorCode PetscViewerDrawBaseSet(PetscViewer viewer,PetscInt windownumber)
166{
167 PetscViewer_Draw *vdraw;
168 PetscErrorCode ierr;
169 PetscBool isdraw;
170
171 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 171; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
172 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),172
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),172,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),172,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),172,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
173 PetscValidLogicalCollectiveInt(viewer,windownumber,2)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -windownumber
; b1[1] = windownumber; _7_ierr = (PetscAllreduceBarrierCheck
(PetscObjectComm((PetscObject)viewer),2,173,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)viewer))),0) || MPI_Allreduce((b1),(b2),(2),(((
MPI_Datatype)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm
((PetscObject)viewer)))));do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),173,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)viewer),173
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,2); } while (0)
;
174 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),174,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
175 if (!isdraw) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,"Must be draw type PetscViewer")return PetscError(((MPI_Comm)0x44000001),175,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Must be draw type PetscViewer")
;
176 vdraw = (PetscViewer_Draw*)viewer->data;
177
178 if (windownumber < 0) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Resulting base %D cannot be negative",windownumber)return PetscError(((MPI_Comm)0x44000001),178,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,63,PETSC_ERROR_INITIAL,"Resulting base %D cannot be negative"
,windownumber)
;
179 vdraw->draw_base = windownumber;
180 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
181}
182
183/*@C
184 PetscViewerDrawGetDrawLG - Returns PetscDrawLG object from PetscViewer object.
185 This PetscDrawLG object may then be used to perform graphics using
186 PetscDrawLGXXX() commands.
187
188 Collective on PetscViewer
189
190 Input Parameter:
191+ PetscViewer - the PetscViewer (created with PetscViewerDrawOpen())
192- windownumber - indicates which subwindow (usually 0)
193
194 Ouput Parameter:
195. draw - the draw line graph object
196
197 Level: intermediate
198
199 Concepts: line graph^accessing context
200
201.seealso: PetscViewerDrawGetDraw(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen()
202@*/
203PetscErrorCode PetscViewerDrawGetDrawLG(PetscViewer viewer,PetscInt windownumber,PetscDrawLG *drawlg)
204{
205 PetscErrorCode ierr;
206 PetscBool isdraw;
207 PetscViewer_Draw *vdraw;
208
209 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 209; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
210 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),210
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),210,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),210,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),210,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
211 PetscValidLogicalCollectiveInt(viewer,windownumber,2)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -windownumber
; b1[1] = windownumber; _7_ierr = (PetscAllreduceBarrierCheck
(PetscObjectComm((PetscObject)viewer),2,211,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)viewer))),0) || MPI_Allreduce((b1),(b2),(2),(((
MPI_Datatype)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm
((PetscObject)viewer)))));do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),211,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)viewer),211
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,2); } while (0)
;
212 PetscValidPointer(drawlg,3)do { if (!drawlg) return PetscError(((MPI_Comm)0x44000001),212
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if
(!PetscCheckPointer(drawlg,PETSC_CHAR)) return PetscError(((
MPI_Comm)0x44000001),212,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
213 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),213,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
214 if (!isdraw) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,"Must be draw type PetscViewer")return PetscError(((MPI_Comm)0x44000001),214,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Must be draw type PetscViewer")
;
215 if (windownumber < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Window number cannot be negative")return PetscError(((MPI_Comm)0x44000001),215,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,63,PETSC_ERROR_INITIAL,"Window number cannot be negative")
;
216 vdraw = (PetscViewer_Draw*)viewer->data;
217
218 if (windownumber+vdraw->draw_base >= vdraw->draw_max || !vdraw->draw[windownumber+vdraw->draw_base]) {
219 ierr = PetscViewerDrawGetDraw(viewer,windownumber,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),219,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
220 }
221 if (!vdraw->drawlg[windownumber+vdraw->draw_base]) {
222 ierr = PetscDrawLGCreate(vdraw->draw[windownumber+vdraw->draw_base],1,&vdraw->drawlg[windownumber+vdraw->draw_base]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),222,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
223 ierr = PetscLogObjectParent((PetscObject)viewer,(PetscObject)vdraw->drawlg[windownumber+vdraw->draw_base]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),223,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
224 ierr = PetscDrawLGSetFromOptions(vdraw->drawlg[windownumber+vdraw->draw_base]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),224,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
225 }
226 *drawlg = vdraw->drawlg[windownumber+vdraw->draw_base];
227 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
228}
229
230/*@C
231 PetscViewerDrawGetDrawAxis - Returns PetscDrawAxis object from PetscViewer object.
232 This PetscDrawAxis object may then be used to perform graphics using
233 PetscDrawAxisXXX() commands.
234
235 Collective on PetscViewer
236
237 Input Parameter:
238+ viewer - the PetscViewer (created with PetscViewerDrawOpen()
239- windownumber - indicates which subwindow (usually 0)
240
241 Ouput Parameter:
242. drawaxis - the draw axis object
243
244 Level: advanced
245
246 Concepts: line graph^accessing context
247
248.seealso: PetscViewerDrawGetDraw(), PetscViewerDrawGetLG(), PetscViewerDrawOpen()
249@*/
250PetscErrorCode PetscViewerDrawGetDrawAxis(PetscViewer viewer,PetscInt windownumber,PetscDrawAxis *drawaxis)
251{
252 PetscErrorCode ierr;
253 PetscBool isdraw;
254 PetscViewer_Draw *vdraw;
255
256 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 256; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
257 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),257
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),257,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),257,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),257,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
258 PetscValidLogicalCollectiveInt(viewer,windownumber,2)do { PetscErrorCode _7_ierr; PetscInt b1[2],b2[2]; b1[0] = -windownumber
; b1[1] = windownumber; _7_ierr = (PetscAllreduceBarrierCheck
(PetscObjectComm((PetscObject)viewer),2,258,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((petsc_allreduce_ct += PetscMPIParallelComm((PetscObjectComm
((PetscObject)viewer))),0) || MPI_Allreduce((b1),(b2),(2),(((
MPI_Datatype)0x4c000405)),((MPI_Op)(0x58000001)),(PetscObjectComm
((PetscObject)viewer)))));do {if (__builtin_expect(!!(_7_ierr
),0)) return PetscError(((MPI_Comm)0x44000001),258,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,_7_ierr,PETSC_ERROR_REPEAT," ");} while (0); if (-b2[0] != b2
[1]) return PetscError(PetscObjectComm((PetscObject)viewer),258
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Int value must be same on all processes, argument # %d"
,2); } while (0)
;
259 PetscValidPointer(drawaxis,3)do { if (!drawaxis) return PetscError(((MPI_Comm)0x44000001),
259,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Pointer: Parameter # %d",3); if
(!PetscCheckPointer(drawaxis,PETSC_CHAR)) return PetscError(
((MPI_Comm)0x44000001),259,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,68,PETSC_ERROR_INITIAL,"Invalid Pointer: Parameter # %d",3);
} while (0)
;
260 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),260,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
261 if (!isdraw) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,"Must be draw type PetscViewer")return PetscError(((MPI_Comm)0x44000001),261,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Must be draw type PetscViewer")
;
262 if (windownumber < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Window number cannot be negative")return PetscError(((MPI_Comm)0x44000001),262,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,63,PETSC_ERROR_INITIAL,"Window number cannot be negative")
;
263 vdraw = (PetscViewer_Draw*)viewer->data;
264
265 if (windownumber+vdraw->draw_base >= vdraw->draw_max || !vdraw->draw[windownumber+vdraw->draw_base]) {
266 ierr = PetscViewerDrawGetDraw(viewer,windownumber,NULL((void*)0));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),266,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
267 }
268 if (!vdraw->drawaxis[windownumber+vdraw->draw_base]) {
269 ierr = PetscDrawAxisCreate(vdraw->draw[windownumber+vdraw->draw_base],&vdraw->drawaxis[windownumber+vdraw->draw_base]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),269,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
270 ierr = PetscLogObjectParent((PetscObject)viewer,(PetscObject)vdraw->drawaxis[windownumber+vdraw->draw_base]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),270,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
271 }
272 *drawaxis = vdraw->drawaxis[windownumber+vdraw->draw_base];
273 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
274}
275
276PetscErrorCode PetscViewerDrawResize(PetscViewer v,int w,int h)
277{
278 PetscErrorCode ierr;
279 PetscViewer_Draw *vdraw;
280 PetscBool isdraw;
281
282 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 282; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
283 PetscValidHeaderSpecific(v,PETSC_VIEWER_CLASSID,1)do { if (!v) return PetscError(((MPI_Comm)0x44000001),283,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(v,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),283,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(v))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(v))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),283,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),283,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
284 ierr = PetscObjectTypeCompare((PetscObject)v,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),284,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
285 if (!isdraw) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
286 vdraw = (PetscViewer_Draw*)v->data;
287
288 if (w >= 1) vdraw->w = w;
289 if (h >= 1) vdraw->h = h;
290 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
291}
292
293PetscErrorCode PetscViewerDrawSetInfo(PetscViewer v,const char display[],const char title[],int x,int y,int w,int h)
294{
295 PetscErrorCode ierr;
296 PetscViewer_Draw *vdraw;
297 PetscBool isdraw;
298
299 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 299; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
300 PetscValidHeaderSpecific(v,PETSC_VIEWER_CLASSID,1)do { if (!v) return PetscError(((MPI_Comm)0x44000001),300,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(v,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),300,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(v))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(v))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),300,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),300,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
301 ierr = PetscObjectTypeCompare((PetscObject)v,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),301,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
302 if (!isdraw) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
303 vdraw = (PetscViewer_Draw*)v->data;
304
305 ierr = PetscStrallocpy(display,&vdraw->display);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),305,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
306 ierr = PetscStrallocpy(title,&vdraw->title);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),306,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
307 if (w >= 1) vdraw->w = w;
308 if (h >= 1) vdraw->h = h;
309 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
310}
311
312PetscErrorCode PetscViewerDrawSetDrawType(PetscViewer v,PetscDrawType drawtype)
313{
314 PetscErrorCode ierr;
315 PetscViewer_Draw *vdraw;
316 PetscBool isdraw;
317
318 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 318; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
319 PetscValidHeaderSpecific(v,PETSC_VIEWER_CLASSID,1)do { if (!v) return PetscError(((MPI_Comm)0x44000001),319,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(v,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),319,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(v))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(v))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),319,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),319,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
320 ierr = PetscObjectTypeCompare((PetscObject)v,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),320,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
321 if (!isdraw) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
322 vdraw = (PetscViewer_Draw*)v->data;
323
324 ierr = PetscFree(vdraw->drawtype)((*PetscTrFree)((void*)(vdraw->drawtype),324,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((vdraw->drawtype) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),324,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
325 ierr = PetscStrallocpy(drawtype,(char**)&vdraw->drawtype);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),325,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
326 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
327}
328
329PetscErrorCode PetscViewerDrawGetDrawType(PetscViewer v,PetscDrawType *drawtype)
330{
331 PetscErrorCode ierr;
332 PetscViewer_Draw *vdraw;
333 PetscBool isdraw;
334
335 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 335; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
336 PetscValidHeaderSpecific(v,PETSC_VIEWER_CLASSID,1)do { if (!v) return PetscError(((MPI_Comm)0x44000001),336,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(v,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),336,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(v))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(v))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),336,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),336,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
337 ierr = PetscObjectTypeCompare((PetscObject)v,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),337,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
338 if (!isdraw) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,"Must be draw type PetscViewer")return PetscError(((MPI_Comm)0x44000001),338,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Must be draw type PetscViewer")
;
339 vdraw = (PetscViewer_Draw*)v->data;
340
341 *drawtype = vdraw->drawtype;
342 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
343}
344
345PetscErrorCode PetscViewerDrawSetTitle(PetscViewer v,const char title[])
346{
347 PetscErrorCode ierr;
348 PetscViewer_Draw *vdraw;
349 PetscBool isdraw;
350
351 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 351; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
352 PetscValidHeaderSpecific(v,PETSC_VIEWER_CLASSID,1)do { if (!v) return PetscError(((MPI_Comm)0x44000001),352,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(v,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),352,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(v))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(v))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),352,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),352,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
353 ierr = PetscObjectTypeCompare((PetscObject)v,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),353,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
354 if (!isdraw) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
355 vdraw = (PetscViewer_Draw*)v->data;
356
357 ierr = PetscFree(vdraw->title)((*PetscTrFree)((void*)(vdraw->title),357,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((vdraw->title) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),357,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
358 ierr = PetscStrallocpy(title,&vdraw->title);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),358,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
359 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
360}
361
362PetscErrorCode PetscViewerDrawGetTitle(PetscViewer v,const char *title[])
363{
364 PetscErrorCode ierr;
365 PetscViewer_Draw *vdraw;
366 PetscBool isdraw;
367
368 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 368; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
369 PetscValidHeaderSpecific(v,PETSC_VIEWER_CLASSID,1)do { if (!v) return PetscError(((MPI_Comm)0x44000001),369,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(v,PETSC_OBJECT)) return PetscError(((MPI_Comm
)0x44000001),369,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(v))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(v))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),369,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),369,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
370 ierr = PetscObjectTypeCompare((PetscObject)v,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),370,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
371 if (!isdraw) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,"Must be draw type PetscViewer")return PetscError(((MPI_Comm)0x44000001),371,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Must be draw type PetscViewer")
;
372 vdraw = (PetscViewer_Draw*)v->data;
373
374 *title = vdraw->title;
375 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
376}
377
378/*@C
379 PetscViewerDrawOpen - Opens a window for use as a PetscViewer. If you want to
380 do graphics in this window, you must call PetscViewerDrawGetDraw() and
381 perform the graphics on the PetscDraw object.
382
383 Collective on MPI_Comm
384
385 Input Parameters:
386+ comm - communicator that will share window
387. display - the X display on which to open, or null for the local machine
388. title - the title to put in the title bar, or null for no title
389. x, y - the screen coordinates of the upper left corner of window, or use PETSC_DECIDE
390- w, h - window width and height in pixels, or may use PETSC_DECIDE or PETSC_DRAW_FULL_SIZE, PETSC_DRAW_HALF_SIZE,
391 PETSC_DRAW_THIRD_SIZE, PETSC_DRAW_QUARTER_SIZE
392
393 Output Parameters:
394. viewer - the PetscViewer
395
396 Format Options:
397+ PETSC_VIEWER_DRAW_BASIC - displays with basic format
398- PETSC_VIEWER_DRAW_LG - displays using a line graph
399
400 Options Database Keys:
401 PetscViewerDrawOpen() calls PetscDrawCreate(), so see the manual page for
402 PetscDrawCreate() for runtime options, including
403+ -draw_type x or null
404. -nox - Disables all x-windows output
405. -display <name> - Specifies name of machine for the X display
406. -geometry <x,y,w,h> - allows setting the window location and size
407- -draw_pause <pause> - Sets time (in seconds) that the
408 program pauses after PetscDrawPause() has been called
409 (0 is default, -1 implies until user input).
410
411 Level: beginner
412
413 Note for Fortran Programmers:
414 Whenever indicating null character data in a Fortran code,
415 PETSC_NULL_CHARACTER must be employed; using NULL is not
416 correct for character data! Thus, PETSC_NULL_CHARACTER can be
417 used for the display and title input parameters.
418
419 Concepts: graphics^opening PetscViewer
420 Concepts: drawing^opening PetscViewer
421
422
423.seealso: PetscDrawCreate(), PetscViewerDestroy(), PetscViewerDrawGetDraw(), PetscViewerCreate(), PETSC_VIEWER_DRAW_,
424 PETSC_VIEWER_DRAW_WORLD, PETSC_VIEWER_DRAW_SELF
425@*/
426PetscErrorCode PetscViewerDrawOpen(MPI_Comm comm,const char display[],const char title[],int x,int y,int w,int h,PetscViewer *viewer)
427{
428 PetscErrorCode ierr;
429
430 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 430; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
431 ierr = PetscViewerCreate(comm,viewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),431,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
432 ierr = PetscViewerSetType(*viewer,PETSCVIEWERDRAW"draw");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),432,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
433 ierr = PetscViewerDrawSetInfo(*viewer,display,title,x,y,w,h);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),433,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
434 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
435}
436
437PetscErrorCode PetscViewerGetSubViewer_Draw(PetscViewer viewer,MPI_Comm comm,PetscViewer *sviewer)
438{
439 PetscErrorCode ierr;
440 PetscMPIInt rank;
441 PetscInt i;
442 PetscViewer_Draw *vdraw = (PetscViewer_Draw*)viewer->data,*svdraw;
443
444 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 444; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
445 if (vdraw->singleton_made) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ORDER,"Trying to get SubViewer without first restoring previous")return PetscError(((MPI_Comm)0x44000001),445,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,58,PETSC_ERROR_INITIAL,"Trying to get SubViewer without first restoring previous"
)
;
1
Assuming the condition is false
2
Taking false branch
446 /* only processor zero can use the PetscViewer draw singleton */
447 if (sviewer) *sviewer = NULL((void*)0);
3
Assuming 'sviewer' is null
4
Taking false branch
448 ierr = MPI_Comm_rank(PetscObjectComm((PetscObject)viewer),&rank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),448,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
449 if (!rank) {
5
Assuming 'rank' is 0
6
Taking true branch
450 ierr = PetscViewerCreate(PETSC_COMM_SELF((MPI_Comm)0x44000001),sviewer);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),450,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
451 ierr = PetscViewerSetType(*sviewer,PETSCVIEWERDRAW"draw");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),451,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
7
Dereference of null pointer (loaded from variable 'sviewer')
452 svdraw = (PetscViewer_Draw*)(*sviewer)->data;
453 (*sviewer)->format = viewer->format;
454 for (i=0; i<vdraw->draw_max; i++) { /* XXX this is wrong if svdraw->draw_max (initially 5) < vdraw->draw_max */
455 if (vdraw->draw[i]) {ierr = PetscDrawGetSingleton(vdraw->draw[i],&svdraw->draw[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),455,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
456 }
457 }
458 vdraw->singleton_made = PETSC_TRUE;
459 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
460}
461
462PetscErrorCode PetscViewerRestoreSubViewer_Draw(PetscViewer viewer,MPI_Comm comm,PetscViewer *sviewer)
463{
464 PetscErrorCode ierr;
465 PetscMPIInt rank;
466 PetscInt i;
467 PetscViewer_Draw *vdraw = (PetscViewer_Draw*)viewer->data,*svdraw;
468
469 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 469; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
470 if (!vdraw->singleton_made) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ORDER,"Trying to restore a singleton that was not gotten")return PetscError(((MPI_Comm)0x44000001),470,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,58,PETSC_ERROR_INITIAL,"Trying to restore a singleton that was not gotten"
)
;
471 ierr = MPI_Comm_rank(PetscObjectComm((PetscObject)viewer),&rank);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),471,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
472 if (!rank) {
473 svdraw = (PetscViewer_Draw*)(*sviewer)->data;
474 for (i=0; i<vdraw->draw_max; i++) {
475 if (vdraw->draw[i] && svdraw->draw[i]) {
476 ierr = PetscDrawRestoreSingleton(vdraw->draw[i],&svdraw->draw[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),476,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
477 }
478 }
479 ierr = PetscFree3(svdraw->draw,svdraw->drawlg,svdraw->drawaxis)PetscFreeA(3,479,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,&(svdraw->draw),&(svdraw->drawlg),&(svdraw
->drawaxis))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),479,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
480 ierr = PetscFree((*sviewer)->data)((*PetscTrFree)((void*)((*sviewer)->data),480,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || (((*sviewer)->data) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),480,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
481 ierr = PetscHeaderDestroy(sviewer)(PetscHeaderDestroy_Private((PetscObject)(*sviewer)) || ((*PetscTrFree
)((void*)(*sviewer),481,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((*sviewer) = 0,0)))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),481,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
482 }
483 vdraw->singleton_made = PETSC_FALSE;
484 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
485}
486
487PetscErrorCode PetscViewerSetFromOptions_Draw(PetscOptionItems *PetscOptionsObject,PetscViewer v)
488{
489 PetscErrorCode ierr;
490 PetscReal bounds[16];
491 PetscInt nbounds = 16;
492 PetscBool flg;
493
494 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 494; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
495 ierr = PetscOptionsHead(PetscOptionsObject,"Draw PetscViewer Options");CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),495,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
496 ierr = PetscOptionsRealArray("-draw_bounds","Bounds to put on plots axis","PetscViewerDrawSetBounds",bounds,&nbounds,&flg)PetscOptionsRealArray_Private(PetscOptionsObject,"-draw_bounds"
,"Bounds to put on plots axis","PetscViewerDrawSetBounds",bounds
,&nbounds,&flg)
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),496,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
497 if (flg) {
498 ierr = PetscViewerDrawSetBounds(v,nbounds/2,bounds);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),498,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
499 }
500 ierr = PetscOptionsTail()0; {if (PetscOptionsObject->count != 1) do { do { ; if (petscstack
&& petscstack->currentsize > 0) { petscstack->
currentsize--; petscstack->function[petscstack->currentsize
] = 0; petscstack->file[petscstack->currentsize] = 0; petscstack
->line[petscstack->currentsize] = 0; petscstack->petscroutine
[petscstack->currentsize] = PETSC_FALSE; } if (petscstack)
{ petscstack->hotdepth = (((petscstack->hotdepth-1)<
(0)) ? (0) : (petscstack->hotdepth-1)); } ; } while (0); return
(0);} while (0);}
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),500,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
501 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
502}
503
504PetscErrorCode PetscViewerView_Draw(PetscViewer viewer,PetscViewer v)
505{
506 PetscErrorCode ierr;
507 PetscDraw draw;
508 PetscInt i;
509 PetscViewer_Draw *vdraw = (PetscViewer_Draw*)viewer->data;
510
511 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 511; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
512 /* If the PetscViewer has just been created then no vdraw->draw yet
513 exists so this will not actually call the viewer on any draws. */
514 for (i=0; i<vdraw->draw_base; i++) {
515 if (vdraw->draw[i]) {
516 ierr = PetscViewerDrawGetDraw(viewer,i,&draw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),516,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
517 ierr = PetscDrawView(draw,v);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),517,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
518 }
519 }
520 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
521}
522
523/*MC
524 PETSCVIEWERDRAW - A viewer that generates graphics, either to the screen or a file
525
526
527.seealso: PetscViewerDrawOpen(), PetscViewerDrawGetDraw(), PETSC_VIEWER_DRAW_(),PETSC_VIEWER_DRAW_SELF, PETSC_VIEWER_DRAW_WORLD,
528 PetscViewerCreate(), PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), PETSCVIEWERBINARY,
529 PetscViewerMatlabOpen(), VecView(), DMView(), PetscViewerMatlabPutArray(), PETSCVIEWERASCII, PETSCVIEWERMATLAB,
530 PetscViewerFileSetName(), PetscViewerFileSetMode(), PetscViewerFormat, PetscViewerType, PetscViewerSetType()
531
532 Level: beginner
533
534M*/
535PETSC_EXTERNextern __attribute__((visibility ("default"))) PetscErrorCode PetscViewerCreate_Draw(PetscViewer viewer)
536{
537 PetscErrorCode ierr;
538 PetscViewer_Draw *vdraw;
539
540 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 540; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
541 ierr = PetscNewLog(viewer,&vdraw)(PetscMallocA(1,PETSC_TRUE,541,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,(size_t)(1)*sizeof(**(((&vdraw)))),(((&vdraw)))) || PetscLogObjectMemory
((PetscObject)viewer,sizeof(**(&vdraw))))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),541,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
542 viewer->data = (void*)vdraw;
543
544 viewer->ops->flush = PetscViewerFlush_Draw;
545 viewer->ops->view = PetscViewerView_Draw;
546 viewer->ops->destroy = PetscViewerDestroy_Draw;
547 viewer->ops->setfromoptions = PetscViewerSetFromOptions_Draw;
548 viewer->ops->getsubviewer = PetscViewerGetSubViewer_Draw;
549 viewer->ops->restoresubviewer = PetscViewerRestoreSubViewer_Draw;
550
551 /* these are created on the fly if requested */
552 vdraw->draw_max = 5;
553 vdraw->draw_base = 0;
554 vdraw->w = PETSC_DECIDE-1;
555 vdraw->h = PETSC_DECIDE-1;
556
557 ierr = PetscCalloc3(vdraw->draw_max,&vdraw->draw,vdraw->draw_max,&vdraw->drawlg,vdraw->draw_max,&vdraw->drawaxis)PetscMallocA(3,PETSC_TRUE,557,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,(size_t)(vdraw->draw_max)*sizeof(**(&vdraw->draw))
,(&vdraw->draw),(size_t)(vdraw->draw_max)*sizeof(**
(&vdraw->drawlg)),(&vdraw->drawlg),(size_t)(vdraw
->draw_max)*sizeof(**(&vdraw->drawaxis)),(&vdraw
->drawaxis))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),557,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
558 vdraw->singleton_made = PETSC_FALSE;
559 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
560}
561
562/*@
563 PetscViewerDrawClear - Clears a PetscDraw graphic associated with a PetscViewer.
564
565 Not Collective
566
567 Input Parameter:
568. viewer - the PetscViewer
569
570 Level: intermediate
571
572.seealso: PetscViewerDrawOpen(), PetscViewerDrawGetDraw(),
573
574@*/
575PetscErrorCode PetscViewerDrawClear(PetscViewer viewer)
576{
577 PetscErrorCode ierr;
578 PetscViewer_Draw *vdraw;
579 PetscBool isdraw;
580 PetscInt i;
581
582 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 582; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
583 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),583
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),583,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),583,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),583,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
584 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),584,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
585 if (!isdraw) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
586 vdraw = (PetscViewer_Draw*)viewer->data;
587
588 for (i=0; i<vdraw->draw_max; i++) {
589 if (vdraw->draw[i]) {ierr = PetscDrawClear(vdraw->draw[i]);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),589,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
590 }
591 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
592}
593
594/*@
595 PetscViewerDrawGetPause - Gets a pause for the first present draw
596
597 Not Collective
598
599 Input Parameter:
600. viewer - the PetscViewer
601
602 Output Parameter:
603. pause - the pause value
604
605 Level: intermediate
606
607.seealso: PetscViewerDrawOpen(), PetscViewerDrawGetDraw(),
608
609@*/
610PetscErrorCode PetscViewerDrawGetPause(PetscViewer viewer,PetscReal *pause)
611{
612 PetscErrorCode ierr;
613 PetscViewer_Draw *vdraw;
614 PetscBool isdraw;
615 PetscInt i;
616 PetscDraw draw;
617
618 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 618; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
619 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),619
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),619,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),619,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),619,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
620 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),620,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
621 if (!isdraw) {*pause = 0.0; PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
622 vdraw = (PetscViewer_Draw*)viewer->data;
623
624 for (i=0; i<vdraw->draw_max; i++) {
625 if (vdraw->draw[i]) {
626 ierr = PetscDrawGetPause(vdraw->draw[i],pause);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),626,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
627 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
628 }
629 }
630 /* none exist yet so create one and get its pause */
631 ierr = PetscViewerDrawGetDraw(viewer,0,&draw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),631,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
632 ierr = PetscDrawGetPause(draw,pause);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),632,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
633 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
634}
635
636/*@
637 PetscViewerDrawSetPause - Sets a pause for each PetscDraw in the viewer
638
639 Not Collective
640
641 Input Parameters:
642+ viewer - the PetscViewer
643- pause - the pause value
644
645 Level: intermediate
646
647.seealso: PetscViewerDrawOpen(), PetscViewerDrawGetDraw(),
648
649@*/
650PetscErrorCode PetscViewerDrawSetPause(PetscViewer viewer,PetscReal pause)
651{
652 PetscErrorCode ierr;
653 PetscViewer_Draw *vdraw;
654 PetscBool isdraw;
655 PetscInt i;
656
657 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 657; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
658 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),658
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),658,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),658,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),658,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
659 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),659,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
660 if (!isdraw) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
661 vdraw = (PetscViewer_Draw*)viewer->data;
662
663 vdraw->pause = pause;
664 for (i=0; i<vdraw->draw_max; i++) {
665 if (vdraw->draw[i]) {ierr = PetscDrawSetPause(vdraw->draw[i],pause);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),665,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;}
666 }
667 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
668}
669
670
671/*@
672 PetscViewerDrawSetHold - Holds previous image when drawing new image
673
674 Not Collective
675
676 Input Parameters:
677+ viewer - the PetscViewer
678- hold - indicates to hold or not
679
680 Level: intermediate
681
682.seealso: PetscViewerDrawOpen(), PetscViewerDrawGetDraw(),
683
684@*/
685PetscErrorCode PetscViewerDrawSetHold(PetscViewer viewer,PetscBool hold)
686{
687 PetscErrorCode ierr;
688 PetscViewer_Draw *vdraw;
689 PetscBool isdraw;
690
691 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 691; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
692 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),692
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),692,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),692,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),692,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
693 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),693,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
694 if (!isdraw) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
695 vdraw = (PetscViewer_Draw*)viewer->data;
696
697 vdraw->hold = hold;
698 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
699}
700
701/*@
702 PetscViewerDrawGetHold - Checks if holds previous image when drawing new image
703
704 Not Collective
705
706 Input Parameter:
707. viewer - the PetscViewer
708
709 Output Parameter:
710. hold - indicates to hold or not
711
712 Level: intermediate
713
714.seealso: PetscViewerDrawOpen(), PetscViewerDrawGetDraw(),
715
716@*/
717PetscErrorCode PetscViewerDrawGetHold(PetscViewer viewer,PetscBool *hold)
718{
719 PetscErrorCode ierr;
720 PetscViewer_Draw *vdraw;
721 PetscBool isdraw;
722
723 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 723; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
724 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),724
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),724,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),724,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),724,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
725 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),725,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
726 if (!isdraw) {*hold = PETSC_FALSE; PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
727 vdraw = (PetscViewer_Draw*)viewer->data;
728
729 *hold = vdraw->hold;
730 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
731}
732
733/* ---------------------------------------------------------------------*/
734/*
735 The variable Petsc_Viewer_Draw_keyval is used to indicate an MPI attribute that
736 is attached to a communicator, in this case the attribute is a PetscViewer.
737*/
738PetscMPIInt Petsc_Viewer_Draw_keyval = MPI_KEYVAL_INVALID0x24000000;
739
740/*@C
741 PETSC_VIEWER_DRAW_ - Creates a window PetscViewer shared by all processors
742 in a communicator.
743
744 Collective on MPI_Comm
745
746 Input Parameter:
747. comm - the MPI communicator to share the window PetscViewer
748
749 Level: intermediate
750
751 Notes:
752 Unlike almost all other PETSc routines, PETSC_VIEWER_DRAW_ does not return
753 an error code. The window is usually used in the form
754$ XXXView(XXX object,PETSC_VIEWER_DRAW_(comm));
755
756.seealso: PETSC_VIEWER_DRAW_WORLD, PETSC_VIEWER_DRAW_SELF, PetscViewerDrawOpen(),
757@*/
758PetscViewer PETSC_VIEWER_DRAW_(MPI_Comm comm)
759{
760 PetscErrorCode ierr;
761 PetscMPIInt flag;
762 PetscViewer viewer;
763 MPI_Comm ncomm;
764
765 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 765; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
766 ierr = PetscCommDuplicate(comm,&ncomm,NULL((void*)0));if (ierr) {PetscError(PETSC_COMM_SELF((MPI_Comm)0x44000001),__LINE__766,"PETSC_VIEWER_DRAW_",__FILE__"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c",PETSC_ERR_PLIB77,PETSC_ERROR_INITIAL," ");PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
767 if (Petsc_Viewer_Draw_keyval == MPI_KEYVAL_INVALID0x24000000) {
768 ierr = MPI_Comm_create_keyval(MPI_COMM_NULL_COPY_FN((MPI_Comm_copy_attr_function*)0),MPI_COMM_NULL_DELETE_FN((MPI_Comm_delete_attr_function*)0),&Petsc_Viewer_Draw_keyval,0);
769 if (ierr) {PetscError(PETSC_COMM_SELF((MPI_Comm)0x44000001),__LINE__769,"PETSC_VIEWER_DRAW_",__FILE__"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c",PETSC_ERR_PLIB77,PETSC_ERROR_INITIAL," ");PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
770 }
771 ierr = MPI_Comm_get_attr(ncomm,Petsc_Viewer_Draw_keyval,(void**)&viewer,&flag);
772 if (ierr) {PetscError(PETSC_COMM_SELF((MPI_Comm)0x44000001),__LINE__772,"PETSC_VIEWER_DRAW_",__FILE__"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c",PETSC_ERR_PLIB77,PETSC_ERROR_INITIAL," ");PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
773 if (!flag) { /* PetscViewer not yet created */
774 ierr = PetscViewerDrawOpen(ncomm,0,0,PETSC_DECIDE-1,PETSC_DECIDE-1,300,300,&viewer);
775 if (ierr) {PetscError(PETSC_COMM_SELF((MPI_Comm)0x44000001),__LINE__775,"PETSC_VIEWER_DRAW_",__FILE__"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c",PETSC_ERR_PLIB77,PETSC_ERROR_INITIAL," ");PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
776 ierr = PetscObjectRegisterDestroy((PetscObject)viewer);
777 if (ierr) {PetscError(PETSC_COMM_SELF((MPI_Comm)0x44000001),__LINE__777,"PETSC_VIEWER_DRAW_",__FILE__"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c",PETSC_ERR_PLIB77,PETSC_ERROR_INITIAL," ");PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
778 ierr = MPI_Comm_set_attr(ncomm,Petsc_Viewer_Draw_keyval,(void*)viewer);
779 if (ierr) {PetscError(PETSC_COMM_SELF((MPI_Comm)0x44000001),__LINE__779,"PETSC_VIEWER_DRAW_",__FILE__"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c",PETSC_ERR_PLIB77,PETSC_ERROR_INITIAL," ");PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
780 }
781 ierr = PetscCommDestroy(&ncomm);
782 if (ierr) {PetscError(PETSC_COMM_SELF((MPI_Comm)0x44000001),__LINE__782,"PETSC_VIEWER_DRAW_",__FILE__"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c",PETSC_ERR_PLIB77,PETSC_ERROR_INITIAL," ");PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
783 PetscFunctionReturn(viewer)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(viewer);} while (0)
;
784}
785
786/*@
787 PetscViewerDrawSetBounds - sets the upper and lower bounds to be used in plotting
788
789 Collective on PetscViewer
790
791 Input Parameters:
792+ viewer - the PetscViewer (created with PetscViewerDrawOpen())
793. nbounds - number of plots that can be made with this viewer, for example the dof passed to DMDACreate()
794- bounds - the actual bounds, the size of this is 2*nbounds, the values are stored in the order min F_0, max F_0, min F_1, max F_1, .....
795
796
797 Options Database:
798. -draw_bounds minF0,maxF0,minF1,maxF1
799
800 Level: intermediate
801
802 Notes:
803 this determines the colors used in 2d contour plots generated with VecView() for DMDA in 2d. Any values in the vector below or above the
804 bounds are moved to the bound value before plotting. In this way the color index from color to physical value remains the same for all plots generated with
805 this viewer. Otherwise the color to physical value meaning changes with each new image if this is not set.
806
807 Concepts: drawing^accessing PetscDraw context from PetscViewer
808 Concepts: graphics
809
810.seealso: PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen()
811@*/
812PetscErrorCode PetscViewerDrawSetBounds(PetscViewer viewer,PetscInt nbounds,const PetscReal *bounds)
813{
814 PetscViewer_Draw *vdraw;
815 PetscBool isdraw;
816 PetscErrorCode ierr;
817
818
819 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 819; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
820 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),820
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),820,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),820,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),820,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
821 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),821,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
822 if (!isdraw) PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
823 vdraw = (PetscViewer_Draw*)viewer->data;
824
825 vdraw->nbounds = nbounds;
826 ierr = PetscFree(vdraw->bounds)((*PetscTrFree)((void*)(vdraw->bounds),826,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
) || ((vdraw->bounds) = 0,0))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),826,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
827 ierr = PetscMalloc1(2*nbounds,&vdraw->bounds)PetscMallocA(1,PETSC_FALSE,827,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,(size_t)(2*nbounds)*sizeof(**(&vdraw->bounds)),(&
vdraw->bounds))
;CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),827,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
828 ierr = PetscMemcpy(vdraw->bounds,bounds,2*nbounds*sizeof(PetscReal));CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),828,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
829 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
830}
831
832/*@C
833 PetscViewerDrawGetBounds - gets the upper and lower bounds to be used in plotting set with PetscViewerDrawSetBounds()
834
835 Collective on PetscViewer
836
837 Input Parameter:
838. viewer - the PetscViewer (created with PetscViewerDrawOpen())
839
840 Output Paramters:
841+ nbounds - number of plots that can be made with this viewer, for example the dof passed to DMDACreate()
842- bounds - the actual bounds, the size of this is 2*nbounds, the values are stored in the order min F_0, max F_0, min F_1, max F_1, .....
843
844 Level: intermediate
845
846 Concepts: drawing^accessing PetscDraw context from PetscViewer
847 Concepts: graphics
848
849.seealso: PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen(), PetscViewerDrawSetBounds()
850@*/
851PetscErrorCode PetscViewerDrawGetBounds(PetscViewer viewer,PetscInt *nbounds,const PetscReal **bounds)
852{
853 PetscViewer_Draw *vdraw;
854 PetscBool isdraw;
855 PetscErrorCode ierr;
856
857 PetscFunctionBegindo { do { ; if (petscstack && (petscstack->currentsize
< 64)) { petscstack->function[petscstack->currentsize
] = __func__; petscstack->file[petscstack->currentsize]
= "/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
; petscstack->line[petscstack->currentsize] = 857; petscstack
->petscroutine[petscstack->currentsize] = PETSC_TRUE; petscstack
->currentsize++; } if (petscstack) { petscstack->hotdepth
+= (PETSC_FALSE || petscstack->hotdepth); } ; } while (0)
; ; } while (0)
;
858 PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,1)do { if (!viewer) return PetscError(((MPI_Comm)0x44000001),858
,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,85,PETSC_ERROR_INITIAL,"Null Object: Parameter # %d",1); if (
!PetscCheckPointer(viewer,PETSC_OBJECT)) return PetscError(((
MPI_Comm)0x44000001),858,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Invalid Pointer to Object: Parameter # %d"
,1); if (((PetscObject)(viewer))->classid != PETSC_VIEWER_CLASSID
) { if (((PetscObject)(viewer))->classid == -1) return PetscError
(((MPI_Comm)0x44000001),858,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,64,PETSC_ERROR_INITIAL,"Object already free: Parameter # %d"
,1); else return PetscError(((MPI_Comm)0x44000001),858,__func__
,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,62,PETSC_ERROR_INITIAL,"Wrong type of object: Parameter # %d"
,1); } } while (0)
;
859 ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERDRAW"draw",&isdraw);CHKERRQ(ierr)do {if (__builtin_expect(!!(ierr),0)) return PetscError(((MPI_Comm
)0x44000001),859,__func__,"/sandbox/petsc/petsc.next-tmp/src/sys/classes/viewer/impls/draw/drawv.c"
,ierr,PETSC_ERROR_REPEAT," ");} while (0)
;
860 if (!isdraw) {if (nbounds) *nbounds = 0; if (bounds) *bounds = NULL((void*)0); PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;}
861 vdraw = (PetscViewer_Draw*)viewer->data;
862
863 if (nbounds) *nbounds = vdraw->nbounds;
864 if (bounds) *bounds = vdraw->bounds;
865 PetscFunctionReturn(0)do { do { ; if (petscstack && petscstack->currentsize
> 0) { petscstack->currentsize--; petscstack->function
[petscstack->currentsize] = 0; petscstack->file[petscstack
->currentsize] = 0; petscstack->line[petscstack->currentsize
] = 0; petscstack->petscroutine[petscstack->currentsize
] = PETSC_FALSE; } if (petscstack) { petscstack->hotdepth =
(((petscstack->hotdepth-1)<(0)) ? (0) : (petscstack->
hotdepth-1)); } ; } while (0); return(0);} while (0)
;
866}