xref: /petsc/src/sys/classes/draw/interface/dflush.c (revision af25d912c737f21fca88746c26cd8b5ca8321f21)
1 /*
2        Provides the calling sequences for all the basic PetscDraw routines.
3 */
4 #include <petsc/private/drawimpl.h>  /*I "petscdraw.h" I*/
5 
6 #undef __FUNCT__
7 #define __FUNCT__ "PetscDrawFlush"
8 /*@
9    PetscDrawFlush - Flushs graphical output.
10 
11    Not collective (Use PetscDrawSynchronizedFlush() for collective)
12 
13    Input Parameters:
14 .  draw - the drawing context
15 
16    Level: beginner
17 
18    Concepts: flushing^graphics
19 
20 .seealso: PetscDrawSynchronizedFlush()
21 @*/
22 PetscErrorCode  PetscDrawFlush(PetscDraw draw)
23 {
24   PetscErrorCode ierr;
25 
26   PetscFunctionBegin;
27   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
28   if (draw->ops->flush) {
29     ierr = (*draw->ops->flush)(draw);CHKERRQ(ierr);
30   }
31   PetscFunctionReturn(0);
32 }
33 
34 #undef __FUNCT__
35 #define __FUNCT__ "PetscDrawSynchronizedFlush"
36 /*@
37    PetscDrawSynchronizedFlush - Flushes graphical output. This waits until all
38    processors have arrived and flushed, then does a global flush.
39    This is usually done to change the frame for double buffered graphics.
40 
41    Collective on PetscDraw
42 
43    Input Parameters:
44 .  draw - the drawing context
45 
46    Level: beginner
47 
48    Concepts: flushing^graphics
49 
50 .seealso: PetscDrawFlush()
51 
52 @*/
53 PetscErrorCode  PetscDrawSynchronizedFlush(PetscDraw draw)
54 {
55   PetscErrorCode ierr;
56 
57   PetscFunctionBegin;
58   PetscValidHeaderSpecific(draw,PETSC_DRAW_CLASSID,1);
59   if (draw->ops->synchronizedflush) {
60     ierr = (*draw->ops->synchronizedflush)(draw);CHKERRQ(ierr);
61   }
62   PetscFunctionReturn(0);
63 }
64