petsc4py.PETSc.Viewer¶
- class petsc4py.PETSc.Viewer¶
Bases:
ObjectViewer object.
Viewer is described in the
PETSc manual.Viewers can be called as functions where the argument specified is the PETSc object to be viewed. See the example below.
Examples
>>> from petsc4py import PETSc >>> u = PETSc.Vec().createWithArray([1,2]) >>> v = PETSc.Viewer() >>> v(u) Vec Object: 1 MPI process type: seq 1. 2.
See also
petsc.PetscViewerEnumerations
Window size.
Viewer file mode.
Viewer format.
Viewer type.
Methods Summary
ASCII(name[, comm])Return an ASCII viewer associated with the communicator.
BINARY([comm])Return the default
Type.BINARYviewer associated with the communicator.DRAW([comm])Return the default
Type.DRAWviewer associated with the communicator.STDERR([comm])Return the standard error viewer associated with the communicator.
STDOUT([comm])Return the standard output viewer associated with the communicator.
addASCIITab(tabs)Increment the ASCII tab level.
Reset graphics.
create([comm])Create a viewer.
createASCII(name[, mode, comm])Create a viewer of type
Type.ASCII.createBinary(name[, mode, comm])Create a viewer of type
Type.BINARY.createDraw([display, title, position, size, ...])Create a
Type.DRAWviewer.createHDF5(name[, mode, comm])Create a viewer of type
Type.HDF5.createMPIIO(name[, mode, comm])Create a viewer of type
Type.BINARYsupporting MPI-IO.createVTK(name[, mode, comm])Create a viewer of type
Type.VTK.destroy()Destroy the viewer.
flush()Flush the viewer.
Return the ASCII tab level.
Return the file mode.
Return file name.
Return the format of the viewer.
getSubViewer([comm])Return a viewer defined on a subcommunicator.
getType()Return the type of the viewer.
Disallow ASCII synchronized calls.
Pop an additional tab level pushed via
pushASCIITab.Pop format from the viewer.
printfASCII(msg)Print a message.
Print a synchronized message.
Allow ASCII synchronized calls.
Push an additional tab level.
pushFormat(format)Push format to the viewer.
restoreSubViewer(sub)Restore a viewer defined on a subcommunicator.
setASCIITab(tabs)Set ASCII tab level.
setDrawInfo([display, title, position, size])Set window information for a
Type.DRAWviewer.setFileMode(mode)Set file mode.
setFileName(name)Set file name.
setType(vwr_type)Set the type of the viewer.
subtractASCIITab(tabs)Decrement the ASCII tab level.
useASCIITabs(flag)Enable/disable the use of ASCII tabs.
view([obj])View the viewer.
Methods Documentation
- classmethod ASCII(name, comm=None)¶
Return an ASCII viewer associated with the communicator.
Collective.
- Parameters:
name (str) – The filename.
comm (Comm | None) – MPI communicator, defaults to
Sys.getDefaultComm.
- Return type:
- classmethod BINARY(comm=None)¶
Return the default
Type.BINARYviewer associated with the communicator.Collective.
- Parameters:
comm (Comm | None) – MPI communicator, defaults to
Sys.getDefaultComm.- Return type:
- classmethod DRAW(comm=None)¶
Return the default
Type.DRAWviewer associated with the communicator.Collective.
- Parameters:
comm (Comm | None) – MPI communicator, defaults to
Sys.getDefaultComm.- Return type:
- classmethod STDERR(comm=None)¶
Return the standard error viewer associated with the communicator.
Collective.
- Parameters:
comm (Comm | None) – MPI communicator, defaults to
Sys.getDefaultComm.- Return type:
- classmethod STDOUT(comm=None)¶
Return the standard output viewer associated with the communicator.
Collective.
- Parameters:
comm (Comm | None) – MPI communicator, defaults to
Sys.getDefaultComm.- Return type:
- addASCIITab(tabs)¶
Increment the ASCII tab level.
Collective.
See also
petsc.PetscViewerASCIIAddTabSource code at petsc4py/PETSc/Viewer.pyx:661
- Parameters:
tabs (int) –
- clearDraw()¶
Reset graphics.
Not collective.
See also
petsc.PetscViewerDrawClearSource code at petsc4py/PETSc/Viewer.pyx:892
- Return type:
- create(comm=None)¶
Create a viewer.
Collective.
- Parameters:
comm (Comm | None) – MPI communicator, defaults to
Sys.getDefaultComm.- Return type:
See also
Sys.getDefaultComm,petsc.PetscViewerCreate
- createASCII(name, mode=None, comm=None)¶
Create a viewer of type
Type.ASCII.Collective.
- Parameters:
- Return type:
Self
- createBinary(name, mode=None, comm=None)¶
Create a viewer of type
Type.BINARY.Collective.
- Parameters:
- Return type:
Self
See also
create,setType,setFileMode,setFileName,Sys.getDefaultComm
- createDraw(display=None, title=None, position=None, size=None, comm=None)¶
Create a
Type.DRAWviewer.Collective.
- Parameters:
display (str | None) – The X display to use or
Nonefor the local machine.position (tuple[int, int] | None) – Screen coordinates of the upper left corner, or
Nonefor default.size (tuple[int, int] | int | None) – Window size or
Nonefor default.comm (Comm | None) – MPI communicator, defaults to
Sys.getDefaultComm.
- Return type:
See also
Sys.getDefaultComm,petsc.PetscViewerDrawOpen
- createHDF5(name, mode=None, comm=None)¶
Create a viewer of type
Type.HDF5.Collective.
- Parameters:
- Return type:
Self
See also
create,setType,setFileMode,setFileName,Sys.getDefaultComm
- createMPIIO(name, mode=None, comm=None)¶
Create a viewer of type
Type.BINARYsupporting MPI-IO.Collective.
- Parameters:
- Return type:
Self
See also
create,setType,setFileMode,setFileName,Sys.getDefaultComm
- createVTK(name, mode=None, comm=None)¶
Create a viewer of type
Type.VTK.Collective.
- Parameters:
- Return type:
Self
See also
create,setType,setFileMode,setFileName,Sys.getDefaultComm
- destroy()¶
Destroy the viewer.
Collective.
See also
petsc.PetscViewerDestroySource code at petsc4py/PETSc/Viewer.pyx:162
- Return type:
- flush()¶
Flush the viewer.
Collective.
See also
petsc.PetscViewerFlushSource code at petsc4py/PETSc/Viewer.pyx:780
- Return type:
- getASCIITab()¶
Return the ASCII tab level.
Not collective.
See also
setASCIITab,petsc.PetscViewerASCIIGetTabSource code at petsc4py/PETSc/Viewer.pyx:647
- Return type:
- getFileMode()¶
Return the file mode.
Not collective.
See also
setFileMode,petsc.PetscViewerFileGetModeSource code at petsc4py/PETSc/Viewer.pyx:804
- Return type:
- getFileName()¶
Return file name.
Not collective.
See also
setFileName,petsc.PetscViewerFileGetNameSource code at petsc4py/PETSc/Viewer.pyx:832
- Return type:
- getFormat()¶
Return the format of the viewer.
Not collective.
See also
pushFormat,popFormat,petsc.PetscViewerGetFormatSource code at petsc4py/PETSc/Viewer.pyx:459
- Return type:
- getSubViewer(comm=None)¶
Return a viewer defined on a subcommunicator.
Collective.
Notes
Users must call
restoreSubViewerwhen done.See also
restoreSubViewer,petsc.PetscViewerGetSubViewer
- getType()¶
Return the type of the viewer.
Not collective.
See also
setType,petsc.PetscViewerGetTypeSource code at petsc4py/PETSc/Viewer.pyx:445
- Return type:
- popASCIISynchronized()¶
Disallow ASCII synchronized calls.
Collective.
See also
printfASCIISynchronized,pushASCIISynchronized,petsc.PetscViewerASCIIPopSynchronizedSource code at petsc4py/PETSc/Viewer.pyx:700
- Return type:
- popASCIITab()¶
Pop an additional tab level pushed via
pushASCIITab.Collective.
See also
pushASCIITab,petsc.PetscViewerASCIIPopTabSource code at petsc4py/PETSc/Viewer.pyx:725
- Return type:
- popFormat()¶
Pop format from the viewer.
Collective.
See also
pushFormat,petsc.PetscViewerPopFormatSource code at petsc4py/PETSc/Viewer.pyx:485
- Return type:
- printfASCII(msg)¶
Print a message.
Collective.
See also
petsc.PetscViewerASCIIPrintf
- printfASCIISynchronized(msg)¶
Print a synchronized message.
Collective.
See also
pushASCIISynchronized,petsc.PetscViewerASCIISynchronizedPrintf
- pushASCIISynchronized()¶
Allow ASCII synchronized calls.
Collective.
See also
printfASCIISynchronized,popASCIISynchronized,petsc.PetscViewerASCIIPushSynchronizedSource code at petsc4py/PETSc/Viewer.pyx:687
- Return type:
- pushASCIITab()¶
Push an additional tab level.
Collective.
See also
popASCIITab,petsc.PetscViewerASCIIPushTabSource code at petsc4py/PETSc/Viewer.pyx:713
- Return type:
- pushFormat(format)¶
Push format to the viewer.
Collective.
See also
popFormat,petsc.PetscViewerPushFormat
- restoreSubViewer(sub)¶
Restore a viewer defined on a subcommunicator.
Collective.
- Parameters:
sub (Viewer) – The subviewer obtained from
getSubViewer.- Return type:
See also
getSubViewer,petsc.PetscViewerRestoreSubViewer
- setASCIITab(tabs)¶
Set ASCII tab level.
Collective.
See also
getASCIITab,petsc.PetscViewerASCIISetTab
- setDrawInfo(display=None, title=None, position=None, size=None)¶
Set window information for a
Type.DRAWviewer.Collective.
- setFileMode(mode)¶
Set file mode.
Collective.
See also
getFileMode,petsc.PetscViewerFileSetMode
- setFileName(name)¶
Set file name.
Collective.
See also
getFileName,petsc.PetscViewerFileSetName
- setType(vwr_type)¶
Set the type of the viewer.
Logically collective.
See also
getType,petsc.PetscViewerSetType
- subtractASCIITab(tabs)¶
Decrement the ASCII tab level.
Collective.
See also
petsc.PetscViewerASCIISubtractTab
- useASCIITabs(flag)¶
Enable/disable the use of ASCII tabs.
Collective.
See also
petsc.PetscViewerASCIIUseTabs