Lines Matching refs:vu

22   PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data;  in PetscViewerFileClose_VU()  local
25 if (vu->vecSeen) PetscCall(PetscViewerVUPrintDeferred(viewer, "};\n\n")); in PetscViewerFileClose_VU()
27 PetscCall(PetscFClose(PetscObjectComm((PetscObject)viewer), vu->fd)); in PetscViewerFileClose_VU()
28 vu->fd = NULL; in PetscViewerFileClose_VU()
29 PetscCall(PetscFree(vu->filename)); in PetscViewerFileClose_VU()
35 PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data; in PetscViewerDestroy_VU() local
39 PetscCall(PetscFree(vu)); in PetscViewerDestroy_VU()
59 PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data; in PetscViewerFileSetMode_VU() local
62 vu->mode = mode; in PetscViewerFileSetMode_VU()
68 PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data; in PetscViewerFileGetMode_VU() local
71 *type = vu->mode; in PetscViewerFileGetMode_VU()
77 PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data; in PetscViewerFileGetName_VU() local
80 *name = vu->filename; in PetscViewerFileGetName_VU()
86 PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data; in PetscViewerFileSetName_VU() local
95 PetscCall(PetscStrallocpy(name, &vu->filename)); in PetscViewerFileSetName_VU()
97 switch (vu->mode) { in PetscViewerFileSetName_VU()
99 vu->fd = fopen(fname, "r"); in PetscViewerFileSetName_VU()
102 vu->fd = fopen(fname, "w"); in PetscViewerFileSetName_VU()
105 vu->fd = fopen(fname, "a"); in PetscViewerFileSetName_VU()
108 vu->fd = fopen(fname, "r+"); in PetscViewerFileSetName_VU()
109 if (!vu->fd) vu->fd = fopen(fname, "w+"); in PetscViewerFileSetName_VU()
115 vu->fd = fopen(fname, "r+"); in PetscViewerFileSetName_VU()
116 if (!vu->fd) vu->fd = fopen(fname, "w+"); in PetscViewerFileSetName_VU()
118 int ret = fseek(vu->fd, 0, SEEK_END); in PetscViewerFileSetName_VU()
123 …ectComm((PetscObject)viewer), PETSC_ERR_SUP, "Unsupported file mode %s", PetscFileModes[vu->mode]); in PetscViewerFileSetName_VU()
126 …PetscCheck(vu->fd, PETSC_COMM_SELF, PETSC_ERR_FILE_OPEN, "Cannot open PetscViewer file: %s", fname… in PetscViewerFileSetName_VU()
141 PetscViewer_VU *vu; in PetscViewerCreate_VU() local
144 PetscCall(PetscNew(&vu)); in PetscViewerCreate_VU()
145 viewer->data = (void *)vu; in PetscViewerCreate_VU()
152 vu->fd = NULL; in PetscViewerCreate_VU()
153 vu->mode = FILE_MODE_WRITE; in PetscViewerCreate_VU()
154 vu->filename = NULL; in PetscViewerCreate_VU()
155 vu->vecSeen = PETSC_FALSE; in PetscViewerCreate_VU()
156 vu->queue = NULL; in PetscViewerCreate_VU()
157 vu->queueBase = NULL; in PetscViewerCreate_VU()
158 vu->queueLength = 0; in PetscViewerCreate_VU()
184 PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data; in PetscViewerVUGetPointer() local
189 *fd = vu->fd; in PetscViewerVUGetPointer()
209 PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data; in PetscViewerVUSetVecSeen() local
212 vu->vecSeen = vecSeen; in PetscViewerVUSetVecSeen()
234 PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data; in PetscViewerVUGetVecSeen() local
239 *vecSeen = vu->vecSeen; in PetscViewerVUGetVecSeen()
258 PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data; in PetscViewerVUPrintDeferred() local
265 if (vu->queue) { in PetscViewerVUPrintDeferred()
266 vu->queue->next = next; in PetscViewerVUPrintDeferred()
267 vu->queue = next; in PetscViewerVUPrintDeferred()
268 vu->queue->next = NULL; in PetscViewerVUPrintDeferred()
270 vu->queueBase = vu->queue = next; in PetscViewerVUPrintDeferred()
272 vu->queueLength++; in PetscViewerVUPrintDeferred()
295 PetscViewer_VU *vu = (PetscViewer_VU *)viewer->data; in PetscViewerVUFlushDeferred() local
296 PrintfQueue next = vu->queueBase; in PetscViewerVUFlushDeferred()
301 for (i = 0; i < vu->queueLength; i++) { in PetscViewerVUFlushDeferred()
302 PetscCall(PetscFPrintf(PetscObjectComm((PetscObject)viewer), vu->fd, "%s", next->string)); in PetscViewerVUFlushDeferred()
307 vu->queue = NULL; in PetscViewerVUFlushDeferred()
308 vu->queueLength = 0; in PetscViewerVUFlushDeferred()