# PETSc.NullVecConstant.

Null vectors, used in place of void pointers in the C API

# PETSc.KSPMethod.

KSP(A::Mat, PA=A; kws...)
KSP(pc::PC; kws...)

Create a KSP solver object that can be used to solve equations Ax=b with the matrix A, where PA (defaults to A) is used to construct the default preconditioner. Alternatively, you can supply a preconditioner object (PC).

The keyword options are zero or more of the following:

These control the solver and preconditioner characteristics: * ksp_type="a": use KSP algorithm a * ksp_pc_side=n: set preconditioner side to PETSc.C.PC_LEFT, PETSc.C.PC_RIGHT, or PETSc.C.PC_SYMMETRIC * ksp_reuse_preconditioner=true: use initial preconditioner and don't ever compute a new one * ksp_diagonal_scale=true: symmetrically diagonally scale A before solving (note that this changes A and the right-hand side in a solve, unless you also set ksp_diagonal_scale_fix=true) * ksp_diagonal_scale_fix=true: undo diagonal scaling after solve * ksp_knoll=true: use preconditioner applied to b for initial guess * ksp_constant_null_space=true: add constant null space to Krylov solver matrix * ksp_initial_guess_nonzero=true: use the contents of initial x instead of zero for initial guess * ksp_fischer_guess="model,size": use Fischer initial guess generator (model=1 or 2) for repeated linear solves with subspace of dimension size

The following keyword options control the stopping criteria for iterative solvers: * ksp_rtol=x: x is relative decrease in residual norm * ksp_atol=x: x is absolute decrease in residual norm * ksp_divtol=x: x is amount residual can increase before method is considered to be diverging * ksp_max_it=n: n is the max number of iterations * ksp_converged_use_initial_residual_norm=true: use initial residual norm for computing relative convergence * ksp_converged_use_min_initial_residual_norm=true: use min of initial residual norm and b for computing relative convergence * ksp_error_if_not_converged=true: generate error if solver does not converge * ksp_convergence_test=:default or :skip: use the default convergence test (tolerances and max_it) or skip convergence tests and run until max_it is reached * ksp_norm_type=n: in residual tests, use norm type n, one of default (PETSc.C.KSP_NORM_DEFAULT), none (PETSc.C.KSP_NORM_NONE), of the preconditioned residual (PETSc.C.KSP_NORM_PRECONDITIONED), the true residual (PETSc.C.KSP_NORM_UNPRECONDITIONED), or the "natural" norm (PETSc.C.KSP_NORM_NATURAL) * ksp_check_norm_iteration=n: compute residual norm starting on iteration n * ksp_lag_norm=true: lag the calculation of the residual norm by one iteration (trades off reduced communication for an additional iteration)

The following options control output that monitors the progress of the solver (default none). * ksp_monitor=filename: print the residual norm at each iteration to filename ("" for STDOUT) * ksp_monitor_short=filename: print preconditioned residual norm with fewer digits * ksp_monitor_range=filename: prints the percentage of residual elements that are more then 10% of the maximum value * ksp_monitor_true_residual=filename: print true residual norm * ksp_monitor_singular_value=filename: print extreme singular values (via Lanczos or Arnoldi process as the linear system is solved) * ksp_monitor_solution=true: plot solution graphically * ksp_monitor_lg_residualnorm=true: plot preconditioned residual norm graphically * ksp_monitor_lg_true_residualnorm=true: plot preconditioned and true residual norm graphically * ksp_monitor_lg_range=true: plot preconditioned residual norm and range of residual values * ksp_monitor_cancel=true: remove any hardwired monitor routines * ksp_compute_singularvalues=true: print extreme singular values (via Lanczos or Arnoldi process as the linear system is solved)

In addition, if default preconditioner is being used, then any of the preconditioner options (see PC) can be specified to control this preconditioner (e.g. pc_type).

# PETSc.LocalVectorType.

Object representing the local part of the array, accessing the memory directly. Supports all the same indexing as a regular Array

# PETSc.LocalVectorMethod.

Get the LocalVector of a vector. Users must call restore when finished updating the vector

# PETSc.MatType.

Create an empty, unsized matrix

# PETSc.MatType.

Create a matrix of a particular size, optionally specifying the pre-allocation. If pre-allocation is not specified, no preallocation is done

# PETSc.MatMethod.

Construct at MATSEQAIJ from an AbstractArray. The argument droptol is used to determine what size entry is considered non-zero

# PETSc.MatMethod.

Create a high level matrix from an already created matrix pointer

# PETSc.MatMethod.

Make a MATSEQ Petsc matrix for a SparseMatrixCSC. This preserve the sparsity pattern of the matrix

# PETSc.PCMethod.

PC(A::Mat, PA=A, kws...)

Create a preconditioner (PC) context, given the matrix A of the linear system to be solved, and optionally a different matrix PA from which the preconditioner is constructed.

The remaining keywords specify zero or more additional options: * pc_type="a": use preconditioning algorithm a * pc_use_amat=true: use Amat (instead of Pmat) to define preconditioner in nested inner solves * ... additional options that depend on the preconditioner type ...

# PETSc.SubMatMethod.

Gets the a submatrix that references the entries in the original matrix. isrow and iscol contain the local indicies of the rows and columns to get. The matrix must have a LocalToGlobalMapping for this to work, therefore a default one is created if the matrix does not already have one registered. The default mapping assumes the matrix is divided up into contiguous block of rows. This is true of AIJ matrices but may not be for other matrix types.

# PETSc.TSMethod.

More explicit constructor: set problem type, method directly

tsptype sets the problem type and can be one of the following: * TS_LINEAR - a linear set of ODEs * TS_NONLINEAR - a nonlinear set of ODEs or DEAs

tstype sets the method used to solve the problem. More information about the possible methods is available at the official PETSc docs.

# PETSc.TSMethod.

Preferred constructor: set problem type explicitly, get method from options database

# PETSc.TSMethod.

Most preferred constructor: take ProblemType, method from options database

# PETSc.VecType.

Create an empty, unsized vector.

# PETSc.VecType.

Construct a vector suitable for multiplying by the given matrix

# PETSc.VecType.

Construct a high level Vec object from a low level C.Vec. The data field is used to protect things from GC. A finalizer is attached to deallocate the memory of the underlying C.Vec, unless first_instance is set to true. assembled indicates when values are set via setindex! and is reset by AssemblyEnd verify_assembled when true, calls to isassembled verify all processes have assembled = true, when false, only the local assembly state is checked. This essentially makes the user responsible for assembling the vector before passing it into functions that will use it (like KSP solves, etc.).

# PETSc.VecType.

Create a vector, specifying the (global) length len or the local length mlocal. Even if the blocksize is > 1, teh lengths are always number of elements in the vector, not number of block elements. Thus len % blocksize must = 0.

# PETSc.VecMethod.

Make a PETSc vector out of an array. If used in parallel, the array becomes the local part of the PETSc vector

# PETSc.AssemblyBeginFunction.

Generic fallback for AbstractArray, no-op

# PETSc.AssemblyBeginFunction.

Start assembling the matrix (the implmentations probably post non-blocking sends and received)

# PETSc.AssemblyBeginFunction.

Start communication to assemble stashed values into the vector

The MatAssemblyType is not needed for vectors, but is provided for compatability with the Mat case.

Unless vec.verify_assembled == false, users must never call the C functions VecAssemblyBegin, VecAssemblyEnd and VecSetValues, they must call AssemblyBegin, AssemblyEnd, and setindex!.

# PETSc.AssemblyEndFunction.

Generic fallback for AbstractArray, no-op

# PETSc.AssemblyEndFunction.

Finish assembling the matrix

# PETSc.AssemblyEndFunction.

Finish communication for assembling the vector

# PETSc.LocalVector_readonlyMethod.

Get the LocalVector_readonly of a vector. Users must call restore when finished with the object.

# PETSc.MatShellFunction.

Create a shell matrix with specified size. The ctx tuple contains can be accessed by any callback function.

# PETSc.VecGhostMethod.

Make a PETSc vector with space for ghost values. ghost_idx are the global indices that will be copied into the ghost space.

# PETSc.VecLocalMethod.

Create a VECSEQ that contains both the local and the ghost values of the original vector. The underlying memory for the orignal and output vectors alias.

# PETSc.assembleFunction.

This function provides a mechanism for efficiently inserting values into and then assembling Petsc matrices and vectors. The function f must be a zero argument function.

This function can be used with the do block syntax.

# PETSc.assembleFunction.

Assemble the Petsc object

# PETSc.assembleFunction.

Low level assemble function

# PETSc.commMethod.

Get the communicator for the object

# PETSc.commMethod.

Gets the MPI communicator of a vector.

# PETSc.getcontextMethod.

Get the tuple of user provided data passed in when the shell matrix was created.

# PETSc.gettypeMethod.

Get the format of the matrix.

# PETSc.gettypeMethod.

Get the symbol that is the format of the vector

# PETSc.ghost_begin!Method.

Start communication to update the ghost values (on other processes) from the local values

# PETSc.ghost_end!Method.

Finish communication for updating ghost values

# PETSc.ghost_update!Method.

Convenience method for calling ghost_begin! and ghost_end! for multiple vectors

# PETSc.has_local_to_global_mappingMethod.

Check if the local to global mappings have been registered

# PETSc.has_local_to_global_mappingMethod.

Check if the local to global mapping has been registered

# PETSc.isassembledFunction.

Check if a vector is assembled (ie. does not have stashed values). If x.verify_assembled, the assembly state of all processes is checked, otherwise only the local process is checked. local_only forces only the local process to be checked, regardless of x.verify_assembled.

# PETSc.isassembledMethod.

Check if the matrix is assembled or not

# PETSc.isassembledMethod.

Check if the matrix is assembled. Whether all processes assembly state is checked or only the local process is determined by x.verify_assembled.

local_only forces only the local process to be checked, regardless of x.verify_assembled.

# PETSc.lengthlocalMethod.

prod(sizelocal))

# PETSc.lengthlocalMethod.

Get the length of the local portion of the vector

# PETSc.localISMethod.

Constructs 2 index sets that map from the local row and columns to the global rows and columns

# PETSc.localISMethod.

Constructs index set mapping from local indexing to global indexing, based on localpart()

# PETSc.local_to_global_mappingMethod.

Construct ISLocalToGlobalMappings for the the rows and columns of the matrix

# PETSc.local_to_global_mappingMethod.

Construct ISLocalToGlobalMappings for the vector. If a block vector, create a block index set

# PETSc.localpartMethod.

Get the range of global indices that define the local part of the vector. Internally, this calls the Petsc function VecGetOwnershipRange, and has the same limitations as that function, namely that some vector formats do not have a well defined contiguous range.

# PETSc.localrangesMethod.

This function returns two Range object corresponding the global indices of the rows and columns of the matrix A.

The function has the same limiations as Petsc's MatGetOwnershipRange, in that it assumes the rows of the matrix are divided up contigously.

# PETSc.normalize!Method.

computes v = norm(x,2), divides x by v, and returns v

# PETSc.petscviewMethod.

Print a Petsc matrix to STDOUT

# PETSc.petscviewMethod.

Use the PETSc routine for printing a vector to stdout

# PETSc.restoreMethod.

Tell Petsc the LocalVector is no longer being used

# PETSc.restoreMethod.

Tell Petsc the VecLocal is no longer needed

# PETSc.scatter!Method.

Convenience method for calling both ghost_begin! and ghost_end!

# PETSc.set_local_to_global_mappingMethod.

Registers the ISLocalToGlobalMappings with the matrix

# PETSc.set_local_to_global_mappingMethod.

Registers the ISLocalToGlobalMapping with the Vec

# PETSc.set_rhs_functionFunction.

Sets the function that evalutes u_t = g(u, t) for an ODE. The function must have the signature:

f(TS, t, U, F, ctx)

where TS is a TS object, t is the current time u is the current state vector F is the vector to be populated with u_t ctx is the user supplied context tuple (empty tuple if not provided)

# PETSc.set_timesMethod.

Set the times related quantities: t0 : initial time value dt0: initial time step nsteps: maximum number of steps tmax: maximum time value

# PETSc.setop!Method.

Provide a callback function for a particular matrix operation. op is a Petsc enum value inidcating the operation, and func is a void pointer (obtained from cfunction() ) that performs the operation.

The function should take the low level Petsc objects (defined in the C module) rather than the high level ones defined in this file. There are constructors to create a high level object from a low level one

# PETSc.setoption!Method.

Pass values to the Petsc function MatSetOption. Note that the handful of options that can be passed here should not be confused with those for the global options database

# PETSc.sizelocalMethod.

Get local size of the vector

# PETSc.sizelocalMethod.

Returns the local dimensions of the matrix

# PETSc.sizelocalMethod.

Get the local size of the vector

# PETSc.solve!Method.

Solve the system using the initial condition provided in vec

# PETSc.solve!Method.

Solve the system using the intitial condition proived by set_ic

# PETSc.mat2vecConstant.

Maps Matrix formats to the corresponding vector format

# PETSc.MatRowType.

Object that enables access to a single row of a sparse matrix.

Users must call restore when done with a MatRow, before attempting to create another one.

# PETSc.MatRowMethod.

Preferred constructor for a MatRow

# PETSc.PetscMatType.

A Petsc matrix.

Unlike Vecs, the Petsc implementation keeps track of the local assembly state, so the Julia type does not have to. verify_assembled: if true, verify all processes are assembled, if false, only local process insertmode: C.InsertMode used by setindex!

# Base.==Method.

Equality test for AbstractArray and PetscMat, SEQ only

# Base.SparseMatrix.nnzMethod.

Number of non-zero entries that have been assigned to

# Base.fill!Method.

Fill the matrix with the specified values.

Currently, this function either destroys the sparsity pattern or gives an error, unless v = 0, in which case it zeros out the non-zero entries without changing the sparsity pattern

# Base.fullMethod.

Create a dense Julia matrix for a Petsc sparse matrix. This only works for SEQ matrices

# Base.kronMethod.

Kronecker product for SEQ matrices only. The output is a non-block matrix even if the inputs are block

# Base.lengthMethod.

Get the global length of the vector

# Base.map!Method.

Multiple source vector map. All vectors must have the local and global lengths. If some a ghost vectors and some are not, the map is applied only to the local part

# Base.map!Method.

Applys f element-wise to src to populate dest. If src is a ghost vector, then f is applied to the ghost elements as well as the local elements.

# Base.sizeMethod.

Returns the global dimensions of the matrix

# Base.sizeMethod.

Get the global size of the vector

# PETSc.PetscDestroyMethod.

Destroy a Mat object and the underlying data structure, if the object has not already been finalized

# PETSc.PetscDestroyMethod.

The Petsc function to deallocate Vec objects

# PETSc.PetscKronMethod.

Kronecker product of A and B, storing the result in D. D should already be pre-allocated with the right sparsity pattern

# PETSc.PetscKronMethod.

Kronecker product of A and B where the result is a Petsc Mat

# PETSc.count_row_nzMethod.

Count the number of non-zeros in a row of the matrix. This temporarily creates a MatRow object, so it cannot be used if one already exists

# PETSc.getinfoFunction.

Get the MatInfo struct for the matrix

# PETSc.iassembleMethod.

Perform a flush assembly (take stashed values and put them into the matrix, but don't squeeze out any preallocated space that has not been used yet

# PETSc.isfinalizedMethod.

Check if PetscDestroy has been called on this object already

# PETSc.isfinalizedMethod.

Determine whether a vector has already been finalized

# PETSc.localIS_blockMethod.

Like localIS, but returns a block index IS

# PETSc.localIS_blockMethod.

Like localIS, but returns a block index IS

# PETSc.localpart_blockMethod.

Similar to localpart, but returns the range of block indices

# PETSc.localpart_blockMethod.

Similar to localpart, but returns the range of block indices

# PETSc.petscwriteMethod.

Print a Petsc matrix to a named file, in text format

# PETSc.rhs_wrapperMethod.

Wrapper for the right hand side function. This function is always passed to PETSc as the right hand side function, and calls the user supplied function internally. The user supplied function must be the first component of the ctx tuple

# PETSc.setindex0!Method.

Like setindex, but requires the indices be 0-base

# PETSc.setpreallocation!Method.

Preallocates the sparsity pattern for (B)AIJ matrices.

=

=# #order = [:type, :function]