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, LibPETSc.PETSCVIEWERASCII)
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
LibPETSc.PetscViewerDestroy(petsclib, viewer)

# 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 = LibPETSc.PetscViewerASCIIOpen(petsclib, LibPETSc.PETSC_COMM_SELF, "output.txt")

# 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 = LibPETSc.PetscViewerBinaryOpen(petsclib, MPI.COMM_WORLD, "checkpoint.dat",
                                        LibPETSc.FILE_MODE_WRITE)

# 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 = LibPETSc.PetscViewerBinaryOpen(petsclib, MPI.COMM_WORLD, "checkpoint.dat",
                                        LibPETSc.FILE_MODE_READ)

# 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 = LibPETSc.PetscViewerVTKOpen(petsclib, MPI.COMM_WORLD, "solution.vtu",
                                     LibPETSc.FILE_MODE_WRITE)

# 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 = LibPETSc.PetscViewerHDF5Open(petsclib, MPI.COMM_WORLD, "data.h5",
                                      LibPETSc.FILE_MODE_WRITE)

# 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)
# display "" selects the default display
viewer = LibPETSc.PetscViewerDrawOpen(petsclib, LibPETSc.PETSC_COMM_SELF, "", "Plot",
                                      Cint(0), Cint(0), Cint(600), Cint(600))

# 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 = LibPETSc.PetscViewerSocketOpen(petsclib, MPI.COMM_WORLD, "localhost", Cint(5000))

# 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 with a Julia callback (see the KSP page for the callback signature)
# LibPETSc.KSPMonitorSet(petsclib, ksp, monitor_cfunction, C_NULL, C_NULL)

Function Reference

PETSc.LibPETSc.PetscViewerADIOSOpen — Method
adiosv::PetscViewer = PetscViewerADIOSOpen(petsclib::PetscLibType, comm::MPI_Comm, name::String, type::PetscFileMode)

Opens a file for ADIOS input/output.

Collective

Input Parameters:

  • comm - MPI communicator
  • name - name of file
  • type - type of file

$FILE_MODE_WRITE - create new file for binary output FILE_MODE_READ - open existing file for binary input FILE_MODE_APPEND - open existing file for binary output$

Output Parameter:

  • adiosv - PetscViewer for ADIOS input/output to use with the specified file

Level: beginner

See also: PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), PetscViewerHDF5Open(), VecView(), MatView(), VecLoad(), PetscViewerSetType(), PetscViewerFileSetMode(), PetscViewerFileSetName(), MatLoad(), PetscFileMode, PetscViewer

External Links

source
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 with PetscViewerASCIIOpen()
  • tabs - number of tabs

Level: developer

See also: PETSCVIEWERASCII, PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer(), PetscViewerASCIIPushTab()

External Links

source
PETSc.LibPETSc.PetscViewerASCIIGetPointer — Method
fd::Ptr{Libc.FILE} = PetscViewerASCIIGetPointer(petsclib::PetscLibType, viewer::PetscViewer)

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 - PetscViewer context, obtained from PetscViewerASCIIOpen()

Output Parameter:

  • fd - file pointer

Level: intermediate

See also: PETSCVIEWERASCII, PetscViewerASCIIOpen(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerCreate(), PetscViewerASCIIPrintf(), PetscViewerASCIISynchronizedPrintf(), PetscViewerFlush()

External Links

source
PETSc.LibPETSc.PetscViewerASCIIGetStderr — Method
viewer::PetscViewer = PetscViewerASCIIGetStderr(petsclib::PetscLibType, comm::MPI_Comm)

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 the PetscViewer

Output Parameter:

  • viewer - the viewer

Level: beginner

See also: PetscViewerASCIIGetStdout(), PETSC_VIEWER_DRAW_(), PetscViewerASCIIOpen(), PETSC_VIEWER_STDERR_, PETSC_VIEWER_STDERR_WORLD, PETSC_VIEWER_STDERR_SELF

External Links

source
PETSc.LibPETSc.PetscViewerASCIIGetStdout — Method
viewer::PetscViewer = PetscViewerASCIIGetStdout(petsclib::PetscLibType, comm::MPI_Comm)

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 the PetscViewer

Output Parameter:

  • viewer - the viewer

Level: beginner

See also: PetscViewerASCIIGetStderr(), PETSC_VIEWER_DRAW_(), PetscViewerASCIIOpen(), PETSC_VIEWER_STDERR_, PETSC_VIEWER_STDOUT_WORLD, PETSC_VIEWER_STDOUT_SELF

External Links

source
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 with PetscViewerASCIIOpen()

Output Parameter:

  • tabs - number of tabs

Level: developer

See also: PETSCVIEWERASCII, PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIISetTab(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer(), PetscViewerASCIIPushTab()

External Links

source
PETSc.LibPETSc.PetscViewerASCIIOpen — Method
viewer::PetscViewer = PetscViewerASCIIOpen(petsclib::PetscLibType, comm::MPI_Comm, name::String)

Opens an ASCII file for writing as a PETSCVIEWERASCII PetscViewer.

Collective

Input Parameters:

  • comm - the communicator
  • name - the file name

Output Parameter:

  • viewer - the PetscViewer to use with the specified file

Level: beginner

See also: 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

source
PETSc.LibPETSc.PetscViewerASCIIOpenWithFILE — Method
viewer::PetscViewer = PetscViewerASCIIOpenWithFILE(petsclib::PetscLibType, comm::MPI_Comm, fd::Libc.FILE)

Given an open file creates an PETSCVIEWERASCII viewer that prints to it.

Collective

Input Parameters:

  • comm - the communicator
  • fd - the FILE pointer

Output Parameter:

  • viewer - the PetscViewer to use with the specified file

Level: beginner

See also: 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

source
PETSc.LibPETSc.PetscViewerASCIIPopSynchronized — Method
PetscViewerASCIIPopSynchronized(petsclib::PetscLibType, viewer::PetscViewer)

Undoes most recent PetscViewerASCIIPushSynchronized() for this viewer

Collective

Input Parameter:

  • viewer - obtained with PetscViewerASCIIOpen()

Level: intermediate

See also: PetscViewerASCIIPushSynchronized(), PetscViewerASCIISynchronizedPrintf(), PetscViewerFlush(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType()

External Links

source
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 with PetscViewerASCIIOpen()

Level: developer

See also: PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIPushTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer()

External Links

source
PETSc.LibPETSc.PetscViewerASCIIPushSynchronized — Method
PetscViewerASCIIPushSynchronized(petsclib::PetscLibType, viewer::PetscViewer)

Allows calls to PetscViewerASCIISynchronizedPrintf() for this viewer

Collective

Input Parameter:

  • viewer - obtained with PetscViewerASCIIOpen()

Level: intermediate

See also: PetscViewerASCIISynchronizedPrintf(), PetscViewerFlush(), PetscViewerASCIIPopSynchronized(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType()

External Links

source
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 with PetscViewerASCIIOpen()

Level: developer

See also: PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer()

External Links

source
PETSc.LibPETSc.PetscViewerASCIIRead — Method
count::PetscInt = PetscViewerASCIIRead(petsclib::PetscLibType, viewer::PetscViewer, data::Ptr{Cvoid}, num::PetscInt, dtype::PetscDataType)

Reads from a PETSCVIEWERASCII file

Only MPI rank 0 in the PetscViewer may call this

Input Parameters:

  • viewer - the PETSCVIEWERASCII viewer
  • data - location to write the data, treated as an array of type indicated by datatype
  • num - number of items of data to read
  • dtype - type of data to read

Output Parameter:

  • count - number of items of data actually read, or NULL

Level: beginner

See also: PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), PetscViewerCreate(), PetscViewerFileSetMode(), PetscViewerFileSetName(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead()

External Links

source
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 - the PetscViewer to use with the specified file
  • fd - the FILE pointer

Level: beginner

See also: 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

source
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 with PetscViewerASCIIOpen()
  • tabs - number of tabs

Level: developer

See also: PETSCVIEWERASCII, PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIGetTab(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer(), PetscViewerASCIIPushTab()

External Links

source
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 with PetscViewerASCIIOpen()
  • tabs - number of tabs

Level: developer

See also: PETSCVIEWERASCII, PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer(), PetscViewerASCIIPushTab()

External Links

source
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 with PetscViewerASCIIOpen()
  • flg - PETSC_TRUE or PETSC_FALSE

Level: developer

See also: PetscPrintf(), PetscSynchronizedPrintf(), PetscViewerASCIIPrintf(), PetscViewerASCIIPopTab(), PetscViewerASCIISynchronizedPrintf(), PetscViewerASCIIPushTab(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType(), PetscViewerASCIIGetPointer()

External Links

source
PETSc.LibPETSc.PetscViewerAndFormatCreate — Method
vf::Ptr{PetscViewerAndFormat} = PetscViewerAndFormatCreate(petsclib::PetscLibType, viewer::PetscViewer, format::PetscViewerFormat)

Creates a PetscViewerAndFormat struct.

Collective

Input Parameters:

  • viewer - the viewer
  • format - the format

Output Parameter:

  • vf - viewer and format object

Level: developer

See also: PetscViewer, PetscViewerAndFormat, PetscViewerFormat, PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDrawOpen(), PetscViewerAndFormatDestroy()

External Links

source
PETSc.LibPETSc.PetscViewerAndFormatDestroy — Method
PetscViewerAndFormatDestroy(petsclib::PetscLibType, vf::PetscViewerAndFormat)

Destroys a PetscViewerAndFormat struct created with PetscViewerAndFormatCreate()

Collective

Input Parameter:

  • vf - the PetscViewerAndFormat to be destroyed.

Level: developer

See also: PetscViewer, PetscViewerAndFormat, PetscViewerFormat, PetscViewerAndFormatCreate(), PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDrawOpen()

External Links

source
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 - the PetscViewer context
  • prefix - the prefix to prepend to all option names

Level: advanced

See also: PetscViewer, PetscViewerGetOptionsPrefix(), PetscViewerSetOptionsPrefix()

External Links

source
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 - PetscViewer context, obtained from PetscViewerBinaryOpen()
  • off - the addition to the global offset

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinaryGetUseMPIIO(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryGetMPIIOOffset()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryGetDescriptor — Method
fdes::Cint = PetscViewerBinaryGetDescriptor(petsclib::PetscLibType, viewer::PetscViewer)

Extracts the file descriptor from a PetscViewer of PetscViewerType PETSCVIEWERBINARY.

Collective because it may trigger a PetscViewerSetUp() call; No Fortran Support

Input Parameter:

  • viewer - PetscViewer context, obtained from PetscViewerBinaryOpen()

Output Parameter:

  • fdes - file descriptor

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer()

External Links

source
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 - PetscViewer context, obtained from PetscViewerBinaryOpen()

Output Parameter:

  • fc - the number of messages

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinarySetFlowControl()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryGetInfoPointer — Method
file::Ptr{Libc.FILE} = PetscViewerBinaryGetInfoPointer(petsclib::PetscLibType, viewer::PetscViewer)

Extracts the file pointer for the ASCII .info file associated with a binary file.

Not Collective; No Fortran Support

Input Parameter:

  • viewer - PetscViewer context, obtained from PetscViewerBinaryOpen()

Output Parameter:

  • file - file pointer Always returns NULL if not a binary viewer

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetSkipInfo(), PetscViewerBinarySetSkipInfo()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryGetMPIIODescriptor — Method
fdes::MPI_File = PetscViewerBinaryGetMPIIODescriptor(petsclib::PetscLibType, viewer::PetscViewer)

Extracts the MPI IO file descriptor from a PetscViewer.

Not Collective; No Fortran Support

Input Parameter:

  • viewer - PetscViewer context, obtained from PetscViewerBinaryOpen()

Output Parameter:

  • fdes - file descriptor

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinaryGetUseMPIIO(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryGetMPIIOOffset()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryGetMPIIOOffset — Method
off::MPI_Offset = PetscViewerBinaryGetMPIIOOffset(petsclib::PetscLibType, viewer::PetscViewer)

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 - PetscViewer context, obtained from PetscViewerBinaryOpen()

Output Parameter:

  • off - the current global offset

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinaryGetUseMPIIO(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryAddMPIIOOffset()

External Links

source
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 - PetscViewer context, obtained from PetscViewerBinaryOpen()

Output Parameter:

  • skip - PETSC_TRUE means do not write header

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySkipInfo(), PetscViewerBinarySetSkipHeader()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryGetSkipInfo — Method
skip::PetscBool = PetscViewerBinaryGetSkipInfo(petsclib::PetscLibType, viewer::PetscViewer)

check if viewer wrote a .info file

Not Collective

Input Parameter:

  • viewer - PetscViewer context, obtained from PetscViewerBinaryOpen()

Output Parameter:

  • skip - PETSC_TRUE implies the .info file was not generated

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySetSkipOptions(), PetscViewerBinarySetSkipInfo(), PetscViewerBinaryGetInfoPointer()

External Links

source
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 - PetscViewer context, obtained from PetscViewerBinaryOpen()

Output Parameter:

  • skip - PETSC_TRUE means do not use

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySkipInfo(), PetscViewerBinarySetSkipOptions()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryGetUseMPIIO — Method
use::PetscBool = PetscViewerBinaryGetUseMPIIO(petsclib::PetscLibType, viewer::PetscViewer)

Returns PETSC_TRUE if the binary viewer uses MPI-IO.

Not Collective

Input Parameter:

  • viewer - PetscViewer context, obtained from PetscViewerBinaryOpen(); must be a PETSCVIEWERBINARY

Output Parameter:

  • use - PETSC_TRUE if MPI-IO is being used

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryGetMPIIOOffset()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryOpen — Method
viewer::PetscViewer = PetscViewerBinaryOpen(petsclib::PetscLibType, comm::MPI_Comm, name::String, mode::PetscFileMode)

Opens a file for binary input/output.

Collective

Input Parameters:

  • comm - MPI communicator
  • name - name of file
  • mode - open mode of file

$FILE_MODE_WRITE - create new file for binary output FILE_MODE_READ - open existing file for binary input FILE_MODE_APPEND - open existing file for binary output$

Output Parameter:

  • viewer - PetscViewer for binary input/output to use with the specified file

Options Database Keys:

  • -viewer_binary_filename name - name of file to use
  • -viewer_binary_skip_info - true to skip opening an info file
  • -viewer_binary_skip_options - true to not use options database while creating viewer
  • -viewer_binary_skip_header - true to skip output object headers to the file
  • -viewer_binary_mpiio - true to use MPI-IO for input and output to the file (more scalable for large problems)

Level: beginner

See also: PETSCVIEWERBINARY, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryGetUseMPIIO(), PetscViewerBinaryGetMPIIOOffset()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryRead — Method
data::Ptr{Cvoid},count::PetscInt = PetscViewerBinaryRead(petsclib::PetscLibType, viewer::PetscViewer, num::PetscInt, dtype::PetscDataType)

Reads from a binary file, all processors get the same result

Collective; No Fortran Support

Input Parameters:

  • viewer - the PETSCVIEWERBINARY viewer
  • num - number of items of data to read
  • dtype - type of data to read

Output Parameters:

  • data - location of the read data, treated as an array of the type indicated by dtype
  • count - number of items of data actually read, or NULL.

Level: beginner

See also: PETSCVIEWERBINARY, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer

External Links

source
PETSc.LibPETSc.PetscViewerBinaryReadAll — Method
data::Ptr{Cvoid} = PetscViewerBinaryReadAll(petsclib::PetscLibType, viewer::PetscViewer, 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 - the PETSCVIEWERBINARY viewer
  • count - local number of items of data to read
  • start - local start, can be PETSC_DETERMINE
  • total - global number of items of data to read, can be PETSC_DETERMINE
  • dtype - type of data to read

Output Parameter:

  • data - location of data, treated as an array of type indicated by dtype

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryRead(), PetscViewerBinaryWriteAll()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryReadStringArray — Method
data::String = PetscViewerBinaryReadStringArray(petsclib::PetscLibType, viewer::PetscViewer)

reads a binary file an array of strings to all MPI processes

Collective; No Fortran Support

Input Parameter:

  • viewer - the PETSCVIEWERBINARY viewer

Output Parameter:

  • data - location of the array of strings

Level: intermediate

See also: PETSCVIEWERBINARY, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead()

External Links

source
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 - PetscViewer context, obtained from PetscViewerBinaryOpen()
  • fc - the number of messages, defaults to 256 if this function was not called

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetInfoPointer(), PetscViewerBinaryGetFlowControl()

External Links

source
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 - PetscViewer context, obtained from PetscViewerBinaryOpen()
  • skip - PETSC_TRUE means do not write header

Options Database Key:

  • -viewer_binary_skip_header (true|false) - true means do not write header

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySkipInfo(), PetscViewerBinaryGetSkipHeader()

External Links

source
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 from PetscViewerCreate()
  • skip - PETSC_TRUE implies the .info file will not be generated

Options Database Key:

  • -viewer_binary_skip_info - true indicates do not generate .info file

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySetSkipOptions(), PetscViewerBinaryGetSkipOptions(), PetscViewerBinaryGetSkipInfo(), PetscViewerBinaryGetInfoPointer()

External Links

source
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 - PetscViewer context, obtained from PetscViewerBinaryOpen()
  • skip - PETSC_TRUE means do not use the options from the options database

Options Database Key:

  • -viewer_binary_skip_options (true|false) - true means do not use the options from the options database

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySkipInfo(), PetscViewerBinaryGetSkipOptions()

External Links

source
PETSc.LibPETSc.PetscViewerBinarySetUseMPIIO — Method
PetscViewerBinarySetUseMPIIO(petsclib::PetscLibType, viewer::PetscViewer, use::PetscBool)

Sets a binary viewer to use MPI-IO for reading/writing. Must be called before PetscViewerFileSetName()

Logically Collective

Input Parameters:

  • viewer - the PetscViewer; must be a PETSCVIEWERBINARY
  • use - PETSC_TRUE means MPI-IO will be used

Options Database Key:

  • -viewer_binary_mpiio (true|false) - flag for using MPI-IO

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen(), PetscViewerBinaryGetUseMPIIO()

External Links

source
PETSc.LibPETSc.PetscViewerBinarySkipInfo — Method
PetscViewerBinarySkipInfo(petsclib::PetscLibType, viewer::PetscViewer)

Binary file will not have .info file created with it

Not Collective

Input Parameter:

  • viewer - PetscViewer context, obtained from PetscViewerCreate()

Options Database Key:

  • -viewer_binary_skip_info - true indicates do not generate .info file

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinaryGetDescriptor(), PetscViewerBinarySetSkipOptions(), PetscViewerBinaryGetSkipOptions(), PetscViewerBinaryGetSkipInfo()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryWrite — Method
PetscViewerBinaryWrite(petsclib::PetscLibType, viewer::PetscViewer, data::Ptr{Cvoid}, count::PetscInt, dtype::PetscDataType)

writes to a binary file, only from the first MPI rank

Collective; No Fortran Support

Input Parameters:

  • viewer - the PETSCVIEWERBINARY viewer
  • data - location of data, treated as an array of the type indicated by dtype
  • count - number of items of data to write
  • dtype - type of data to write

Level: beginner

See also: PETSCVIEWERBINARY, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscDataType, PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead()

External Links

source
PETSc.LibPETSc.PetscViewerBinaryWriteAll — Method
PetscViewerBinaryWriteAll(petsclib::PetscLibType, viewer::PetscViewer, data::Ptr{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 - the PETSCVIEWERBINARY viewer
  • data - location of data
  • count - local number of items of data to write, treated as an array of type indicated by dtype
  • start - local start, can be PETSC_DETERMINE
  • total - global number of items of data to write, can be PETSC_DETERMINE
  • dtype - type of data to write

Level: advanced

See also: PETSCVIEWERBINARY, PetscViewerBinaryOpen(), PetscViewerBinarySetUseMPIIO(), PetscViewerBinaryReadAll()

External Links

source
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 - the PETSCVIEWERBINARY viewer
  • data - location of the array of strings

Level: intermediate

See also: PETSCVIEWERBINARY, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode, PetscViewer, PetscViewerBinaryRead()

External Links

source
PETSc.LibPETSc.PetscViewerCGNSGetSolutionIndex — Method
solution_id::PetscInt = PetscViewerCGNSGetSolutionIndex(petsclib::PetscLibType, viewer::PetscViewer)

Get index of solution

Not Collective

Input Parameter:

  • viewer - PETSCVIEWERCGNS PetscViewer for CGNS input/output to use with the specified file

Output Parameter:

  • solution_id - Index of the solution id

Level: intermediate

See also: PETSCVIEWERCGNS, PetscViewerCGNSSetSolutionIndex(), PetscViewerCGNSGetSolutionInfo()

External Links

source
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 - PETSCVIEWERCGNS PetscViewer for CGNS input/output to use with the specified file

Output Parameters:

  • iteration - Solution iteration of the FlowSolution_t node
  • set - Whether the time data is in the file

Level: intermediate

See also: PETSCVIEWERCGNS, PetscViewer, PetscViewerCGNSGetSolutionTime(), PetscViewerCGNSSetSolutionIndex(), PetscViewerCGNSGetSolutionIndex(), PetscViewerCGNSGetSolutionName()

External Links

source
PETSc.LibPETSc.PetscViewerCGNSGetSolutionName — Method
name::String = PetscViewerCGNSGetSolutionName(petsclib::PetscLibType, viewer::PetscViewer)

Gets name of FlowSolution of the viewer

Collective

Input Parameter:

  • viewer - PETSCVIEWERCGNS PetscViewer for 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

See also: PETSCVIEWERCGNS, PetscViewer, PetscViewerCGNSSetSolutionIndex(), PetscViewerCGNSGetSolutionIndex(), PetscViewerCGNSGetSolutionTime()

External Links

source
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 - PETSCVIEWERCGNS PetscViewer for CGNS input/output to use with the specified file

Output Parameters:

  • time - Solution time of the FlowSolution_t node
  • set - Whether the time data is in the file

Level: intermediate

See also: PETSCVIEWERCGNS, PetscViewer, PetscViewerCGNSGetSolutionIteration(), PetscViewerCGNSSetSolutionIndex(), PetscViewerCGNSGetSolutionIndex(), PetscViewerCGNSGetSolutionName()

External Links

source
PETSc.LibPETSc.PetscViewerCGNSOpen — Method
viewer::PetscViewer = PetscViewerCGNSOpen(petsclib::PetscLibType, comm::MPI_Comm, name::String, type::PetscFileMode)

Opens a file for CGNS input/output.

Collective

Input Parameters:

  • comm - MPI communicator
  • name - name of file
  • type - type of file

$FILE_MODE_WRITE - create new file for binary output FILE_MODE_READ - open existing file for binary input FILE_MODE_APPEND - open existing file for binary output$

Output Parameter:

  • viewer - PETSCVIEWERCGNS PetscViewer for CGNS input/output to use with the specified file

Level: beginner

See also: PETSCVIEWERCGNS, PetscViewer, PetscViewerPushFormat(), PetscViewerDestroy(), DMLoad(), PetscFileMode, PetscViewerSetType(), PetscViewerFileSetMode(), PetscViewerFileSetName()

External Links

source
PETSc.LibPETSc.PetscViewerCGNSSetSolutionIndex — Method
PetscViewerCGNSSetSolutionIndex(petsclib::PetscLibType, viewer::PetscViewer, solution_id::PetscInt)

Set index of solution

Not Collective

Input Parameters:

  • viewer - PETSCVIEWERCGNS PetscViewer for CGNS input/output to use with the specified file
  • solution_id - Index of the solution id, or -1 for the last solution on the file

Level: intermediate

See also: PETSCVIEWERCGNS, PetscViewerCGNSGetSolutionIndex(), PetscViewerCGNSGetSolutionInfo()

External Links

source
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 - the PetscViewer context

Level: intermediate

See also: PetscViewer, PetscViewerReadable(), PetscViewerCheckWritable(), PetscViewerCreate(), PetscViewerFileSetMode(), PetscViewerFileSetType()

External Links

source
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 - the PetscViewer context

Level: intermediate

See also: PetscViewer, PetscViewerWritable(), PetscViewerCheckReadable(), PetscViewerCreate(), PetscViewerFileSetMode(), PetscViewerFileSetType()

External Links

source
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 the PetscViewer context

Level: advanced

See also: PetscViewer, PetscViewerDestroy(), PetscViewerSetType(), PetscViewerType

External Links

source
PETSc.LibPETSc.PetscViewerDestroy — Method
PetscViewerDestroy(petsclib::PetscLibType, viewer::Union{PetscViewer, Ref{PetscViewer}})

Destroys a PetscViewer.

Collective

Input Parameter:

  • viewer - the PetscViewer to be destroyed.

Level: beginner

See also: PetscViewer, PetscViewerCreate(), PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerDrawOpen()

External Links

source
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 - the PetscViewer (created with PetscViewerDrawOpen())
  • windownumber - how much to add to the base

Level: developer

See also: PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen(), PetscViewerDrawGetDraw(), PetscViewerDrawBaseSet()

External Links

source
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 - the PetscViewer (created with PetscViewerDrawOpen())
  • windownumber - value to set the base

Level: developer

See also: PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen(), PetscViewerDrawGetDraw(), PetscViewerDrawBaseAdd()

External Links

source
PETSc.LibPETSc.PetscViewerDrawClear — Method
PetscViewerDrawClear(petsclib::PetscLibType, viewer::PetscViewer)

Clears a PetscDraw graphic associated with a PetscViewer.

Not Collective

Input Parameter:

  • viewer - the PetscViewer

Level: intermediate

See also: PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawGetDraw()

External Links

source
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 - the PetscViewer (created with PetscViewerDrawOpen())

Output Parameters:

  • nbounds - number of plots that can be made with this viewer, for example the dof passed to DMDACreate()
  • 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

See also: PETSCVIEWERDRAW, PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen(), PetscViewerDrawSetBounds()

External Links

source
PETSc.LibPETSc.PetscViewerDrawGetDraw — Method
draw::PetscDraw = PetscViewerDrawGetDraw(petsclib::PetscLibType, viewer::PetscViewer, windownumber::PetscInt)

Returns PetscDraw object from PETSCVIEWERDRAW PetscViewer object. This PetscDraw object may then be used to perform graphics using PetscDraw commands.

Collective

Input Parameters:

  • viewer - the PetscViewer (created with PetscViewerDrawOpen() of type PETSCVIEWERDRAW)
  • windownumber - indicates which subwindow (usually 0) to obtain

Output Parameter:

  • draw - the draw object

Level: intermediate

See also: PETSCVIEWERDRAW, PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen()

External Links

source
PETSc.LibPETSc.PetscViewerDrawGetDrawAxis — Method
drawaxis::PetscDrawAxis = PetscViewerDrawGetDrawAxis(petsclib::PetscLibType, viewer::PetscViewer, windownumber::PetscInt)

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 - the PetscViewer (created with PetscViewerDrawOpen())
  • windownumber - indicates which subwindow (usually 0)

Output Parameter:

  • drawaxis - the draw axis object

Level: advanced

See also: PetscViewerDrawGetDraw(), PetscViewerDrawGetLG(), PetscViewerDrawOpen()

External Links

source
PETSc.LibPETSc.PetscViewerDrawGetDrawLG — Method
drawlg::PetscDrawLG = PetscViewerDrawGetDrawLG(petsclib::PetscLibType, viewer::PetscViewer, windownumber::PetscInt)

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 - the PetscViewer (created with PetscViewerDrawOpen())
  • windownumber - indicates which subwindow (usually 0)

Output Parameter:

  • drawlg - the draw line graph object

Level: intermediate

See also: PetscDrawLG, PetscViewerDrawGetDraw(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen()

External Links

source
PETSc.LibPETSc.PetscViewerDrawGetDrawType — Method
drawtype::String = PetscViewerDrawGetDrawType(petsclib::PetscLibType, v::PetscViewer)

Get the underlying PetscDrawType used by a PETSCVIEWERDRAW viewer.

Not Collective

Input Parameter:

  • v - the PETSCVIEWERDRAW viewer

Output Parameter:

  • drawtype - the PetscDrawType currently in use

Level: advanced

See also: PetscViewer, PETSCVIEWERDRAW, PetscDrawType, PetscViewerDrawSetDrawType(), PetscViewerDrawGetDraw()

External Links

source
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 - the PetscViewer

Output Parameter:

  • hold - indicates to hold or not

Level: intermediate

See also: PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawGetDraw()

External Links

source
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 - the PetscViewer

Output Parameter:

  • pause - the pause value

Level: intermediate

See also: PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawGetDraw()

External Links

source
PETSc.LibPETSc.PetscViewerDrawGetTitle — Method
title::String = PetscViewerDrawGetTitle(petsclib::PetscLibType, v::PetscViewer)

Get the default title used for PetscDraw windows created by a PETSCVIEWERDRAW viewer.

Not Collective; No Fortran Support

Input Parameter:

  • v - the PETSCVIEWERDRAW viewer

Output Parameter:

  • title - the window title (owned by the viewer; do not free)

Level: intermediate

See also: PetscViewer, PETSCVIEWERDRAW, PetscViewerDrawSetTitle(), PetscViewerDrawOpen(), PetscViewerDrawSetInfo()

External Links

source
PETSc.LibPETSc.PetscViewerDrawOpen — Method
viewer::PetscViewer = PetscViewerDrawOpen(petsclib::PetscLibType, comm::MPI_Comm, display::String, title::String, x::Cint, y::Cint, w::Cint, h::Cint)

Opens a PetscDraw window for use as a PetscViewer with type PETSCVIEWERDRAW.

Collective

Input Parameters:

  • comm - communicator that will share window
  • display - the X display on which to open, or NULL for the local machine
  • title - the title to put in the title bar, or NULL for no title
  • x - horizontal screen coordinate of the upper left corner of window, or use PETSC_DECIDE
  • y - vertical screen coordinate of the upper left corner of window, or use PETSC_DECIDE
  • w - window width in pixels, or may use PETSC_DECIDE or PETSC_DRAW_FULL_SIZE, PETSC_DRAW_HALF_SIZE,PETSC_DRAW_THIRD_SIZE, PETSC_DRAW_QUARTER_SIZE
  • h - window height in pixels, or may use PETSC_DECIDE or PETSC_DRAW_FULL_SIZE, PETSC_DRAW_HALF_SIZE,PETSC_DRAW_THIRD_SIZE, PETSC_DRAW_QUARTER_SIZE

Output Parameter:

  • viewer - the PetscViewer

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

See also: PETSCVIEWERDRAW, PetscDrawCreate(), PetscViewerDestroy(), PetscViewerDrawGetDraw(), PetscViewerCreate(), PETSC_VIEWER_DRAW_, PETSC_VIEWER_DRAW_WORLD, PETSC_VIEWER_DRAW_SELF

External Links

source
PETSc.LibPETSc.PetscViewerDrawResize — Method
PetscViewerDrawResize(petsclib::PetscLibType, v::PetscViewer, w::Cint, h::Cint)

Set the default width and height (in pixels) for PetscDraw windows created by a PETSCVIEWERDRAW viewer.

Logically Collective

Input Parameters:

  • v - the PETSCVIEWERDRAW viewer
  • w - the new default window width in pixels; values less than 1 are ignored
  • h - the new default window height in pixels; values less than 1 are ignored

Level: intermediate

See also: PetscViewer, PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawSetInfo()

External Links

source
PETSc.LibPETSc.PetscViewerDrawSetBounds — Method
PetscViewerDrawSetBounds(petsclib::PetscLibType, viewer::PetscViewer, nbounds::PetscInt, bounds::Vector{PetscReal})

sets the upper and lower bounds to be used in plotting in a PETSCVIEWERDRAW PetscViewer

Collective

Input Parameters:

  • viewer - the PetscViewer (created with PetscViewerDrawOpen())
  • nbounds - number of plots that can be made with this viewer, for example the dof passed to DMDACreate()
  • 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

See also: PETSCVIEWERDRAW, PetscViewerDrawGetLG(), PetscViewerDrawGetAxis(), PetscViewerDrawOpen()

External Links

source
PETSc.LibPETSc.PetscViewerDrawSetDrawType — Method
PetscViewerDrawSetDrawType(petsclib::PetscLibType, v::PetscViewer, drawtype::String)

Set the underlying PetscDrawType used by a PETSCVIEWERDRAW viewer.

Logically Collective

Input Parameters:

  • v - the PETSCVIEWERDRAW viewer
  • drawtype - the PetscDrawType (e.g. PETSC_DRAW_X, PETSC_DRAW_IMAGE, PETSC_DRAW_NULL)

Level: advanced

See also: PetscViewer, PETSCVIEWERDRAW, PetscDrawType, PetscViewerDrawGetDrawType(), PetscViewerDrawGetDraw()

External Links

source
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 - the PetscViewer
  • hold - PETSC_TRUE indicates to hold the previous image

Level: intermediate

See also: PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawGetDraw()

External Links

source
PETSc.LibPETSc.PetscViewerDrawSetInfo — Method
PetscViewerDrawSetInfo(petsclib::PetscLibType, v::PetscViewer, display::String, title::String, x::Cint, y::Cint, w::Cint, h::Cint)

Record the default display, title, position, and size to use for PetscDraw windows created by a PETSCVIEWERDRAW viewer.

Logically Collective

Input Parameters:

  • v - the PETSCVIEWERDRAW viewer
  • display - the X display name, or NULL for the local machine
  • title - the window title, or NULL
  • x - the horizontal screen coordinate of the upper left corner (unused; retained for API symmetry)
  • y - the vertical screen coordinate of the upper left corner (unused; retained for API symmetry)
  • w - the default window width in pixels; values less than 1 are ignored
  • h - the default window height in pixels; values less than 1 are ignored

Level: intermediate

See also: PetscViewer, PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawSetTitle(), PetscViewerDrawResize()

External Links

source
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 - the PetscViewer
  • pause - the pause value

Level: intermediate

See also: PETSCVIEWERDRAW, PetscViewerDrawOpen(), PetscViewerDrawGetDraw()

External Links

source
PETSc.LibPETSc.PetscViewerDrawSetTitle — Method
PetscViewerDrawSetTitle(petsclib::PetscLibType, v::PetscViewer, title::String)

Set the default title used for PetscDraw windows created by a PETSCVIEWERDRAW viewer.

Logically Collective

Input Parameters:

  • v - the PETSCVIEWERDRAW viewer
  • title - the window title, or NULL for no title

Level: intermediate

See also: PetscViewer, PETSCVIEWERDRAW, PetscViewerDrawGetTitle(), PetscViewerDrawOpen(), PetscViewerDrawSetInfo()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIGetId — Method
exoid::Cint = PetscViewerExodusIIGetId(petsclib::PetscLibType, viewer::PetscViewer)

Get the file id of the PETSCVIEWEREXODUSII file

Logically Collective

Input Parameter:

  • viewer - the PetscViewer

Output Parameter:

  • exoid - The ExodusII file id

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIGetNodalVariable — Method
num::PetscExodusIIInt = PetscViewerExodusIIGetNodalVariable(petsclib::PetscLibType, viewer::PetscViewer)

Gets the number of nodal variables in an ExodusII file

Collective

Input Parameters:

  • viewer - a PetscViewer of type PETSCVIEWEREXODUSII

Output Parameter:

  • num - the number variables in the ExodusII file

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIISetNodalVariable()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIGetNodalVariableIndex — Method
varIndex::PetscExodusIIInt = PetscViewerExodusIIGetNodalVariableIndex(petsclib::PetscLibType, viewer::PetscViewer, name::String)

return the location of a nodal variable in an ExodusII file given its name

Collective

Input Parameters:

  • viewer - a PetscViewer of type PETSCVIEWEREXODUSII
  • name - 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

See also: PetscViewerExodusIISetNodalVariable(), PetscViewerExodusIIGetNodalVariable(), PetscViewerExodusIISetNodalVariableName(), PetscViewerExodusIISetNodalVariableNames(), PetscViewerExodusIIGetNodalVariableName(), PetscViewerExodusIIGetNodalVariableNames()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIGetNodalVariableName — Method
name::String = PetscViewerExodusIIGetNodalVariableName(petsclib::PetscLibType, viewer::PetscViewer, idx::PetscExodusIIInt)

Gets the name of a nodal variable.

Collective;

Input Parameters:

  • viewer - a PetscViewer of type PETSCVIEWEREXODUSII
  • idx - the index for which you want to save the name

Output Parameter:

  • name - string array containing name characters

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIISetNodalVariableName()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIGetNodalVariableNames — Method
varNames::Ptr{Ptr{Cchar}} = PetscViewerExodusIIGetNodalVariableNames(petsclib::PetscLibType, viewer::PetscViewer, numVars::PetscExodusIIInt)

Gets the names of all nodal variables.

Collective; No Fortran Support

Input Parameters:

  • viewer - a PetscViewer of type PETSCVIEWEREXODUSII
  • numVars - 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

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIISetNodalVariableNames()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIGetOrder — Method
order::PetscInt = PetscViewerExodusIIGetOrder(petsclib::PetscLibType, viewer::PetscViewer)

Get the elements order in the ExodusII file.

Collective

Input Parameters:

  • viewer - the PETSCVIEWEREXODUSII viewer
  • order - elements order

Output Parameter:

Level: beginner

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerExodusIIGetId(), PetscViewerExodusIISetOrder()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIGetZonalVariable — Method
num::PetscExodusIIInt = PetscViewerExodusIIGetZonalVariable(petsclib::PetscLibType, viewer::PetscViewer)

Gets the number of zonal variables in an ExodusII file

Collective

Input Parameters:

  • viewer - a PetscViewer of type PETSCVIEWEREXODUSII

Output Parameter:

  • num - the number variables in the ExodusII file

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIsetZonalVariable()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIGetZonalVariableIndex — Method
varIndex::Cint = PetscViewerExodusIIGetZonalVariableIndex(petsclib::PetscLibType, viewer::PetscViewer, name::String)

return the location of a zonal variable in an ExodusII file given its name

Collective

Input Parameters:

  • viewer - a PetscViewer of type PETSCVIEWEREXODUSII
  • name - 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

See also: PetscViewerExodusIISetNodalVariable(), PetscViewerExodusIIGetNodalVariable(), PetscViewerExodusIISetNodalVariableName(), PetscViewerExodusIISetNodalVariableNames(), PetscViewerExodusIIGetNodalVariableName(), PetscViewerExodusIIGetNodalVariableNames()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIGetZonalVariableName — Method
name::String = PetscViewerExodusIIGetZonalVariableName(petsclib::PetscLibType, viewer::PetscViewer, idx::PetscExodusIIInt)

Gets the name of a zonal variable.

Collective;

Input Parameters:

  • viewer - a PetscViewer of type PETSCVIEWEREXODUSII
  • idx - the index for which you want to get the name

Output Parameter:

  • name - pointer to the string containing the name characters

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIISetZonalVariableName()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIGetZonalVariableNames — Method
varNames::Ptr{Ptr{Cchar}} = PetscViewerExodusIIGetZonalVariableNames(petsclib::PetscLibType, viewer::PetscViewer, numVars::PetscExodusIIInt)

Gets the names of all zonal variables.

Collective; No Fortran Support

Input Parameters:

  • viewer - a PetscViewer of type PETSCVIEWEREXODUSII
  • numVars - 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

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIISetZonalVariableNames()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIIOpen — Method
exo::PetscViewer = PetscViewerExodusIIOpen(petsclib::PetscLibType, comm::MPI_Comm, name::String, type::PetscFileMode)

Opens a file for ExodusII input/output.

Collective

Input Parameters:

  • comm - MPI communicator
  • name - name of file
  • type - type of file

$FILE_MODE_WRITE - create new file for binary output FILE_MODE_READ - open existing file for binary input FILE_MODE_APPEND - open existing file for binary output$

Output Parameter:

  • exo - PETSCVIEWEREXODUSII PetscViewer for Exodus II input/output to use with the specified file

Level: beginner

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerPushFormat(), PetscViewerDestroy(), DMLoad(), PetscFileMode, PetscViewerSetType(), PetscViewerFileSetMode(), PetscViewerFileSetName()

External Links

source
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 - a PetscViewer of type PETSCVIEWEREXODUSII
  • num - the number of nodal variables in the ExodusII file

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetNodalVariable()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIISetNodalVariableName — Method
PetscViewerExodusIISetNodalVariableName(petsclib::PetscLibType, viewer::PetscViewer, idx::PetscExodusIIInt, name::String)

Sets the name of a nodal variable.

Collective;

Input Parameters:

  • viewer - a PetscViewer of type PETSCVIEWEREXODUSII
  • idx - the index for which you want to save the name
  • name - string containing the name characters

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetNodalVariableName()

External Links

source
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 - a PetscViewer of type PETSCVIEWEREXODUSII
  • names - an array of string names to be set, the strings are copied into the PetscViewer

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetNodalVariableNames()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIISetOrder — Method
PetscViewerExodusIISetOrder(petsclib::PetscLibType, viewer::PetscViewer, order::PetscInt)

Set the elements order in the ExodusII file.

Collective

Input Parameters:

  • viewer - the PETSCVIEWEREXODUSII viewer
  • order - elements order

Output Parameter:

Level: beginner

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerExodusIIGetId(), PetscViewerExodusIIGetOrder()

External Links

source
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 - a PetscViewer of type PETSCVIEWEREXODUSII
  • num - the number of zonal variables in the ExodusII file

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetZonalVariable()

External Links

source
PETSc.LibPETSc.PetscViewerExodusIISetZonalVariableName — Method
PetscViewerExodusIISetZonalVariableName(petsclib::PetscLibType, viewer::PetscViewer, idx::PetscExodusIIInt, name::String)

Sets the name of a zonal variable.

Collective;

Input Parameters:

  • viewer - a PetscViewer of type PETSCVIEWEREXODUSII
  • idx - the index for which you want to save the name
  • name - string containing the name characters

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetZonalVariableName()

External Links

source
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 - a PetscViewer of type PETSCVIEWEREXODUSII
  • names - an array of string names to be set, the strings are copied into the PetscViewer

Level: intermediate

See also: PETSCVIEWEREXODUSII, PetscViewer, PetscViewerCreate(), PetscViewerDestroy(), PetscViewerExodusIIOpen(), PetscViewerSetType(), PetscViewerType, PetscViewerExodusIIGetZonalVariableNames()

External Links

source
PETSc.LibPETSc.PetscViewerFileGetMode — Method
mode::PetscFileMode = PetscViewerFileGetMode(petsclib::PetscLibType, viewer::PetscViewer)

Gets the open mode of a file associated with a PetscViewer

Not Collective

Input Parameter:

  • viewer - the PetscViewer; must be a PETSCVIEWERBINARY, PETSCVIEWERMATLAB, PETSCVIEWERHDF5, or PETSCVIEWERASCII PetscViewer

Output Parameter:

  • mode - open mode of file

$FILE_MODE_WRITE - create new file for binary output FILE_MODE_READ - open existing file for binary input FILE_MODE_APPEND - open existing file for binary output$

Level: advanced

See also: PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen()

External Links

source
PETSc.LibPETSc.PetscViewerFileGetName — Method
name::String = PetscViewerFileGetName(petsclib::PetscLibType, viewer::PetscViewer)

Gets the name of the file the PetscViewer is using

Not Collective

Input Parameter:

  • viewer - the PetscViewer

Output Parameter:

  • name - the name of the file it is using

Level: advanced

See also: PetscViewerCreate(), PetscViewerSetType(), PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), PetscViewerFileSetName()

External Links

source
PETSc.LibPETSc.PetscViewerFileSetMode — Method
PetscViewerFileSetMode(petsclib::PetscLibType, viewer::PetscViewer, mode::PetscFileMode)

Sets the open mode of file

Logically Collective

Input Parameters:

  • viewer - the PetscViewer; must be a PETSCVIEWERBINARY, PETSCVIEWERMATLAB, PETSCVIEWERHDF5, or PETSCVIEWERASCII PetscViewer
  • mode - open mode of file

$FILE_MODE_WRITE - create new file for output FILE_MODE_READ - open existing file for input FILE_MODE_APPEND - open existing file for output$

Level: advanced

See also: PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen()

External Links

source
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 - the PetscViewer; for example, of type PETSCVIEWERASCII or PETSCVIEWERBINARY
  • name - the name of the file it should use

Level: advanced

See also: PetscViewerCreate(), PetscViewerSetType(), PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), PetscViewerDestroy(), PetscViewerASCIIGetPointer(), PetscViewerASCIIPrintf(), PetscViewerASCIISynchronizedPrintf()

External Links

source
PETSc.LibPETSc.PetscViewerFlowControlEndMain — Method
mcnt::PetscInt = PetscViewerFlowControlEndMain(petsclib::PetscLibType, viewer::PetscViewer)

Finish a flow-controlled viewer operation on the main MPI process by signalling completion to the workers

Collective

Input Parameter:

  • viewer - the binary viewer

Input/Output Parameter:

  • mcnt - the flow-control counter; reset to 0 and broadcast to signal completion

Level: developer

See also: PetscViewer, PetscViewerFlowControlStart(), PetscViewerFlowControlStepMain(), PetscViewerFlowControlStepWorker(), PetscViewerFlowControlEndWorker()

External Links

source
PETSc.LibPETSc.PetscViewerFlowControlEndWorker — Method
mcnt::PetscInt = PetscViewerFlowControlEndWorker(petsclib::PetscLibType, viewer::PetscViewer)

Wait on a worker MPI process for the main MPI process to signal completion of a flow-controlled viewer operation

Collective

Input Parameter:

  • viewer - the binary viewer

Input/Output Parameter:

  • mcnt - the flow-control counter; updated with values broadcast from the main MPI process until it becomes 0

Level: developer

See also: PetscViewer, PetscViewerFlowControlStart(), PetscViewerFlowControlStepMain(), PetscViewerFlowControlEndMain(), PetscViewerFlowControlStepWorker()

External Links

source
PETSc.LibPETSc.PetscViewerFlowControlStart — Method
mcnt::PetscInt,cnt::PetscInt = PetscViewerFlowControlStart(petsclib::PetscLibType, viewer::PetscViewer)

Begin a flow-controlled viewer operation on the main MPI process

Collective

Input Parameter:

  • viewer - the binary viewer

Output Parameters:

  • mcnt - the current flow-control counter on the main MPI process
  • cnt - the flow-control window size (also read from the viewer)

Level: developer

See also: PetscViewer, PetscViewerFlowControlStepMain(), PetscViewerFlowControlEndMain(), PetscViewerFlowControlStepWorker(), PetscViewerFlowControlEndWorker(), PetscViewerBinaryGetFlowControl()

External Links

source
PETSc.LibPETSc.PetscViewerFlowControlStepMain — Method
mcnt::PetscInt = PetscViewerFlowControlStepMain(petsclib::PetscLibType, viewer::PetscViewer, i::PetscInt, cnt::PetscInt)

Advance the flow-control window on the main MPI process during a viewer operation

Collective

Input Parameters:

  • viewer - the binary viewer
  • i - the current MPI rank being served
  • cnt - the flow-control window size returned by PetscViewerFlowControlStart()

Input/Output Parameter:

  • mcnt - the running flow-control counter; incremented and broadcast when i reaches it

Level: developer

See also: PetscViewer, PetscViewerFlowControlStart(), PetscViewerFlowControlEndMain(), PetscViewerFlowControlStepWorker(), PetscViewerFlowControlEndWorker()

External Links

source
PETSc.LibPETSc.PetscViewerFlowControlStepWorker — Method
mcnt::PetscInt = PetscViewerFlowControlStepWorker(petsclib::PetscLibType, viewer::PetscViewer, rank::PetscMPIInt)

Wait on a worker MPI process until the flow-control window includes this rank

Collective

Input Parameters:

  • viewer - the binary viewer
  • rank - the calling MPI process rank

Input/Output Parameter:

  • mcnt - the flow-control counter; updated with values broadcast from the main MPI process until it exceeds rank

Level: developer

See also: PetscViewer, PetscViewerFlowControlStart(), PetscViewerFlowControlStepMain(), PetscViewerFlowControlEndMain(), PetscViewerFlowControlEndWorker()

External Links

source
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 - the PetscViewer to be flushed

Level: intermediate

See also: PetscViewer, PetscViewerWriteable(), PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscViewerCreate(), PetscViewerDestroy(), PetscViewerSetType()

External Links

source
PETSc.LibPETSc.PetscViewerGLVisOpen — Method
viewer::PetscViewer = PetscViewerGLVisOpen(petsclib::PetscLibType, comm::MPI_Comm, type::PetscViewerGLVisType, name::String, port::PetscInt)

Opens a PETSCVIEWERGLVIS PetscViewer

Collective; No Fortran Support

Input Parameters:

  • comm - the MPI communicator
  • type - the viewer type: PETSC_VIEWER_GLVIS_SOCKET for real-time visualization or PETSC_VIEWER_GLVIS_DUMP for dumping to a file
  • name - either the hostname where the GLVis server is running or the base filename for dumping the data for subsequent visualizations
  • port - socket port where the GLVis server is listening. Not referenced when type is PETSC_VIEWER_GLVIS_DUMP

Output Parameter:

  • viewer - the PetscViewer object

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

See also: PETSCVIEWERGLVIS, PetscViewerCreate(), PetscViewerSetType(), PetscViewerGLVisType

External Links

source
PETSc.LibPETSc.PetscViewerGLVisSetFields — Method
PetscViewerGLVisSetFields(petsclib::PetscLibType, viewer::PetscViewer, nf::PetscInt, fec_type::String, dim::Vector{PetscInt}, g2l::external, Vfield::Vector{PetscObject}, ctx::Ptr{Cvoid}, destroyctx::Ptr{Cvoid})

Sets the required information to visualize different fields from a vector.

Logically Collective

Input Parameters:

  • viewer - the PetscViewer of type PETSCVIEWERGLVIS
  • nf - number of fields to be visualized
  • fec_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 prototype
  • Vfield - array of work vectors, one for each field
  • ctx - User context to store the relevant data to apply g2lfields
  • destroyctx - Destroy function for ctx

Level: intermediate

See also: PETSCVIEWERGLVIS, PetscViewerGLVisOpen(), PetscViewerCreate(), PetscViewerSetType(), PetscObjectSetName()

External Links

source
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 - the PetscViewer of type PETSCVIEWERGLVIS
  • prec - the number of digits required

Level: beginner

See also: PETSCVIEWERGLVIS, PetscViewerGLVisOpen(), PetscViewerGLVisSetFields(), PetscViewerCreate(), PetscViewerSetType()

External Links

source
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 - the PetscViewer of type PETSCVIEWERGLVIS
  • id - the current snapshot id in a time-dependent simulation

Level: beginner

See also: PETSCVIEWERGLVIS, PetscViewerGLVisOpen(), PetscViewerGLVisSetFields(), PetscViewerCreate(), PetscViewerSetType()

External Links

source
PETSc.LibPETSc.PetscViewerGetFormat — Method
format::PetscViewerFormat = PetscViewerGetFormat(petsclib::PetscLibType, viewer::PetscViewer)

Gets the current format for PetscViewer.

Not Collective

Input Parameter:

  • viewer - the PetscViewer

Output Parameter:

  • format - the format

Level: intermediate

See also: PetscViewer, PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), MatView(), VecView(), PetscViewerType, PetscViewerPushFormat(), PetscViewerPopFormat(), PetscViewerDrawOpen(), PetscViewerSocketOpen()

External Links

source
PETSc.LibPETSc.PetscViewerGetOptionsPrefix — Method
prefix::String = PetscViewerGetOptionsPrefix(petsclib::PetscLibType, viewer::PetscViewer)

Gets the prefix used for searching for PetscViewer options in the database during PetscViewerSetFromOptions().

Not Collective

Input Parameter:

  • viewer - the PetscViewer context

Output Parameter:

  • prefix - pointer to the prefix string used

Level: advanced

See also: PetscViewer, PetscViewerAppendOptionsPrefix(), PetscViewerSetOptionsPrefix()

External Links

source
PETSc.LibPETSc.PetscViewerGetSubViewer — Method
outviewer::PetscViewer = PetscViewerGetSubViewer(petsclib::PetscLibType, viewer::PetscViewer, comm::MPI_Comm)

Creates a new PetscViewer (same type as the old) that lives on a subcommunicator of the original viewer's communicator

Collective

Input Parameters:

  • viewer - the PetscViewer to be reproduced
  • comm - the sub communicator to use

Output Parameter:

  • outviewer - new PetscViewer

Level: advanced

See also: PetscViewer, PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscViewerFlush(), PetscViewerRestoreSubViewer()

External Links

source
PETSc.LibPETSc.PetscViewerGetType — Method
type::String = PetscViewerGetType(petsclib::PetscLibType, viewer::PetscViewer)

Returns the type of a PetscViewer.

Not Collective

Input Parameter:

  • viewer - the PetscViewer

Output Parameter:

  • type - PetscViewerType

Level: intermediate

See also: PetscViewerType, PetscViewer, PetscViewerCreate(), PetscViewerSetType(), PetscObjectTypeCompare(), PetscObjectTypeCompareAny()

External Links

source
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 - the PetscViewer, must be PETSCVIEWERHDF5

Output Parameter:

  • flg - if PETSC_TRUE the vector will always have at least a dimension of 2 even if that first dimension is of size 1

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5GetCollective — Method
flg::PetscBool = PetscViewerHDF5GetCollective(petsclib::PetscLibType, viewer::PetscViewer)

Return flag whether collective MPI-IO transfer mode is used for HDF5 reads and writes.

Not Collective

Input Parameter:

  • viewer - the PETSCVIEWERHDF5 PetscViewer

Output Parameter:

  • flg - the flag

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5SetCollective(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerHDF5Open()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5GetCompress — Method
flg::PetscBool = PetscViewerHDF5GetCompress(petsclib::PetscLibType, viewer::PetscViewer)

Get the flag for compression

Not Collective

Input Parameter:

  • viewer - the PetscViewer of type PETSCVIEWERHDF5

Output Parameter:

  • flg - if PETSC_TRUE we will turn on compression

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5SetCompress()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5GetDMPlexStorageVersionReading — Method
version::DMPlexStorageVersion = PetscViewerHDF5GetDMPlexStorageVersionReading(petsclib::PetscLibType, viewer::PetscViewer)

Get the storage version for reading

Logically collective

Input Parameter:

  • viewer - The PetscViewer

Output Parameter:

  • version - The storage format version

Options Database Keys:

  • -dm_plex_view_hdf5_storage_version num - Overrides the storage format version

Level: advanced

See also: DM, PetscViewerHDF5SetDMPlexStorageVersionReading(), PetscViewerHDF5GetDMPlexStorageVersionWriting(), PetscViewerHDF5SetDMPlexStorageVersionWriting()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5GetDMPlexStorageVersionWriting — Method
version::DMPlexStorageVersion = PetscViewerHDF5GetDMPlexStorageVersionWriting(petsclib::PetscLibType, viewer::PetscViewer)

Get the storage version for writing

Logically collective

Input Parameter:

  • viewer - The PetscViewer

Output Parameter:

  • version - The storage format version

Options Database Keys:

  • -dm_plex_view_hdf5_storage_version num - Overrides the storage format version

Level: advanced

See also: DM, PetscViewerHDF5SetDMPlexStorageVersionWriting(), PetscViewerHDF5GetDMPlexStorageVersionReading(), PetscViewerHDF5SetDMPlexStorageVersionReading()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5GetDefaultTimestepping — Method
flg::PetscBool = PetscViewerHDF5GetDefaultTimestepping(petsclib::PetscLibType, viewer::PetscViewer)

Get the flag for default timestepping

Not Collective

Input Parameter:

  • viewer - the PetscViewer of type PETSCVIEWERHDF5

Output Parameter:

  • flg - if PETSC_TRUE we will assume that timestepping is on

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5SetDefaultTimestepping(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5GetTimestep()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5GetFileId — Method
file_id::hid_t = PetscViewerHDF5GetFileId(petsclib::PetscLibType, viewer::PetscViewer)

Retrieve the file id, this file ID then can be used in direct HDF5 calls

Not Collective

Input Parameter:

  • viewer - the PetscViewer

Output Parameter:

  • file_id - The file id

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5GetGroup — Method
abspath::String = PetscViewerHDF5GetGroup(petsclib::PetscLibType, viewer::PetscViewer, path::String)

Get the current HDF5 group name (full path), set with PetscViewerHDF5PushGroup()/PetscViewerHDF5PopGroup().

Not Collective

Input Parameters:

  • viewer - the PetscViewer of type PETSCVIEWERHDF5
  • path - (Optional) The path relative to the pushed group

Output Parameter:

  • abspath - The absolute HDF5 path (group)

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5OpenGroup(), PetscViewerHDF5WriteGroup()

External Links

source
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 type PETSCVIEWERHDF5

Output Parameter:

  • flg - if PETSC_TRUE the data will be written to disk with single precision

Level: intermediate

See also: PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen(), PetscReal, PetscViewerHDF5SetSPOutput()

External Links

source
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 - the PetscViewer of type PETSCVIEWERHDF5

Output Parameter:

  • timestep - The timestep

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5IncrementTimestep(), PetscViewerHDF5SetTimestep()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5HasAttribute — Method
has::PetscBool = PetscViewerHDF5HasAttribute(petsclib::PetscLibType, viewer::PetscViewer, parent::String, name::String)

Check whether an attribute exists

Collective

Input Parameters:

  • viewer - The PETSCVIEWERHDF5 viewer
  • parent - The parent dataset/group name
  • name - The attribute name

Output Parameter:

  • has - Flag for attribute existence

Level: advanced

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5HasObjectAttribute(), PetscViewerHDF5WriteAttribute(), PetscViewerHDF5ReadAttribute(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()

External Links

source
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 - The PETSCVIEWERHDF5 viewer
  • path - The dataset path

Output Parameter:

  • has - Flag whether dataset exists

Level: advanced

See also: PETSCVIEWERHDF5, PetscViewerHDF5HasObject(), PetscViewerHDF5HasAttribute(), PetscViewerHDF5HasGroup(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()

External Links

source
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 - The PETSCVIEWERHDF5 viewer
  • path - (Optional) The path relative to the pushed group

Output Parameter:

  • has - Flag for group existence

Level: advanced

See also: PETSCVIEWERHDF5, PetscViewerHDF5HasAttribute(), PetscViewerHDF5HasDataset(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup(), PetscViewerHDF5OpenGroup()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5HasObject — Method
has::PetscBool = PetscViewerHDF5HasObject(petsclib::PetscLibType, viewer::PetscViewer, obj)

Check whether a dataset with the same name as given object exists in the HDF5 file under current group

Collective

Input Parameters:

  • viewer - The PETSCVIEWERHDF5 viewer
  • obj - The named object

Output Parameter:

  • has - Flag for dataset existence

Level: advanced

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5HasDataset(), PetscViewerHDF5HasAttribute(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5HasObjectAttribute — Method
has::PetscBool = PetscViewerHDF5HasObjectAttribute(petsclib::PetscLibType, viewer::PetscViewer, obj, name::String)

Check whether an attribute is attached to the dataset matching the given PetscObject by name

Collective

Input Parameters:

  • viewer - The PETSCVIEWERHDF5 viewer
  • obj - 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

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5HasAttribute(), PetscViewerHDF5WriteObjectAttribute(), PetscViewerHDF5ReadObjectAttribute(), PetscViewerHDF5HasObject(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()

External Links

source
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 - the PetscViewer of type PETSCVIEWERHDF5

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5SetTimestep(), PetscViewerHDF5GetTimestep()

External Links

source
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 - the PetscViewer of type PETSCVIEWERHDF5

Output Parameter:

  • flg - is timestepping active?

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5PopTimestepping(), PetscViewerHDF5SetTimestep(), PetscViewerHDF5IncrementTimestep(), PetscViewerHDF5GetTimestep()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5Load — Method
newarr::Ptr{Cvoid} = PetscViewerHDF5Load(petsclib::PetscLibType, viewer::PetscViewer, name::String, map::PetscLayout, datatype::hid_t)

Read a raw array from the PETSCVIEWERHDF5 dataset in parallel

Collective; No Fortran Support

Input Parameters:

  • viewer - The PETSCVIEWERHDF5 viewer
  • name - The dataset name
  • datatype - 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

See also: PetscViewer, PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushGroup(), PetscViewerHDF5OpenGroup(), PetscViewerHDF5ReadSizes(), VecLoad(), ISLoad(), PetscLayout

External Links

source
PETSc.LibPETSc.PetscViewerHDF5Open — Method
hdf5v::PetscViewer = PetscViewerHDF5Open(petsclib::PetscLibType, comm::MPI_Comm, name::String, type::PetscFileMode)

Opens a file for HDF5 input/output as a PETSCVIEWERHDF5 PetscViewer

Collective

Input Parameters:

  • comm - MPI communicator
  • name - name of file
  • type - type of file

Output Parameter:

  • hdf5v - PetscViewer for 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

See also: PETSCVIEWERHDF5, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), PetscViewerHDF5SetBaseDimension2(), PetscViewerHDF5SetSPOutput(), PetscViewerHDF5GetBaseDimension2(), VecView(), MatView(), VecLoad(), MatLoad(), PetscFileMode, PetscViewer, PetscViewerSetType(), PetscViewerFileSetMode(), PetscViewerFileSetName()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5OpenGroup — Method
fileId::hid_t,groupId::hid_t = PetscViewerHDF5OpenGroup(petsclib::PetscLibType, viewer::PetscViewer, path::String)

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 - the PetscViewer of type PETSCVIEWERHDF5
  • path - (Optional) The path relative to the pushed group

Output Parameters:

  • fileId - The HDF5 file ID
  • groupId - The HDF5 group ID

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup(), PetscViewerHDF5WriteGroup()

External Links

source
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 - the PetscViewer of type PETSCVIEWERHDF5

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushGroup(), PetscViewerHDF5GetGroup(), PetscViewerHDF5OpenGroup(), PetscViewerHDF5WriteGroup()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5PopTimestepping — Method
PetscViewerHDF5PopTimestepping(petsclib::PetscLibType, viewer::PetscViewer)

Deactivate timestepping mode for subsequent HDF5 reading and writing.

Not Collective

Input Parameter:

  • viewer - the PetscViewer of type PETSCVIEWERHDF5

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5IsTimestepping(), PetscViewerHDF5SetTimestep(), PetscViewerHDF5IncrementTimestep(), PetscViewerHDF5GetTimestep()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5PushGroup — Method
PetscViewerHDF5PushGroup(petsclib::PetscLibType, viewer::PetscViewer, name::String)

Set the current HDF5 group for output

Not Collective

Input Parameters:

  • viewer - the PetscViewer of type PETSCVIEWERHDF5
  • name - The group name

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup(), PetscViewerHDF5OpenGroup(), PetscViewerHDF5WriteGroup()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5PushTimestepping — Method
PetscViewerHDF5PushTimestepping(petsclib::PetscLibType, viewer::PetscViewer)

Activate timestepping mode for subsequent HDF5 reading and writing.

Not Collective

Input Parameter:

  • viewer - the PetscViewer of type PETSCVIEWERHDF5

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PopTimestepping(), PetscViewerHDF5IsTimestepping(), PetscViewerHDF5SetTimestep(), PetscViewerHDF5IncrementTimestep(), PetscViewerHDF5GetTimestep()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5ReadAttribute — Method
value::Ptr{Cvoid} = PetscViewerHDF5ReadAttribute(petsclib::PetscLibType, viewer::PetscViewer, parent::String, name::String, datatype::PetscDataType, defaultValue::Ptr{Cvoid})

Read an attribute

Collective

Input Parameters:

  • viewer - The PETSCVIEWERHDF5 viewer
  • parent - The parent dataset/group name
  • name - The attribute name
  • datatype - The attribute type
  • defaultValue - The pointer to the default value

Output Parameter:

  • value - The pointer to the read HDF5 attribute value

Level: advanced

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5ReadObjectAttribute(), PetscViewerHDF5WriteAttribute(), PetscViewerHDF5HasAttribute(), PetscViewerHDF5HasObject(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5ReadObjectAttribute — Method
value::Ptr{Cvoid} = PetscViewerHDF5ReadObjectAttribute(petsclib::PetscLibType, viewer::PetscViewer, obj, name::String, datatype::PetscDataType, defaultValue::Ptr{Cvoid})

Read an attribute from the dataset matching the given PetscObject by name

Collective

Input Parameters:

  • viewer - The PETSCVIEWERHDF5 viewer
  • obj - The object whose name is used to lookup the parent dataset, relative to the current group.
  • name - The attribute name
  • datatype - The attribute type
  • defaultValue - The default attribute value

Output Parameter:

  • value - The attribute value

Level: advanced

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5ReadAttribute(), PetscViewerHDF5WriteObjectAttribute(), PetscViewerHDF5HasObjectAttribute(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()

External Links

source
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 - The PETSCVIEWERHDF5 viewer
  • name - The dataset name

Output Parameters:

  • bs - block size
  • N - global size

Level: advanced

See also: PetscViewer, PETSCVIEWERHDF5, PetscViewerHDF5Open(), VecLoad(), ISLoad(), VecGetSize(), ISGetSize(), PetscViewerHDF5SetBaseDimension2()

External Links

source
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 - the PetscViewer; if it is a PETSCVIEWERHDF5 then this command is ignored
  • flg - if PETSC_TRUE the 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

See also: PETSCVIEWERHDF5, PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5SetCollective — Method
PetscViewerHDF5SetCollective(petsclib::PetscLibType, viewer::PetscViewer, flg::PetscBool)

Use collective MPI-IO transfer mode for HDF5 reads and writes.

Logically Collective; flg must contain common value

Input Parameters:

  • viewer - the PetscViewer; if it is not PETSCVIEWERHDF5 then this command is ignored
  • flg - PETSC_TRUE for collective mode; PETSC_FALSE for independent mode (default)

Options Database Key:

  • -viewer_hdf5_collective - turns on (true) or off (false) collective transfers

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5GetCollective(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerHDF5Open()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5SetCompress — Method
PetscViewerHDF5SetCompress(petsclib::PetscLibType, viewer::PetscViewer, flg::PetscBool)

Set the flag for compression

Logically Collective

Input Parameters:

  • viewer - the PetscViewer; if it is not PETSCVIEWERHDF5 then this command is ignored
  • flg - if PETSC_TRUE we will turn on compression

Options Database Key:

  • -viewer_hdf5_compress - turns on (true) or off (false) compression

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5GetCompress()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5SetDMPlexStorageVersionReading — Method
PetscViewerHDF5SetDMPlexStorageVersionReading(petsclib::PetscLibType, viewer::PetscViewer, version::DMPlexStorageVersion)

Set the storage version for reading

Logically collective

Input Parameters:

  • viewer - The PetscViewer
  • version - The storage format version

Level: advanced

See also: DM, PetscViewerHDF5GetDMPlexStorageVersionReading(), PetscViewerHDF5GetDMPlexStorageVersionWriting(), PetscViewerHDF5SetDMPlexStorageVersionWriting()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5SetDMPlexStorageVersionWriting — Method
PetscViewerHDF5SetDMPlexStorageVersionWriting(petsclib::PetscLibType, viewer::PetscViewer, version::DMPlexStorageVersion)

Set the storage version for writing

Logically collective

Input Parameters:

  • viewer - The PetscViewer
  • version - The storage format version

Level: advanced

See also: DM, PetscViewerHDF5GetDMPlexStorageVersionWriting(), PetscViewerHDF5GetDMPlexStorageVersionReading(), PetscViewerHDF5SetDMPlexStorageVersionReading()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5SetDefaultTimestepping — Method
PetscViewerHDF5SetDefaultTimestepping(petsclib::PetscLibType, viewer::PetscViewer, flg::PetscBool)

Set the flag for default timestepping

Logically Collective

Input Parameters:

  • viewer - the PetscViewer; if it is not PETSCVIEWERHDF5 then this command is ignored
  • flg - if PETSC_TRUE we will assume that timestepping is on

Options Database Key:

  • -viewer_hdf5_default_timestepping - turns on (true) or off (false) default timestepping

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5GetDefaultTimestepping(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5GetTimestep()

External Links

source
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 a PETSCVIEWERHDF5 then this command is ignored
  • flg - if PETSC_TRUE the 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

See also: PETSCVIEWERHDF5, PetscViewerFileSetMode(), PetscViewerCreate(), PetscViewerSetType(), PetscViewerBinaryOpen(), PetscReal, PetscViewerHDF5GetSPOutput()

External Links

source
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 - the PetscViewer of type PETSCVIEWERHDF5
  • timestep - The timestep

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushTimestepping(), PetscViewerHDF5IncrementTimestep(), PetscViewerHDF5GetTimestep()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5WriteAttribute — Method
PetscViewerHDF5WriteAttribute(petsclib::PetscLibType, viewer::PetscViewer, parent::String, name::String, datatype::PetscDataType, value::Ptr{Cvoid})

Write an attribute

Collective

Input Parameters:

  • viewer - The PETSCVIEWERHDF5 viewer
  • parent - The parent dataset/group name
  • name - The attribute name
  • datatype - The attribute type
  • value - The attribute value

Level: advanced

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5WriteObjectAttribute(), PetscViewerHDF5ReadAttribute(), PetscViewerHDF5HasAttribute(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()

External Links

source
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 - the PetscViewer of type PETSCVIEWERHDF5
  • path - (Optional) The path relative to the pushed group

Level: intermediate

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup(), PetscViewerHDF5OpenGroup()

External Links

source
PETSc.LibPETSc.PetscViewerHDF5WriteObjectAttribute — Method
PetscViewerHDF5WriteObjectAttribute(petsclib::PetscLibType, viewer::PetscViewer, obj, name::String, datatype::PetscDataType, value::Ptr{Cvoid})

Write an attribute to the dataset matching the given PetscObject by name

Collective

Input Parameters:

  • viewer - The PETSCVIEWERHDF5 viewer
  • obj - The object whose name is used to lookup the parent dataset, relative to the current group.
  • name - The attribute name
  • datatype - The attribute type
  • value - The attribute value

Level: advanced

See also: PETSCVIEWERHDF5, PetscViewerHDF5Open(), PetscViewerHDF5WriteAttribute(), PetscViewerHDF5ReadObjectAttribute(), PetscViewerHDF5HasObjectAttribute(), PetscViewerHDF5HasObject(), PetscViewerHDF5PushGroup(), PetscViewerHDF5PopGroup(), PetscViewerHDF5GetGroup()

External Links

source
PETSc.LibPETSc.PetscViewerMathematicaGetName — Method
name::String = PetscViewerMathematicaGetName(petsclib::PetscLibType, viewer::PetscViewer)

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

See also: PETSCVIEWERMATHEMATICA, PetscViewerMathematicaSetName(), PetscViewerMathematicaClearName()

External Links

source
PETSc.LibPETSc.PetscViewerMathematicaOpen — Method
v::PetscViewer = PetscViewerMathematicaOpen(petsclib::PetscLibType, comm::MPI_Comm, port::Cint, machine::String, mode::String)

Communicates with Mathemtica using MathLink.

Collective

Input Parameters:

  • comm - The MPI communicator
  • port - [optional] The port to connect on, or PETSC_DECIDE
  • machine - [optional] The machine to run Mathematica on, or NULL
  • mode - [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

See also: PETSCVIEWERMATHEMATICA, MatView(), VecView()

External Links

source
PETSc.LibPETSc.PetscViewerMathematicaPutCSRMatrix — Method
i::Cint,j::Cint,a::PetscReal = PetscViewerMathematicaPutCSRMatrix(petsclib::PetscLibType, viewer::PetscViewer, m::Cint, n::Cint)

Send a sparse matrix in CSR format to a Mathematica kernel as a LinearAlgebraCSRMatrix bound to a symbol in the kernel's namespace.

Not Collective

Input Parameters:

  • viewer - the PETSCVIEWERMATHEMATICA viewer
  • m - the number of rows
  • n - the number of columns
  • i - CSR row pointers of length m + 1
  • j - CSR column indices
  • a - CSR nonzero values

Level: developer

See also: PetscViewer, PETSCVIEWERMATHEMATICA, PetscViewerMathematicaPutMatrix(), PetscViewerMathematicaSetName()

External Links

source
PETSc.LibPETSc.PetscViewerMathematicaPutMatrix — Method
a::PetscReal = PetscViewerMathematicaPutMatrix(petsclib::PetscLibType, viewer::PetscViewer, m::Cint, n::Cint)

Send a dense matrix to a Mathematica kernel as a two-dimensional array bound to a symbol in the kernel's namespace.

Not Collective

Input Parameters:

  • viewer - the PETSCVIEWERMATHEMATICA viewer
  • m - the number of rows
  • n - the number of columns
  • a - the matrix values, in column-major order, of length m * n

Level: developer

See also: PetscViewer, PETSCVIEWERMATHEMATICA, PetscViewerMathematicaPutCSRMatrix(), PetscViewerMathematicaSetName()

External Links

source
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 viewer
  • name - The name for new objects created in Mathematica

Level: intermediate

See also: PETSCVIEWERMATHEMATICA, PetscViewerMathematicaClearName()

External Links

source
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 viewer
  • type - The packet type to search for, e.g RETURNPKT

Level: advanced

See also: PetscViewerMathematicaSetName(), PetscViewerMathematicaGetVector()

External Links

source
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 viewer
  • m - the first dimensions of array
  • n - the second dimensions of array
  • array - the array (represented in one dimension), must of be length m * n
  • name - the MATLAB name of array

Level: advanced

See also: PETSCVIEWERMATLAB, PetscViewerMatlabPutArray()

External Links

source
PETSc.LibPETSc.PetscViewerMatlabOpen — Method
binv::PetscViewer = PetscViewerMatlabOpen(petsclib::PetscLibType, comm::MPI_Comm, name::String, type::PetscFileMode)

Opens a MATLAB .mat file for output

Collective

Input Parameters:

  • comm - MPI communicator
  • name - name of file
  • type - type of file

$FILE_MODE_WRITE - create new file for MATLAB output FILE_MODE_READ - open existing file for MATLAB input FILE_MODE_WRITE - open existing file for MATLAB output$

Output Parameter:

  • binv - PetscViewer for MATLAB output to use with the specified file

Level: beginner

See also: PETSCVIEWERMATLAB, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), PETSCVIEWERBINARY, PetscViewerBinaryOpen(), VecView(), MatView(), VecLoad(), MatLoad()

External Links

source
PETSc.LibPETSc.PetscViewerMatlabPutArray — Method
PetscViewerMatlabPutArray(petsclib::PetscLibType, mfile::PetscViewer, m::Cint, n::Cint, array::Vector{PetscScalar}, name::String)

Puts an array into the PETSCVIEWERMATLAB viewer.

Not Collective, only processor zero saves array

Input Parameters:

  • mfile - the viewer
  • m - the first dimensions of array
  • n - the second dimensions of array
  • array - the array (represented in one dimension)
  • name - the MATLAB name of array

Level: advanced

See also: PETSCVIEWERMATLAB, PetscViewerMatlabGetArray()

External Links

source
PETSc.LibPETSc.PetscViewerMatlabPutVariable — Method
PetscViewerMatlabPutVariable(petsclib::PetscLibType, viewer::PetscViewer, name::String, mat::Ptr{Cvoid})

Write a raw MATLAB mxArray variable into a PETSCVIEWERMATLAB file under a chosen name.

Not Collective; only processor zero writes the variable

Input Parameters:

  • viewer - the PETSCVIEWERMATLAB viewer
  • name - the MATLAB variable name
  • mat - the mxArray * variable to write (cast to void *)

Level: advanced

See also: PetscViewer, PETSCVIEWERMATLAB, PetscViewerMatlabPutArray(), PetscViewerMatlabGetArray(), PetscViewerMatlabOpen()

External Links

source
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 a PETSCVIEWERDRAW it will set to that PetscViewerType
  • host - the host to open the window on, NULL indicates the local host
  • title - the title at the top of the window
  • metric - the label above the graph
  • l - the number of curves
  • names - 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 use PETSC_DECIDE
  • y - vertical screen coordinate of the upper left corner of window, or use PETSC_DECIDE
  • m - window width in pixels, or may use PETSC_DECIDE or PETSC_DRAW_FULL_SIZE, PETSC_DRAW_HALF_SIZE,PETSC_DRAW_THIRD_SIZE, PETSC_DRAW_QUARTER_SIZE
  • n - window height in pixels, or may use PETSC_DECIDE or PETSC_DRAW_FULL_SIZE, PETSC_DRAW_HALF_SIZE,PETSC_DRAW_THIRD_SIZE, PETSC_DRAW_QUARTER_SIZE

Level: developer

See also: PetscViewer(), PETSCVIEWERDRAW, PetscViewerDrawGetDrawLG(), PetscViewerDrawOpen(), PetscViewerDrawSetInfo()

External Links

source
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 - the PetscViewer

Level: intermediate

See also: PetscViewer, PetscViewerFormat, PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), MatView(), VecView(), PetscViewerSetFormat(), PetscViewerPushFormat()

External Links

source
PETSc.LibPETSc.PetscViewerPushFormat — Method
PetscViewerPushFormat(petsclib::PetscLibType, viewer::PetscViewer, format::PetscViewerFormat)

Sets the format for a PetscViewer.

Logically Collective

Input Parameters:

  • viewer - the PetscViewer
  • format - the format

Level: intermediate

See also: PetscViewer, PetscViewerFormat, PetscViewerASCIIOpen(), PetscViewerBinaryOpen(), MatView(), VecView(), PetscViewerSetFormat(), PetscViewerPopFormat()

External Links

source
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 communicator
  • pyname - full dotted Python name [package].module[.{class|function}]

Output Parameter:

  • viewer - the viewer

Level: intermediate

See also: PetscViewer, PetscViewerType, PETSCVIEWERPYTHON, PetscViewerPythonSetType(), PetscPythonInitialize(), PetscViewerPythonViewObject()

External Links

source
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

See also: PetscViewer, PetscViewerType, PetscViewerCreate(), PetscViewerSetType(), PETSCVIEWERPYTHON, PetscPythonInitialize(), PetscViewerPythonSetType()

External Links

source
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

See also: PetscViewer, PetscViewerType, PetscViewerCreate(), PetscViewerSetType(), PETSCVIEWERPYTHON, PetscPythonInitialize()

External Links

source
PETSc.LibPETSc.PetscViewerRead — Method
count::PetscInt = PetscViewerRead(petsclib::PetscLibType, viewer::PetscViewer, data::Ptr{Cvoid}, num::PetscInt, dtype::PetscDataType)

Reads data from a PetscViewer

Collective

Input Parameters:

  • viewer - The viewer
  • data - Location to write the data, treated as an array of the type defined by datatype
  • num - Number of items of data to read
  • dtype - Type of data to read

Output Parameter:

  • count - number of items of data actually read, or NULL

Level: beginner

See also: PetscViewer, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), PetscViewerReadable(), PetscViewerBinaryGetDescriptor(), PetscViewerBinaryGetInfoPointer(), PetscFileMode

External Links

source
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 - the PetscViewer context

Output Parameter:

  • flg - PETSC_TRUE if the viewer is readable, PETSC_FALSE otherwise

Level: intermediate

See also: PetscViewerRead(), PetscViewer, PetscViewerWritable(), PetscViewerCheckReadable(), PetscViewerCreate(), PetscViewerFileSetMode(), PetscViewerFileSetType()

External Links

source
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 viewer
  • function - routine to create method context

Level: developer

See also: PetscViewerRegisterAll()

External Links

source
PETSc.LibPETSc.PetscViewerRestoreSubViewer — Method
PetscViewerRestoreSubViewer(petsclib::PetscLibType, viewer::PetscViewer, comm::MPI_Comm, outviewer::PetscViewer)

Restores a PetscViewer obtained with PetscViewerGetSubViewer().

Collective

Input Parameters:

  • viewer - the PetscViewer that was reproduced
  • comm - the sub communicator
  • outviewer - the subviewer to be returned

Level: advanced

See also: PetscViewer, PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscViewerGetSubViewer(), PetscViewerFlush()

External Links

source
PETSc.LibPETSc.PetscViewerSAWsOpen — Method
lab::PetscViewer = PetscViewerSAWsOpen(petsclib::PetscLibType, comm::MPI_Comm)

Opens an SAWs PetscViewer.

Collective; No Fortran Support

Input Parameter:

  • comm - the MPI communicator

Output Parameter:

  • lab - the PetscViewer

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 (for KSP and SNES it is the end of a solve) until

the user unblocks the problem with an external tool that access the object with SAWS

Level: advanced

See also: PetscViewerDestroy(), PetscViewerStringSPrintf(), PETSC_VIEWER_SAWS_(), PetscObjectSAWsBlock(), PetscObjectSAWsViewOff(), PetscObjectSAWsTakeAccess(), PetscObjectSAWsGrantAccess()

External Links

source
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

See also: PetscViewer, PetscViewerCreate(), PetscViewerSetType(), PetscViewerType

External Links

source
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 - the PetscViewer context
  • prefix - the prefix to prepend to all option names

See also: PetscViewer, PetscViewerSetFromOptions(), PetscViewerAppendOptionsPrefix()

External Links

source
PETSc.LibPETSc.PetscViewerSetType — Method
PetscViewerSetType(petsclib::PetscLibType, viewer::PetscViewer, type::String)

Builds PetscViewer for a particular implementation.

Collective

Input Parameters:

  • viewer - the PetscViewer context obtained with PetscViewerCreate()
  • 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

See also: PetscViewer, PetscViewerCreate(), PetscViewerGetType(), PetscViewerType, PetscViewerPushFormat()

External Links

source
PETSc.LibPETSc.PetscViewerSetUp — Method
PetscViewerSetUp(petsclib::PetscLibType, viewer::PetscViewer)

Sets up the internal viewer data structures for the later use.

Collective

Input Parameter:

  • viewer - the PetscViewer context

Level: advanced

See also: PetscViewer, PetscViewerCreate(), PetscViewerDestroy()

External Links

source
PETSc.LibPETSc.PetscViewerSocketOpen — Method
lab::PetscViewer = PetscViewerSocketOpen(petsclib::PetscLibType, comm::MPI_Comm, machine::String, port::Cint)

Opens a connection to a MATLAB or other socket based server.

Collective

Input Parameters:

  • comm - the MPI communicator
  • machine - the machine the server is running on, use NULL for the local machine, use "server" to passively wait for

a connection from elsewhere

  • port - the port to connect to, use PETSC_DEFAULT for 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 name
  • PETSC_VIEWER_SOCKET_PORT - portnumber

Level: intermediate

See also: 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

source
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 connect
  • machine - host to connect to, use NULL for the local machine,use "server" to passively wait for

a connection from elsewhere

  • port - the port on the machine one is connecting to, use PETSC_DEFAULT for default

Level: advanced

See also: PETSCVIEWERMATLAB, PETSCVIEWERSOCKET, PetscViewerSocketOpen()

External Links

source
PETSc.LibPETSc.PetscViewerStringGetStringRead — Method
string::String,len::Csize_t = PetscViewerStringGetStringRead(petsclib::PetscLibType, viewer::PetscViewer)

Returns the string that a PETSCVIEWERSTRING uses

Logically Collective

Input Parameter:

  • viewer - PETSCVIEWERSTRING viewer

Output Parameters:

  • string - the string, optional use NULL if you do not need
  • len - the length of the string, optional use NULL if you do not need it

Level: advanced

See also: PetscViewerStringOpen(), PETSCVIEWERSTRING, PetscViewerStringSetString(), PetscViewerStringSPrintf(), PetscViewerStringSetOwnString()

External Links

source
PETSc.LibPETSc.PetscViewerStringOpen — Method
lab::PetscViewer = PetscViewerStringOpen(petsclib::PetscLibType, comm::MPI_Comm, string::String, len::Csize_t)

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 communicator
  • string - the string to use
  • len - the string length

Output Parameter:

  • lab - the PetscViewer

Level: advanced

See also: PETSCVIEWERSTRING, PetscViewerDestroy(), PetscViewerStringSPrintf(), PetscViewerStringGetStringRead(), PetscViewerStringSetString()

External Links

source
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

See also: PetscViewerStringOpen(), PETSCVIEWERSTRING, PetscViewerStringGetStringRead(), PetscViewerStringSPrintf(), PetscViewerStringSetString()

External Links

source
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 to
  • string - the string to print data into
  • len - the length of the string

Level: advanced

See also: PetscViewerStringOpen(), PETSCVIEWERSTRING, PetscViewerStringGetStringRead(), PetscViewerStringSPrintf(), PetscViewerStringSetOwnString()

External Links

source
PETSc.LibPETSc.PetscViewerVTKAddField — Method
PetscViewerVTKAddField(petsclib::PetscLibType, viewer::PetscViewer, dm, PetscViewerVTKWriteFunction::external, fieldnum::PetscInt, fieldtype::PetscViewerVTKFieldType, checkdm::PetscBool, vec)

Add a field to the viewer

Collective

Input Parameters:

  • viewer - PETSCVIEWERVTK
  • dm - DM on which Vec lives
  • PetscViewerVTKWriteFunction - function to write this Vec
  • fieldnum - which field of the DM to write (PETSC_DEFAULT if the whole vector should be written)
  • fieldtype - Either PETSC_VTK_POINT_FIELD or PETSC_VTK_CELL_FIELD
  • checkdm - whether to check for identical dm arguments as fields are added
  • vec - Vec from which to write

Level: developer

See also: PETSCVIEWERVTK, PetscViewerVTKOpen(), DMDAVTKWriteAll(), PetscViewerVTKWriteFunction, PetscViewerVTKGetDM()

External Links

source
PETSc.LibPETSc.PetscViewerVTKGetDM — Method
PetscViewerVTKGetDM(petsclib::PetscLibType, viewer::PetscViewer, dm::PetscObject)

get the DM associated with the PETSCVIEWERVTK viewer

Collective

Input Parameters:

  • viewer - PETSCVIEWERVTK viewer
  • dm - DM associated with the viewer (as a PetscObject)

Level: developer

See also: PETSCVIEWERVTK, PetscViewerVTKOpen(), DMDAVTKWriteAll(), PetscViewerVTKWriteFunction, PetscViewerVTKAddField()

External Links

source
PETSc.LibPETSc.PetscViewerVTKOpen — Method
vtk::PetscViewer = PetscViewerVTKOpen(petsclib::PetscLibType, comm::MPI_Comm, name::String, type::PetscFileMode)

Opens a PETSCVIEWERVTK viewer file.

Collective

Input Parameters:

  • comm - MPI communicator
  • name - name of file
  • type - type of file

$FILE_MODE_WRITE - create new file for binary output FILE_MODE_READ - open existing file for binary input (not currently supported) FILE_MODE_APPEND - open existing file for binary output (not currently supported)$

Output Parameter:

  • vtk - PetscViewer for VTK input/output to use with the specified file

Level: beginner

See also: PETSCVIEWERVTK, PetscViewerASCIIOpen(), PetscViewerPushFormat(), PetscViewerDestroy(), VecView(), MatView(), VecLoad(), MatLoad(), PetscFileMode, PetscViewer

External Links

source
PETSc.LibPETSc.PetscViewerVUGetPointer — Method
fd::Ptr{Libc.FILE} = PetscViewerVUGetPointer(petsclib::PetscLibType, viewer::PetscViewer)

Extracts the file pointer from a PETSCVIEWERVU PetscViewer.

Not Collective

Input Parameter:

  • viewer - The PetscViewer

Output Parameter:

  • fd - The file pointer

Level: intermediate

See also: PETSCVIEWERVU, PetscViewerASCIIGetPointer()

External Links

source
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 - The PETSCVIEWERVU PetscViewer

Output Parameter:

  • vecSeen - The flag which indicates whether we have viewed a vector

Level: advanced

See also: PETSCVIEWERVU

External Links

source
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 - The PETSCVIEWERVU PetscViewer
  • vecSeen - The flag which indicates whether we have viewed a vector

Level: developer

See also: PETSCVIEWERVU, PetscViewerVUGetVecSeen()

External Links

source
PETSc.LibPETSc.PetscViewerView — Method
PetscViewerView(petsclib::PetscLibType, v::PetscViewer, viewer::PetscViewer)

Visualizes a viewer object.

Collective

Input Parameters:

  • v - the viewer to be viewed
  • viewer - visualization context

Level: beginner

See also: PetscViewer, PetscViewerPushFormat(), PetscViewerASCIIOpen(), PetscViewerDrawOpen(), PetscViewerSocketOpen(), PetscViewerBinaryOpen(), PetscViewerLoad()

External Links

source
PETSc.LibPETSc.PetscViewerViewFromOptions — Method
PetscViewerViewFromOptions(petsclib::PetscLibType, A::PetscViewer, obj, name::String)

View from the viewer based on options in the options database

Collective

Input Parameters:

  • A - the PetscViewer context
  • obj - Optional object that provides the prefix for the option names
  • name - command line option

Level: intermediate

See also: PetscViewer, PetscViewerView, PetscObjectViewFromOptions(), PetscViewerCreate()

External Links

source
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 - the PetscViewer context

Output Parameter:

  • flg - PETSC_TRUE if the viewer is writable, PETSC_FALSE otherwise

Level: intermediate

See also: PetscViewer, PetscViewerReadable(), PetscViewerCheckWritable(), PetscViewerCreate(), PetscViewerFileSetMode(), PetscViewerFileSetType()

External Links

source
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 of PetscViewers

Level: intermediate

See also: PetscViewer, PetscViewers, PetscViewerCreate(), PetscViewersDestroy()

External Links

source
PETSc.LibPETSc.PetscViewersDestroy — Method
PetscViewersDestroy(petsclib::PetscLibType, v::Union{PetscViewers, Ref{PetscViewers}})

Destroys a set of PetscViewers created with PetscViewersCreate().

Collective

Input Parameter:

  • v - the PetscViewers to be destroyed.

Level: intermediate

See also: PetscViewer, PetscViewerDestroy(), PetscViewers, PetscViewerSocketOpen(), PetscViewerASCIIOpen(), PetscViewerCreate(), PetscViewerDrawOpen(), PetscViewersCreate()

External Links

source
PETSc.LibPETSc.PetscViewersGetViewer — Method
viewer::PetscViewer = PetscViewersGetViewer(petsclib::PetscLibType, viewers::PetscViewers, n::PetscInt)

Gets a PetscViewer from a PetscViewers collection

Collective if the viewer has not previously be obtained.

Input Parameters:

  • viewers - object created with PetscViewersCreate()
  • n - number of PetscViewer you want

Output Parameter:

  • viewer - the PetscViewer

Level: intermediate

See also: PetscViewer, PetscViewers, PetscViewersCreate(), PetscViewersDestroy()

External Links

source

Standard viewers (hand-written)

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

See also: PETSC_VIEWER_STDERR_WORLD, PetscViewerASCIIGetStderr()

source
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

See also: PETSC_VIEWER_STDERR_SELF, PetscViewerASCIIGetStderr()

source
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

See also: PETSC_VIEWER_STDOUT_WORLD, PetscViewerASCIIGetStdout()

source
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

See also: PETSC_VIEWER_STDOUT_SELF, PetscViewerASCIIGetStdout()

source