PetscViewer - Low-level Interface
The PetscViewer component provides flexible I/O capabilities for visualizing and saving PETSc objects, including vectors, matrices, and other data structures. Viewers support multiple output formats for analysis, debugging, and post-processing.
Overview
PETSc viewers enable:
- Text output: ASCII formatted data for debugging
- Binary I/O: Efficient storage and checkpointing
- Visualization: Integration with visualization tools (VTK, HDF5, MATLAB)
- Monitoring: Runtime inspection of solver progress
- Logging: Recording solver statistics and performance data
Available viewer types:
- PETSCVIEWERASCII: Human-readable text output
- PETSCVIEWERBINARY: Platform-independent binary format
- PETSCVIEWERVTK: VTK format for ParaView, VisIt
- PETSCVIEWERHDF5: HDF5 hierarchical data format
- PETSCVIEWERDRAW: X-window graphics (2D plots, contours)
- PETSCVIEWERSOCKET: Network streaming to MATLAB, Python
- PETSCVIEWERMATLAB: MATLAB-compatible output
Basic Usage
using PETSc, MPI
# Initialize MPI and PETSc
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
# Create a viewer for ASCII output to stdout
viewer = LibPETSc.PetscViewerCreate(petsclib, LibPETSc.PETSC_COMM_SELF)
LibPETSc.PetscViewerSetType(petsclib, viewer, "ascii") # String convenience wrapper
LibPETSc.PetscViewerFileSetMode(petsclib, viewer, LibPETSc.FILE_MODE_WRITE)
# View a vector
# LibPETSc.VecView(petsclib, vec, viewer)
# View a matrix
# LibPETSc.MatView(petsclib, mat, viewer)
# Cleanup - wrap in Ref since PetscViewerDestroy expects Ptr{PetscViewer}
viewer_ref = Ref(viewer)
LibPETSc.PetscViewerDestroy(petsclib, viewer_ref)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()Convenience Functions
For commonly used viewers, PETSc.jl provides convenience functions:
using PETSc, MPI
# Initialize MPI and PETSc
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
# Get stdout viewer (single process)
viewer_stdout_self = LibPETSc.PETSC_VIEWER_STDOUT_SELF(petsclib)
# Get stdout viewer (all processes)
viewer_stdout_world = LibPETSc.PETSC_VIEWER_STDOUT_WORLD(petsclib)
# Get stderr viewer (single process)
viewer_stderr_self = LibPETSc.PETSC_VIEWER_STDERR_SELF(petsclib)
# Get stderr viewer (all processes)
viewer_stderr_world = LibPETSc.PETSC_VIEWER_STDERR_WORLD(petsclib)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()
# Use them to view objects
# LibPETSc.VecView(petsclib, vec, viewer_stdout_self)
# LibPETSc.MatView(petsclib, mat, viewer_stderr_world)Output to Files
ASCII File Output
# Create ASCII file viewer
viewer = Ref{LibPETSc.PetscViewer}()
LibPETSc.PetscViewerASCIIOpen(petsclib, LibPETSc.PETSC_COMM_SELF, "output.txt", viewer)
# Set format (optional)
LibPETSc.PetscViewerPushFormat(petsclib, viewer[], LibPETSc.PETSC_VIEWER_ASCII_MATLAB)
# View object
# LibPETSc.MatView(petsclib, mat, viewer[])
LibPETSc.PetscViewerDestroy(petsclib, viewer)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()Binary File Output
# Create binary viewer for checkpointing
viewer = Ref{LibPETSc.PetscViewer}()
LibPETSc.PetscViewerBinaryOpen(petsclib, MPI.COMM_WORLD, "checkpoint.dat",
LibPETSc.FILE_MODE_WRITE, viewer)
# Save vector
# LibPETSc.VecView(petsclib, vec, viewer[])
# Save matrix
# LibPETSc.MatView(petsclib, mat, viewer[])
LibPETSc.PetscViewerDestroy(petsclib, viewer)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()Loading from Binary Files
# Open for reading
viewer = Ref{LibPETSc.PetscViewer}()
LibPETSc.PetscViewerBinaryOpen(petsclib, MPI.COMM_WORLD, "checkpoint.dat",
LibPETSc.FILE_MODE_READ, viewer)
# Load vector
vec = LibPETSc.VecCreate(petsclib, MPI.COMM_WORLD)
LibPETSc.VecLoad(petsclib, vec, viewer[])
LibPETSc.PetscViewerDestroy(petsclib, viewer)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()Visualization Formats
VTK Output
# Create VTK viewer for ParaView/VisIt
viewer = Ref{LibPETSc.PetscViewer}()
LibPETSc.PetscViewerVTKOpen(petsclib, MPI.COMM_WORLD, "solution.vtu",
LibPETSc.FILE_MODE_WRITE, viewer)
# View DM-based solution
# LibPETSc.DMView(petsclib, dm, viewer[])
# LibPETSc.VecView(petsclib, solution, viewer[])
LibPETSc.PetscViewerDestroy(petsclib, viewer)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()HDF5 Output
# Create HDF5 viewer for hierarchical data
viewer = Ref{LibPETSc.PetscViewer}()
LibPETSc.PetscViewerHDF5Open(petsclib, MPI.COMM_WORLD, "data.h5",
LibPETSc.FILE_MODE_WRITE, viewer)
# Organize data in groups
LibPETSc.PetscViewerHDF5PushGroup(petsclib, viewer[], "/timestep_001")
# LibPETSc.VecView(petsclib, vec, viewer[])
LibPETSc.PetscViewerHDF5PopGroup(petsclib, viewer[])
LibPETSc.PetscViewerDestroy(petsclib, viewer)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()Standard Viewers
PETSc provides predefined viewers:
# Standard output
LibPETSc.PETSC_VIEWER_STDOUT_SELF(petsclib)
LibPETSc.PETSC_VIEWER_STDOUT_WORLD(petsclib)
# Standard error
LibPETSc.PETSC_VIEWER_STDERR_SELF(petsclib)
LibPETSc.PETSC_VIEWER_STDERR_WORLD(petsclib)
# Example: view to stdout
# LibPETSc.VecView(petsclib, vec, LibPETSc.PETSC_VIEWER_STDOUT_WORLD(petsclib))Format Options
Control output detail with PetscViewerPushFormat:
- PETSCVIEWERDEFAULT: Standard format
- PETSCVIEWERASCII_MATLAB: MATLAB-compatible format
- PETSCVIEWERASCII_DENSE: Dense matrix format
- PETSCVIEWERASCII_INFO: Summary information only
- PETSCVIEWERASCIIINFODETAIL: Detailed information
Draw Viewer (Graphics)
For interactive 2D visualization:
# Create draw viewer (X-window)
viewer = Ref{LibPETSc.PetscViewer}()
LibPETSc.PetscViewerDrawOpen(petsclib, LibPETSc.PETSC_COMM_SELF, C_NULL, "Plot",
0, 0, 600, 600, viewer)
# View vector as bar chart
# LibPETSc.VecView(petsclib, vec, viewer[])
# View matrix structure
# LibPETSc.MatView(petsclib, mat, viewer[])
LibPETSc.PetscViewerDestroy(petsclib, viewer)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()Socket Viewer (MATLAB/Python)
Stream data to external tools:
# Create socket viewer
viewer = Ref{LibPETSc.PetscViewer}()
LibPETSc.PetscViewerSocketOpen(petsclib, MPI.COMM_WORLD, "localhost", 5000, viewer)
# Send data
# LibPETSc.VecView(petsclib, vec, viewer[])
LibPETSc.PetscViewerDestroy(petsclib, viewer)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()Monitoring Convergence
Viewers are used with KSP/SNES monitors:
# Monitor KSP residuals (automatic viewer to stdout)
# LibPETSc.KSPMonitorSet(petsclib, ksp, LibPETSc.KSPMonitorDefault,
# LibPETSc.PETSC_VIEWER_STDOUT_SELF(petsclib), C_NULL)Function Reference
PETSc.LibPETSc.PETSC_VIEWER_STDERR_SELF — Method
viewer::PetscViewer = PETSC_VIEWER_STDERR_SELF(petsclib::PetscLibType)Get the default PETSc STDERR viewer for MPI.COMM_SELF
Not Collective
Input Parameter:
petsclib- the PETSc library instance
Output Parameter:
viewer- the viewer
Level: beginner
-seealso: PETSC_VIEWER_STDERR_WORLD, PetscViewerASCIIGetStderr()
PETSc.LibPETSc.PETSC_VIEWER_STDERR_WORLD — Method
viewer::PetscViewer = PETSC_VIEWER_STDERR_WORLD(petsclib::PetscLibType)Get the default PETSc STDERR viewer for MPI.COMM_WORLD
Collective on MPI.COMM_WORLD
Input Parameter:
petsclib- the PETSc library instance
Output Parameter:
viewer- the viewer
Level: beginner
-seealso: PETSC_VIEWER_STDERR_SELF, PetscViewerASCIIGetStderr()
PETSc.LibPETSc.PETSC_VIEWER_STDOUT_SELF — Method
viewer::PetscViewer = PETSC_VIEWER_STDOUT_SELF(petsclib::PetscLibType)Get the default PETSc STDOUT viewer for MPI.COMM_SELF
Not Collective
Input Parameter:
petsclib- the PETSc library instance
Output Parameter:
viewer- the viewer
Level: beginner
-seealso: PETSC_VIEWER_STDOUT_WORLD, PetscViewerASCIIGetStdout()
PETSc.LibPETSc.PETSC_VIEWER_STDOUT_WORLD — Method
viewer::PetscViewer = PETSC_VIEWER_STDOUT_WORLD(petsclib::PetscLibType)Get the default PETSc STDOUT viewer for MPI.COMM_WORLD
Collective on MPI.COMM_WORLD
Input Parameter:
petsclib- the PETSc library instance
Output Parameter:
viewer- the viewer
Level: beginner
-seealso: PETSC_VIEWER_STDOUT_SELF, PetscViewerASCIIGetStdout()
PETSc.LibPETSc.PetscViewerADIOSOpen — Method
PetscViewerADIOSOpen(petsclib::PetscLibType,comm::MPI_Comm, name::String, type::PetscFileMode, adiosv::PetscViewer)Opens a file for ADIOS input/output.
Collective
Input Parameters:
comm- MPI communicatorname- name of filetype- type of file
-seealso: PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), PetscViewerHDF5Open(), VecView(), MatView(), VecLoad(), PetscViewerSetType(), PetscViewerFileSetMode(), PetscViewerFileSetName() MatLoad(), PetscFileMode, PetscViewer
External Links
- PETSc Manual:
Sys/PetscViewerADIOSOpen
PETSc.LibPETSc.PetscViewerASCIIAddTab — Method
PetscViewerASCIIAddTab(petsclib::PetscLibType,viewer::PetscViewer, tabs::PetscInt)Add to the number of times a PETSCVIEWERASCII viewer tabs before printing
Not Collective, but only first processor in set has any effect; No Fortran Support
Input Parameters:
viewer- obtained withPetscViewerASCIIOpen()tabs- number of tabs
Level: developer
-seealso: , PETSCVIEWERASCII, PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer(), PetscViewerASCIIPushTab()
External Links
- PETSc Manual:
Sys/PetscViewerASCIIAddTab
PETSc.LibPETSc.PetscViewerASCIIGetPointer — Method
PetscViewerASCIIGetPointer(petsclib::PetscLibType,viewer::PetscViewer, fd::Libc.FILE)Extracts the file pointer from an ASCII PetscViewer.
Not Collective, depending on the viewer the value may be meaningless except for process 0 of the viewer; No Fortran Support
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerASCIIOpen()
Output Parameter:
fd- file pointer
Level: intermediate
-seealso: , PETSCVIEWERASCII, PetscViewerASCIIOpen(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerCreate(), PetscViewerASCIIPrintf(), PetscViewerASCIISynchronizedPrintf(), PetscViewerFlush()
External Links
- PETSc Manual:
Sys/PetscViewerASCIIGetPointer
PETSc.LibPETSc.PetscViewerASCIIGetStderr — Method
PetscViewerASCIIGetStderr(petsclib::PetscLibType,comm::MPI_Comm, viewer::PetscViewer)Creates a PETSCVIEWERASCII PetscViewer shared by all MPI processes in a communicator that prints to stderr. Error returning version of PETSC_VIEWER_STDERR_()
Collective
Input Parameter:
comm- the MPI communicator to share thePetscViewer
Output Parameter:
viewer- the viewer
Level: beginner
-seealso: , PetscViewerASCIIGetStdout(), PETSC_VIEWER_DRAW_(), PetscViewerASCIIOpen(), PETSC_VIEWER_STDERR_, PETSC_VIEWER_STDERR_WORLD, PETSC_VIEWER_STDERR_SELF
External Links
- PETSc Manual:
Sys/PetscViewerASCIIGetStderr
PETSc.LibPETSc.PetscViewerASCIIGetStdout — Method
PetscViewerASCIIGetStdout(petsclib::PetscLibType,comm::MPI_Comm, viewer::PetscViewer)Creates a PETSCVIEWERASCII PetscViewer shared by all processes in a communicator that prints to stdout. Error returning version of PETSC_VIEWER_STDOUT_()
Collective
Input Parameter:
comm- the MPI communicator to share thePetscViewer
Output Parameter:
viewer- the viewer
Level: beginner
-seealso: , PetscViewerASCIIGetStderr(), PETSC_VIEWER_DRAW_(), PetscViewerASCIIOpen(), PETSC_VIEWER_STDERR_, PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_STDOUT_SELF
External Links
- PETSc Manual:
Sys/PetscViewerASCIIGetStdout
PETSc.LibPETSc.PetscViewerASCIIGetTab — Method
tabs::PetscInt = PetscViewerASCIIGetTab(petsclib::PetscLibType,viewer::PetscViewer)Return the number of tabs used by PetscViewer.
Not Collective, meaningful on first processor only; No Fortran Support
Input Parameter:
viewer- obtained withPetscViewerASCIIOpen()
Output Parameter:
tabs- number of tabs
Level: developer
-seealso: , PETSCVIEWERASCII, PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIISetTab(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer(), PetscViewerASCIIPushTab()
External Links
- PETSc Manual:
Sys/PetscViewerASCIIGetTab
PETSc.LibPETSc.PetscViewerASCIIOpen — Method
PetscViewerASCIIOpen(petsclib::PetscLibType,comm::MPI_Comm, name::String, viewer::PetscViewer)Opens an ASCII file for writing as a PETSCVIEWERASCII PetscViewer.
Collective
Input Parameters:
comm- the communicatorname- the file name
Output Parameter:
viewer- thePetscViewerto use with the specified file
Level: beginner
-seealso: , MatView(), VecView(), PetscViewerDestroy(), PetscViewerBinaryOpen(), PetscViewerASCIIRead(), PETSCVIEWERASCII PetscViewerASCIIGetPointer(), PetscViewerPushFormat(), PETSC_VIEWER_STDOUT_, PETSC_VIEWER_STDERR_, PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_STDOUT_SELF, PetscViewerASCIIGetStdout(), PetscViewerASCIIGetStderr()
External Links
- PETSc Manual:
Sys/PetscViewerASCIIOpen
PETSc.LibPETSc.PetscViewerASCIIOpenWithFILE — Method
PetscViewerASCIIOpenWithFILE(petsclib::PetscLibType,comm::MPI_Comm, fd::Libc.FILE, viewer::PetscViewer)Given an open file creates an PETSCVIEWERASCII viewer that prints to it.
Collective
Input Parameters:
comm- the communicatorfd- theFILEpointer
Output Parameter:
viewer- thePetscViewerto use with the specified file
Level: beginner
-seealso: , MatView(), VecView(), PetscViewerDestroy(), PetscViewerBinaryOpen(), PetscViewerASCIIOpenWithFileUnit(), PetscViewerASCIIGetPointer(), PetscViewerPushFormat(), PETSC_VIEWER_STDOUT_, PETSC_VIEWER_STDERR_, PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_STDOUT_SELF, PetscViewerASCIIOpen(), PetscViewerASCIISetFILE(), PETSCVIEWERASCII
External Links
- PETSc Manual:
Sys/PetscViewerASCIIOpenWithFILE
PETSc.LibPETSc.PetscViewerASCIIPopSynchronized — Method
PetscViewerASCIIPopSynchronized(petsclib::PetscLibType,viewer::PetscViewer)Undoes most recent PetscViewerASCIIPushSynchronized() for this viewer
Collective
Input Parameter:
viewer- obtained withPetscViewerASCIIOpen()
Level: intermediate
-seealso: , PetscViewerASCIIPushSynchronized(), PetscViewerASCIISynchronizedPrintf(), PetscViewerFlush(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType()
External Links
- PETSc Manual:
Sys/PetscViewerASCIIPopSynchronized
PETSc.LibPETSc.PetscViewerASCIIPopTab — Method
PetscViewerASCIIPopTab(petsclib::PetscLibType,viewer::PetscViewer)Removes one tab from the amount that PetscViewerASCIIPrintf() lines are tabbed that was provided by PetscViewerASCIIPushTab()
Not Collective, but only first MPI rank in the viewer has any effect; No Fortran Support
Input Parameter:
viewer- obtained withPetscViewerASCIIOpen()
Level: developer
-seealso: , PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIPushTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer()
External Links
- PETSc Manual:
Sys/PetscViewerASCIIPopTab
PETSc.LibPETSc.PetscViewerASCIIPushSynchronized — Method
PetscViewerASCIIPushSynchronized(petsclib::PetscLibType,viewer::PetscViewer)Allows calls to PetscViewerASCIISynchronizedPrintf() for this viewer
Collective
Input Parameter:
viewer- obtained withPetscViewerASCIIOpen()
Level: intermediate
-seealso: , PetscViewerASCIISynchronizedPrintf(), PetscViewerFlush(), PetscViewerASCIIPopSynchronized(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType()
External Links
- PETSc Manual:
Sys/PetscViewerASCIIPushSynchronized
PETSc.LibPETSc.PetscViewerASCIIPushTab — Method
PetscViewerASCIIPushTab(petsclib::PetscLibType,viewer::PetscViewer)Adds one more tab to the amount that PetscViewerASCIIPrintf() lines are tabbed.
Not Collective, but only first MPI rank in the viewer has any effect; No Fortran Support
Input Parameter:
viewer- obtained withPetscViewerASCIIOpen()
Level: developer
-seealso: , PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer()
External Links
- PETSc Manual:
Sys/PetscViewerASCIIPushTab
PETSc.LibPETSc.PetscViewerASCIIRead — Method
count::PetscInt = PetscViewerASCIIRead(petsclib::PetscLibType,viewer::PetscViewer, data::Cvoid, num::PetscInt, dtype::PetscDataType)Reads from a PETSCVIEWERASCII file
Only MPI rank 0 in the PetscViewer may call this
Input Parameters:
viewer- thePETSCVIEWERASCIIviewerdata- location to write the data, treated as an array of type indicated bydatatypenum- number of items of data to readdtype- type of data to read
Output Parameter:
count- number of items of data actually read, orNULL
Level: beginner
-seealso: , PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), PetscViewerCreate(), PetscViewerFileSetMode(), PetscViewerFileSetName() VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead()
External Links
- PETSc Manual:
Sys/PetscViewerASCIIRead
PETSc.LibPETSc.PetscViewerASCIISetFILE — Method
PetscViewerASCIISetFILE(petsclib::PetscLibType,viewer::PetscViewer, fd::Libc.FILE)Given an open file sets the PETSCVIEWERASCII viewer to use the file for output
Not Collective
Input Parameters:
viewer- thePetscViewerto use with the specified filefd- theFILEpointer
Level: beginner
-seealso: MatView(), VecView(), PetscViewerDestroy(), PetscViewerBinaryOpen(), PetscViewerASCIISetFileUnit(), PetscViewerASCIIGetPointer(), PetscViewerPushFormat(), PETSC_VIEWER_STDOUT_, PETSC_VIEWER_STDERR_, PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_STDOUT_SELF, PetscViewerASCIIOpen(), PetscViewerASCIIOpenWithFILE(), PETSCVIEWERASCII
External Links
- PETSc Manual:
Sys/PetscViewerASCIISetFILE
PETSc.LibPETSc.PetscViewerASCIISetTab — Method
PetscViewerASCIISetTab(petsclib::PetscLibType,viewer::PetscViewer, tabs::PetscInt)Causes PetscViewer to tab in a number of times before printing
Not Collective, but only first processor in set has any effect; No Fortran Support
Input Parameters:
viewer- obtained withPetscViewerASCIIOpen()tabs- number of tabs
Level: developer
-seealso: , PETSCVIEWERASCII, PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIGetTab(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer(), PetscViewerASCIIPushTab()
External Links
- PETSc Manual:
Sys/PetscViewerASCIISetTab
PETSc.LibPETSc.PetscViewerASCIISubtractTab — Method
PetscViewerASCIISubtractTab(petsclib::PetscLibType,viewer::PetscViewer, tabs::PetscInt)Subtracts from the number of times a PETSCVIEWERASCII viewer tabs before printing
Not Collective, but only first processor in set has any effect; No Fortran Support
Input Parameters:
viewer- obtained withPetscViewerASCIIOpen()tabs- number of tabs
Level: developer
-seealso: , PETSCVIEWERASCII, PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer(), PetscViewerASCIIPushTab()
External Links
- PETSc Manual:
Sys/PetscViewerASCIISubtractTab
PETSc.LibPETSc.PetscViewerASCIIUseTabs — Method
PetscViewerASCIIUseTabs(petsclib::PetscLibType,viewer::PetscViewer, flg::PetscBool)Turns on or off the use of tabs with the PETSCVIEWERASCII PetscViewer
Not Collective, but only first MPI rank in the viewer has any effect; No Fortran Support
Input Parameters:
viewer- obtained withPetscViewerASCIIOpen()flg-PETSC_TRUEorPETSC_FALSE
Level: developer
-seealso: , PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIPushTab(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer()
External Links
- PETSc Manual:
Sys/PetscViewerASCIIUseTabs
PETSc.LibPETSc.PetscViewerAndFormatCreate — Method
vf::PetscViewerAndFormat = PetscViewerAndFormatCreate(petsclib::PetscLibType,viewer::PetscViewer, format::PetscViewerFormat)Creates a PetscViewerAndFormat struct.
Collective
Input Parameters:
viewer- the viewerformat- the format
Output Parameter:
vf- viewer and format object
Level: developer
-seealso: , PetscViewer, PetscViewerAndFormat, PetscViewerFormat, PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDrawOpen(), PetscViewerAndFormatDestroy()
External Links
- PETSc Manual:
Sys/PetscViewerAndFormatCreate
PETSc.LibPETSc.PetscViewerAndFormatDestroy — Method
PetscViewerAndFormatDestroy(petsclib::PetscLibType,vf::PetscViewerAndFormat)Destroys a PetscViewerAndFormat struct created with PetscViewerAndFormatCreate()
Collective
Input Parameter:
vf- thePetscViewerAndFormatto be destroyed.
Level: developer
-seealso: , PetscViewer, PetscViewerAndFormat, PetscViewerFormat, PetscViewerAndFormatCreate(), PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDrawOpen()
External Links
- PETSc Manual:
Sys/PetscViewerAndFormatDestroy
PETSc.LibPETSc.PetscViewerAppendOptionsPrefix — Method
PetscViewerAppendOptionsPrefix(petsclib::PetscLibType,viewer::PetscViewer, prefix::String)Appends to the prefix used for searching for PetscViewer options in the database during PetscViewerSetFromOptions().
Logically Collective
Input Parameters:
viewer- thePetscViewercontextprefix- the prefix to prepend to all option names
Level: advanced
-seealso: , PetscViewer, PetscViewerGetOptionsPrefix(), PetscViewerSetOptionsPrefix()
External Links
- PETSc Manual:
Sys/PetscViewerAppendOptionsPrefix
PETSc.LibPETSc.PetscViewerBinaryAddMPIIOOffset — Method
PetscViewerBinaryAddMPIIOOffset(petsclib::PetscLibType,viewer::PetscViewer, off::MPI_Offset)Adds to the current global offset
Logically Collective; No Fortran Support
Input Parameters:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()off- the addition to the global offset
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinaryGetUseMPIIO(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryGetMPIIOOffset()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryAddMPIIOOffset
PETSc.LibPETSc.PetscViewerBinaryGetDescriptor — Method
PetscViewerBinaryGetDescriptor(petsclib::PetscLibType,viewer::PetscViewer, fdes::Cint)Extracts the file descriptor from a PetscViewer of PetscViewerType PETSCVIEWERBINARY.
Collective because it may trigger a PetscViewerSetUp() call; No Fortran Support
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()
Output Parameter:
fdes- file descriptor
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryGetDescriptor
PETSc.LibPETSc.PetscViewerBinaryGetFlowControl — Method
fc::PetscInt = PetscViewerBinaryGetFlowControl(petsclib::PetscLibType,viewer::PetscViewer)Returns how many messages are allowed to be outstanding at the same time during parallel IO reads/writes
Not Collective
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()
Output Parameter:
fc- the number of messages
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinarySetFlowControl()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryGetFlowControl
PETSc.LibPETSc.PetscViewerBinaryGetInfoPointer — Method
PetscViewerBinaryGetInfoPointer(petsclib::PetscLibType,viewer::PetscViewer, file::Libc.FILE)Extracts the file pointer for the ASCII .info file associated with a binary file.
Not Collective; No Fortran Support
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()
Output Parameter:
file- file pointer Always returnsNULLif not a binary viewer
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetSkipInfo(), PetscViewerBinarySetSkipInfo()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryGetInfoPointer
PETSc.LibPETSc.PetscViewerBinaryGetMPIIODescriptor — Method
PetscViewerBinaryGetMPIIODescriptor(petsclib::PetscLibType,viewer::PetscViewer, fdes::MPI_File)Extracts the MPI IO file descriptor from a PetscViewer.
Not Collective; No Fortran Support
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()
Output Parameter:
fdes- file descriptor
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinaryGetUseMPIIO(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryGetMPIIOOffset()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryGetMPIIODescriptor
PETSc.LibPETSc.PetscViewerBinaryGetMPIIOOffset — Method
PetscViewerBinaryGetMPIIOOffset(petsclib::PetscLibType,viewer::PetscViewer, off::MPI_Offset)Gets the current global offset that should be passed to MPI_File_set_view() or MPI_File_{write|read}_at[_all]()
Not Collective; No Fortran Support
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()
Output Parameter:
off- the current global offset
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinaryGetUseMPIIO(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryAddMPIIOOffset()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryGetMPIIOOffset
PETSc.LibPETSc.PetscViewerBinaryGetSkipHeader — Method
skip::PetscBool = PetscViewerBinaryGetSkipHeader(petsclib::PetscLibType,viewer::PetscViewer)checks whether to write a header with size information on output, or just raw data
Not Collective
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()
Output Parameter:
skip-PETSC_TRUEmeans do not write header
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySkipInfo(), PetscViewerBinarySetSkipHeader()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryGetSkipHeader
PETSc.LibPETSc.PetscViewerBinaryGetSkipInfo — Method
skip::PetscBool = PetscViewerBinaryGetSkipInfo(petsclib::PetscLibType,viewer::PetscViewer)check if viewer wrote a .info file
Not Collective
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()
Output Parameter:
skip-PETSC_TRUEimplies the.infofile was not generated
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySetSkipOptions(), PetscViewerBinarySetSkipInfo(), PetscViewerBinaryGetInfoPointer()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryGetSkipInfo
PETSc.LibPETSc.PetscViewerBinaryGetSkipOptions — Method
skip::PetscBool = PetscViewerBinaryGetSkipOptions(petsclib::PetscLibType,viewer::PetscViewer)checks if viewer uses the PETSc options database when loading objects
Not Collective
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()
Output Parameter:
skip-PETSC_TRUEmeans do not use
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySkipInfo(), PetscViewerBinarySetSkipOptions()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryGetSkipOptions
PETSc.LibPETSc.PetscViewerBinaryGetUseMPIIO — Method
use::PetscBool = PetscViewerBinaryGetUseMPIIO(petsclib::PetscLibType,viewer::PetscViewer)Returns PETSC_TRUE if the binary viewer uses MPI
Not Collective
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen(); must be aPETSCVIEWERBINARY
Output Parameter:
use-PETSC_TRUEif MPI-IO is being used
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryGetMPIIOOffset()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryGetUseMPIIO
PETSc.LibPETSc.PetscViewerBinaryOpen — Method
PetscViewerBinaryOpen(petsclib::PetscLibType,comm::MPI_Comm, name::String, mode::PetscFileMode, viewer::PetscViewer)Opens a file for binary input/output.
Collective
Input Parameters:
comm- MPI communicatorname- name of filemode- open mode of file
-seealso: , PETSCVIEWERBINARY, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryGetUseMPIIO(), PetscViewerBinaryGetMPIIOOffset()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryOpen
PETSc.LibPETSc.PetscViewerBinaryRead — Method
count::PetscInt = PetscViewerBinaryRead(petsclib::PetscLibType,viewer::PetscViewer, data::Cvoid, num::PetscInt, dtype::PetscDataType)Reads from a binary file, all processors get the same result
Collective; No Fortran Support
Input Parameters:
viewer- thePETSCVIEWERBINARYviewernum- number of items of data to readdtype- type of data to read
Output Parameters:
data- location of the read data, treated as an array of the type indicated bydtypecount- number of items of data actually read, orNULL.
Level: beginner
-seealso: , PETSCVIEWERBINARY, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer
External Links
- PETSc Manual:
Sys/PetscViewerBinaryRead
PETSc.LibPETSc.PetscViewerBinaryReadAll — Method
PetscViewerBinaryReadAll(petsclib::PetscLibType,viewer::PetscViewer, data::Cvoid, count::PetscCount, start::PetscCount, total::PetscCount, dtype::PetscDataType)reads from a binary file from all MPI processes, each rank receives its own portion of the data
Collective; No Fortran Support
Input Parameters:
viewer- thePETSCVIEWERBINARYviewercount- local number of items of data to readstart- local start, can bePETSC_DETERMINEtotal- global number of items of data to read, can bePETSC_DETERMINEdtype- type of data to read
Output Parameter:
data- location of data, treated as an array of type indicated bydtype
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryRead(), PetscViewerBinaryWriteAll()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryReadAll
PETSc.LibPETSc.PetscViewerBinaryReadStringArray — Method
PetscViewerBinaryReadStringArray(petsclib::PetscLibType,viewer::PetscViewer, data::Cchar)reads a binary file an array of strings to all MPI processes
Collective; No Fortran Support
Input Parameter:
viewer- thePETSCVIEWERBINARYviewer
Output Parameter:
data- location of the array of strings
Level: intermediate
-seealso: , PETSCVIEWERBINARY, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryReadStringArray
PETSc.LibPETSc.PetscViewerBinarySetFlowControl — Method
PetscViewerBinarySetFlowControl(petsclib::PetscLibType,viewer::PetscViewer, fc::PetscInt)Sets how many messages are allowed to be outstanding at the same time during parallel IO reads/writes
Not Collective
Input Parameters:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()fc- the number of messages, defaults to 256 if this function was not called
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinaryGetFlowControl()
External Links
- PETSc Manual:
Sys/PetscViewerBinarySetFlowControl
PETSc.LibPETSc.PetscViewerBinarySetSkipHeader — Method
PetscViewerBinarySetSkipHeader(petsclib::PetscLibType,viewer::PetscViewer, skip::PetscBool)do not write a header with size information on output, just raw data
Not Collective
Input Parameters:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()skip-PETSC_TRUEmeans do not write header
Options Database Key:
-viewer_binary_skip_header <true or false>- true means do not write header
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySkipInfo(), PetscViewerBinaryGetSkipHeader()
External Links
- PETSc Manual:
Sys/PetscViewerBinarySetSkipHeader
PETSc.LibPETSc.PetscViewerBinarySetSkipInfo — Method
PetscViewerBinarySetSkipInfo(petsclib::PetscLibType,viewer::PetscViewer, skip::PetscBool)Binary file will not have .info file created with it
Not Collective
Input Parameters:
viewer- PetscViewer context, obtained fromPetscViewerCreate()skip-PETSC_TRUEimplies the.infofile will not be generated
Options Database Key:
-viewer_binary_skip_info- true indicates do not generate.infofile
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySetSkipOptions(), PetscViewerBinaryGetSkipOptions(), PetscViewerBinaryGetSkipInfo(), PetscViewerBinaryGetInfoPointer()
External Links
- PETSc Manual:
Sys/PetscViewerBinarySetSkipInfo
PETSc.LibPETSc.PetscViewerBinarySetSkipOptions — Method
PetscViewerBinarySetSkipOptions(petsclib::PetscLibType,viewer::PetscViewer, skip::PetscBool)do not use values in the PETSc options database when loading objects
Not Collective
Input Parameters:
viewer-PetscViewercontext, obtained fromPetscViewerBinaryOpen()skip-PETSC_TRUEmeans do not use the options from the options database
Options Database Key:
-viewer_binary_skip_options <true or false>- true means do not use the options from the options database
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySkipInfo(), PetscViewerBinaryGetSkipOptions()
External Links
- PETSc Manual:
Sys/PetscViewerBinarySetSkipOptions
PETSc.LibPETSc.PetscViewerBinarySetUseMPIIO — Method
PetscViewerBinarySetUseMPIIO(petsclib::PetscLibType,viewer::PetscViewer, use::PetscBool)Sets a binary viewer to use MPI before PetscViewerFileSetName()
Logically Collective
Input Parameters:
viewer- thePetscViewer; must be aPETSCVIEWERBINARYuse-PETSC_TRUEmeans MPI-IO will be used
Options Database Key:
-viewer_binary_mpiio- <true or false> flag for using MPI-IO
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen(), PetscViewerBinaryGetUseMPIIO()
External Links
- PETSc Manual:
Sys/PetscViewerBinarySetUseMPIIO
PETSc.LibPETSc.PetscViewerBinarySkipInfo — Method
PetscViewerBinarySkipInfo(petsclib::PetscLibType,viewer::PetscViewer)Binary file will not have .info file created with it
Not Collective
Input Parameter:
viewer-PetscViewercontext, obtained fromPetscViewerCreate()
Options Database Key:
-viewer_binary_skip_info- true indicates do not generate.infofile
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySetSkipOptions(), PetscViewerBinaryGetSkipOptions(), PetscViewerBinaryGetSkipInfo()
External Links
- PETSc Manual:
Sys/PetscViewerBinarySkipInfo
PETSc.LibPETSc.PetscViewerBinaryWrite — Method
PetscViewerBinaryWrite(petsclib::PetscLibType,viewer::PetscViewer, data::Cvoid, count::PetscInt, dtype::PetscDataType)writes to a binary file, only from the first MPI rank
Collective; No Fortran Support
Input Parameters:
viewer- thePETSCVIEWERBINARYviewerdata- location of data, treated as an array of the type indicated bydtypecount- number of items of data to writedtype- type of data to write
Level: beginner
-seealso: , PETSCVIEWERBINARY, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscDataType PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryWrite
PETSc.LibPETSc.PetscViewerBinaryWriteAll — Method
PetscViewerBinaryWriteAll(petsclib::PetscLibType,viewer::PetscViewer, data::Cvoid, count::PetscCount, start::PetscCount, total::PetscCount, dtype::PetscDataType)writes to a binary file from all MPI processes, each rank writes its own portion of the data
Collective; No Fortran Support
Input Parameters:
viewer- thePETSCVIEWERBINARYviewerdata- location of datacount- local number of items of data to write, treated as an array of type indicated bydtypestart- local start, can bePETSC_DETERMINEtotal- global number of items of data to write, can bePETSC_DETERMINEdtype- type of data to write
Level: advanced
-seealso: , PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryReadAll()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryWriteAll
PETSc.LibPETSc.PetscViewerBinaryWriteStringArray — Method
PetscViewerBinaryWriteStringArray(petsclib::PetscLibType,viewer::PetscViewer, data::String)writes to a binary file, only from the first MPI rank, an array of strings
Collective; No Fortran Support
Input Parameters:
viewer- thePETSCVIEWERBINARYviewerdata- location of the array of strings
Level: intermediate
-seealso: , PETSCVIEWERBINARY, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead()
External Links
- PETSc Manual:
Sys/PetscViewerBinaryWriteStringArray
PETSc.LibPETSc.PetscViewerCGNSGetSolutionIndex — Method
solution_id::PetscInt = PetscViewerCGNSGetSolutionIndex(petsclib::PetscLibType,viewer::PetscViewer)Get index of solution
Not Collective
Input Parameter:
viewer-PETSCVIEWERCGNSPetscViewerfor CGNS input/output to use with the specified file
Output Parameter:
solution_id- Index of the solution id
Level: intermediate
-seealso: PETSCVIEWERCGNS, PetscViewerCGNSSetSolutionIndex(), PetscViewerCGNSGetSolutionInfo()
External Links
- PETSc Manual:
Sys/PetscViewerCGNSGetSolutionIndex
PETSc.LibPETSc.PetscViewerCGNSGetSolutionIteration — Method
iteration::PetscInt,set::PetscBool = PetscViewerCGNSGetSolutionIteration(petsclib::PetscLibType,viewer::PetscViewer)Gets the solution iteration for the FlowSolution of the viewer
Collective
Input Parameter:
viewer-PETSCVIEWERCGNSPetscViewerfor CGNS input/output to use with the specified file
Output Parameters:
iteration- Solution iteration of the FlowSolution_t nodeset- Whether the time data is in the file
Level: intermediate
-seealso: PETSCVIEWERCGNS, PetscViewer, PetscViewerCGNSGetSolutionTime(), PetscViewerCGNSSetSolutionIndex(), PetscViewerCGNSGetSolutionIndex(), PetscViewerCGNSGetSolutionName()
External Links
- PETSc Manual:
Sys/PetscViewerCGNSGetSolutionIteration
PETSc.LibPETSc.PetscViewerCGNSGetSolutionName — Method
PetscViewerCGNSGetSolutionName(petsclib::PetscLibType,viewer::PetscViewer, name::String)Gets name of FlowSolution of the viewer
Collective
Input Parameter:
viewer-PETSCVIEWERCGNSPetscViewerfor CGNS input/output to use with the specified file
Output Parameter:
name- Name of the FlowSolution_t node corresponding to the solution index
Level: intermediate
-seealso: PETSCVIEWERCGNS, PetscViewer, PetscViewerCGNSSetSolutionIndex(), PetscViewerCGNSGetSolutionIndex(), PetscViewerCGNSGetSolutionTime()
External Links
- PETSc Manual:
Sys/PetscViewerCGNSGetSolutionName
PETSc.LibPETSc.PetscViewerCGNSGetSolutionTime — Method
time::PetscReal,set::PetscBool = PetscViewerCGNSGetSolutionTime(petsclib::PetscLibType,viewer::PetscViewer)Gets the solution time for the FlowSolution of the viewer
Collective
Input Parameter:
viewer-PETSCVIEWERCGNSPetscViewerfor CGNS input/output to use with the specified file
Output Parameters:
time- Solution time of the FlowSolution_t nodeset- Whether the time data is in the file
Level: intermediate
-seealso: PETSCVIEWERCGNS, PetscViewer, PetscViewerCGNSGetSolutionIteration(), PetscViewerCGNSSetSolutionIndex(), PetscViewerCGNSGetSolutionIndex(), PetscViewerCGNSGetSolutionName()
External Links
- PETSc Manual:
Sys/PetscViewerCGNSGetSolutionTime
PETSc.LibPETSc.PetscViewerCGNSOpen — Method
PetscViewerCGNSOpen(petsclib::PetscLibType,comm::MPI_Comm, name::String, type::PetscFileMode, viewer::PetscViewer)Opens a file for CGNS input/output.
Collective
Input Parameters:
comm- MPI communicatorname- name of filetype- type of file
-seealso: PETSCVIEWERCGNS, PetscViewer, PetscViewerPushFormat(), PetscViewerDestroy(), DMLoad(), PetscFileMode, PetscViewerSetType(), PetscViewerFileSetMode(), PetscViewerFileSetName()
External Links
- PETSc Manual:
Sys/PetscViewerCGNSOpen
PETSc.LibPETSc.PetscViewerCGNSSetSolutionIndex — Method
PetscViewerCGNSSetSolutionIndex(petsclib::PetscLibType,viewer::PetscViewer, solution_id::PetscInt)Set index of solution
Not Collective
Input Parameters:
viewer-PETSCVIEWERCGNSPetscViewerfor CGNS input/output to use with the specified filesolution_id- Index of the solution id, or-1for the last solution on the file
Level: intermediate
-seealso: PETSCVIEWERCGNS, PetscViewerCGNSGetSolutionIndex(), PetscViewerCGNSGetSolutionInfo()
External Links
- PETSc Manual:
Sys/PetscViewerCGNSSetSolutionIndex
PETSc.LibPETSc.PetscViewerCheckReadable — Method
PetscViewerCheckReadable(petsclib::PetscLibType,viewer::PetscViewer)Check whether the viewer can be read from, generates an error if not
Collective
Input Parameter:
viewer- thePetscViewercontext
Level: intermediate
-seealso: , PetscViewer, PetscViewerReadable(), PetscViewerCheckWritable(), PetscViewerCreate(), PetscViewerFileSetMode(), PetscViewerFileSetType()
External Links
- PETSc Manual:
Sys/PetscViewerCheckReadable
PETSc.LibPETSc.PetscViewerCheckWritable — Method
PetscViewerCheckWritable(petsclib::PetscLibType,viewer::PetscViewer)Check whether the viewer can be written to, generates an error if not
Collective
Input Parameter:
viewer- thePetscViewercontext
Level: intermediate
-seealso: , PetscViewer, PetscViewerWritable(), PetscViewerCheckReadable(), PetscViewerCreate(), PetscViewerFileSetMode(), PetscViewerFileSetType()
External Links
- PETSc Manual:
Sys/PetscViewerCheckWritable
PETSc.LibPETSc.PetscViewerCreate — Method
inviewer::PetscViewer = PetscViewerCreate(petsclib::PetscLibType,comm::MPI_Comm)Creates a viewing context. A PetscViewer represents a file, a graphical window, a Unix socket or a variety of other ways of viewing a PETSc object
Collective
Input Parameter:
comm- MPI communicator
Output Parameter:
inviewer- location to put thePetscViewercontext
Level: advanced
-seealso: , PetscViewer, PetscViewerDestroy(), PetscViewerSetType(), PetscViewerType
External Links
- PETSc Manual:
Sys/PetscViewerCreate
PETSc.LibPETSc.PetscViewerDestroy — Method
PetscViewerDestroy(petsclib::PetscLibType,viewer::PetscViewer)Destroys a PetscViewer.
Collective
Input Parameter:
viewer- thePetscViewerto be destroyed.
Level: beginner
-seealso: , PetscViewer, PetscViewerCreate(), PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerDrawOpen()
External Links
- PETSc Manual:
Sys/PetscViewerDestroy
PETSc.LibPETSc.PetscViewerDrawBaseAdd — Method
PetscViewerDrawBaseAdd(petsclib::PetscLibType,viewer::PetscViewer, windownumber::PetscInt)add to the base integer that is added to the windownumber passed to PetscViewerDrawGetDraw()
Logically Collective
Input Parameters:
viewer- thePetscViewer(created withPetscViewerDrawOpen())windownumber- how much to add to the base
Level: developer
-seealso: , PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen(), PetscViewerDrawGetDraw(), PetscViewerDrawBaseSet()
External Links
- PETSc Manual:
Sys/PetscViewerDrawBaseAdd
PETSc.LibPETSc.PetscViewerDrawBaseSet — Method
PetscViewerDrawBaseSet(petsclib::PetscLibType,viewer::PetscViewer, windownumber::PetscInt)sets the base integer that is added to the windownumber passed to PetscViewerDrawGetDraw()
Logically Collective
Input Parameters:
viewer- thePetscViewer(created withPetscViewerDrawOpen())windownumber- value to set the base
Level: developer
-seealso: , PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen(), PetscViewerDrawGetDraw(), PetscViewerDrawBaseAdd()
External Links
- PETSc Manual:
Sys/PetscViewerDrawBaseSet
PETSc.LibPETSc.PetscViewerDrawClear — Method
PetscViewerDrawClear(petsclib::PetscLibType,viewer::PetscViewer)Clears a PetscDraw graphic associated with a PetscViewer.
Not Collective
Input Parameter:
viewer- thePetscViewer
Level: intermediate
-seealso: , PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawGetDraw(),
External Links
- PETSc Manual:
Sys/PetscViewerDrawClear
PETSc.LibPETSc.PetscViewerDrawGetBounds — Method
nbounds::PetscInt,bounds::Vector{PetscReal} = PetscViewerDrawGetBounds(petsclib::PetscLibType,viewer::PetscViewer)gets the upper and lower bounds to be used in plotting set with PetscViewerDrawSetBounds()
Collective
Input Parameter:
viewer- thePetscViewer(created withPetscViewerDrawOpen())
Output Parameters:
nbounds- number of plots that can be made with this viewer, for example the dof passed toDMDACreate()bounds- the actual bounds, the size of this is 2*nbounds, the values are stored in the order min F0, max F0, min F1, max F1, .....
Level: intermediate
-seealso: , PETSCVIEWERDRAW, PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen(), PetscViewerDrawSetBounds()
External Links
- PETSc Manual:
Sys/PetscViewerDrawGetBounds
PETSc.LibPETSc.PetscViewerDrawGetDraw — Method
PetscViewerDrawGetDraw(petsclib::PetscLibType,viewer::PetscViewer, windownumber::PetscInt, draw::PetscDraw)Returns PetscDraw object from PETSCVIEWERDRAW PetscViewer object. This PetscDraw object may then be used to perform graphics using PetscDraw commands.
Collective
Input Parameters:
viewer- thePetscViewer(created withPetscViewerDrawOpen()of typePETSCVIEWERDRAW)windownumber- indicates which subwindow (usually 0) to obtain
Output Parameter:
draw- the draw object
Level: intermediate
-seealso: , PETSCVIEWERDRAW, PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen()
External Links
- PETSc Manual:
Sys/PetscViewerDrawGetDraw
PETSc.LibPETSc.PetscViewerDrawGetDrawAxis — Method
PetscViewerDrawGetDrawAxis(petsclib::PetscLibType,viewer::PetscViewer, windownumber::PetscInt, drawaxis::PetscDrawAxis)Returns a PetscDrawAxis object from a PetscViewer object of type PETSCVIEWERDRAW. This PetscDrawAxis object may then be used to perform graphics using PetscDrawAxis commands.
Collective
Input Parameters:
viewer- thePetscViewer(created withPetscViewerDrawOpen())windownumber- indicates which subwindow (usually 0)
Output Parameter:
drawaxis- the draw axis object
Level: advanced
-seealso: , PetscViewerDrawGetDraw(), PetscViewerDrawGetLG(), PetscViewerDrawOpen()
External Links
- PETSc Manual:
Sys/PetscViewerDrawGetDrawAxis
PETSc.LibPETSc.PetscViewerDrawGetDrawLG — Method
PetscViewerDrawGetDrawLG(petsclib::PetscLibType,viewer::PetscViewer, windownumber::PetscInt, drawlg::PetscDrawLG)Returns a PetscDrawLG object from PetscViewer object of type PETSCVIEWERDRAW. This PetscDrawLG object may then be used to perform graphics using PetscDrawLG commands.
Collective
Input Parameters:
viewer- thePetscViewer(created withPetscViewerDrawOpen())windownumber- indicates which subwindow (usually 0)
Output Parameter:
drawlg- the draw line graph object
Level: intermediate
-seealso: , PetscDrawLG, PetscViewerDrawGetDraw(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen()
External Links
- PETSc Manual:
Sys/PetscViewerDrawGetDrawLG
PETSc.LibPETSc.PetscViewerDrawGetDrawType — Method
drawtype::PetscDrawType = PetscViewerDrawGetDrawType(petsclib::PetscLibType,v::PetscViewer)External Links
- PETSc Manual:
Sys/PetscViewerDrawGetDrawType
PETSc.LibPETSc.PetscViewerDrawGetHold — Method
hold::PetscBool = PetscViewerDrawGetHold(petsclib::PetscLibType,viewer::PetscViewer)Checks if the PETSCVIEWERDRAW PetscViewer holds previous image when drawing new image
Not Collective
Input Parameter:
viewer- thePetscViewer
Output Parameter:
hold- indicates to hold or not
Level: intermediate
-seealso: , PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawGetDraw(),
External Links
- PETSc Manual:
Sys/PetscViewerDrawGetHold
PETSc.LibPETSc.PetscViewerDrawGetPause — Method
pause::PetscReal = PetscViewerDrawGetPause(petsclib::PetscLibType,viewer::PetscViewer)Gets the pause value (how long to pause before an image is changed) in the PETSCVIEWERDRAW PetscViewer
Not Collective
Input Parameter:
viewer- thePetscViewer
Output Parameter:
pause- the pause value
Level: intermediate
-seealso: , PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawGetDraw(),
External Links
- PETSc Manual:
Sys/PetscViewerDrawGetPause
PETSc.LibPETSc.PetscViewerDrawGetTitle — Method
PetscViewerDrawGetTitle(petsclib::PetscLibType,v::PetscViewer, title::String)External Links
- PETSc Manual:
Sys/PetscViewerDrawGetTitle
PETSc.LibPETSc.PetscViewerDrawOpen — Method
PetscViewerDrawOpen(petsclib::PetscLibType,comm::MPI_Comm, display::String, title::String, x::Cint, y::Cint, w::Cint, h::Cint, viewer::PetscViewer)Opens a PetscDraw window for use as a PetscViewer with type PETSCVIEWERDRAW.
Collective
Input Parameters:
comm- communicator that will share windowdisplay- the X display on which to open, orNULLfor the local machinetitle- the title to put in the title bar, orNULLfor no titlex- horizontal screen coordinate of the upper left corner of window, or usePETSC_DECIDEy- vertical screen coordinate of the upper left corner of window, or usePETSC_DECIDEw- window width in pixels, or may usePETSC_DECIDEorPETSC_DRAW_FULL_SIZE,PETSC_DRAW_HALF_SIZE,PETSC_DRAW_THIRD_SIZE,PETSC_DRAW_QUARTER_SIZEh- window height in pixels, or may usePETSC_DECIDEorPETSC_DRAW_FULL_SIZE,PETSC_DRAW_HALF_SIZE,PETSC_DRAW_THIRD_SIZE,PETSC_DRAW_QUARTER_SIZE
Output Parameter:
viewer- thePetscViewer
Options Database Keys:
-draw_type- use x or null-nox- Disables all x-windows output-display <name>- Specifies name of machine for the X display-geometry <x,y,w,h>- allows setting the window location and size-draw_pause <pause>- Sets time (in seconds) that the
program pauses after PetscDrawPause() has been called (0 is default, -1 implies until user input).
Level: beginner
-seealso: , PETSCVIEWERDRAW, PetscDrawCreate(), PetscViewerDestroy(), PetscViewerDrawGetDraw(), PetscViewerCreate(), PETSC_VIEWER_DRAW_, PETSC_VIEWER_DRAW_WORLD, PETSC_VIEWER_DRAW_SELF
External Links
- PETSc Manual:
Sys/PetscViewerDrawOpen
PETSc.LibPETSc.PetscViewerDrawResize — Method
PetscViewerDrawResize(petsclib::PetscLibType,v::PetscViewer, w::Cint, h::Cint)External Links
- PETSc Manual:
Sys/PetscViewerDrawResize
PETSc.LibPETSc.PetscViewerDrawSetBounds — Method
PetscViewerDrawSetBounds(petsclib::PetscLibType,viewer::PetscViewer, nbounds::PetscInt, bounds::PetscReal)sets the upper and lower bounds to be used in plotting in a PETSCVIEWERDRAW PetscViewer
Collective
Input Parameters:
viewer- thePetscViewer(created withPetscViewerDrawOpen())nbounds- number of plots that can be made with this viewer, for example the dof passed toDMDACreate()bounds- the actual bounds, the size of this is 2*nbounds, the values are stored in the order min F0, max F0, min F1, max F1, .....
Options Database Key:
-draw_bounds minF0,maxF0,minF1,maxF1- the lower left and upper right bounds
Level: intermediate
-seealso: , PETSCVIEWERDRAW, PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen()
External Links
- PETSc Manual:
Sys/PetscViewerDrawSetBounds
PETSc.LibPETSc.PetscViewerDrawSetDrawType — Method
PetscViewerDrawSetDrawType(petsclib::PetscLibType,v::PetscViewer, drawtype::PetscDrawType)External Links
- PETSc Manual:
Sys/PetscViewerDrawSetDrawType
PETSc.LibPETSc.PetscViewerDrawSetHold — Method
PetscViewerDrawSetHold(petsclib::PetscLibType,viewer::PetscViewer, hold::PetscBool)Holds previous image when drawing new image in a PETSCVIEWERDRAW
Not Collective
Input Parameters:
viewer- thePetscViewerhold-PETSC_TRUEindicates to hold the previous image
Level: intermediate
-seealso: , PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawGetDraw(),
External Links
- PETSc Manual:
Sys/PetscViewerDrawSetHold
PETSc.LibPETSc.PetscViewerDrawSetInfo — Method
PetscViewerDrawSetInfo(petsclib::PetscLibType,v::PetscViewer, display::String, title::String, x::Cint, y::Cint, w::Cint, h::Cint)External Links
- PETSc Manual:
Sys/PetscViewerDrawSetInfo
PETSc.LibPETSc.PetscViewerDrawSetPause — Method
PetscViewerDrawSetPause(petsclib::PetscLibType,viewer::PetscViewer, pause::PetscReal)Sets a pause for each PetscDraw in the PETSCVIEWERDRAW PetscViewer
Not Collective
Input Parameters:
viewer- thePetscViewerpause- the pause value
Level: intermediate
-seealso: , PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawGetDraw(),
External Links
- PETSc Manual:
Sys/PetscViewerDrawSetPause
PETSc.LibPETSc.PetscViewerDrawSetTitle — Method
PetscViewerDrawSetTitle(petsclib::PetscLibType,v::PetscViewer, title::String)External Links
- PETSc Manual:
Sys/PetscViewerDrawSetTitle
PETSc.LibPETSc.PetscViewerExodusIIGetId — Method
PetscViewerExodusIIGetId(petsclib::PetscLibType,viewer::PetscViewer, exoid::Cint)Get the file id of the PETSCVIEWEREXODUSII file
Logically Collective
Input Parameter:
viewer- thePetscViewer
Output Parameter:
exoid- The ExodusII file id
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIGetId
PETSc.LibPETSc.PetscViewerExodusIIGetNodalVariable — Method
PetscViewerExodusIIGetNodalVariable(petsclib::PetscLibType,viewer::PetscViewer, num::PetscExodusIIInt)Gets the number of nodal variables in an ExodusII file
Collective
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSII
Output Parameter:
num- the number variables in the ExodusII file
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIISetNodalVariable()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIGetNodalVariable
PETSc.LibPETSc.PetscViewerExodusIIGetNodalVariableIndex — Method
PetscViewerExodusIIGetNodalVariableIndex(petsclib::PetscLibType,viewer::PetscViewer, name::String, varIndex::PetscExodusIIInt)return the location of a nodal variable in an ExodusII file given its name
Collective
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIIname- the name of the result
Output Parameter:
varIndex- the location of the variable in the exodus file or -1 if the variable is not found
Level: beginner
-seealso: PetscViewerExodusIISetNodalVariable(), PetscViewerExodusIIGetNodalVariable(), PetscViewerExodusIISetNodalVariableName(), PetscViewerExodusIISetNodalVariableNames(), PetscViewerExodusIIGetNodalVariableName(), PetscViewerExodusIIGetNodalVariableNames()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIGetNodalVariableIndex
PETSc.LibPETSc.PetscViewerExodusIIGetNodalVariableName — Method
PetscViewerExodusIIGetNodalVariableName(petsclib::PetscLibType,viewer::PetscViewer, idx::PetscExodusIIInt, name::String)Gets the name of a nodal variable.
Collective;
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIIidx- the index for which you want to save the name
Output Parameter:
name- string array containing name characters
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIISetNodalVariableName()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIGetNodalVariableName
PETSc.LibPETSc.PetscViewerExodusIIGetNodalVariableNames — Method
PetscViewerExodusIIGetNodalVariableNames(petsclib::PetscLibType,viewer::PetscViewer, numVars::PetscExodusIIInt, varNames::String)Gets the names of all nodal variables.
Collective; No Fortran Support
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIInumVars- the number of nodal variable names to retrieve
Output Parameter:
varNames- returns an array of char pointers where the nodal variable names are
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIISetNodalVariableNames()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIGetNodalVariableNames
PETSc.LibPETSc.PetscViewerExodusIIGetOrder — Method
PetscViewerExodusIIGetOrder(petsclib::PetscLibType,viewer::PetscViewer, order::PetscInt)Get the elements order in the ExodusII file.
Collective
Input Parameters:
viewer- thePETSCVIEWEREXODUSIIviewerorder- elements order
Output Parameter:
Level: beginner
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerExodusIIGetId(), PetscViewerExodusIISetOrder()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIGetOrder
PETSc.LibPETSc.PetscViewerExodusIIGetZonalVariable — Method
PetscViewerExodusIIGetZonalVariable(petsclib::PetscLibType,viewer::PetscViewer, num::PetscExodusIIInt)Gets the number of zonal variables in an ExodusII file
Collective
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSII
Output Parameter:
num- the number variables in the ExodusII file
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIsetZonalVariable()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIGetZonalVariable
PETSc.LibPETSc.PetscViewerExodusIIGetZonalVariableIndex — Method
PetscViewerExodusIIGetZonalVariableIndex(petsclib::PetscLibType,viewer::PetscViewer, name::String, varIndex::Cint)return the location of a zonal variable in an ExodusII file given its name
Collective
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIIname- the name of the result
Output Parameter:
varIndex- the location of the variable in the exodus file or -1 if the variable is not found
Level: beginner
-seealso: PetscViewerExodusIISetNodalVariable(), PetscViewerExodusIIGetNodalVariable(), PetscViewerExodusIISetNodalVariableName(), PetscViewerExodusIISetNodalVariableNames(), PetscViewerExodusIIGetNodalVariableName(), PetscViewerExodusIIGetNodalVariableNames()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIGetZonalVariableIndex
PETSc.LibPETSc.PetscViewerExodusIIGetZonalVariableName — Method
PetscViewerExodusIIGetZonalVariableName(petsclib::PetscLibType,viewer::PetscViewer, idx::PetscExodusIIInt, name::String)Gets the name of a zonal variable.
Collective;
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIIidx- the index for which you want to get the name
Output Parameter:
name- pointer to the string containing the name characters
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIISetZonalVariableName()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIGetZonalVariableName
PETSc.LibPETSc.PetscViewerExodusIIGetZonalVariableNames — Method
PetscViewerExodusIIGetZonalVariableNames(petsclib::PetscLibType,viewer::PetscViewer, numVars::PetscExodusIIInt, varNames::String)Gets the names of all zonal variables.
Collective; No Fortran Support
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIInumVars- the number of zonal variable names to retrieve
Output Parameter:
varNames- returns an array of char pointers where the zonal variable names are
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIISetZonalVariableNames()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIGetZonalVariableNames
PETSc.LibPETSc.PetscViewerExodusIIOpen — Method
PetscViewerExodusIIOpen(petsclib::PetscLibType,comm::MPI_Comm, name::String, type::PetscFileMode, exo::PetscViewer)Opens a file for ExodusII input/output.
Collective
Input Parameters:
comm- MPI communicatorname- name of filetype- type of file
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerPushFormat(), PetscViewerDestroy(), DMLoad(), PetscFileMode, PetscViewerSetType(), PetscViewerFileSetMode(), PetscViewerFileSetName()
External Links
- PETSc Manual:
DM/PetscViewerExodusIIOpen
PETSc.LibPETSc.PetscViewerExodusIISetNodalVariable — Method
PetscViewerExodusIISetNodalVariable(petsclib::PetscLibType,viewer::PetscViewer, num::PetscExodusIIInt)Sets the number of nodal variables in an ExodusII file
Collective;
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIInum- the number of nodal variables in the ExodusII file
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetNodalVariable()
External Links
- PETSc Manual:
DM/PetscViewerExodusIISetNodalVariable
PETSc.LibPETSc.PetscViewerExodusIISetNodalVariableName — Method
PetscViewerExodusIISetNodalVariableName(petsclib::PetscLibType,viewer::PetscViewer, idx::PetscExodusIIInt, name::String)Sets the name of a nodal variable.
Collective;
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIIidx- the index for which you want to save the namename- string containing the name characters
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetNodalVariableName()
External Links
- PETSc Manual:
DM/PetscViewerExodusIISetNodalVariableName
PETSc.LibPETSc.PetscViewerExodusIISetNodalVariableNames — Method
PetscViewerExodusIISetNodalVariableNames(petsclib::PetscLibType,viewer::PetscViewer, names::String)Sets the names of all nodal variables.
Collective; No Fortran Support
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIInames- an array of string names to be set, the strings are copied into thePetscViewer
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetNodalVariableNames()
External Links
- PETSc Manual:
DM/PetscViewerExodusIISetNodalVariableNames
PETSc.LibPETSc.PetscViewerExodusIISetOrder — Method
PetscViewerExodusIISetOrder(petsclib::PetscLibType,viewer::PetscViewer, order::PetscInt)Set the elements order in the ExodusII file.
Collective
Input Parameters:
viewer- thePETSCVIEWEREXODUSIIviewerorder- elements order
Output Parameter:
Level: beginner
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerExodusIIGetId(), PetscViewerExodusIIGetOrder()
External Links
- PETSc Manual:
DM/PetscViewerExodusIISetOrder
PETSc.LibPETSc.PetscViewerExodusIISetZonalVariable — Method
PetscViewerExodusIISetZonalVariable(petsclib::PetscLibType,viewer::PetscViewer, num::PetscExodusIIInt)Sets the number of zonal variables in an ExodusII file
Collective;
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIInum- the number of zonal variables in the ExodusII file
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetZonalVariable()
External Links
- PETSc Manual:
DM/PetscViewerExodusIISetZonalVariable
PETSc.LibPETSc.PetscViewerExodusIISetZonalVariableName — Method
PetscViewerExodusIISetZonalVariableName(petsclib::PetscLibType,viewer::PetscViewer, idx::PetscExodusIIInt, name::String)Sets the name of a zonal variable.
Collective;
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIIidx- the index for which you want to save the namename- string containing the name characters
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetZonalVariableName()
External Links
- PETSc Manual:
DM/PetscViewerExodusIISetZonalVariableName
PETSc.LibPETSc.PetscViewerExodusIISetZonalVariableNames — Method
PetscViewerExodusIISetZonalVariableNames(petsclib::PetscLibType,viewer::PetscViewer, names::String)Sets the names of all nodal variables
Collective; No Fortran Support
Input Parameters:
viewer- aPetscViewerof typePETSCVIEWEREXODUSIInames- an array of string names to be set, the strings are copied into thePetscViewer
Level: intermediate
-seealso: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetZonalVariableNames()
External Links
- PETSc Manual:
DM/PetscViewerExodusIISetZonalVariableNames
PETSc.LibPETSc.PetscViewerFileGetMode — Method
PetscViewerFileGetMode(petsclib::PetscLibType,viewer::PetscViewer, mode::PetscFileMode)Gets the open mode of a file associated with a PetscViewer
Not Collective
Input Parameter:
viewer- thePetscViewer; must be aPETSCVIEWERBINARY,PETSCVIEWERMATLAB,PETSCVIEWERHDF5, orPETSCVIEWERASCIIPetscViewer
Output Parameter:
mode- open mode of file
-seealso: , PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen()
External Links
- PETSc Manual:
Sys/PetscViewerFileGetMode
PETSc.LibPETSc.PetscViewerFileGetName — Method
PetscViewerFileGetName(petsclib::PetscLibType,viewer::PetscViewer, name::String)Gets the name of the file the PetscViewer is using
Not Collective
Input Parameter:
viewer- thePetscViewer
Output Parameter:
name- the name of the file it is using
Level: advanced
-seealso: , PetscViewerCreate(), PetscViewerSetType(), PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), PetscViewerFileSetName()
External Links
- PETSc Manual:
Sys/PetscViewerFileGetName
PETSc.LibPETSc.PetscViewerFileSetMode — Method
PetscViewerFileSetMode(petsclib::PetscLibType,viewer::PetscViewer, mode::PetscFileMode)Sets the open mode of file
Logically Collective
Input Parameters:
viewer- thePetscViewer; must be aPETSCVIEWERBINARY,PETSCVIEWERMATLAB,PETSCVIEWERHDF5, orPETSCVIEWERASCIIPetscViewermode- open mode of file
-seealso: , PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen()
External Links
- PETSc Manual:
Sys/PetscViewerFileSetMode
PETSc.LibPETSc.PetscViewerFileSetName — Method
PetscViewerFileSetName(petsclib::PetscLibType,viewer::PetscViewer, name::String)Sets the name of the file the PetscViewer should use.
Collective
Input Parameters:
viewer- thePetscViewer; for example, of typePETSCVIEWERASCIIorPETSCVIEWERBINARYname- the name of the file it should use
Level: advanced
-seealso: , PetscViewerCreate(), PetscViewerSetType(), PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), PetscViewerDestroy(), PetscViewerASCIIGetPointer(), PetscViewerASCIIPrintf(), PetscViewerASCIISynchronizedPrintf()
External Links
- PETSc Manual:
Sys/PetscViewerFileSetName
PETSc.LibPETSc.PetscViewerFinalizePackage — Method
PetscViewerFinalizePackage(petsclib::PetscLibType)This function destroys any global objects created in PETSc viewers. It is called from PetscFinalize().
Level: developer
-seealso: , PetscViewer, PetscFinalize(), PetscViewerInitializePackage()
External Links
- PETSc Manual:
Sys/PetscViewerFinalizePackage
PETSc.LibPETSc.PetscViewerFlowControlEndMain — Method
mcnt::PetscInt = PetscViewerFlowControlEndMain(petsclib::PetscLibType,viewer::PetscViewer)External Links
- PETSc Manual:
Sys/PetscViewerFlowControlEndMain
PETSc.LibPETSc.PetscViewerFlowControlEndWorker — Method
mcnt::PetscInt = PetscViewerFlowControlEndWorker(petsclib::PetscLibType,viewer::PetscViewer)External Links
- PETSc Manual:
Sys/PetscViewerFlowControlEndWorker
PETSc.LibPETSc.PetscViewerFlowControlStart — Method
mcnt::PetscInt,cnt::PetscInt = PetscViewerFlowControlStart(petsclib::PetscLibType,viewer::PetscViewer)External Links
- PETSc Manual:
Sys/PetscViewerFlowControlStart
PETSc.LibPETSc.PetscViewerFlowControlStepMain — Method
mcnt::PetscInt = PetscViewerFlowControlStepMain(petsclib::PetscLibType,viewer::PetscViewer, i::PetscInt, cnt::PetscInt)External Links
- PETSc Manual:
Sys/PetscViewerFlowControlStepMain
PETSc.LibPETSc.PetscViewerFlowControlStepWorker — Method
mcnt::PetscInt = PetscViewerFlowControlStepWorker(petsclib::PetscLibType,viewer::PetscViewer, rank::PetscMPIInt)External Links
- PETSc Manual:
Sys/PetscViewerFlowControlStepWorker
PETSc.LibPETSc.PetscViewerFlush — Method
PetscViewerFlush(petsclib::PetscLibType,viewer::PetscViewer)Flushes a PetscViewer (i.e. tries to dump all the data that has been printed through a PetscViewer).
Collective
Input Parameter:
viewer- thePetscViewerto be flushed
Level: intermediate
-seealso: , PetscViewer, PetscViewerWriteable(), PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType()
External Links
- PETSc Manual:
Sys/PetscViewerFlush
PETSc.LibPETSc.PetscViewerGLVisOpen — Method
PetscViewerGLVisOpen(petsclib::PetscLibType,comm::MPI_Comm, type::PetscViewerGLVisType, name::String, port::PetscInt, viewer::PetscViewer)Opens a PETSCVIEWERGLVIS PetscViewer
Collective; No Fortran Support
Input Parameters:
comm- the MPI communicatortype- the viewer type:PETSC_VIEWER_GLVIS_SOCKETfor real-time visualization orPETSC_VIEWER_GLVIS_DUMPfor dumping to a filename- either the hostname where the GLVis server is running or the base filename for dumping the data for subsequent visualizationsport- socket port where the GLVis server is listening. Not referenced when type isPETSC_VIEWER_GLVIS_DUMP
Output Parameter:
viewer- thePetscViewerobject
Options Database Keys:
-glvis_precision <precision>- Sets number of digits for floating point values-glvis_size <width,height>- Sets the window size (in pixels)-glvis_pause <pause>- Sets time (in seconds) that the program pauses after each visualization
(0 is default, -1 implies every visualization)
-glvis_keys- Additional keys to configure visualization-glvis_exec- Additional commands to configure visualization
Level: beginner
-seealso: , PETSCVIEWERGLVIS, PetscViewerCreate(), PetscViewerSetType(), PetscViewerGLVisType
External Links
- PETSc Manual:
Sys/PetscViewerGLVisOpen
PETSc.LibPETSc.PetscViewerGLVisSetFields — Method
PetscViewerGLVisSetFields(petsclib::PetscLibType,viewer::PetscViewer, nf::PetscInt, fec_type::String, dim::Vector{PetscInt}, g2l::external, Vfield::Vector{PetscObject}, ctx::Cvoid, destroyctx::external)Sets the required information to visualize different fields from a vector.
Logically Collective
Input Parameters:
viewer- thePetscViewerof typePETSCVIEWERGLVISnf- number of fields to be visualizedfec_type- the type of finite element to be used to visualize the data (see FiniteElementCollection::Name() in MFEM)dim- array of space dimension for field vectors (used to initialize the scene)g2l- User routine to compute the local field vectors to be visualized; PetscObject is used in place of Vec on the prototypeVfield- array of work vectors, one for each fieldctx- User context to store the relevant data to apply g2lfieldsdestroyctx- Destroy function for userctx
Level: intermediate
-seealso: , PETSCVIEWERGLVIS, PetscViewerGLVisOpen(), PetscViewerCreate(), PetscViewerSetType(), PetscObjectSetName()
External Links
- PETSc Manual:
Sys/PetscViewerGLVisSetFields
PETSc.LibPETSc.PetscViewerGLVisSetPrecision — Method
PetscViewerGLVisSetPrecision(petsclib::PetscLibType,viewer::PetscViewer, prec::PetscInt)Set the number of digits for floating point values to be displayed
Not Collective
Input Parameters:
viewer- thePetscViewerof typePETSCVIEWERGLVISprec- the number of digits required
Level: beginner
-seealso: , PETSCVIEWERGLVIS, PetscViewerGLVisOpen(), PetscViewerGLVisSetFields(), PetscViewerCreate(), PetscViewerSetType()
External Links
- PETSc Manual:
Sys/PetscViewerGLVisSetPrecision
PETSc.LibPETSc.PetscViewerGLVisSetSnapId — Method
PetscViewerGLVisSetSnapId(petsclib::PetscLibType,viewer::PetscViewer, id::PetscInt)Set the snapshot id. Only relevant when the PetscViewerGLVisType is PETSC_VIEWER_GLVIS_DUMP
Logically Collective
Input Parameters:
viewer- thePetscViewerof typePETSCVIEWERGLVISid- the current snapshot id in a time-dependent simulation
Level: beginner
-seealso: , PETSCVIEWERGLVIS, PetscViewerGLVisOpen(), PetscViewerGLVisSetFields(), PetscViewerCreate(), PetscViewerSetType()
External Links
- PETSc Manual:
Sys/PetscViewerGLVisSetSnapId
PETSc.LibPETSc.PetscViewerGetFormat — Method
PetscViewerGetFormat(petsclib::PetscLibType,viewer::PetscViewer, format::PetscViewerFormat)Gets the current format for PetscViewer.
Not Collective
Input Parameter:
viewer- thePetscViewer
Output Parameter:
format- the format
Level: intermediate
-seealso: , PetscViewer, PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), MatView(), VecView(), PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat(), PetscViewerDrawOpen(), PetscViewerSocketOpen()
External Links
- PETSc Manual:
Sys/PetscViewerGetFormat
PETSc.LibPETSc.PetscViewerGetOptionsPrefix — Method
PetscViewerGetOptionsPrefix(petsclib::PetscLibType,viewer::PetscViewer, prefix::String)Gets the prefix used for searching for PetscViewer options in the database during PetscViewerSetFromOptions().
Not Collective
Input Parameter:
viewer- thePetscViewercontext
Output Parameter:
prefix- pointer to the prefix string used
Level: advanced
-seealso: , PetscViewer, PetscViewerAppendOptionsPrefix(), PetscViewerSetOptionsPrefix()
External Links
- PETSc Manual:
Sys/PetscViewerGetOptionsPrefix
PETSc.LibPETSc.PetscViewerGetSubViewer — Method
PetscViewerGetSubViewer(petsclib::PetscLibType,viewer::PetscViewer, comm::MPI_Comm, outviewer::PetscViewer)Creates a new PetscViewer (same type as the old) that lives on a subcommunicator of the original viewer's communicator
Collective
Input Parameters:
viewer- thePetscViewerto be reproducedcomm- the sub communicator to use
Output Parameter:
outviewer- newPetscViewer
Level: advanced
-seealso: , PetscViewer, PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscViewerFlush(), PetscViewerRestoreSubViewer()
External Links
- PETSc Manual:
Sys/PetscViewerGetSubViewer
PETSc.LibPETSc.PetscViewerGetType — Method
type::PetscViewerType = PetscViewerGetType(petsclib::PetscLibType,viewer::PetscViewer)Returns the type of a PetscViewer.
Not Collective
Input Parameter:
viewer- thePetscViewer
Output Parameter:
type-PetscViewerType
Level: intermediate
-seealso: , PetscViewerType, PetscViewer, PetscViewerCreate(), PetscViewerSetType()
External Links
- PETSc Manual:
Sys/PetscViewerGetType
PETSc.LibPETSc.PetscViewerHDF5GetBaseDimension2 — Method
flg::PetscBool = PetscViewerHDF5GetBaseDimension2(petsclib::PetscLibType,viewer::PetscViewer)Vectors of 1 dimension (i.e. bs/dof is 1) will be saved in the HDF5 file with a dimension of 2.
Logically Collective
Input Parameter:
viewer- thePetscViewer, must bePETSCVIEWERHDF5
Output Parameter:
flg- ifPETSC_TRUEthe vector will always have at least a dimension of 2 even if that first dimension is of size 1
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5GetBaseDimension2
PETSc.LibPETSc.PetscViewerHDF5GetCollective — Method
flg::PetscBool = PetscViewerHDF5GetCollective(petsclib::PetscLibType,viewer::PetscViewer)Return flag whether collective MPI
Not Collective
Input Parameter:
viewer- thePETSCVIEWERHDF5PetscViewer
Output Parameter:
flg- the flag
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5SetCollective(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerHDF5Open()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5GetCollective
PETSc.LibPETSc.PetscViewerHDF5GetCompress — Method
flg::PetscBool = PetscViewerHDF5GetCompress(petsclib::PetscLibType,viewer::PetscViewer)Get the flag for compression
Not Collective
Input Parameter:
viewer- thePetscViewerof typePETSCVIEWERHDF5
Output Parameter:
flg- ifPETSC_TRUEwe will turn on compression
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5SetCompress()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5GetCompress
PETSc.LibPETSc.PetscViewerHDF5GetDMPlexStorageVersionReading — Method
PetscViewerHDF5GetDMPlexStorageVersionReading(petsclib::PetscLibType,viewer::PetscViewer, version::DMPlexStorageVersion)Get the storage version for reading
Logically collective
Input Parameter:
viewer- ThePetscViewer
Output Parameter:
version- The storage format version
Options Database Keys:
-dm_plex_view_hdf5_storage_version <num>- Overrides the storage format version
Level: advanced
Note: The version has major, minor, and subminor integers. Parallel operations are only available for version 3.0.0.
See also:
DM, PetscViewerHDF5SetDMPlexStorageVersionReading(), PetscViewerHDF5GetDMPlexStorageVersionWriting(), PetscViewerHDF5SetDMPlexStorageVersionWriting()
External Links
- PETSc Manual:
DM/PetscViewerHDF5GetDMPlexStorageVersionReading
PETSc.LibPETSc.PetscViewerHDF5GetDMPlexStorageVersionWriting — Method
PetscViewerHDF5GetDMPlexStorageVersionWriting(petsclib::PetscLibType,viewer::PetscViewer, version::DMPlexStorageVersion)Get the storage version for writing
Logically collective
Input Parameter:
viewer- ThePetscViewer
Output Parameter:
version- The storage format version
Options Database Keys:
-dm_plex_view_hdf5_storage_version <num>- Overrides the storage format version
Level: advanced
Note: The version has major, minor, and subminor integers. Parallel operations are only available for version 3.0.0.
See also:
DM, PetscViewerHDF5SetDMPlexStorageVersionWriting(), PetscViewerHDF5GetDMPlexStorageVersionReading(), PetscViewerHDF5SetDMPlexStorageVersionReading()
External Links
- PETSc Manual:
DM/PetscViewerHDF5GetDMPlexStorageVersionWriting
PETSc.LibPETSc.PetscViewerHDF5GetDefaultTimestepping — Method
flg::PetscBool = PetscViewerHDF5GetDefaultTimestepping(petsclib::PetscLibType,viewer::PetscViewer)Get the flag for default timestepping
Not Collective
Input Parameter:
viewer- thePetscViewerof typePETSCVIEWERHDF5
Output Parameter:
flg- ifPETSC_TRUEwe will assume that timestepping is on
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5SetDefaultTimestepping(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5GetTimestep()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5GetDefaultTimestepping
PETSc.LibPETSc.PetscViewerHDF5GetFileId — Method
PetscViewerHDF5GetFileId(petsclib::PetscLibType,viewer::PetscViewer, file_id::hid_t)Retrieve the file id, this file ID then can be used in direct HDF5 calls
Not Collective
Input Parameter:
viewer- thePetscViewer
Output Parameter:
file_id- The file id
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5GetFileId
PETSc.LibPETSc.PetscViewerHDF5GetGroup — Method
PetscViewerHDF5GetGroup(petsclib::PetscLibType,viewer::PetscViewer, path::String, abspath::String)Get the current HDF5 group name (full path), set with PetscViewerHDF5PushGroup()/PetscViewerHDF5PopGroup().
Not Collective
Input Parameters:
viewer- thePetscViewerof typePETSCVIEWERHDF5path- (Optional) The path relative to the pushed group
Output Parameter:
abspath- The absolute HDF5 path (group)
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5OpenGroup(), PetscViewerHDF5WriteGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5GetGroup
PETSc.LibPETSc.PetscViewerHDF5GetSPOutput — Method
flg::PetscBool = PetscViewerHDF5GetSPOutput(petsclib::PetscLibType,viewer::PetscViewer)Data is written to disk in single precision even if PETSc is compiled with double precision PetscReal.
Logically Collective
Input Parameter:
viewer- the PetscViewer, must be of typePETSCVIEWERHDF5
Output Parameter:
flg- ifPETSC_TRUEthe data will be written to disk with single precision
Level: intermediate
-seealso: , PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen(), PetscReal, PetscViewerHDF5SetSPOutput()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5GetSPOutput
PETSc.LibPETSc.PetscViewerHDF5GetTimestep — Method
timestep::PetscInt = PetscViewerHDF5GetTimestep(petsclib::PetscLibType,viewer::PetscViewer)Get the current timestep for the HDF5 output. Fields are stacked in time.
Not Collective
Input Parameter:
viewer- thePetscViewerof typePETSCVIEWERHDF5
Output Parameter:
timestep- The timestep
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5IncrementTimestep(), PetscViewerHDF5SetTimestep()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5GetTimestep
PETSc.LibPETSc.PetscViewerHDF5HasAttribute — Method
has::PetscBool = PetscViewerHDF5HasAttribute(petsclib::PetscLibType,viewer::PetscViewer, parent::String, name::String)Check whether an attribute exists
Collective
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewerparent- The parent dataset/group namename- The attribute name
Output Parameter:
has- Flag for attribute existence
Level: advanced
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5HasObjectAttribute(), PetscViewerHDF5WriteAttribute(), PetscViewerHDF5ReadAttribute(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5HasAttribute
PETSc.LibPETSc.PetscViewerHDF5HasDataset — Method
has::PetscBool = PetscViewerHDF5HasDataset(petsclib::PetscLibType,viewer::PetscViewer, path::String)Check whether a given dataset exists in the HDF5 file
Collective
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewerpath- The dataset path
Output Parameter:
has- Flag whether dataset exists
Level: advanced
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5HasObject(), PetscViewerHDF5HasAttribute(), PetscViewerHDF5HasGroup(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5HasDataset
PETSc.LibPETSc.PetscViewerHDF5HasGroup — Method
has::PetscBool = PetscViewerHDF5HasGroup(petsclib::PetscLibType,viewer::PetscViewer, path::String)Check whether the current (pushed) group exists in the HDF5 file
Collective
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewerpath- (Optional) The path relative to the pushed group
Output Parameter:
has- Flag for group existence
Level: advanced
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5HasAttribute(), PetscViewerHDF5HasDataset(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup(), PetscViewerHDF5OpenGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5HasGroup
PETSc.LibPETSc.PetscViewerHDF5HasObject — Method
has::PetscBool = PetscViewerHDF5HasObject(petsclib::PetscLibType,viewer::PetscViewer, obj::PetscObject)Check whether a dataset with the same name as given object exists in the HDF5 file under current group
Collective
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewerobj- The named object
Output Parameter:
has- Flag for dataset existence
Level: advanced
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5HasDataset(), PetscViewerHDF5HasAttribute(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5HasObject
PETSc.LibPETSc.PetscViewerHDF5HasObjectAttribute — Method
has::PetscBool = PetscViewerHDF5HasObjectAttribute(petsclib::PetscLibType,viewer::PetscViewer, obj::PetscObject, name::String)Check whether an attribute is attached to the dataset matching the given PetscObject by name
Collective
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewerobj- The object whose name is used to lookup the parent dataset, relative to the current group.name- The attribute name
Output Parameter:
has- Flag for attribute existence
Level: advanced
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5HasAttribute(), PetscViewerHDF5WriteObjectAttribute(), PetscViewerHDF5ReadObjectAttribute(), PetscViewerHDF5HasObject(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5HasObjectAttribute
PETSc.LibPETSc.PetscViewerHDF5IncrementTimestep — Method
PetscViewerHDF5IncrementTimestep(petsclib::PetscLibType,viewer::PetscViewer)Increments current timestep for the HDF5 output. Fields are stacked in time.
Not Collective
Input Parameter:
viewer- thePetscViewerof typePETSCVIEWERHDF5
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5SetTimestep(), PetscViewerHDF5GetTimestep()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5IncrementTimestep
PETSc.LibPETSc.PetscViewerHDF5IsTimestepping — Method
flg::PetscBool = PetscViewerHDF5IsTimestepping(petsclib::PetscLibType,viewer::PetscViewer)Ask the viewer whether it is in timestepping mode currently.
Not Collective
Input Parameter:
viewer- thePetscViewerof typePETSCVIEWERHDF5
Output Parameter:
flg- is timestepping active?
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5PopTimestepping(), PetscViewerHDF5SetTimestep(), PetscViewerHDF5IncrementTimestep(), PetscViewerHDF5GetTimestep()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5IsTimestepping
PETSc.LibPETSc.PetscViewerHDF5Load — Method
PetscViewerHDF5Load(petsclib::PetscLibType,viewer::PetscViewer, name::String, map::PetscLayout, datatype::hid_t, newarr::Cvoid)Read a raw array from the PETSCVIEWERHDF5 dataset in parallel
Collective; No Fortran Support
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewername- The dataset namedatatype- The HDF5 datatype of the items in the dataset
Input/Output Parameter:
map- The layout which specifies array partitioning, on output the
set up layout (with global size and blocksize according to dataset)
Output Parameter:
newarr- The partitioned array, a memory image of the given dataset
Level: developer
-seealso: PetscViewer, PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushGroup(), PetscViewerHDF5OpenGroup(), PetscViewerHDF5ReadSizes(), VecLoad(), ISLoad(), PetscLayout
External Links
- PETSc Manual:
Sys/PetscViewerHDF5Load
PETSc.LibPETSc.PetscViewerHDF5Open — Method
PetscViewerHDF5Open(petsclib::PetscLibType,comm::MPI_Comm, name::String, type::PetscFileMode, hdf5v::PetscViewer)Opens a file for HDF5 input/output as a PETSCVIEWERHDF5 PetscViewer
Collective
Input Parameters:
comm- MPI communicatorname- name of filetype- type of file
Output Parameter:
hdf5v-PetscViewerfor HDF5 input/output to use with the specified file
Options Database Keys:
-viewer_hdf5_base_dimension2- turns on (true) or off (false) using a dimension of 2 in the HDF5 file even if the bs/dof of the vector is 1-viewer_hdf5_sp_output- forces (if true) the viewer to write data in single precision independent on the precision of PetscReal
Level: beginner
-seealso: , PETSCVIEWERHDF5, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), PetscViewerHDF5SetBaseDimension2(), PetscViewerHDF5SetSPOutput(), PetscViewerHDF5GetBaseDimension2(), VecView(), MatView(), VecLoad(), MatLoad(), PetscFileMode, PetscViewer, PetscViewerSetType(), PetscViewerFileSetMode(), PetscViewerFileSetName()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5Open
PETSc.LibPETSc.PetscViewerHDF5OpenGroup — Method
PetscViewerHDF5OpenGroup(petsclib::PetscLibType,viewer::PetscViewer, path::String, fileId::hid_t, groupId::hid_t)Open the HDF5 group with the name (full path) returned by PetscViewerHDF5GetGroup(), and return this group's ID and file ID. If PetscViewerHDF5GetGroup() yields NULL, then group ID is file ID.
Not Collective
Input Parameters:
viewer- thePetscViewerof typePETSCVIEWERHDF5path- (Optional) The path relative to the pushed group
Output Parameters:
fileId- The HDF5 file IDgroupId- The HDF5 group ID
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup(), PetscViewerHDF5WriteGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5OpenGroup
PETSc.LibPETSc.PetscViewerHDF5PathIsRelative — Method
has::PetscBool = PetscViewerHDF5PathIsRelative(petsclib::PetscLibType,path::String, emptyIsRelative::PetscBool)External Links
- PETSc Manual:
Viewer/PetscViewerHDF5PathIsRelative
PETSc.LibPETSc.PetscViewerHDF5PopGroup — Method
PetscViewerHDF5PopGroup(petsclib::PetscLibType,viewer::PetscViewer)Return the current HDF5 group for output to the previous value
Not Collective
Input Parameter:
viewer- thePetscViewerof typePETSCVIEWERHDF5
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushGroup(), PetscViewerHDF5GetGroup(), PetscViewerHDF5OpenGroup(), PetscViewerHDF5WriteGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5PopGroup
PETSc.LibPETSc.PetscViewerHDF5PopTimestepping — Method
PetscViewerHDF5PopTimestepping(petsclib::PetscLibType,viewer::PetscViewer)Deactivate timestepping mode for subsequent HDF5 reading and writing.
Not Collective
Input Parameter:
viewer- thePetscViewerof typePETSCVIEWERHDF5
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5IsTimestepping(), PetscViewerHDF5SetTimestep(), PetscViewerHDF5IncrementTimestep(), PetscViewerHDF5GetTimestep()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5PopTimestepping
PETSc.LibPETSc.PetscViewerHDF5PushGroup — Method
PetscViewerHDF5PushGroup(petsclib::PetscLibType,viewer::PetscViewer, name::String)Set the current HDF5 group for output
Not Collective
Input Parameters:
viewer- thePetscViewerof typePETSCVIEWERHDF5name- The group name
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup(), PetscViewerHDF5OpenGroup(), PetscViewerHDF5WriteGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5PushGroup
PETSc.LibPETSc.PetscViewerHDF5PushTimestepping — Method
PetscViewerHDF5PushTimestepping(petsclib::PetscLibType,viewer::PetscViewer)Activate timestepping mode for subsequent HDF5 reading and writing.
Not Collective
Input Parameter:
viewer- thePetscViewerof typePETSCVIEWERHDF5
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PopTimestepping(), PetscViewerHDF5IsTimestepping(), PetscViewerHDF5SetTimestep(), PetscViewerHDF5IncrementTimestep(), PetscViewerHDF5GetTimestep()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5PushTimestepping
PETSc.LibPETSc.PetscViewerHDF5ReadAttribute — Method
PetscViewerHDF5ReadAttribute(petsclib::PetscLibType,viewer::PetscViewer, parent::String, name::String, datatype::PetscDataType, defaultValue::Cvoid, value::Cvoid)Read an attribute
Collective
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewerparent- The parent dataset/group namename- The attribute namedatatype- The attribute typedefaultValue- The pointer to the default value
Output Parameter:
value- The pointer to the read HDF5 attribute value
Level: advanced
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5ReadObjectAttribute(), PetscViewerHDF5WriteAttribute(), PetscViewerHDF5HasAttribute(), PetscViewerHDF5HasObject(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5ReadAttribute
PETSc.LibPETSc.PetscViewerHDF5ReadObjectAttribute — Method
PetscViewerHDF5ReadObjectAttribute(petsclib::PetscLibType,viewer::PetscViewer, obj::PetscObject, name::String, datatype::PetscDataType, defaultValue::Cvoid, value::Cvoid)Read an attribute from the dataset matching the given PetscObject by name
Collective
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewerobj- The object whose name is used to lookup the parent dataset, relative to the current group.name- The attribute namedatatype- The attribute typedefaultValue- The default attribute value
Output Parameter:
value- The attribute value
Level: advanced
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5ReadAttribute() PetscViewerHDF5WriteObjectAttribute(), PetscViewerHDF5HasObjectAttribute(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5ReadObjectAttribute
PETSc.LibPETSc.PetscViewerHDF5ReadSizes — Method
bs::PetscInt,N::PetscInt = PetscViewerHDF5ReadSizes(petsclib::PetscLibType,viewer::PetscViewer, name::String)Read block size and global size of a Vec or IS stored in an HDF5 file.
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewername- The dataset name
Output Parameters:
bs- block sizeN- global size
Level: advanced
-seealso: PetscViewer, PETSCVIEWERHDF5, PetscViewerHDF5Open(), VecLoad(), ISLoad(), VecGetSize(), ISGetSize(), PetscViewerHDF5SetBaseDimension2()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5ReadSizes
PETSc.LibPETSc.PetscViewerHDF5SetBaseDimension2 — Method
PetscViewerHDF5SetBaseDimension2(petsclib::PetscLibType,viewer::PetscViewer, flg::PetscBool)Vectors of 1 dimension (i.e. bs/dof is 1) will be saved in the HDF5 file with a dimension of 2.
Logically Collective
Input Parameters:
viewer- thePetscViewer; if it is aPETSCVIEWERHDF5then this command is ignoredflg- ifPETSC_TRUEthe vector will always have at least a dimension of 2 even if that first dimension is of size 1
Options Database Key:
-viewer_hdf5_base_dimension2- turns on (true) or off (false) using a dimension of 2 in the HDF5 file even if the bs/dof of the vector is 1
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5SetBaseDimension2
PETSc.LibPETSc.PetscViewerHDF5SetCollective — Method
PetscViewerHDF5SetCollective(petsclib::PetscLibType,viewer::PetscViewer, flg::PetscBool)Use collective MPI
Logically Collective; flg must contain common value
Input Parameters:
viewer- thePetscViewer; if it is notPETSCVIEWERHDF5then this command is ignoredflg-PETSC_TRUEfor collective mode;PETSC_FALSEfor independent mode (default)
Options Database Key:
-viewer_hdf5_collective- turns on (true) or off (false) collective transfers
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5GetCollective(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerHDF5Open()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5SetCollective
PETSc.LibPETSc.PetscViewerHDF5SetCompress — Method
PetscViewerHDF5SetCompress(petsclib::PetscLibType,viewer::PetscViewer, flg::PetscBool)Set the flag for compression
Logically Collective
Input Parameters:
viewer- thePetscViewer; if it is notPETSCVIEWERHDF5then this command is ignoredflg- ifPETSC_TRUEwe will turn on compression
Options Database Key:
-viewer_hdf5_compress- turns on (true) or off (false) compression
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5GetCompress()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5SetCompress
PETSc.LibPETSc.PetscViewerHDF5SetDMPlexStorageVersionReading — Method
PetscViewerHDF5SetDMPlexStorageVersionReading(petsclib::PetscLibType,viewer::PetscViewer, version::DMPlexStorageVersion)Set the storage version for reading
Logically collective
Input Parameters:
viewer- ThePetscViewerversion- The storage format version
Level: advanced
Note: The version has major, minor, and subminor integers. Parallel operations are only available for version 3.0.0.
See also:
DM, PetscViewerHDF5GetDMPlexStorageVersionReading(), PetscViewerHDF5GetDMPlexStorageVersionWriting(), PetscViewerHDF5SetDMPlexStorageVersionWriting()
External Links
- PETSc Manual:
DM/PetscViewerHDF5SetDMPlexStorageVersionReading
PETSc.LibPETSc.PetscViewerHDF5SetDMPlexStorageVersionWriting — Method
PetscViewerHDF5SetDMPlexStorageVersionWriting(petsclib::PetscLibType,viewer::PetscViewer, version::DMPlexStorageVersion)Set the storage version for writing
Logically collective
Input Parameters:
viewer- ThePetscViewerversion- The storage format version
Level: advanced
Note: The version has major, minor, and subminor integers. Parallel operations are only available for version 3.0.0.
See also:
DM, PetscViewerHDF5GetDMPlexStorageVersionWriting(), PetscViewerHDF5GetDMPlexStorageVersionReading(), PetscViewerHDF5SetDMPlexStorageVersionReading()
External Links
- PETSc Manual:
DM/PetscViewerHDF5SetDMPlexStorageVersionWriting
PETSc.LibPETSc.PetscViewerHDF5SetDefaultTimestepping — Method
PetscViewerHDF5SetDefaultTimestepping(petsclib::PetscLibType,viewer::PetscViewer, flg::PetscBool)Set the flag for default timestepping
Logically Collective
Input Parameters:
viewer- thePetscViewer; if it is notPETSCVIEWERHDF5then this command is ignoredflg- ifPETSC_TRUEwe will assume that timestepping is on
Options Database Key:
-viewer_hdf5_default_timestepping- turns on (true) or off (false) default timestepping
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5GetDefaultTimestepping(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5GetTimestep()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5SetDefaultTimestepping
PETSc.LibPETSc.PetscViewerHDF5SetSPOutput — Method
PetscViewerHDF5SetSPOutput(petsclib::PetscLibType,viewer::PetscViewer, flg::PetscBool)Data is written to disk in single precision even if PETSc is compiled with double precision PetscReal.
Logically Collective
Input Parameters:
viewer- the PetscViewer; if it is aPETSCVIEWERHDF5then this command is ignoredflg- ifPETSC_TRUEthe data will be written to disk with single precision
Options Database Key:
-viewer_hdf5_sp_output- turns on (true) or off (false) output in single precision
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen(), PetscReal, PetscViewerHDF5GetSPOutput()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5SetSPOutput
PETSc.LibPETSc.PetscViewerHDF5SetTimestep — Method
PetscViewerHDF5SetTimestep(petsclib::PetscLibType,viewer::PetscViewer, timestep::PetscInt)Set the current timestep for the HDF5 output. Fields are stacked in time.
Logically Collective
Input Parameters:
viewer- thePetscViewerof typePETSCVIEWERHDF5timestep- The timestep
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5IncrementTimestep(), PetscViewerHDF5GetTimestep()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5SetTimestep
PETSc.LibPETSc.PetscViewerHDF5WriteAttribute — Method
PetscViewerHDF5WriteAttribute(petsclib::PetscLibType,viewer::PetscViewer, parent::String, name::String, datatype::PetscDataType, value::Cvoid)Write an attribute
Collective
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewerparent- The parent dataset/group namename- The attribute namedatatype- The attribute typevalue- The attribute value
Level: advanced
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5WriteObjectAttribute(), PetscViewerHDF5ReadAttribute(), PetscViewerHDF5HasAttribute(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5WriteAttribute
PETSc.LibPETSc.PetscViewerHDF5WriteGroup — Method
PetscViewerHDF5WriteGroup(petsclib::PetscLibType,viewer::PetscViewer, path::String)Ensure the HDF5 group exists in the HDF5 file
Not Collective
Input Parameters:
viewer- thePetscViewerof typePETSCVIEWERHDF5path- (Optional) The path relative to the pushed group
Level: intermediate
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup(), PetscViewerHDF5OpenGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5WriteGroup
PETSc.LibPETSc.PetscViewerHDF5WriteObjectAttribute — Method
PetscViewerHDF5WriteObjectAttribute(petsclib::PetscLibType,viewer::PetscViewer, obj::PetscObject, name::String, datatype::PetscDataType, value::Cvoid)Write an attribute to the dataset matching the given PetscObject by name
Collective
Input Parameters:
viewer- ThePETSCVIEWERHDF5viewerobj- The object whose name is used to lookup the parent dataset, relative to the current group.name- The attribute namedatatype- The attribute typevalue- The attribute value
Level: advanced
-seealso: , PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5WriteAttribute(), PetscViewerHDF5ReadObjectAttribute(), PetscViewerHDF5HasObjectAttribute(), PetscViewerHDF5HasObject(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()
External Links
- PETSc Manual:
Sys/PetscViewerHDF5WriteObjectAttribute
PETSc.LibPETSc.PetscViewerInitializePackage — Method
PetscViewerInitializePackage(petsclib::PetscLibType)This function initializes everything in the PetscViewer package.
Level: developer
-seealso: , PetscViewer, PetscInitialize(), PetscViewerFinalizePackage()
External Links
- PETSc Manual:
Sys/PetscViewerInitializePackage
PETSc.LibPETSc.PetscViewerMathematicaClearName — Method
PetscViewerMathematicaClearName(petsclib::PetscLibType,viewer::PetscViewer)Use the default name for objects communicated to Mathematica
Input Parameter:
viewer- The Mathematica viewer
Level: intermediate
-seealso: PETSCVIEWERMATHEMATICA, PetscViewerMathematicaGetName(), PetscViewerMathematicaSetName()
External Links
- PETSc Manual:
Sys/PetscViewerMathematicaClearName
PETSc.LibPETSc.PetscViewerMathematicaFinalizePackage — Method
PetscViewerMathematicaFinalizePackage(petsclib::PetscLibType)This function destroys everything in the PETSc interface to Mathematica. It is called from PetscFinalize().
Level: developer
-seealso: PetscFinalize()
External Links
- PETSc Manual:
Sys/PetscViewerMathematicaFinalizePackage
PETSc.LibPETSc.PetscViewerMathematicaGetName — Method
PetscViewerMathematicaGetName(petsclib::PetscLibType,viewer::PetscViewer, name::Cchar)Retrieve the default name for objects communicated to Mathematica via PETSCVIEWERMATHEMATICA
Input Parameter:
viewer- The Mathematica viewer
Output Parameter:
name- The name for new objects created in Mathematica
Level: intermediate
-seealso: PETSCVIEWERMATHEMATICA, PetscViewerMathematicaSetName(), PetscViewerMathematicaClearName()
External Links
- PETSc Manual:
Sys/PetscViewerMathematicaGetName
PETSc.LibPETSc.PetscViewerMathematicaInitializePackage — Method
PetscViewerMathematicaInitializePackage(petsclib::PetscLibType)This function initializes everything in the PETSc interface to Mathematica. It is called from PetscViewerInitializePackage().
Level: developer
-seealso: PetscSysInitializePackage(), PetscInitialize()
External Links
- PETSc Manual:
Sys/PetscViewerMathematicaInitializePackage
PETSc.LibPETSc.PetscViewerMathematicaOpen — Method
PetscViewerMathematicaOpen(petsclib::PetscLibType,comm::MPI_Comm, port::Cint, machine::String, mode::String, v::PetscViewer)Communicates with Mathemtica using MathLink.
Collective
Input Parameters:
comm- The MPI communicatorport- [optional] The port to connect on, or PETSC_DECIDEmachine- [optional] The machine to run Mathematica on, or NULLmode- [optional] The connection mode, or NULL
Output Parameter:
v- The Mathematica viewer
Options Database Keys:
-viewer_math_linkhost <machine>- The host machine for the kernel-viewer_math_linkname <name>- The full link name for the connection-viewer_math_linkport <port>- The port for the connection-viewer_math_mode <mode>- The mode, e.g. Launch, Connect-viewer_math_type <type>- The plot type, e.g. Triangulation, Vector-viewer_math_graphics <output>- The output type, e.g. Motif, PS, PSFile
Level: intermediate
-seealso: PETSCVIEWERMATHEMATICA, MatView(), VecView()
External Links
- PETSc Manual:
Sys/PetscViewerMathematicaOpen
PETSc.LibPETSc.PetscViewerMathematicaPutCSRMatrix — Method
a::PetscReal = PetscViewerMathematicaPutCSRMatrix(petsclib::PetscLibType,viewer::PetscViewer, m::Cint, n::Cint, i::Cint, j::Cint)External Links
- PETSc Manual:
Sys/PetscViewerMathematicaPutCSRMatrix
PETSc.LibPETSc.PetscViewerMathematicaPutMatrix — Method
a::PetscReal = PetscViewerMathematicaPutMatrix(petsclib::PetscLibType,viewer::PetscViewer, m::Cint, n::Cint)External Links
- PETSc Manual:
Sys/PetscViewerMathematicaPutMatrix
PETSc.LibPETSc.PetscViewerMathematicaSetName — Method
PetscViewerMathematicaSetName(petsclib::PetscLibType,viewer::PetscViewer, name::String)Override the default name for objects communicated to Mathematica via PETSCVIEWERMATHEMATICA
Input Parameters:
viewer- The Mathematica viewername- The name for new objects created in Mathematica
Level: intermediate
-seealso: PETSCVIEWERMATHEMATICA, PetscViewerMathematicaClearName()
External Links
- PETSc Manual:
Sys/PetscViewerMathematicaSetName
PETSc.LibPETSc.PetscViewerMathematicaSkipPackets — Method
PetscViewerMathematicaSkipPackets(petsclib::PetscLibType,viewer::PetscViewer, type::Cint)Discard packets sent by Mathematica until a certain packet type is received
Input Parameters:
viewer- The Mathematica viewertype- The packet type to search for, e.g RETURNPKT
Level: advanced
-seealso: PetscViewerMathematicaSetName(), PetscViewerMathematicaGetVector()
External Links
- PETSc Manual:
Sys/PetscViewerMathematicaSkipPackets
PETSc.LibPETSc.PetscViewerMatlabGetArray — Method
PetscViewerMatlabGetArray(petsclib::PetscLibType,mfile::PetscViewer, m::Cint, n::Cint, array::Vector{PetscScalar}, name::String)Gets a variable from a PETSCVIEWERMATLAB viewer into an array
Not Collective; only processor zero reads in the array
Input Parameters:
mfile- the MATLAB file viewerm- the first dimensions ofarrayn- the second dimensions ofarrayarray- the array (represented in one dimension), must of be lengthm*nname- the MATLAB name ofarray
Level: advanced
-seealso: PETSCVIEWERMATLAB, PetscViewerMatlabPutArray()
External Links
- PETSc Manual:
Sys/PetscViewerMatlabGetArray
PETSc.LibPETSc.PetscViewerMatlabOpen — Method
PetscViewerMatlabOpen(petsclib::PetscLibType,comm::MPI_Comm, name::String, type::PetscFileMode, binv::PetscViewer)Opens a MATLAB .mat file for output
Collective
Input Parameters:
comm- MPI communicatorname- name of filetype- type of file
-seealso: PETSCVIEWERMATLAB, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), PETSCVIEWERBINARY, PetscViewerBinaryOpen() VecView(), MatView(), VecLoad(), MatLoad()
External Links
- PETSc Manual:
Sys/PetscViewerMatlabOpen
PETSc.LibPETSc.PetscViewerMatlabPutArray — Method
PetscViewerMatlabPutArray(petsclib::PetscLibType,mfile::PetscViewer, m::Cint, n::Cint, array::PetscScalar, name::String)Puts an array into the PETSCVIEWERMATLAB viewer.
Not Collective, only processor zero saves array
Input Parameters:
mfile- the viewerm- the first dimensions ofarrayn- the second dimensions ofarrayarray- the array (represented in one dimension)name- the MATLAB name ofarray
Level: advanced
-seealso: PETSCVIEWERMATLAB, PetscViewerMatlabGetArray()
External Links
- PETSc Manual:
Sys/PetscViewerMatlabPutArray
PETSc.LibPETSc.PetscViewerMatlabPutVariable — Method
PetscViewerMatlabPutVariable(petsclib::PetscLibType,viewer::PetscViewer, name::String, mat::Cvoid)External Links
- PETSc Manual:
Sys/PetscViewerMatlabPutVariable
PETSc.LibPETSc.PetscViewerMonitorLGSetUp — Method
PetscViewerMonitorLGSetUp(petsclib::PetscLibType,viewer::PetscViewer, host::String, title::String, metric::String, l::PetscInt, names::String, x::Cint, y::Cint, m::Cint, n::Cint)sets up a viewer to be used by line graph monitoring routines such as KSPMonitorResidualDrawLG()
Collective
Input Parameters:
viewer- the viewer in which to display the line graphs, it not aPETSCVIEWERDRAWit will set to thatPetscViewerTypehost- the host to open the window on, 'NULL' indicates the local hosttitle- the title at the top of the windowmetric- the label above the graphl- the number of curvesnames- the names of each curve to be used in displaying the legend. May be 'NULL'x- horizontal screen coordinate of the upper left corner of window, or usePETSC_DECIDEy- vertical screen coordinate of the upper left corner of window, or usePETSC_DECIDEm- window width in pixels, or may usePETSC_DECIDEorPETSC_DRAW_FULL_SIZE,PETSC_DRAW_HALF_SIZE,PETSC_DRAW_THIRD_SIZE,PETSC_DRAW_QUARTER_SIZEn- window height in pixels, or may usePETSC_DECIDEorPETSC_DRAW_FULL_SIZE,PETSC_DRAW_HALF_SIZE,PETSC_DRAW_THIRD_SIZE,PETSC_DRAW_QUARTER_SIZE
Level: developer
-seealso: PetscViewer(), PETSCVIEWERDRAW, PetscViewerDrawGetDrawLG(), PetscViewerDrawOpen(), PetscViewerDrawSetInfo()
External Links
- PETSc Manual:
Sys/PetscViewerMonitorLGSetUp
PETSc.LibPETSc.PetscViewerPopFormat — Method
PetscViewerPopFormat(petsclib::PetscLibType,viewer::PetscViewer)Resets the format for a PetscViewer to the value it had before the previous call to PetscViewerPushFormat()
Logically Collective
Input Parameter:
viewer- thePetscViewer
Level: intermediate
-seealso: , PetscViewer, PetscViewerFormat, PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), MatView(), VecView(), PetscViewerSetFormat(), PetscViewerPushFormat()
External Links
- PETSc Manual:
Sys/PetscViewerPopFormat
PETSc.LibPETSc.PetscViewerPushFormat — Method
PetscViewerPushFormat(petsclib::PetscLibType,viewer::PetscViewer, format::PetscViewerFormat)Sets the format for a PetscViewer.
Logically Collective
Input Parameters:
viewer- thePetscViewerformat- the format
Level: intermediate
-seealso: , PetscViewer, PetscViewerFormat, PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), MatView(), VecView(), PetscViewerSetFormat(), PetscViewerPopFormat()
External Links
- PETSc Manual:
Sys/PetscViewerPushFormat
PETSc.LibPETSc.PetscViewerPythonCreate — Method
viewer::PetscViewer = PetscViewerPythonCreate(petsclib::PetscLibType,comm::MPI_Comm, pyname::String)Create a PetscViewer object implemented in Python.
Collective
Input Parameters:
comm- MPI communicatorpyname- full dotted Python name [package].module[.{class|function}]
Output Parameter:
viewer- the viewer
Level: intermediate
-seealso: , PetscViewer, PetscViewerType, PETSCVIEWERPYTHON, PetscViewerPythonSetType(), PetscPythonInitialize(), PetscViewerPythonViewObject()
External Links
- PETSc Manual:
Sys/PetscViewerPythonCreate
PETSc.LibPETSc.PetscViewerPythonGetType — Method
pyname::String = PetscViewerPythonGetType(petsclib::PetscLibType,viewer::PetscViewer)Get the Python name of a PetscViewer object implemented in Python.
Not Collective
Input Parameter:
viewer- the viewer
Output Parameter:
pyname- full dotted Python name [package].module[.{class|function}]
Level: intermediate
-seealso: , PetscViewer, PetscViewerType, PetscViewerCreate(), PetscViewerSetType(), PETSCVIEWERPYTHON, PetscPythonInitialize(), PetscViewerPythonSetType()
External Links
- PETSc Manual:
Sys/PetscViewerPythonGetType
PETSc.LibPETSc.PetscViewerPythonSetType — Method
PetscViewerPythonSetType(petsclib::PetscLibType,viewer::PetscViewer, pyname::String)Initialize a PetscViewer object implemented in Python.
Collective
Input Parameters:
viewer- the viewer object.pyname- full dotted Python name [package].module[.{class|function}]
Options Database Key:
-viewer_python_type <pyname>- python class
Level: intermediate
-seealso: , PetscViewer, PetscViewerType, PetscViewerCreate(), PetscViewerSetType(), PETSCVIEWERPYTHON, PetscPythonInitialize()
External Links
- PETSc Manual:
Sys/PetscViewerPythonSetType
PETSc.LibPETSc.PetscViewerPythonViewObject — Method
PetscViewerPythonViewObject(petsclib::PetscLibType,viewer::PetscViewer, obj::PetscObject)View a PetscObject.
Collective
Input Parameters:
viewer- the viewer object.obj- the object to be viewed.
Level: intermediate
-seealso: , PetscViewer, PetscViewerPythonCreate()
External Links
- PETSc Manual:
Sys/PetscViewerPythonViewObject
PETSc.LibPETSc.PetscViewerRead — Method
count::PetscInt = PetscViewerRead(petsclib::PetscLibType,viewer::PetscViewer, data::Cvoid, num::PetscInt, dtype::PetscDataType)Reads data from a PetscViewer
Collective
Input Parameters:
viewer- The viewerdata- Location to write the data, treated as an array of the type defined bydatatypenum- Number of items of data to readdtype- Type of data to read
Output Parameter:
count- number of items of data actually read, orNULL
Level: beginner
-seealso: , PetscViewer, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), PetscViewerReadable(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode
External Links
- PETSc Manual:
Sys/PetscViewerRead
PETSc.LibPETSc.PetscViewerReadable — Method
flg::PetscBool = PetscViewerReadable(petsclib::PetscLibType,viewer::PetscViewer)Return a flag whether the viewer can be read from with PetscViewerRead()
Not Collective
Input Parameter:
viewer- thePetscViewercontext
Output Parameter:
flg-PETSC_TRUEif the viewer is readable,PETSC_FALSEotherwise
Level: intermediate
-seealso: , PetscViewerRead(), PetscViewer, PetscViewerWritable(), PetscViewerCheckReadable(), PetscViewerCreate(), PetscViewerFileSetMode(), PetscViewerFileSetType()
External Links
- PETSc Manual:
Sys/PetscViewerReadable
PETSc.LibPETSc.PetscViewerRegister — Method
PetscViewerRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds a viewer to those available for use with PetscViewerSetType()
Not Collective, No Fortran Support
Input Parameters:
sname- name of a new user-defined viewerfunction- routine to create method context
Level: developer
-seealso: , PetscViewerRegisterAll()
External Links
- PETSc Manual:
Sys/PetscViewerRegister
PETSc.LibPETSc.PetscViewerRestoreSubViewer — Method
PetscViewerRestoreSubViewer(petsclib::PetscLibType,viewer::PetscViewer, comm::MPI_Comm, outviewer::PetscViewer)Restores a PetscViewer obtained with PetscViewerGetSubViewer().
Collective
Input Parameters:
viewer- thePetscViewerthat was reproducedcomm- the sub communicatoroutviewer- the subviewer to be returned
Level: advanced
-seealso: , PetscViewer, PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscViewerGetSubViewer(), PetscViewerFlush()
External Links
- PETSc Manual:
Sys/PetscViewerRestoreSubViewer
PETSc.LibPETSc.PetscViewerSAWsOpen — Method
PetscViewerSAWsOpen(petsclib::PetscLibType,comm::MPI_Comm, lab::PetscViewer)Opens an SAWs PetscViewer.
Collective; No Fortran Support
Input Parameter:
comm- the MPI communicator
Output Parameter:
lab- thePetscViewer
Options Database Keys:
-saws_port <port number>- port number where you are running SAWs client-xxx_view saws- publish the object xxx-xxx_saws_block- blocks the program at the end of a critical point (forKSPandSNESit is the end of a solve) until
the user unblocks the problem with an external tool that access the object with SAWS
Level: advanced
-seealso: , PetscViewerDestroy(), PetscViewerStringSPrintf(), PETSC_VIEWER_SAWS_(), PetscObjectSAWsBlock(), PetscObjectSAWsViewOff(), PetscObjectSAWsTakeAccess(), PetscObjectSAWsGrantAccess()
External Links
- PETSc Manual:
Sys/PetscViewerSAWsOpen
PETSc.LibPETSc.PetscViewerSetFromOptions — Method
PetscViewerSetFromOptions(petsclib::PetscLibType,viewer::PetscViewer)Sets various options for a viewer based on values in the options database.
Collective
Input Parameter:
viewer- the viewer context
Level: intermediate
-seealso: , PetscViewer, PetscViewerCreate(), PetscViewerSetType(), PetscViewerType
External Links
- PETSc Manual:
Sys/PetscViewerSetFromOptions
PETSc.LibPETSc.PetscViewerSetOptionsPrefix — Method
PetscViewerSetOptionsPrefix(petsclib::PetscLibType,viewer::PetscViewer, prefix::String)Sets the prefix used for searching for PetscViewer options in the database during PetscViewerSetFromOptions().
Logically Collective
Input Parameters:
viewer- thePetscViewercontextprefix- the prefix to prepend to all option names
-seealso: , PetscViewer, PetscViewerSetFromOptions(), PetscViewerAppendOptionsPrefix()
External Links
- PETSc Manual:
Sys/PetscViewerSetOptionsPrefix
PETSc.LibPETSc.PetscViewerSetType — Method
PetscViewerSetType(petsclib::PetscLibType,viewer::PetscViewer, type::PetscViewerType)Builds PetscViewer for a particular implementation.
Collective
Input Parameters:
viewer- thePetscViewercontext obtained withPetscViewerCreate()type- for example,PETSCVIEWERASCII
Options Database Key:
-viewer_type <type>- Sets the type; use -help for a list of available methods (for instance, ascii)
Level: advanced
-seealso: , PetscViewer, PetscViewerCreate(), PetscViewerGetType(), PetscViewerType, PetscViewerPushFormat()
External Links
- PETSc Manual:
Sys/PetscViewerSetType
PETSc.LibPETSc.PetscViewerSetUp — Method
PetscViewerSetUp(petsclib::PetscLibType,viewer::PetscViewer)Sets up the internal viewer data structures for the later use.
Collective
Input Parameter:
viewer- thePetscViewercontext
Level: advanced
-seealso: , PetscViewer, PetscViewerCreate(), PetscViewerDestroy()
External Links
- PETSc Manual:
Sys/PetscViewerSetUp
PETSc.LibPETSc.PetscViewerSocketOpen — Method
PetscViewerSocketOpen(petsclib::PetscLibType,comm::MPI_Comm, machine::String, port::Cint, lab::PetscViewer)Opens a connection to a MATLAB or other socket based server.
Collective
Input Parameters:
comm- the MPI communicatormachine- the machine the server is running on, useNULLfor the local machine, use "server" to passively wait for
a connection from elsewhere
port- the port to connect to, usePETSC_DEFAULTfor the default
Output Parameter:
lab- a context to use when communicating with the server
Options Database Keys: For use with PETSC_VIEWER_SOCKET_WORLD, PETSC_VIEWER_SOCKET_SELF, PETSC_VIEWER_SOCKET_() or if NULL is passed for machine or PETSC_DEFAULT is passed for port
-viewer_socket_machine <machine>- the machine where the socket is available-viewer_socket_port <port>- the socket to connect to
Environmental variables:
PETSC_VIEWER_SOCKET_MACHINE- machine namePETSC_VIEWER_SOCKET_PORT- portnumber
Level: intermediate
-seealso: , PETSCVIEWERBINARY, PETSCVIEWERSOCKET, MatView(), VecView(), PetscViewerDestroy(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerSocketSetConnection(), PETSC_VIEWER_SOCKET_, PETSC_VIEWER_SOCKET_WORLD, PETSC_VIEWER_SOCKET_SELF, PetscViewerBinaryWrite(), PetscViewerBinaryRead(), PetscViewerBinaryWriteStringArray(), PetscBinaryViewerGetDescriptor(), PetscMatlabEngineCreate()
External Links
- PETSc Manual:
Sys/PetscViewerSocketOpen
PETSc.LibPETSc.PetscViewerSocketSetConnection — Method
PetscViewerSocketSetConnection(petsclib::PetscLibType,v::PetscViewer, machine::String, port::Cint)Sets the machine and port that a PETSc socket viewer is to use
Logically Collective
Input Parameters:
v- viewer to connectmachine- host to connect to, useNULLfor the local machine,use "server" to passively wait for
a connection from elsewhere
port- the port on the machine one is connecting to, usePETSC_DEFAULTfor default
Level: advanced
-seealso: , PETSCVIEWERMATLAB, PETSCVIEWERSOCKET, PetscViewerSocketOpen()
External Links
- PETSc Manual:
Sys/PetscViewerSocketSetConnection
PETSc.LibPETSc.PetscViewerStringGetStringRead — Method
PetscViewerStringGetStringRead(petsclib::PetscLibType,viewer::PetscViewer, string::String, len::Csize_t)Returns the string that a PETSCVIEWERSTRING uses
Logically Collective
Input Parameter:
viewer-PETSCVIEWERSTRINGviewer
Output Parameters:
string- the string, optional useNULLif you do not needlen- the length of the string, optional useNULLif you do not need it
Level: advanced
-seealso: , PetscViewerStringOpen(), PETSCVIEWERSTRING, PetscViewerStringSetString(), PetscViewerStringSPrintf(), PetscViewerStringSetOwnString()
External Links
- PETSc Manual:
Sys/PetscViewerStringGetStringRead
PETSc.LibPETSc.PetscViewerStringOpen — Method
PetscViewerStringOpen(petsclib::PetscLibType,comm::MPI_Comm, string::String, len::Csize_t, lab::PetscViewer)Opens a string as a PETSCVIEWERSTRING PetscViewer. This is a very simple PetscViewer; information on the object is simply stored into the string in a fairly nice way.
Collective; No Fortran Support
Input Parameters:
comm- the communicatorstring- the string to uselen- the string length
Output Parameter:
lab- thePetscViewer
Level: advanced
-seealso: , PETSCVIEWERSTRING, PetscViewerDestroy(), PetscViewerStringSPrintf(), PetscViewerStringGetStringRead(), PetscViewerStringSetString()
External Links
- PETSc Manual:
Sys/PetscViewerStringOpen
PETSc.LibPETSc.PetscViewerStringSetOwnString — Method
PetscViewerStringSetOwnString(petsclib::PetscLibType,viewer::PetscViewer)tells the viewer that it now owns the string and is responsible for freeing it with PetscFree()
Logically Collective
Input Parameter:
viewer- string viewer
Level: advanced
-seealso: , PetscViewerStringOpen(), PETSCVIEWERSTRING, PetscViewerStringGetStringRead(), PetscViewerStringSPrintf(), PetscViewerStringSetString()
External Links
- PETSc Manual:
Sys/PetscViewerStringSetOwnString
PETSc.LibPETSc.PetscViewerStringSetString — Method
PetscViewerStringSetString(petsclib::PetscLibType,viewer::PetscViewer, string::String, len::Csize_t)sets the string that a string viewer will print to
Logically Collective
Input Parameters:
viewer- string viewer you wish to attach string tostring- the string to print data intolen- the length of the string
Level: advanced
-seealso: , PetscViewerStringOpen(), PETSCVIEWERSTRING, PetscViewerStringGetStringRead(), PetscViewerStringSPrintf(), PetscViewerStringSetOwnString()
External Links
- PETSc Manual:
Sys/PetscViewerStringSetString
PETSc.LibPETSc.PetscViewerVTKAddField — Method
PetscViewerVTKAddField(petsclib::PetscLibType,viewer::PetscViewer, dm::PetscObject, PetscViewerVTKWriteFunction::external, fieldnum::PetscInt, fieldtype::PetscViewerVTKFieldType, checkdm::PetscBool, vec::PetscObject)Add a field to the viewer
Collective
Input Parameters:
viewer-PETSCVIEWERVTKdm-DMon whichVeclivesPetscViewerVTKWriteFunction- function to write thisVecfieldnum- which field of theDMto write (PETSC_DEFAULTif the whole vector should be written)fieldtype- EitherPETSC_VTK_POINT_FIELDorPETSC_VTK_CELL_FIELDcheckdm- whether to check for identical dm arguments as fields are addedvec-Vecfrom which to write
Level: developer
-seealso: , PETSCVIEWERVTK, PetscViewerVTKOpen(), DMDAVTKWriteAll(), PetscViewerVTKWriteFunction, PetscViewerVTKGetDM()
External Links
- PETSc Manual:
Sys/PetscViewerVTKAddField
PETSc.LibPETSc.PetscViewerVTKGetDM — Method
PetscViewerVTKGetDM(petsclib::PetscLibType,viewer::PetscViewer, dm::PetscObject)get the DM associated with the PETSCVIEWERVTK viewer
Collective
Input Parameters:
viewer-PETSCVIEWERVTKviewerdm-DMassociated with the viewer (as aPetscObject)
Level: developer
-seealso: , PETSCVIEWERVTK, PetscViewerVTKOpen(), DMDAVTKWriteAll(), PetscViewerVTKWriteFunction, PetscViewerVTKAddField()
External Links
- PETSc Manual:
Sys/PetscViewerVTKGetDM
PETSc.LibPETSc.PetscViewerVTKOpen — Method
PetscViewerVTKOpen(petsclib::PetscLibType,comm::MPI_Comm, name::String, type::PetscFileMode, vtk::PetscViewer)Opens a PETSCVIEWERVTK viewer file.
Collective
Input Parameters:
comm- MPI communicatorname- name of filetype- type of file
-seealso: , PETSCVIEWERVTK, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscFileMode, PetscViewer
External Links
- PETSc Manual:
Sys/PetscViewerVTKOpen
PETSc.LibPETSc.PetscViewerVUFlushDeferred — Method
PetscViewerVUFlushDeferred(petsclib::PetscLibType,viewer::PetscViewer)Flushes the deferred write cache to the file.
Not Collective
Input Parameter:
viewer- ThePETSCVIEWERVUPetscViewer
Level: intermediate
-seealso: , PETSCVIEWERVU, PetscViewerVUPrintDeferred()
External Links
- PETSc Manual:
Sys/PetscViewerVUFlushDeferred
PETSc.LibPETSc.PetscViewerVUGetPointer — Method
PetscViewerVUGetPointer(petsclib::PetscLibType,viewer::PetscViewer, fd::Libc.FILE)Extracts the file pointer from a PETSCVIEWERVU PetscViewer.
Not Collective
Input Parameter:
viewer- ThePetscViewer
Output Parameter:
fd- The file pointer
Level: intermediate
-seealso: , PETSCVIEWERVU, PetscViewerASCIIGetPointer()
External Links
- PETSc Manual:
Sys/PetscViewerVUGetPointer
PETSc.LibPETSc.PetscViewerVUGetVecSeen — Method
vecSeen::PetscBool = PetscViewerVUGetVecSeen(petsclib::PetscLibType,viewer::PetscViewer)Gets the flag which indicates whether we have viewed a vector. This is usually called internally rather than by a user.
Not Collective
Input Parameter:
viewer- ThePETSCVIEWERVUPetscViewer
Output Parameter:
vecSeen- The flag which indicates whether we have viewed a vector
Level: advanced
External Links
- PETSc Manual:
Sys/PetscViewerVUGetVecSeen
PETSc.LibPETSc.PetscViewerVUSetVecSeen — Method
PetscViewerVUSetVecSeen(petsclib::PetscLibType,viewer::PetscViewer, vecSeen::PetscBool)Sets the flag which indicates whether we have viewed a vector. This is usually called internally rather than by a user.
Not Collective
Input Parameters:
viewer- ThePETSCVIEWERVUPetscViewervecSeen- The flag which indicates whether we have viewed a vector
Level: developer
-seealso: , PETSCVIEWERVU, PetscViewerVUGetVecSeen()
External Links
- PETSc Manual:
Sys/PetscViewerVUSetVecSeen
PETSc.LibPETSc.PetscViewerView — Method
PetscViewerView(petsclib::PetscLibType,v::PetscViewer, viewer::PetscViewer)Visualizes a viewer object.
Collective
Input Parameters:
v- the viewer to be viewedviewer- visualization context
Level: beginner
-seealso: , PetscViewer, PetscViewerPushFormat(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscViewerSocketOpen(), PetscViewerBinaryOpen(), PetscViewerLoad()
External Links
- PETSc Manual:
Sys/PetscViewerView
PETSc.LibPETSc.PetscViewerViewFromOptions — Method
PetscViewerViewFromOptions(petsclib::PetscLibType,A::PetscViewer, obj::PetscObject, name::String)View from the viewer based on options in the options database
Collective
Input Parameters:
A- thePetscViewercontextobj- Optional object that provides the prefix for the option namesname- command line option
Level: intermediate
-seealso: , PetscViewer, PetscViewerView, PetscObjectViewFromOptions(), PetscViewerCreate()
External Links
- PETSc Manual:
Sys/PetscViewerViewFromOptions
PETSc.LibPETSc.PetscViewerWritable — Method
flg::PetscBool = PetscViewerWritable(petsclib::PetscLibType,viewer::PetscViewer)Return a flag whether the viewer can be written to with PetscViewerWrite()
Not Collective
Input Parameter:
viewer- thePetscViewercontext
Output Parameter:
flg-PETSC_TRUEif the viewer is writable,PETSC_FALSEotherwise
Level: intermediate
-seealso: , PetscViewer, PetscViewerReadable(), PetscViewerCheckWritable(), PetscViewerCreate(), PetscViewerFileSetMode(), PetscViewerFileSetType()
External Links
- PETSc Manual:
Sys/PetscViewerWritable
PETSc.LibPETSc.PetscViewersCreate — Method
v::PetscViewers = PetscViewersCreate(petsclib::PetscLibType,comm::MPI_Comm)Creates a container to hold a set of PetscViewer's. The container is essentially a sparse, growable in length array of PetscViewers
Collective
Input Parameter:
comm- the MPI communicator
Output Parameter:
v- the collection ofPetscViewers
Level: intermediate
-seealso: , PetscViewer, PetscViewers, PetscViewerCreate(), PetscViewersDestroy()
External Links
- PETSc Manual:
Sys/PetscViewersCreate
PETSc.LibPETSc.PetscViewersDestroy — Method
PetscViewersDestroy(petsclib::PetscLibType,v::PetscViewers)Destroys a set of PetscViewers created with PetscViewersCreate().
Collective
Input Parameter:
v- thePetscViewersto be destroyed.
Level: intermediate
-seealso: , PetscViewer, PetscViewerDestroy(), PetscViewers, PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDrawOpen(), PetscViewersCreate()
External Links
- PETSc Manual:
Sys/PetscViewersDestroy
PETSc.LibPETSc.PetscViewersGetViewer — Method
PetscViewersGetViewer(petsclib::PetscLibType,viewers::PetscViewers, n::PetscInt, viewer::PetscViewer)Gets a PetscViewer from a PetscViewers collection
Collective if the viewer has not previously be obtained.
Input Parameters:
viewers- object created withPetscViewersCreate()n- number ofPetscVieweryou want
Output Parameter:
viewer- thePetscViewer
Level: intermediate
-seealso: , PetscViewer, PetscViewers, PetscViewersCreate(), PetscViewersDestroy()
External Links
- PETSc Manual:
Sys/PetscViewersGetViewer