Lines Matching full:viewer

36 static PetscErrorCode BinaryReadIntoInt(PetscViewer viewer, PetscInt *out, PetscDataType file_type)…  in BinaryReadIntoInt()  argument
41 PetscCall(PetscViewerBinaryRead(viewer, &val, 1, NULL, PETSC_INT32)); in BinaryReadIntoInt()
45 PetscCall(PetscViewerBinaryRead(viewer, &val, 1, NULL, PETSC_INT64)); in BinaryReadIntoInt()
48 PetscCall(PetscViewerBinaryRead(viewer, out, 1, NULL, PETSC_INT)); in BinaryReadIntoInt()
63 PetscViewer viewer; in HoneeLoadInitialCondition() local
72 PetscCall(PetscViewerBinaryOpen(comm, filename, FILE_MODE_READ, &viewer)); in HoneeLoadInitialCondition()
73 PetscCall(HoneeLoadBinaryVec(viewer, Q, solution_time, solution_steps)); in HoneeLoadInitialCondition()
74 PetscCall(PetscViewerDestroy(&viewer)); in HoneeLoadInitialCondition()
82 PetscCall(PetscViewerCGNSOpen(comm, filename, FILE_MODE_READ, &viewer)); in HoneeLoadInitialCondition()
86 PetscCall(VecLoad(V_output, viewer)); in HoneeLoadInitialCondition()
92 PetscCall(PetscViewerCGNSGetSolutionTime(viewer, solution_time, &set)); in HoneeLoadInitialCondition()
94 PetscCall(PetscViewerCGNSGetSolutionIteration(viewer, solution_steps, &set)); in HoneeLoadInitialCondition()
100 PetscCall(PetscViewerCGNSGetSolutionName(viewer, &name)); in HoneeLoadInitialCondition()
108 PetscCall(PetscViewerDestroy(&viewer)); in HoneeLoadInitialCondition()
123 @param[in] viewer `PetscViewer` to read the vec from. Must be a binary viewer
128 PetscErrorCode HoneeLoadBinaryVec(PetscViewer viewer, Vec Q, PetscReal *time, PetscInt *step_number… in HoneeLoadBinaryVec() argument
132 MPI_Comm comm = PetscObjectComm((PetscObject)viewer); in HoneeLoadBinaryVec()
136 PetscCall(PetscViewerFileGetName(viewer, &filename)); in HoneeLoadBinaryVec()
137 PetscCall(PetscViewerBinaryRead(viewer, &token, 1, NULL, PETSC_INT32)); in HoneeLoadBinaryVec()
143 PetscCall(BinaryReadIntoInt(viewer, &file_step_number, file_type)); in HoneeLoadBinaryVec()
144 PetscCall(PetscViewerBinaryRead(viewer, &file_time, 1, NULL, PETSC_REAL)); in HoneeLoadBinaryVec()
152 PetscCall(BinaryReadIntoInt(viewer, &length, PETSC_INT32)); in HoneeLoadBinaryVec()
156 PetscCall(PetscViewerBinaryRead(viewer, &token2, 1, NULL, PETSC_INT32)); in HoneeLoadBinaryVec()
159 PetscCall(BinaryReadIntoInt(viewer, &length, PETSC_INT64)); in HoneeLoadBinaryVec()
164 PetscCall(PetscViewerBinarySetSkipHeader(viewer, PETSC_TRUE)); in HoneeLoadBinaryVec()
171 PetscCall(VecLoad(Q, viewer)); in HoneeLoadBinaryVec()
178 @param[in] viewer `PetscViewer` for binary file. Must be binary viewer and in write mode
183 PetscErrorCode HoneeWriteBinaryVec(PetscViewer viewer, Vec Q, PetscReal time, PetscInt step_number)… in HoneeWriteBinaryVec() argument
187 { // Verify viewer is in correct state in HoneeWriteBinaryVec()
191 MPI_Comm comm = PetscObjectComm((PetscObject)viewer); in HoneeWriteBinaryVec()
193 PetscCall(PetscViewerGetType(viewer, &viewer_type)); in HoneeWriteBinaryVec()
195 …PetscCheck(is_binary_viewer, comm, PETSC_ERR_ARG_WRONGSTATE, "Viewer must be binary type; instead … in HoneeWriteBinaryVec()
196 PetscCall(PetscViewerFileGetMode(viewer, &file_mode)); in HoneeWriteBinaryVec()
197 …PetscCheck(file_mode == FILE_MODE_WRITE, comm, PETSC_ERR_ARG_WRONGSTATE, "Viewer must be binary ty… in HoneeWriteBinaryVec()
201 PetscCall(PetscViewerBinaryWrite(viewer, &token, 1, PETSC_INT32)); in HoneeWriteBinaryVec()
202 PetscCall(PetscViewerBinaryWrite(viewer, &step_number, 1, PETSC_INT)); in HoneeWriteBinaryVec()
203 PetscCall(PetscViewerBinaryWrite(viewer, &time, 1, PETSC_REAL)); in HoneeWriteBinaryVec()
204 PetscCall(VecView(Q, viewer)); in HoneeWriteBinaryVec()