| PETSC4PY(3) | Project name not set | PETSC4PY(3) |
petsc4py - PETSc for Python
This document describes petsc4py, a Python wrapper to the PETSc libraries.
PETSc (the Portable, Extensible Toolkit for Scientific Computation) is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI standard for all message-passing communication.
This package provides an important subset of PETSc functionalities and uses NumPy to efficiently manage input and output of array data.
A good friend of petsc4py is:
Other projects depend on petsc4py:
PETSc is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI standard for all message-passing communication.
PETSc is intended for use in large-scale application projects [petsc-efficient], and several ongoing computational science projects are built around the PETSc libraries. With strict attention to component interoperability, PETSc facilitates the integration of independently developed application modules, which often most naturally employ different coding styles and data structures.
PETSc is easy to use for beginners [petsc-user-ref]. Moreover, its careful design allows advanced users to have detailed control over the solution process. PETSc includes an expanding suite of parallel linear and nonlinear equation solvers that are easily used in application codes written in C, C++, and Fortran. PETSc provides many of the mechanisms needed within parallel application codes, such as simple parallel matrix and vector assembly routines that allow the overlap of communication and computation.
PETSc is designed with an object-oriented style. Almost all user-visible types are abstract interfaces with implementations that may be chosen at runtime. Those objects are managed through handles to opaque data structures which are created, accessed and destroyed by calling appropriate library routines.
PETSc consists of a variety of components. Each component manipulates a particular family of objects and the operations one would like to perform on these objects. These components provide the functionality required for many parallel solutions of PDEs.
You can use pip to install petsc4py and its dependencies (mpi4py is optional but highly recommended):
$ python -m pip install mpi4py petsc petsc4py
First build PETSc. Next cd to the top of the PETSc source tree and set the PETSC_DIR and PETSC_ARCH environment variables. Run:
$ python -m pip install src/binding/petsc4py
The installation of petsc4py supports multiple PETSC_ARCH in the form of colon separated list:
$ PETSC_ARCH='arch-0:...:arch-N' python -m pip install src/binding/petsc4py
If you are cross-compiling, and the numpy module cannot be loaded on your build host, then before invoking pip, set the NUMPY_INCLUDE environment variable to the path that would be returned by import numpy; numpy.get_include():
$ export NUMPY_INCLUDE=/usr/lib/pythonX/site-packages/numpy/core/include
When installing from source, the petsc4py complete testsuite can be run as:
$ cd src/binding/petsc4py $ python test/runtests.py
or via the makefile rule test:
$ make test -C src/binding/petsc4py
Specific tests can be run using the command-line option -k, e.g.:
$ python test/runtests.py -k test_optdb
to run all the tests provided in tests/test_optdb.py.
For other command-line options, run:
$ python test/runtests.py --help
If not otherwise specified, all tests will be run in sequential mode. To run all the tests with the same number of MPI processes, for example 4, run:
$ mpiexec -n 4 python test/runtests.py
or:
$ make test-4 -C src/binding/petsc4py
Install the documentation dependencies:
$ python -m pip install -r ${PETSC_DIR/doc/requirements.txt
Then:
$ cd src/binding/petsc4py/docs/source $ make html
The resulting HTML files will be in _build/html.
NOTE:
Contributions from the user community are welcome. See the PETSc developers documentation for general information on contributions.
New contributions to petsc4py must adhere with the coding standards. We use cython-lint for Cython and ruff for Python source codes. These can be installed using:
$ python -m pip install -r src/binding/petsc4py/conf/requirements-lint.txt
If you are contributing Cython code, you can check compliance with:
$ make cython-lint -C src/binding/petsc4py
For Python code, run:
$ make ruff-lint -C src/binding/petsc4py
Python code can be auto-formatted using:
$ make ruff-lint RUFF_OPTS='format' -C src/binding/petsc4py
New contributions to petsc4py must be tested. Tests are located in the src/binding/petsc4py/test folder. To add a new test, either add a new test_xxx.py or modify a pre-existing file according to the unittest specifications.
If you add a new test_xxx.py, you can run the tests using:
$ cd src/binding/petsc4py $ python test/runtests.py -k test_xxx
If instead you are modifying an existing test_xxx.py, you can test your additions by using the fully qualified name of the Python class or method you are modifying, e.g.:
$ python test/runtests.py -k test_xxx.class_name.method_name
All new code must include documentation in accordance with the documentation standard. To check for compliance, run:
$ make html SPHINXOPTS='-W' -C src/binding/petsc4py/docs/source
WARNING:
If PETSc for Python has been significant to a project that leads to an academic publication, please acknowledge that fact by citing the project.
| petsc4py | The PETSc for Python package. |
| petsc4py.typing | Typing support. |
| petsc4py.PETSc | Portable, Extensible Toolkit for Scientific Computation. |
The PETSc for Python package.
This package is an interface to PETSc libraries.
PETSc (the Portable, Extensible Toolkit for Scientific Computation) is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It employs the MPI standard for all message-passing communications.
Functions
| get_config() | Return a dictionary with information about PETSc. |
| get_include() | Return the directory in the package that contains header files. |
| init([args, arch, comm]) | Initialize PETSc. |
Extension modules that need to compile against petsc4py should use this function to locate the appropriate include directory.
Example
Using Python distutils or NumPy distutils:
import petsc4py
Extension('extension_name', ...
include_dirs=[..., petsc4py.get_include()])
Notes
This function should be called only once, typically at the very beginning of the bootstrap script of an application.
Typing support.
Attributes
| Scalar | Scalar type. |
| ArrayBool | Array of bool. |
| ArrayInt | Array of int. |
| ArrayReal | Array of float. |
| ArrayComplex | Array of complex. |
| ArrayScalar | Array of Scalar numbers. |
| DimsSpec | Dimensions specification. |
| AccessModeSpec | Access mode specification. |
| InsertModeSpec | Insertion mode specification. |
| ScatterModeSpec | Scatter mode specification. |
| LayoutSizeSpec | int or 2-tuple of int describing the layout sizes. |
| NormTypeSpec | Norm type specification. |
| PetscOptionsHandlerFunction | Callback for processing extra options. |
| MatAssemblySpec | Matrix assembly specification. |
| MatSizeSpec | int or (nested) tuple of int describing the matrix sizes. |
| MatBlockSizeSpec | The row and column block sizes. |
| CSRIndicesSpec | CSR indices format specification. |
| CSRSpec | CSR format specification. |
| NNZSpec | Nonzero pattern specification. |
| MatNullFunction | PETSc.NullSpace callback. |
| DMCoarsenHookFunction | PETSc.DM coarsening hook callback. |
| DMRestrictHookFunction | PETSc.DM restriction hook callback. |
| KSPRHSFunction | PETSc.KSP right-hand side function callback. |
| KSPOperatorsFunction | PETSc.KSP operators function callback. |
| KSPConvergenceTestFunction | PETSc.KSP convergence test callback. |
| KSPMonitorFunction | PETSc.KSP monitor callback. |
| KSPPreSolveFunction | PETSc.KSP pre solve callback. |
| KSPPostSolveFunction | PETSc.KSP post solve callback. |
| SNESMonitorFunction | SNES monitor callback. |
| SNESObjFunction | SNES objective function callback. |
| SNESFunction | SNES residual function callback. |
| SNESJacobianFunction | SNES Jacobian callback. |
| SNESGuessFunction | SNES initial guess callback. |
| SNESUpdateFunction | SNES step update callback. |
| SNESLSPreFunction | SNES linesearch pre-check update callback. |
| SNESNGSFunction | SNES nonlinear Gauss-Seidel callback. |
| SNESConvergedFunction | SNES convergence test callback. |
| TSRHSFunction | TS right-hand side function callback. |
| TSRHSJacobian | TS right-hand side Jacobian callback. |
| TSRHSJacobianP | TS right-hand side parameter Jacobian callback. |
| TSIFunction | TS implicit function callback. |
| TSIJacobian | TS implicit Jacobian callback. |
| TSIJacobianP | TS implicit parameter Jacobian callback. |
| TSI2Function | TS implicit 2nd order function callback. |
| TSI2Jacobian | TS implicit 2nd order Jacobian callback. |
| TSI2JacobianP | TS implicit 2nd order parameter Jacobian callback. |
| TSMonitorFunction | TS monitor callback. |
| TSPreStepFunction | TS pre-step callback. |
| TSPostStepFunction | TS post-step callback. |
| TSIndicatorFunction | TS event indicator callback. |
| TSPostEventFunction | TS post-event callback. |
| TAOObjectiveFunction | TAO objective function callback. |
| TAOGradientFunction | TAO objective gradient callback. |
| TAOObjectiveGradientFunction | TAO objective function and gradient callback. |
| TAOHessianFunction | TAO objective Hessian callback. |
| TAOUpdateFunction | TAO update callback. |
| TAOMonitorFunction | TAO monitor callback. |
| TAOConvergedFunction | TAO convergence test callback. |
| TAOJacobianFunction | TAO Jacobian callback. |
| TAOResidualFunction | TAO residual callback. |
| TAOJacobianResidualFunction | TAO Jacobian residual callback. |
| TAOVariableBoundsFunction | TAO variable bounds callback. |
| TAOConstraintsFunction | TAO constraints callback. |
| TAOLSObjectiveFunction | TAOLineSearch objective function callback. |
| TAOLSGradientFunction | TAOLineSearch objective gradient callback. |
| TAOLSObjectiveGradientFunction | TAOLineSearch objective function and gradient callback. |
Scalars can be either float or complex (but not both) depending on how PETSc was configured (./configure --with-scalar-type=real|complex).
alias of ndarray[tuple[int, ...], dtype[bool]]
alias of ndarray[tuple[int, ...], dtype[int]]
alias of ndarray[tuple[int, ...], dtype[float]]
alias of ndarray[tuple[int, ...], dtype[complex]]
alias of ndarray[tuple[int, ...], dtype[float | complex]]
N-tuples indicates N-dimensional grid sizes.
alias of tuple[int, ...]
SEE ALSO:
SEE ALSO:
A single int indicates global size. A tuple of int indicates (local_size, global_size).
SEE ALSO:
Possible values include:
SEE ALSO:
alias of Callable[[Object], None]
SEE ALSO:
If int then rows = columns. A single tuple of int indicates (rows, columns). A nested tuple of int indicates ((local_rows, rows), (local_columns, columns)).
SEE ALSO:
If a single int is provided then rows and columns share the same block size.
A 2-tuple carrying the (row_start, col_indices) information.
alias of tuple[Sequence[int], Sequence[int]]
A 3-tuple carrying the (row_start, col_indices, values) information.
alias of tuple[Sequence[int], Sequence[int], Sequence[float | complex]]
A single int corresponds to fixed number of non-zeros per row. A Sequence of int indicates different non-zeros per row. If a 2-tuple is used, the elements of the tuple corresponds to the on-process and off-process parts of the matrix.
SEE ALSO:
alias of int | Sequence[int] | tuple[Sequence[int], Sequence[int]]
alias of Callable[[NullSpace, Vec], None]
alias of Callable[[DM, DM], None]
alias of Callable[[DM, Mat, Vec, Mat, DM], None]
alias of Callable[[KSP, Vec], None]
alias of Callable[[KSP, Mat, Mat], None]
alias of Callable[[KSP, int, float], ConvergedReason]
alias of Callable[[KSP, int, float], None]
alias of Callable[[KSP, Vec, Vec], None]
alias of Callable[[KSP, Vec, Vec], None]
alias of Callable[[SNES, int, float], None]
alias of Callable[[SNES, Vec], None]
alias of Callable[[SNES, Vec, Vec], None]
alias of Callable[[SNES, Vec, Mat, Mat], None]
alias of Callable[[SNES, Vec], None]
alias of Callable[[SNES, int], None]
alias of Callable[[Vec, Vec], None]
alias of Callable[[SNES, Vec, Vec], None]
alias of Callable[[SNES, int, tuple[float, float, float]], ConvergedReason]
alias of Callable[[TS, float, Vec, Vec], None]
alias of Callable[[TS, float, Vec, Mat, Mat], None]
alias of Callable[[TS, float, Vec, Mat], None]
alias of Callable[[TS, float, Vec, Vec, Vec], None]
alias of Callable[[TS, float, Vec, Vec, float, Mat, Mat], None]
alias of Callable[[TS, float, Vec, Vec, float, Mat], None]
alias of Callable[[TS, float, Vec, Vec, Vec, Vec], None]
alias of Callable[[TS, float, Vec, Vec, Vec, float, float, Mat, Mat], None]
alias of Callable[[TS, float, Vec, Vec, Vec, float, float, Mat], None]
alias of Callable[[TS, int, float, Vec], None]
alias of Callable[[TS], None]
alias of Callable[[TS], None]
alias of Callable[[TS, float, Vec, ndarray[tuple[int, ...], dtype[float]]], None]
alias of Callable[[TS, ndarray[tuple[int, ...], dtype[int]], float, Vec, bool], None]
alias of Callable[[TAO, Vec], float]
alias of Callable[[TAO, Vec, Vec], None]
alias of Callable[[TAO, Vec, Vec], float]
alias of Callable[[TAO, Vec, Mat, Mat], None]
alias of Callable[[TAO, int], None]
alias of Callable[[TAO], None]
alias of Callable[[TAO], None]
alias of Callable[[TAO, Vec, Mat, Mat], None]
alias of Callable[[TAO, Vec, Vec], None]
alias of Callable[[TAO, Vec, Mat, Mat], None]
alias of Callable[[TAO, Vec, Vec], None]
alias of Callable[[TAO, Vec, Vec], None]
alias of Callable[[TAOLineSearch, Vec], float]
alias of Callable[[TAOLineSearch, Vec, Vec], None]
alias of Callable[[TAOLineSearch, Vec, Vec], float]
Portable, Extensible Toolkit for Scientific Computation.
Basic constants:
More constants:
Classes
| AO | Application ordering object. |
| Comm | Communicator object. |
| DM | An object describing a computational grid or mesh. |
| DMComposite | A DM object that is used to manage data for a collection of DMs. |
| DMDA | A DM object that is used to manage data for a structured grid. |
| DMInterpolation | Interpolation on a mesh. |
| DMLabel | An object representing a subset of mesh entities from a DM. |
| DMPlex | Encapsulate an unstructured mesh. |
| DMPlexTransform | Mesh transformations. |
| DMPlexTransformType | Transformation types. |
| DMShell | A shell DM object, used to manage user-defined problem data. |
| DMStag | A DM object representing a "staggered grid" or a structured cell complex. |
| DMSwarm | A DM object used to represent arrays of data (fields) of arbitrary type. |
| DS | Discrete System object. |
| Device | The device object. |
| DeviceContext | DeviceContext object. |
| DualSpace | Dual space to a linear space. |
| FE | A PETSc object that manages a finite element space. |
| IS | A collection of indices. |
| InsertMode | Insertion mode. |
| KSP | Abstract PETSc object that manages all Krylov methods. |
| LGMap | Mapping from a local to a global ordering. |
| Log | Logging support. |
| LogClass | Logging support. |
| LogEvent | Logging support. |
| LogStage | Logging support for different stages. |
| Mat | Matrix object. |
| MatPartitioning | Object for managing the partitioning of a matrix or graph. |
| NormType | Norm type. |
| NullSpace | Nullspace object. |
| Object | Base class wrapping a PETSc object. |
| Options | The options database object. |
| PC | Preconditioners. |
| Partitioner | A graph partitioner. |
| Quad | Quadrature rule for integration. |
| Random | The random number generator object. |
| SF | Star Forest object for communication. |
| SNES | Nonlinear equations solver. |
| Scatter | Scatter object. |
| ScatterMode | Scatter mode. |
| Section | Mapping from integers in a range to unstructured set of integers. |
| Space | Function space object. |
| Sys | System utilities. |
| TAO | Optimization solver. |
| TAOLineSearch | TAO Line Search. |
| TS | ODE integrator. |
| Vec | A vector object. |
| Viewer | Viewer object. |
| ViewerHDF5 | Viewer object for HDF5 file formats. |
Application ordering object.
Enumerations
| Type | The application ordering types. |
The application ordering types.
Attributes Summary
| ADVANCED | Object ADVANCED of type str |
| BASIC | Object BASIC of type str |
| MAPPING | Object MAPPING of type str |
| MEMORYSCALABLE | Object MEMORYSCALABLE of type str |
Attributes Documentation
Methods Summary
| app2petsc(indices) | Map an application-defined ordering to the PETSc ordering. |
| createBasic(app[, petsc, comm]) | Return a basic application ordering using two orderings. |
| createMapping(app[, petsc, comm]) | Return an application mapping using two orderings. |
| createMemoryScalable(app[, petsc, comm]) | Return a memory scalable application ordering using two orderings. |
| destroy() | Destroy the application ordering. |
| getType() | Return the application ordering type. |
| petsc2app(indices) | Map a PETSc ordering to the application-defined ordering. |
| view([viewer]) | Display the application ordering. |
Methods Documentation
Collective.
Any integers in indices that are negative are left unchanged. This allows one to convert, for example, neighbor lists that use negative entries to indicate nonexistent neighbors due to boundary conditions, etc.
Integers that are out of range are mapped to -1.
If IS is used, it cannot be of type stride or block.
SEE ALSO:
Source code at petsc4py/PETSc/AO.pyx:214
Collective.
The arrays/indices app and petsc must contain all the integers 0 to len(app)-1 with no duplicates; that is there cannot be any "holes" in the indices. Use createMapping if you wish to have "holes" in the indices.
SEE ALSO:
Source code at petsc4py/PETSc/AO.pyx:53
Collective.
The arrays app and petsc need NOT contain all the integers 0 to len(app)-1, that is there CAN be "holes" in the indices. Use createBasic if they do not have holes for better performance.
SEE ALSO:
Source code at petsc4py/PETSc/AO.pyx:154
Collective.
The arrays/indices app and petsc must contain all the integers 0 to len(app)-1 with no duplicates; that is there cannot be any "holes" in the indices. Use createMapping if you wish to have "holes" in the indices.
Comparing with createBasic, this routine trades memory with message communication.
SEE ALSO:
Source code at petsc4py/PETSc/AO.pyx:102
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/AO.pyx:40
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/AO.pyx:200
Collective.
Any integers in indices that are negative are left unchanged. This allows one to convert, for example, neighbor lists that use negative entries to indicate nonexistent neighbors due to boundary conditions, etc.
Integers that are out of range are mapped to -1.
If IS is used, it cannot be of type stride or block.
SEE ALSO:
Source code at petsc4py/PETSc/AO.pyx:248
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/AO.pyx:21
Communicator object.
Predefined instances:
SEE ALSO:
Methods Summary
| barrier() | Barrier synchronization. |
| destroy() | Destroy the communicator. |
| duplicate() | Duplicate the communicator. |
| getRank() | Return the rank of the calling processes in the communicator. |
| getSize() | Return the number of processes in the communicator. |
| tompi4py() | Convert communicator to mpi4py. |
Attributes Summary
| fortran | Fortran handle. |
| rank | Communicator rank. |
| size | Communicator size. |
Methods Documentation
Collective.
Source code at petsc4py/PETSc/Comm.pyx:123
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Comm.pyx:61
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Comm.pyx:79
Not collective.
Source code at petsc4py/PETSc/Comm.pyx:111
Not collective.
Source code at petsc4py/PETSc/Comm.pyx:99
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Comm.pyx:155
Attributes Documentation
Source code at petsc4py/PETSc/Comm.pyx:147
Source code at petsc4py/PETSc/Comm.pyx:140
Source code at petsc4py/PETSc/Comm.pyx:135
An object describing a computational grid or mesh.
Enumerations
| BoundaryType | DM Boundary types. |
| PolytopeType | The DM cell types. |
| ReorderDefaultFlag | The DM reordering default flags. |
| Type | DM types. |
DM Boundary types.
Attributes Summary
| GHOSTED | Constant GHOSTED of type int |
| MIRROR | Constant MIRROR of type int |
| NONE | Constant NONE of type int |
| PERIODIC | Constant PERIODIC of type int |
| TWIST | Constant TWIST of type int |
Attributes Documentation
The DM cell types.
Attributes Summary
| FV_GHOST | Constant FV_GHOST of type int |
| HEXAHEDRON | Constant HEXAHEDRON of type int |
| INTERIOR_GHOST | Constant INTERIOR_GHOST of type int |
| POINT | Constant POINT of type int |
| POINT_PRISM_TENSOR | Constant POINT_PRISM_TENSOR of type int |
| PYRAMID | Constant PYRAMID of type int |
| QUADRILATERAL | Constant QUADRILATERAL of type int |
| QUAD_PRISM_TENSOR | Constant QUAD_PRISM_TENSOR of type int |
| SEGMENT | Constant SEGMENT of type int |
| SEG_PRISM_TENSOR | Constant SEG_PRISM_TENSOR of type int |
| TETRAHEDRON | Constant TETRAHEDRON of type int |
| TRIANGLE | Constant TRIANGLE of type int |
| TRI_PRISM | Constant TRI_PRISM of type int |
| TRI_PRISM_TENSOR | Constant TRI_PRISM_TENSOR of type int |
| UNKNOWN | Constant UNKNOWN of type int |
| UNKNOWN_CELL | Constant UNKNOWN_CELL of type int |
| UNKNOWN_FACE | Constant UNKNOWN_FACE of type int |
Attributes Documentation
The DM reordering default flags.
Attributes Summary
| FALSE | Constant FALSE of type int |
| NOTSET | Constant NOTSET of type int |
| TRUE | Constant TRUE of type int |
Attributes Documentation
DM types.
Attributes Summary
| COMPOSITE | Object COMPOSITE of type str |
| DA | Object DA of type str |
| FOREST | Object FOREST of type str |
| MOAB | Object MOAB of type str |
| NETWORK | Object NETWORK of type str |
| P4EST | Object P4EST of type str |
| P8EST | Object P8EST of type str |
| PATCH | Object PATCH of type str |
| PLEX | Object PLEX of type str |
| PRODUCT | Object PRODUCT of type str |
| REDUNDANT | Object REDUNDANT of type str |
| SHELL | Object SHELL of type str |
| SLICED | Object SLICED of type str |
| STAG | Object STAG of type str |
| SWARM | Object SWARM of type str |
Attributes Documentation
Methods Summary
| adaptLabel(label) | Adapt a DM based on a DMLabel. |
| adaptMetric(metric[, bdLabel, rgLabel]) | Return a mesh adapted to the specified metric field. |
| addCoarsenHook(coarsenhook, restricthook[, ...]) | Add a callback to be executed when restricting to a coarser grid. |
| addField(field[, label]) | Add a field to a DM object. |
| appendOptionsPrefix(prefix) | Append to the prefix used for searching for options in the database. |
| clearDS() | Remove all discrete systems from the DM. |
| clearFields() | Remove all fields from the DM. |
| clearLabelStratum(name, value) | Remove all points from a stratum. |
| clearLabelValue(name, point, value) | Remove a point from a DMLabel with given value. |
| clone() | Return the cloned DM . |
| coarsen([comm]) | Return a coarsened DM object. |
| coarsenHierarchy(nlevels) | Coarsen this DM and return the coarsened DM hierarchy. |
| convert(dm_type) | Return a DM converted to another DM. |
| copyDS(dm[, minDegree, maxDegree]) | Copy the discrete systems for this DM into another DM. |
| copyDisc(dm) | Copy fields and discrete systems of a DM into another DM. |
| copyFields(dm[, minDegree, maxDegree]) | Copy the discretizations of this DM into another DM. |
| create([comm]) | Return an empty DM. |
| createDS() | Create discrete systems. |
| createFieldDecomposition() | Return a list of IS objects. |
| createGlobalVec() | Return a global vector. |
| createInjection(dm) | Return the injection matrix into a finer DM. |
| createInterpolation(dm) | Return the interpolation matrix to a finer DM. |
| createLabel(name) | Create a label of the given name if it does not already exist. |
| createLocalVec() | Return a local vector. |
| createMassMatrix(dmf) | Return the mass matrix between this DM and the given DM. |
| createMat() | Return an empty matrix. |
| createRestriction(dm) | Return the restriction matrix between this DM and the given DM. |
| createSectionSF(localsec, globalsec) | Create the SF encoding the parallel DOF overlap for the DM. |
| createSubDM(fields) | Return IS and DM encapsulating a subproblem. |
| destroy() | Destroy the object. |
| getAppCtx() | Return the application context. |
| getAuxiliaryVec([label, value, part]) | Return an auxiliary vector for region. |
| getBasicAdjacency() | Return the flags for determining variable influence. |
| getBlockSize() | Return the inherent block size associated with a DM. |
| getBoundingBox() | Return the dimension of embedding space for coordinates values. |
| getCellCoordinateDM() | Return the cell coordinate DM. |
| getCellCoordinateSection() | Return the cell coordinate layout over the DM. |
| getCellCoordinates() | Return a global vector with the cellwise coordinates. |
| getCellCoordinatesLocal() | Return a local vector with the cellwise coordinates. |
| getCoarseDM() | Return the coarse DM. |
| getCoarsenLevel() | Return the number of coarsenings. |
| getCoordinateDM() | Return the coordinate DM. |
| getCoordinateDim() | Return the dimension of embedding space for coordinates values. |
| getCoordinateSection() | Return coordinate values layout over the mesh. |
| getCoordinates() | Return a global vector with the coordinates associated. |
| getCoordinatesLocal() | Return a local vector with the coordinates associated. |
| getCoordinatesLocalized() | Check if the coordinates have been localized for cells. |
| getDS() | Return default DS. |
| getDimension() | Return the topological dimension of the DM. |
| getField(index) | Return the discretization object for a given DM field. |
| getFieldAdjacency(field) | Return the flags for determining variable influence. |
| getGlobalSection() | Return the Section encoding the global data layout for the DM. |
| getGlobalVec([name]) | Return a global vector. |
| getLGMap() | Return local mapping to global mapping. |
| getLabel(name) | Return the label of a given name. |
| getLabelIdIS(name) | Return an IS of all values that the DMLabel takes. |
| getLabelName(index) | Return the name of nth label. |
| getLabelOutput(name) | Return the output flag for a given label. |
| getLabelSize(name) | Return the number of values that the DMLabel takes. |
| getLabelValue(name, point) | Return the value in DMLabel for the given point. |
| getLocalBoundingBox() | Return the bounding box for the piece of the DM. |
| getLocalSection() | Return the Section encoding the local data layout for the DM. |
| getLocalVec([name]) | Return a local vector. |
| getNumFields() | Return the number of fields in the DM. |
| getNumLabels() | Return the number of labels defined by on the DM. |
| getOptionsPrefix() | Return the prefix used for searching for options in the database. |
| getPointSF() | Return the SF encoding the parallel DOF overlap for the DM. |
| getRefineLevel() | Return the refinement level. |
| getSectionSF() | Return the Section encoding the parallel DOF overlap. |
| getStratumIS(name, value) | Return the points in a label stratum. |
| getStratumSize(name, value) | Return the number of points in a label stratum. |
| getType() | Return the DM type name. |
| globalToLocal(vg, vl[, addv]) | Update local vectors from global vector. |
| hasLabel(name) | Determine whether the DM has a label. |
| load(viewer) | Return a DM stored in binary. |
| localToGlobal(vl, vg[, addv]) | Update global vectors from local vector. |
| localToLocal(vl, vlg[, addv]) | Map the values from a local vector to another local vector. |
| localizeCoordinates() | Create local coordinates for cells having periodic faces. |
| refine([comm]) | Return a refined DM object. |
| refineHierarchy(nlevels) | Refine this DM and return the refined DM hierarchy. |
| removeLabel(name) | Remove and destroy the label by name. |
| restoreGlobalVec(vg[, name]) | Restore a global vector obtained with getGlobalVec. |
| restoreLocalVec(vl[, name]) | Restore a local vector obtained with getLocalVec. |
| setAppCtx(appctx) | Set the application context. |
| setAuxiliaryVec(aux, label[, value, part]) | Set an auxiliary vector for a specific region. |
| setBasicAdjacency(useCone, useClosure) | Set the flags for determining variable influence. |
| setCellCoordinateDM(dm) | Set the cell coordinate DM. |
| setCellCoordinateSection(dim, sec) | Set the cell coordinate layout over the DM. |
| setCellCoordinates(c) | Set a global vector with the cellwise coordinates. |
| setCellCoordinatesLocal(c) | Set a local vector with the cellwise coordinates. |
| setCoarseDM(dm) | Set the coarse DM. |
| setCoordinateDim(dim) | Set the dimension of embedding space for coordinates values. |
| setCoordinateDisc(disc, project) | Project coordinates to a different space. |
| setCoordinates(c) | Set a global vector that holds the coordinates. |
| setCoordinatesLocal(c) | Set a local vector with the ghost point holding the coordinates. |
| setDimension(dim) | Set the topological dimension of the DM. |
| setField(index, field[, label]) | Set the discretization object for a given DM field. |
| setFieldAdjacency(field, useCone, useClosure) | Set the flags for determining variable influence. |
| setFromOptions() | Configure the object from the options database. |
| setGlobalSection(sec) | Set the Section encoding the global data layout for the DM. |
| setKSPComputeOperators(operators[, args, kargs]) | Matrix associated with the linear system. |
| setLabelOutput(name, output) | Set if a given label should be saved to a view. |
| setLabelValue(name, point, value) | Set a point to a DMLabel with a given value. |
| setLocalSection(sec) | Set the Section encoding the local data layout for the DM. |
| setMatType(mat_type) | Set matrix type to be used by DM.createMat. |
| setNumFields(numFields) | Set the number of fields in the DM. |
| setOptionsPrefix(prefix) | Set the prefix used for searching for options in the database. |
| setPointSF(sf) | Set the SF encoding the parallel DOF overlap for the DM. |
| setRefineLevel(level) | Set the number of refinements. |
| setSNESFunction(function[, args, kargs]) | Set SNES residual evaluation function. |
| setSNESJacobian(jacobian[, args, kargs]) | Set the SNES Jacobian evaluation function. |
| setSectionSF(sf) | Set the Section encoding the parallel DOF overlap for the DM. |
| setType(dm_type) | Build a DM. |
| setUp() | Return the data structure. |
| setVecType(vec_type) | Set the type of vector. |
| view([viewer]) | View the DM. |
Attributes Summary
| appctx | Application context. |
| ds | Discrete space. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1645
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1668
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2333
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:611
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:298
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:691
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:634
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2124
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2010
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:155
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1519
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1570
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1472
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:718
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:751
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:646
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:134
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:679
Not collective.
Notes
The user is responsible for freeing all requested arrays.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2222
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:798
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1434
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1413
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1922
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:812
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1394
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1380
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1453
Collective.
Notes
Encoding based on the Section describing the data layout.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1786
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:446
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:121
Source code at petsc4py/PETSc/DM.pyx:343
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:503
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:370
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:770
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1306
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1159
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1194
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1226
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1258
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1020
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1629
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1048
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:238
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1063
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1095
Collective the first time it is called.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1127
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1292
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:703
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:206
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:586
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:416
Collective the first time it is called.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1762
Collective.
Notes
When done with the vector, it must be restored using restoreGlobalVec.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:826
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1003
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1704
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2055
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1881
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2168
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2034
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1963
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1323
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1735
Not collective.
Notes
When done with the vector, it must be restored using restoreLocalVec.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:880
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:546
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1867
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:284
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1840
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1597
Collective the first time it is called.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1809
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2100
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2076
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:192
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:934
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1901
Collective.
Notes
When using Viewer.Type.HDF5 format, one can save multiple DMPlex meshes in a single HDF5 files. This in turn requires one to name the DMPlex object with Object.setName before saving it with DM.view and before loading it with DM.load for identification of the mesh object.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:95
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:957
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:980
Collective.
Notes
Used if the mesh is periodic.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1340
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1495
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1543
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1941
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:855
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:909
Source code at petsc4py/PETSc/DM.pyx:339
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:473
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:349
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1142
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1174
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1209
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1241
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1035
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:252
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1273
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1078
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1110
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:220
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:560
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:392
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:312
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1750
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2194
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2146
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1986
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1723
Logically collective.
Notes
The option -dm_mat_type is used to set the matrix type.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1357
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:533
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:270
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1855
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1611
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2270
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:2302
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:1824
Collective.
Notes
DM types are available in DM.Type class.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:169
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:324
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:784
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DM.pyx:76
Attributes Documentation
Source code at petsc4py/PETSc/DM.pyx:2386
Source code at petsc4py/PETSc/DM.pyx:2396
A DM object that is used to manage data for a collection of DMs.
Methods Summary
| addDM(dm, *args) | Add a DM vector to the composite. |
| create([comm]) | Create a composite object. |
| gather(gvec, imode, lvecs) | Gather split local vectors into a coupled global vector. |
| getAccess(gvec[, locs]) | Get access to the individual vectors from the global vector. |
| getEntries() | Return sub-DMs contained in the composite. |
| getGlobalISs() | Return the index sets for each composed object in the composite. |
| getLGMaps() | Return a local-to-global mapping for each DM in the composite. |
| getLocalISs() | Return index sets for each component of a composite local vector. |
| getNumber() | Get number of sub-DMs contained in the composite. |
| scatter(gvec, lvecs) | Scatter coupled global vector into split local vectors. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMComposite.pyx:28
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMComposite.pyx:6
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMComposite.pyx:115
Not collective.
Use via The with statement context manager (PEP 343).
Source code at petsc4py/PETSc/DMComposite.pyx:219
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMComposite.pyx:66
Collective.
These could be used to extract a subset of vector entries for a "multi-physics" preconditioner.
Use getLocalISs for index sets in the packed local numbering, and getLGMaps for to map local sub-DM (including ghost) indices to packed global indices.
SEE ALSO:
Source code at petsc4py/PETSc/DMComposite.pyx:143
Collective.
Note that this includes all the ghost points that individual ghosted DMDA may have.
SEE ALSO:
Source code at petsc4py/PETSc/DMComposite.pyx:196
Not collective.
To get the composite global indices at all local points (including ghosts), use getLGMaps.
To get index sets for pieces of the composite global vector, use getGlobalISs.
SEE ALSO:
Source code at petsc4py/PETSc/DMComposite.pyx:170
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMComposite.pyx:51
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMComposite.pyx:90
A DM object that is used to manage data for a structured grid.
Enumerations
| ElementType | Element types. |
| InterpolationType | Interpolation types. |
| StencilType | Stencil types. |
Element types.
Attributes Summary
| P1 | Constant P1 of type int |
| Q1 | Constant Q1 of type int |
Attributes Documentation
Interpolation types.
Attributes Summary
| Q0 | Constant Q0 of type int |
| Q1 | Constant Q1 of type int |
Attributes Documentation
Stencil types.
Attributes Summary
| BOX | Constant BOX of type int |
| STAR | Constant STAR of type int |
Attributes Documentation
Methods Summary
| create([dim, dof, sizes, proc_sizes, ...]) | Create a DMDA object. |
| createNaturalVec() | Create a vector that will hold values in the natural numbering. |
| duplicate([dof, boundary_type, ...]) | Duplicate a DMDA. |
| getAO() | Return the application ordering context for a distributed array. |
| getBoundaryType() | Return the type of ghost nodes at boundary in each dimension. |
| getCoordinateName(index) | Return the name of a coordinate dimension. |
| getCorners() | Return the lower left corner and the sizes of the owned local region. |
| getDim() | Return the topological dimension. |
| getDof() | Return the number of degrees of freedom per node. |
| getElementType() | Return the element type to be returned by getElements. |
| getElements([elem_type]) | Return an array containing the indices of all the local elements. |
| getFieldName(field) | Return the name of an individual field component. |
| getGhostCorners() | Return the lower left corner and the size of the ghosted local region. |
| getGhostRanges() | Return the ranges of the local region in each dimension, including ghost nodes. |
| getInterpolationType() | Return the type of interpolation. |
| getOwnershipRanges() | Return the ranges of indices in each dimension owned by each process. |
| getProcSizes() | Return the number of processes in each dimension. |
| getRanges() | Return the ranges of the owned local region in each dimension. |
| getRefinementFactor() | Return the ratios that the DMDA grid is refined in each dimension. |
| getScatter() | Return the global-to-local, and local-to-local scatter contexts. |
| getSizes() | Return the number of grid points in each dimension. |
| getStencil() | Return the stencil type and width. |
| getStencilType() | Return the stencil type. |
| getStencilWidth() | Return the stencil width. |
| getVecArray(vec[, readonly]) | Get access to the vector as laid out on a N-d grid. |
| globalToNatural(vg, vn[, addv]) | Map values to the "natural" grid ordering. |
| naturalToGlobal(vn, vg[, addv]) | Map values the to grid ordering. |
| setBoundaryType(boundary_type) | Set the type of ghost nodes on domain boundaries. |
| setCoordinateName(index, name) | Set the name of the coordinate dimension. |
| setDim(dim) | Set the topological dimension. |
| setDof(dof) | Set the number of degrees of freedom per vertex. |
| setElementType(elem_type) | Set the element type to be returned by getElements. |
| setFieldName(field, name) | Set the name of individual field components. |
| setInterpolationType(interp_type) | Set the type of interpolation. |
| setProcSizes(proc_sizes) | Set the number of processes in each dimension. |
| setRefinementFactor([refine_x, refine_y, ...]) | Set the ratios for the DMDA grid refinement. |
| setSizes(sizes) | Set the number of grid points in each dimension. |
| setStencil(stencil_type, stencil_width) | Set the stencil type and width. |
| setStencilType(stencil_type) | Set the stencil type. |
| setStencilWidth(stencil_width) | Set the stencil width. |
| setUniformCoordinates([xmin, xmax, ymin, ...]) | Set the DMDA coordinates to be a uniform grid. |
Attributes Summary
| boundary_type | Boundary types in each dimension. |
| corners | The lower left corner and size of local region in each dimension. |
| dim | The grid dimension. |
| dof | The number of DOFs associated with each stratum of the grid. |
| ghost_corners | The lower left corner and size of local region in each dimension. |
| ghost_ranges | Ranges of local region, including ghost nodes. |
| proc_sizes | The number of processes in each dimension in the global decomposition. |
| ranges | Ranges of the local region in each dimension. |
| sizes | The global dimension. |
| stencil | Stencil type and width. |
| stencil_type | Stencil type. |
| stencil_width | Elementwise stencil width. |
Methods Documentation
Collective.
This routine performs the following steps of the C API: - petsc.DMDACreate - petsc.DMSetDimension - petsc.DMDASetDof - petsc.DMDASetSizes - petsc.DMDASetNumProcs - petsc.DMDASetOwnershipRanges - petsc.DMDASetBoundaryType - petsc.DMDASetStencilType - petsc.DMDASetStencilWidth - petsc.DMSetUp (optionally)
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:32
Collective.
The number of local entries in the vector on each process is the same as in a vector created with DM.createGlobalVec.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:832
Collective.
This routine retrieves the information from the DMDA and recreates it. Parameters dof, boundary_type, stencil_type, stencil_width will be overwritten, if provided.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:148
Collective.
The returned AO maps to the natural grid ordering that would be used for the DMDA if only 1 processor were employed (ordering most rapidly in the x-dimension, then y, then z). Multiple degrees of freedom are numbered for each node (rather than 1 component for the whole grid, then the next component, etc.).
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:909
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:407
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:810
Not collective.
Returns the global (x,y,z) indices of the lower left corner (first tuple) and size of the local region (second tuple).
Excluding ghost points.
The corner information is independent of the number of degrees of freedom per node. Thus the returned values can be thought of as coordinates on a logical grid, where each grid point has (potentially) several degrees of freedom.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:622
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:234
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:264
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:1050
Not collective.
The elements are in local coordinates.
Each process uniquely owns a subset of the elements. That is, no element is owned by two or more processes.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:1064
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:699
Not collective.
Returns the global (x,y,z) indices of the lower left corner (first tuple) and size of the local region (second tuple).
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:651
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:577
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:1020
Not collective.
These numbers are not multiplied by the number of DOFs per node.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:597
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:361
Not collective.
Excluding ghost nodes.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:555
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:981
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:930
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:311
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:532
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:448
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:486
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:723
Neighborwise collective.
You must call createNaturalVec before using this routine.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:849
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:879
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:384
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:788
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:217
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:246
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:1036
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:675
Logically collective.
You should call this on the coarser of the two DMDAs you pass to DM.createInterpolation.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:999
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:334
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:949
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:284
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:506
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:430
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:468
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMDA.pyx:744
Attributes Documentation
Source code at petsc4py/PETSc/DMDA.pyx:1123
Source code at petsc4py/PETSc/DMDA.pyx:1153
Source code at petsc4py/PETSc/DMDA.pyx:1103
Source code at petsc4py/PETSc/DMDA.pyx:1108
Source code at petsc4py/PETSc/DMDA.pyx:1158
Source code at petsc4py/PETSc/DMDA.pyx:1148
Source code at petsc4py/PETSc/DMDA.pyx:1118
Source code at petsc4py/PETSc/DMDA.pyx:1143
Source code at petsc4py/PETSc/DMDA.pyx:1113
Source code at petsc4py/PETSc/DMDA.pyx:1128
Source code at petsc4py/PETSc/DMDA.pyx:1133
Source code at petsc4py/PETSc/DMDA.pyx:1138
Interpolation on a mesh.
Methods Summary
| create([comm]) | Create a DMInterpolation context. |
| destroy() | Destroy the DMInterpolation context. |
| evaluate(dm, x[, v]) | Calculate interpolated field values at the interpolation points. |
| getCoordinates() | Return the coordinates of each interpolation point. |
| getDim() | Return the spatial dimension of the interpolation context. |
| getDof() | Return the number of fields interpolated at a point. |
| getVector() | Return a Vec which can hold all the interpolated field values. |
| restoreVector(vec) | Restore a Vec which can hold all the interpolated field values. |
| setDim(dim) | Set the spatial dimension for the interpolation context. |
| setDof(dof) | Set the number of fields interpolated at a point. |
| setUp(dm[, redundantPoints, ignoreOutsideDomain]) | Compute spatial indices for point location during interpolation. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:13
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:35
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:48
Collective.
The local vector entries correspond to interpolation points lying on this process, according to the associated DM.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:74
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:92
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:106
Collective.
This vector should be returned using restoreVector.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:185
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:201
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:120
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:138
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMUtils.pyx:156
An object representing a subset of mesh entities from a DM.
Methods Summary
| addStrata(strata) | Add new stratum values in a DMLabel. |
| addStrataIS(iset) | Add new stratum values in a DMLabel. |
| addStratum(value) | Add a new stratum value in a DMLabel. |
| clearStratum(stratum) | Remove a stratum. |
| clearValue(point, value) | Clear the value a label assigns to a point. |
| computeIndex() | Create an index structure for membership determination. |
| convertToSection() | Return a Section and IS that encode the label. |
| create(name[, comm]) | Create a DMLabel object, which is a multimap. |
| createIndex(pStart, pEnd) | Create an index structure for membership determination. |
| destroy() | Destroy the label. |
| destroyIndex() | Destroy the index structure. |
| distribute(sf) | Create a new label pushed forward over the SF. |
| duplicate() | Duplicate the DMLabel. |
| filter(start, end) | Remove all points outside of [start, end). |
| gather(sf) | Gather all label values from leaves into roots. |
| getBounds() | Return the smallest and largest point in the label. |
| getDefaultValue() | Return the default value returned by getValue. |
| getNonEmptyStratumValuesIS() | Return an IS of all values that the DMLabel takes. |
| getNumValues() | Return the number of values that the DMLabel takes. |
| getStratumIS(stratum) | Return an IS with the stratum points. |
| getStratumSize(stratum) | Return the size of a stratum. |
| getValue(point) | Return the value a label assigns to a point. |
| getValueIS() | Return an IS of all values that the DMLabel takes. |
| hasPoint(point) | Determine whether the label contains a point. |
| hasStratum(value) | Determine whether points exist with the given value. |
| hasValue(value) | Determine whether a label assigns the value to any point. |
| insertIS(iset, value) | Set all points in the IS to a value. |
| permute(permutation) | Create a new label with permuted points. |
| reset() | Destroy internal data structures in the DMLabel. |
| setDefaultValue(value) | Set the default value returned by getValue. |
| setStratumIS(stratum, iset) | Set the stratum points using an IS. |
| setValue(point, value) | Set the value a label assigns to a point. |
| stratumHasPoint(value, point) | Return whether the stratum contains a point. |
| view([viewer]) | View the label. |
Methods Documentation
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:238
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:258
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:220
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:406
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:199
Not collective.
Automatically determines the bounds.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:424
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:607
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:40
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:438
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:8
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:458
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:567
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:65
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:528
Collective.
This is the inverse operation to distribute.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:586
Not collective.
The returned values are the smallest point and the largest point + 1.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:512
Not collective.
The default value is returned if a point has not been explicitly given a value. When a label is created, it is initialized to -1.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:161
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:622
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:275
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:366
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:346
Not collective.
If no value was assigned, a default value will be returned The default value, initially -1, can be changed with setDefaultValue.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:137
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:289
Not collective.
The user must call createIndex before this function.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:490
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:326
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:470
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:91
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:548
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:79
Not collective.
The value is used if a point has not been explicitly given a value. When a label is created, the default value is initialized to -1.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:178
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:386
Not collective.
If the value is the same as the label's default value (which is initially -1, and can be changed with setDefaultValue), this function will do nothing.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:112
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:303
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMLabel.pyx:21
Encapsulate an unstructured mesh.
DMPlex encapsulates both topology and geometry. It is capable of parallel refinement and coarsening (using Pragmatic or ParMmg) and parallel redistribution for load balancing.
Methods Summary
| computeCellGeometryFVM(cell) | Compute the volume for a given cell. |
| computeGradientClementInterpolant(locX, locC) | Return the L2 projection of the cellwise gradient of a function onto P1. |
| constructGhostCells([labelName]) | Construct ghost cells which connect to every boundary face. |
| coordinatesLoad(viewer, sfxc) | Load coordinates into this DMPlex object. |
| coordinatesView(viewer) | Save DMPlex coordinates into a file. |
| create([comm]) | Create a DMPlex object, which encapsulates an unstructured mesh. |
| createBoxMesh(faces[, lower, upper, ...]) | Create a mesh on the tensor product of intervals. |
| createBoxSurfaceMesh(faces[, lower, upper, ...]) | Create a mesh on the surface of a box mesh using tensor cells. |
| createCGNS(cgid[, interpolate, comm]) | Create a DMPlex mesh from a CGNS file. |
| createCGNSFromFile(filename[, interpolate, comm]) | "Create a DMPlex mesh from a CGNS file. |
| createClosureIndex(sec) | Calculate an index for sec for the closure operation. |
| createCoarsePointIS() | Create an IS covering the coarse DMPlex chart with the fine points as data. |
| createCohesiveSubmesh(hasLagrange, value) | Extract the hypersurface defined by one face of the cohesive cells. |
| createExodus(exoid[, interpolate, comm]) | Create a DMPlex mesh from an ExodusII file ID. |
| createExodusFromFile(filename[, ...]) | Create a DMPlex mesh from an ExodusII file. |
| createFromCellList(dim, cells, coords[, ...]) | Create a DMPlex from a list of vertices for each cell on process 0. |
| createFromFile(filename[, plexname, ...]) | Create DMPlex from a file. |
| createGmsh(viewer[, interpolate, comm]) | Create a DMPlex mesh from a Gmsh file viewer. |
| createPointNumbering() | Create a global numbering for all points. |
| createSection(numComp, numDof[, bcField, ...]) | Create a Section based upon the DOF layout specification provided. |
| distribute([overlap]) | Distribute the mesh and any associated sections. |
| distributeField(sf, sec, vec[, newsec, newvec]) | Distribute field data with a with a given SF. |
| distributeGetDefault() | Return a flag indicating whether the DM should be distributed by default. |
| distributeOverlap([overlap]) | Add partition overlap to a distributed non-overlapping DMPlex. |
| distributeSetDefault(flag) | Set flag indicating whether the DMPlex should be distributed by default. |
| distributionGetName() | Retrieve the name of the specific parallel distribution. |
| distributionSetName(name) | Set the name of the specific parallel distribution. |
| generate(boundary[, name, interpolate]) | Generate a mesh. |
| getAdjacency(p) | Return all points adjacent to the given point. |
| getAdjacencyUseAnchors() | Query whether adjacency in the mesh uses the point-to-point constraints. |
| getCellNumbering() | Return a global cell numbering for all cells on this process. |
| getCellType(p) | Return the polytope type of a given cell. |
| getCellTypeLabel() | Return the DMLabel recording the polytope type of each cell. |
| getChart() | Return the interval for all mesh points [pStart, pEnd). |
| getCone(p) | Return the points on the in-edges for this point in the DAG. |
| getConeOrientation(p) | Return the orientations on the in-edges for this point in the DAG. |
| getConeSize(p) | Return the number of in-edges for this point in the DAG. |
| getDepth() | Return the depth of the DAG representing this mesh. |
| getDepthStratum(svalue) | Return the bounds [start, end) for all points at a certain depth. |
| getFullJoin(points) | Return an array for the join of the set of points. |
| getHeightStratum(svalue) | Return the bounds [start, end) for all points at a certain height. |
| getJoin(points) | Return an array for the join of the set of points. |
| getMaxSizes() | Return the maximum number of in-edges and out-edges of the DAG. |
| getMeet(points) | Return an array for the meet of the set of points. |
| getMinRadius() | Return the minimum distance from any cell centroid to a face. |
| getOrdering(otype) | Calculate a reordering of the mesh. |
| getPartitioner() | Return the mesh partitioner. |
| getPointDepth(point) | Return the depth of a given point. |
| getPointGlobal(point) | Return location of point data in global Vec. |
| getPointGlobalField(point, field) | Return location of point field data in global Vec. |
| getPointHeight(point) | Return the height of a given point. |
| getPointLocal(point) | Return location of point data in local Vec. |
| getPointLocalField(point, field) | Return location of point field data in local Vec. |
| getRefinementLimit() | Retrieve the maximum cell volume for refinement. |
| getRefinementUniform() | Retrieve the flag for uniform refinement. |
| getSubpointIS() | Return an IS covering the entire subdm chart. |
| getSubpointMap() | Return a DMLabel with point dimension as values. |
| getSupport(p) | Return the points on the out-edges for this point in the DAG. |
| getSupportSize(p) | Return the number of out-edges for this point in the DAG. |
| getTransitiveClosure(p[, useCone]) | Return the points and orientations on the transitive closure of this point. |
| getVecClosure(sec, vec, point) | Return an array of the values on the closure of a point. |
| getVertexNumbering() | Return a global vertex numbering for all vertices on this process. |
| globalVectorLoad(viewer, sectiondm, sf, vec) | Load on-disk vector data into a global vector. |
| globalVectorView(viewer, sectiondm, vec) | Save a global vector. |
| insertCone(p, conePos, conePoint) | DMPlexInsertCone - Insert a point into the in-edges for the point p in the DAG. |
| insertConeOrientation(p, conePos, ...) | Insert a point orientation for the in-edge for the point p in the DAG. |
| interpolate() | Convert to a mesh with all intermediate faces, edges, etc. |
| isDistributed() | Return the flag indicating if the mesh is distributed. |
| isSimplex() | Return the flag indicating if the first cell is a simplex. |
| labelCohesiveComplete(label, bdlabel, ...) | Add all other mesh pieces to complete the surface. |
| labelComplete(label) | Add the transitive closure to the surface. |
| labelsLoad(viewer, sfxc) | Load labels into this DMPlex object. |
| labelsView(viewer) | Save DMPlex labels into a file. |
| localVectorLoad(viewer, sectiondm, sf, vec) | Load on-disk vector data into a local vector. |
| localVectorView(viewer, sectiondm, vec) | Save a local vector. |
| markBoundaryFaces(label[, value]) | Mark all faces on the boundary. |
| metricAverage2(metric1, metric2, metricAvg) | Compute and return the unweighted average of two metrics. |
| metricAverage3(metric1, metric2, metric3, ...) | Compute and return the unweighted average of three metrics. |
| metricCreate([field]) | Create a Riemannian metric field. |
| metricCreateIsotropic(indicator[, field]) | Construct an isotropic metric from an error indicator. |
| metricCreateUniform(alpha[, field]) | Construct a uniform isotropic metric. |
| metricDeterminantCreate([field]) | Create the determinant field for a Riemannian metric. |
| metricEnforceSPD(metric, ometric, determinant) | Enforce symmetric positive-definiteness of a metric. |
| metricGetGradationFactor() | Return the metric gradation factor. |
| metricGetHausdorffNumber() | Return the metric Hausdorff number. |
| metricGetMaximumAnisotropy() | Return the maximum tolerated metric anisotropy. |
| metricGetMaximumMagnitude() | Return the maximum tolerated metric magnitude. |
| metricGetMinimumMagnitude() | Return the minimum tolerated metric magnitude. |
| metricGetNormalizationOrder() | Return the order p for L-p normalization. |
| metricGetNumIterations() | Return the number of parallel adaptation iterations. |
| metricGetTargetComplexity() | Return the target metric complexity. |
| metricGetVerbosity() | Return the verbosity of the mesh adaptation package. |
| metricIntersection2(metric1, metric2, metricInt) | Compute and return the intersection of two metrics. |
| metricIntersection3(metric1, metric2, ...) | Compute the intersection of three metrics. |
| metricIsIsotropic() | Return the flag indicating whether the metric is isotropic or not. |
| metricIsUniform() | Return the flag indicating whether the metric is uniform or not. |
| metricNoInsertion() | Return the flag indicating whether node insertion and deletion are turned off. |
| metricNoMovement() | Return the flag indicating whether node movement is turned off. |
| metricNoSurf() | Return the flag indicating whether surface modification is turned off. |
| metricNoSwapping() | Return the flag indicating whether facet swapping is turned off. |
| metricNormalize(metric, ometric, determinant) | Apply L-p normalization to a metric. |
| metricRestrictAnisotropyFirst() | Return true if anisotropy is restricted before normalization. |
| metricSetFromOptions() | Configure the object from the options database. |
| metricSetGradationFactor(beta) | Set the metric gradation factor. |
| metricSetHausdorffNumber(hausd) | Set the metric Hausdorff number. |
| metricSetIsotropic(isotropic) | Record whether the metric is isotropic or not. |
| metricSetMaximumAnisotropy(a_max) | Set the maximum tolerated metric anisotropy. |
| metricSetMaximumMagnitude(h_max) | Set the maximum tolerated metric magnitude. |
| metricSetMinimumMagnitude(h_min) | Set the minimum tolerated metric magnitude. |
| metricSetNoInsertion(noInsert) | Set the flag indicating whether node insertion should be turned off. |
| metricSetNoMovement(noMove) | Set the flag indicating whether node movement should be turned off. |
| metricSetNoSurf(noSurf) | Set the flag indicating whether surface modification should be turned off. |
| metricSetNoSwapping(noSwap) | Set the flag indicating whether facet swapping should be turned off. |
| metricSetNormalizationOrder(p) | Set the order p for L-p normalization. |
| metricSetNumIterations(numIter) | Set the number of parallel adaptation iterations. |
| metricSetRestrictAnisotropyFirst(...) | Record whether anisotropy is be restricted before normalization or after. |
| metricSetTargetComplexity(targetComplexity) | Set the target metric complexity. |
| metricSetUniform(uniform) | Record whether the metric is uniform or not. |
| metricSetVerbosity(verbosity) | Set the verbosity of the mesh adaptation package. |
| orient() | Give a consistent orientation to the input mesh. |
| permute(perm) | Reorder the mesh according to the input permutation. |
| rebalanceSharedPoints([entityDepth, ...]) | Redistribute shared points in order to achieve better balancing. |
| reorderGetDefault() | Return flag indicating whether the DMPlex should be reordered by default. |
| reorderSetDefault(flag) | Set flag indicating whether the DM should be reordered by default. |
| sectionLoad(viewer, sectiondm, sfxc) | Load section into a DM. |
| sectionView(viewer, sectiondm) | Save a section associated with a DMPlex. |
| setAdjacencyUseAnchors([useAnchors]) | Define adjacency in the mesh using the point-to-point constraints. |
| setCellType(p, ctype) | Set the polytope type of a given cell. |
| setChart(pStart, pEnd) | Set the interval for all mesh points [pStart, pEnd). |
| setCone(p, cone[, orientation]) | Set the points on the in-edges for this point in the DAG. |
| setConeOrientation(p, orientation) | Set the orientations on the in-edges for this point in the DAG. |
| setConeSize(p, size) | Set the number of in-edges for this point in the DAG. |
| setMatClosure(sec, gsec, mat, point, values) | Set an array of the values on the closure of point. |
| setPartitioner(part) | Set the mesh partitioner. |
| setRefinementLimit(refinementLimit) | Set the maximum cell volume for refinement. |
| setRefinementUniform([refinementUniform]) | Set the flag for uniform refinement. |
| setSupport(p, supp) | Set the points on the out-edges for this point in the DAG. |
| setSupportSize(p, size) | Set the number of out-edges for this point in the DAG. |
| setTetGenOptions(opts) | Set the options used for the Tetgen mesh generator. |
| setTriangleOptions(opts) | Set the options used for the Triangle mesh generator. |
| setVecClosure(sec, vec, point, values[, addv]) | Set an array of the values on the closure of point. |
| stratify() | Calculate the strata of DAG. |
| symmetrize() | Create support (out-edge) information from cone (in-edge) information. |
| topologyLoad(viewer) | Load a topology into this DMPlex object. |
| topologyView(viewer) | Save a DMPlex topology into a file. |
| uninterpolate() | Convert to a mesh with only cells and vertices. |
| vecGetClosure(sec, vec, p) | Return an array of values on the closure of p. |
Methods Documentation
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2217
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3151
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2249
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3324
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3191
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:14
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:90
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:149
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:226
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:254
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2031
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1817
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:377
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:312
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:283
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:35
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:192
Collective.
Notes
-dm_plex_gmsh_hybrid forces triangular prisms to use tensor order.
-dm_plex_gmsh_periodic allows for reading Gmsh periodic section.
-dm_plex_gmsh_highorder allows for generating high-order coordinates.
-dm_plex_gmsh_project projects high-order coordinates to a different space, use the prefix -dm_plex_gmsh_project_ to define the space.
-dm_plex_gmsh_use_regions generates labels with region names.
-dm_plex_gmsh_mark_vertices adds vertices to generated labels.
-dm_plex_gmsh_multiple_tags allows multiple tags for default labels.
-dm_plex_gmsh_spacedim <d> embedding space dimension.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:339
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:915
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1837
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1561
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1758
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1647
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1589
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1667
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1708
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1687
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1284
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1467
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1452
Collective the first time it is called.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:885
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:685
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:706
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:400
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:491
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:606
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:442
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:929
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:944
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1092
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:971
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1066
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:826
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1040
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1803
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2130
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1510
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:998
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1972
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2000
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1019
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1913
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1941
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2114
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2073
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2278
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2298
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:771
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:722
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1118
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1185
Collective the first time it is called.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:900
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3401
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3248
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:556
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:581
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1728
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1618
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1632
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1396
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1379
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3344
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3209
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3426
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3272
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1352
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3059
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3081
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2890
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2935
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2911
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2958
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2987
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2841
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2875
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2739
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2705
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2671
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2807
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2637
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2773
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2598
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3105
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3127
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2386
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2352
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2455
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2527
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2563
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2491
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3023
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2420
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2320
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2822
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2856
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2367
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2720
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2686
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2652
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2435
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2507
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2543
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2471
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2788
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2618
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2401
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2754
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2333
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2579
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:873
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2158
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1527
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2182
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2196
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3364
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3227
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1431
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:663
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:421
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:517
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:632
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:466
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1247
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1492
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2094
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:2053
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:797
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:746
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1332
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1312
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1215
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:861
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:848
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3298
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3173
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1743
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:1157
Mesh transformations.
Methods Summary
| apply(dm) | Apply a mesh transformation. |
| create([comm]) | Create a mesh transformation. |
| destroy() | Destroy a mesh transformation. |
| getType() | Return the transformation type name. |
| setDM(dm) | Set the DM for the transformation. |
| setFromOptions() | Configure the transformation from the options database. |
| setType(tr_type) | Set the transformation type. |
| setUp() | Setup a mesh transformation. |
| view([viewer]) | View the mesh transformation. |
Methods Documentation
Collective.
Source code at petsc4py/PETSc/DMPlex.pyx:3475
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3486
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3503
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3516
Logically collective.
Source code at petsc4py/PETSc/DMPlex.pyx:3554
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3563
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3540
Collective.
Source code at petsc4py/PETSc/DMPlex.pyx:3530
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMPlex.pyx:3575
Transformation types.
Attributes Summary
| EXTRUDE | Object EXTRUDE of type str |
| REFINE1D | Object REFINE1D of type str |
| REFINEALFELD | Object REFINEALFELD of type str |
| REFINEBOUNDARYLAYER | Object REFINEBOUNDARYLAYER of type str |
| REFINEPOWELLSABIN | Object REFINEPOWELLSABIN of type str |
| REFINEREGULAR | Object REFINEREGULAR of type str |
| REFINESBR | Object REFINESBR of type str |
| REFINETOBOX | Object REFINETOBOX of type str |
| REFINETOSIMPLEX | Object REFINETOSIMPLEX of type str |
| TRANSFORMFILTER | Object TRANSFORMFILTER of type str |
Attributes Documentation
A shell DM object, used to manage user-defined problem data.
Methods Summary
| create([comm]) | Creates a shell DM object. |
| setCoarsen(coarsen[, args, kargs]) | Set the routine used to coarsen the DMShell. |
| setCreateDomainDecomposition(decomp[, args, ...]) | Set the routine used to create a domain decomposition. |
| setCreateDomainDecompositionScatters(scatter) | Set the routine used to create the scatter contexts for domain decomposition. |
| setCreateFieldDecomposition(decomp[, args, ...]) | Set the routine used to create a field decomposition. |
| setCreateGlobalVector(create_gvec[, args, kargs]) | Set the routine to create a global vector. |
| setCreateInjection(create_injection[, args, ...]) | Set the routine used to create the injection operator. |
| setCreateInterpolation(create_interpolation) | Set the routine used to create the interpolation operator. |
| setCreateLocalVector(create_lvec[, args, kargs]) | Set the routine to create a local vector. |
| setCreateMatrix(create_matrix[, args, kargs]) | Set the routine to create a matrix. |
| setCreateRestriction(create_restriction[, ...]) | Set the routine used to create the restriction operator. |
| setCreateSubDM(create_subdm[, args, kargs]) | Set the routine used to create a sub DM from the DMShell. |
| setGlobalToLocal(begin, end[, begin_args, ...]) | Set the routines used to perform a global to local scatter. |
| setGlobalToLocalVecScatter(gtol) | Set a Scatter context for global to local communication. |
| setGlobalVector(gv) | Set a template global vector. |
| setLocalToGlobal(begin, end[, begin_args, ...]) | Set the routines used to perform a local to global scatter. |
| setLocalToGlobalVecScatter(ltog) | Set a Scatter context for local to global communication. |
| setLocalToLocal(begin, end[, begin_args, ...]) | Set the routines used to perform a local to local scatter. |
| setLocalToLocalVecScatter(ltol) | Set a Scatter context for local to local communication. |
| setLocalVector(lv) | Set a template local vector. |
| setMatrix(mat) | Set a template matrix. |
| setRefine(refine[, args, kargs]) | Set the routine used to refine the DMShell. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:4
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:368
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:560
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:592
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:528
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:76
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:464
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:432
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:108
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:336
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:496
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:624
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:140
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:189
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:42
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:206
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:253
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:270
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:319
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:59
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:25
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMShell.pyx:400
A DM object representing a "staggered grid" or a structured cell complex.
Enumerations
| StencilLocation | Stencil location types. |
| StencilType | Stencil types. |
Stencil location types.
Attributes Summary
| BACK | Constant BACK of type int |
| BACK_DOWN | Constant BACK_DOWN of type int |
| BACK_DOWN_LEFT | Constant BACK_DOWN_LEFT of type int |
| BACK_DOWN_RIGHT | Constant BACK_DOWN_RIGHT of type int |
| BACK_LEFT | Constant BACK_LEFT of type int |
| BACK_RIGHT | Constant BACK_RIGHT of type int |
| BACK_UP | Constant BACK_UP of type int |
| BACK_UP_LEFT | Constant BACK_UP_LEFT of type int |
| BACK_UP_RIGHT | Constant BACK_UP_RIGHT of type int |
| DOWN | Constant DOWN of type int |
| DOWN_LEFT | Constant DOWN_LEFT of type int |
| DOWN_RIGHT | Constant DOWN_RIGHT of type int |
| ELEMENT | Constant ELEMENT of type int |
| FRONT | Constant FRONT of type int |
| FRONT_DOWN | Constant FRONT_DOWN of type int |
| FRONT_DOWN_LEFT | Constant FRONT_DOWN_LEFT of type int |
| FRONT_DOWN_RIGHT | Constant FRONT_DOWN_RIGHT of type int |
| FRONT_LEFT | Constant FRONT_LEFT of type int |
| FRONT_RIGHT | Constant FRONT_RIGHT of type int |
| FRONT_UP | Constant FRONT_UP of type int |
| FRONT_UP_LEFT | Constant FRONT_UP_LEFT of type int |
| FRONT_UP_RIGHT | Constant FRONT_UP_RIGHT of type int |
| LEFT | Constant LEFT of type int |
| NULLLOC | Constant NULLLOC of type int |
| RIGHT | Constant RIGHT of type int |
| UP | Constant UP of type int |
| UP_LEFT | Constant UP_LEFT of type int |
| UP_RIGHT | Constant UP_RIGHT of type int |
Attributes Documentation
Stencil types.
Attributes Summary
| BOX | Constant BOX of type int |
| NONE | Constant NONE of type int |
| STAR | Constant STAR of type int |
Attributes Documentation
Methods Summary
| VecSplitToDMDA(vec, loc, c) | Return DMDA, Vec from a subgrid of a DMStag, its Vec. |
| create(dim[, dofs, sizes, boundary_types, ...]) | Create a DMDA object. |
| createCompatibleDMStag(dofs) | Create a compatible DMStag with different DOFs/stratum. |
| get1dCoordinatecArrays() | Not implemented. |
| getBoundaryTypes() | Return boundary types in each dimension. |
| getCorners() | Return starting element index, width and number of partial elements. |
| getDim() | Return the number of dimensions. |
| getDof() | Get number of DOFs associated with each stratum of the grid. |
| getEntriesPerElement() | Return the number of entries per element in the local representation. |
| getGhostCorners() | Return starting element index and width of local region. |
| getGlobalSizes() | Return global element counts in each dimension. |
| getIsFirstRank() | Return whether this process is first in each dimension in the process grid. |
| getIsLastRank() | Return whether this process is last in each dimension in the process grid. |
| getLocalSizes() | Return local elementwise sizes in each dimension. |
| getLocationDof(loc) | Return number of DOFs associated with a given point on the grid. |
| getLocationSlot(loc, c) | Return index to use in accessing raw local arrays. |
| getOwnershipRanges() | Return elements per process in each dimension. |
| getProcSizes() | Return number of processes in each dimension. |
| getProductCoordinateLocationSlot(loc) | Return slot for use with local product coordinate arrays. |
| getStencilType() | Return elementwise ghost/halo stencil type. |
| getStencilWidth() | Return elementwise stencil width. |
| getVecArray(vec) | Not implemented. |
| migrateVec(vec, dmTo, vecTo) | Transfer a vector between two DMStag objects. |
| setBoundaryTypes(boundary_types) | Set the boundary types. |
| setCoordinateDMType(dmtype) | Set the type to store coordinates. |
| setDof(dofs) | Set DOFs/stratum. |
| setGlobalSizes(sizes) | Set global element counts in each dimension. |
| setOwnershipRanges(ranges) | Set elements per process in each dimension. |
| setProcSizes(sizes) | Set the number of processes in each dimension in the global process grid. |
| setStencilType(stenciltype) | Set elementwise ghost/halo stencil type. |
| setStencilWidth(swidth) | Set elementwise stencil width. |
| setUniformCoordinates([xmin, xmax, ymin, ...]) | Set the coordinates to be a uniform grid.. |
| setUniformCoordinatesExplicit([xmin, xmax, ...]) | Set coordinates to be a uniform grid, storing all values. |
| setUniformCoordinatesProduct([xmin, xmax, ...]) | Create uniform coordinates, as a product of 1D arrays. |
Attributes Summary
| boundary_types | Boundary types in each dimension. |
| corners | The lower left corner and size of local region in each dimension. |
| dim | The dimension. |
| dofs | The number of DOFs associated with each stratum of the grid. |
| entries_per_element | The number of entries per element in the local representation. |
| ghost_corners | The lower left corner and size of local region in each dimension. |
| global_sizes | Global element counts in each dimension. |
| local_sizes | Local elementwise sizes in each dimension. |
| proc_sizes | The number of processes in each dimension in the global decomposition. |
| stencil_type | Stencil type. |
| stencil_width | Elementwise stencil width. |
Methods Documentation
Collective.
If a c value of -k is provided, the first k DOFs for that position are extracted, padding with zero values if needed. If a non-negative value is provided, a single DOF is extracted.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:790
Collective.
Creates an object to manage data living on the elements and vertices / the elements, faces, and vertices / the elements, faces, edges, and vertices of a parallelized regular 1D / 2D / 3D grid.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:50
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:766
Source code at petsc4py/PETSc/DMStag.pyx:832
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:478
Not collective.
The returned value is calculated excluding ghost points.
The number of extra partial elements is either 1 or 0. The value is 1 on right, top, and front non-periodic domain ("physical") boundaries, in the x, y, and z dimensions respectively, and otherwise 0.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:363
Not collective.
Source code at petsc4py/PETSc/DMStag.pyx:310
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:348
Not collective.
This is the natural block size for most local operations.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:318
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:385
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:417
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:496
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:512
Not collective.
The returned value is calculated excluding ghost points.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:400
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:721
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:678
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:461
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:432
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:701
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:447
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:334
Source code at petsc4py/PETSc/DMStag.pyx:828
Collective.
Currently only implemented to migrate global vectors to global vectors.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:743
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:201
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:657
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:224
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:246
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:286
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:266
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:183
Logically collective.
The width value is not used when StencilType.NONE is specified.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:163
Collective.
Local coordinates are populated, linearly extrapolated to ghost cells, including those outside the physical domain. This is also done in case of periodic boundaries, meaning that the same global point may have different coordinates in different local representations, which are equivalent assuming a periodicity implied by the arguments to this function, i.e., two points are equivalent if their difference is a multiple of xmax-xmin in the x dimension, ymax-ymin in the y dimension, and zmax-zmin in the z dimension.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:610
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:530
Collective.
The per-dimension 1-dimensional DMStag objects that comprise the product always have active 0-cells (vertices, element boundaries) and 1-cells (element centers).
SEE ALSO:
Source code at petsc4py/PETSc/DMStag.pyx:568
Attributes Documentation
Source code at petsc4py/PETSc/DMStag.pyx:866
Source code at petsc4py/PETSc/DMStag.pyx:881
Source code at petsc4py/PETSc/DMStag.pyx:836
Source code at petsc4py/PETSc/DMStag.pyx:841
Source code at petsc4py/PETSc/DMStag.pyx:846
Source code at petsc4py/PETSc/DMStag.pyx:886
Source code at petsc4py/PETSc/DMStag.pyx:851
Source code at petsc4py/PETSc/DMStag.pyx:856
Source code at petsc4py/PETSc/DMStag.pyx:861
Source code at petsc4py/PETSc/DMStag.pyx:871
Source code at petsc4py/PETSc/DMStag.pyx:876
A DM object used to represent arrays of data (fields) of arbitrary type.
Enumerations
| CollectType | Swarm collection types. |
| MigrateType | Swarm migration types. |
| PICLayoutType | Swarm PIC layout types. |
| Type | Swarm types. |
Swarm collection types.
Attributes Summary
| COLLECT_BASIC | Constant COLLECT_BASIC of type int |
| COLLECT_DMDABOUNDINGBOX | Constant COLLECT_DMDABOUNDINGBOX of type int |
| COLLECT_GENERAL | Constant COLLECT_GENERAL of type int |
| COLLECT_USER | Constant COLLECT_USER of type int |
Attributes Documentation
Swarm migration types.
Attributes Summary
| MIGRATE_BASIC | Constant MIGRATE_BASIC of type int |
| MIGRATE_DMCELLEXACT | Constant MIGRATE_DMCELLEXACT of type int |
| MIGRATE_DMCELLNSCATTER | Constant MIGRATE_DMCELLNSCATTER of type int |
| MIGRATE_USER | Constant MIGRATE_USER of type int |
Attributes Documentation
Swarm PIC layout types.
Attributes Summary
| LAYOUT_GAUSS | Constant LAYOUT_GAUSS of type int |
| LAYOUT_REGULAR | Constant LAYOUT_REGULAR of type int |
| LAYOUT_SUBDIVISION | Constant LAYOUT_SUBDIVISION of type int |
Attributes Documentation
Swarm types.
Attributes Summary
| BASIC | Constant BASIC of type int |
| PIC | Constant PIC of type int |
Attributes Documentation
Methods Summary
| addNPoints(npoints) | Add space for a number of new points in the DMSwarm. |
| addPoint() | Add space for one new point in the DMSwarm. |
| collectViewCreate() | Apply a collection method and gather points in neighbor ranks. |
| collectViewDestroy() | Reset the DMSwarm to the size prior to calling collectViewCreate. |
| copyPoint(pi, pj) | Copy point pi to point pj in the DMSwarm. |
| create([comm]) | Create an empty DM object and set its type to DM.Type.SWARM. |
| createGlobalVectorFromField(fieldname) | Create a global Vec object associated with a given field. |
| createLocalVectorFromField(fieldname) | Create a local Vec object associated with a given field. |
| destroyGlobalVectorFromField(fieldname) | Destroy the global Vec object associated with a given field. |
| destroyLocalVectorFromField(fieldname) | Destroy the local Vec object associated with a given field. |
| finalizeFieldRegister() | Finalize the registration of fields to a DMSwarm. |
| getCellDM() | Return DM cell attached to DMSwarm. |
| getField(fieldname) | Return arrays storing all entries associated with a field. |
| getLocalSize() | Return the local length of fields registered. |
| getSize() | Return the total length of fields registered. |
| initializeFieldRegister() | Initiate the registration of fields to a DMSwarm. |
| insertPointUsingCellDM(layoutType, fill_param) | Insert point coordinates within each cell. |
| migrate([remove_sent_points]) | Relocate points defined in the DMSwarm to other MPI ranks. |
| projectFields(dm, fieldnames, vecs[, mode]) | Project a set of DMSwarm fields onto the cell DM. |
| registerField(fieldname, blocksize[, dtype]) | Register a field to a DMSwarm with a native PETSc data type. |
| removePoint() | Remove the last point from the DMSwarm. |
| removePointAtIndex(index) | Remove a specific point from the DMSwarm. |
| restoreField(fieldname) | Restore accesses associated with a registered field. |
| setCellDM(dm) | Attach a DM to a DMSwarm. |
| setLocalSizes(nlocal, buffer) | Set the length of all registered fields on the DMSwarm. |
| setPointCoordinates(coordinates[, ...]) | Set point coordinates in a DMSwarm from a user-defined list. |
| setPointCoordinatesCellwise(coordinates) | Insert point coordinates within each cell. |
| setPointsUniformCoordinates(min, max, npoints) | Set point coordinates in a DMSwarm on a regular (ijk) grid. |
| setType(dmswarm_type) | Set particular flavor of DMSwarm. |
| sortGetAccess() | Setup up a DMSwarm point sort context. |
| sortGetIsValid() | Return whether the sort context is up-to-date. |
| sortGetNumberOfPointsPerCell(e) | Return the number of points in a cell. |
| sortGetPointsPerCell(e) | Create an array of point indices for all points in a cell. |
| sortGetSizes() | Return the sizes associated with a DMSwarm point sorting context. |
| sortRestoreAccess() | Invalidate the DMSwarm point sorting context. |
| vectorDefineField(fieldname) | Set the field from which to define a Vec object. |
| viewFieldsXDMF(filename, fieldnames) | Write a selection of DMSwarm fields to an XDMF3 file. |
| viewXDMF(filename) | Write this DMSwarm fields to an XDMF3 file. |
Methods Documentation
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:329
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:317
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:445
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:457
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:377
Collective.
DMs are the abstract objects in PETSc that mediate between meshes and discretizations and the algebraic solvers, time integrators, and optimization algorithms.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:39
Collective.
The vector must be returned to the DMSwarm using a matching call to destroyGlobalVectorFromField.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:65
Collective.
The vector must be returned to the DMSwarm using a matching call to destroyLocalVectorFromField.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:109
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:89
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:133
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:167
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:486
Not collective.
The returned array contains underlying values of the field.
The array must be returned to the DMSwarm using a matching call to restoreField.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:231
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:398
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:412
Collective.
After all fields have been registered, you must call finalizeFieldRegister.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:153
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:601
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:426
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:810
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:201
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:347
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:359
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:274
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:469
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:179
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:565
Not collective.
Point coordinates are defined over the reference cell.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:623
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:521
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:503
Not collective.
The point sort context is used for efficient traversal of points within a cell.
You must call sortRestoreAccess when you no longer need access to the sort context.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:698
Not collective.
Returns the flag associated with a DMSwarm point sorting context.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:772
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:752
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:728
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:788
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:716
Collective.
The field will be used when DM.createLocalVec, or DM.createGlobalVec is called.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:295
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:650
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DMSwarm.pyx:679
Discrete System object.
Enumerations
| Type | The Discrete System types. |
The Discrete System types.
Attributes Summary
| BASIC | Object BASIC of type str |
Attributes Documentation
Methods Summary
| create([comm]) | Create an empty DS. |
| destroy() | Destroy the discrete system. |
| getComponents() | Return the number of components for each field on an evaluation point. |
| getCoordinateDimension() | Return the coordinate dimension of the DS. |
| getDimensions() | Return the size of the space for each field on an evaluation point. |
| getFieldIndex(disc) | Return the index of the given field. |
| getNumFields() | Return the number of fields in the DS. |
| getSpatialDimension() | Return the spatial dimension of the DS. |
| getTotalComponents() | Return the total number of components in this system. |
| getTotalDimensions() | Return the total size of the approximation space for this system. |
| getType() | Return the type of the discrete system. |
| setDiscretisation(f, disc) | Set the discretization object for the given field. |
| setFromOptions() | Set parameters in a DS from the options database. |
| setType(ds_type) | Build a particular type of a discrete system. |
| setUp() | Construct data structures for the discrete system. |
| view([viewer]) | View a discrete system. |
Methods Documentation
Collective.
The type can then be set with setType.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:53
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:40
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:246
Not collective.
The coordinate dimension of the DS is the dimension of the space into which the discretiaztions are embedded.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:153
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:231
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:184
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:170
Not collective.
The spatial dimension of the DS is the topological dimension of the discretizations.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:136
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:217
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:203
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:95
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:261
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:109
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:76
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:121
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DS.pyx:21
The device object.
Represents a handle to an accelerator (which may be the host).
SEE ALSO:
Enumerations
| Type | The type of device. |
The type of device.
SEE ALSO:
Attributes Summary
| CUDA | Constant CUDA of type int |
| DEFAULT | Constant DEFAULT of type int |
| HIP | Constant HIP of type int |
| HOST | Constant HOST of type int |
| SYCL | Constant SYCL of type int |
Attributes Documentation
Methods Summary
| configure() | Configure and setup a device object. |
| create([dtype, device_id]) | Create a device object. |
| destroy() | Destroy a device object. |
| getDeviceId() | Return the device id. |
| getDeviceType() | Return the type of the device. |
| setDefaultType(device_type) | Set the device type to be used as the default in subsequent calls to create. |
| view([viewer]) | View a device object. |
Attributes Summary
| device_id | The device id. |
| type | The device type. |
Methods Documentation
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:132
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:94
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:120
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:180
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:165
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:195
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:144
Attributes Documentation
Source code at petsc4py/PETSc/Device.pyx:215
Source code at petsc4py/PETSc/Device.pyx:210
DeviceContext object.
Represents an abstract handle to a device context.
SEE ALSO:
Enumerations
| DeviceJoinMode | The type of join to perform. |
| StreamType | The type of stream. |
The type of join to perform.
SEE ALSO:
Attributes Summary
| DESTROY | Constant DESTROY of type int |
| NO_SYNC | Constant NO_SYNC of type int |
| SYNC | Constant SYNC of type int |
Attributes Documentation
The type of stream.
SEE ALSO:
Attributes Summary
| DEFAULT | Constant DEFAULT of type int |
| DEFAULT_WITH_BARRIER | Constant DEFAULT_WITH_BARRIER of type int |
| NONBLOCKING | Constant NONBLOCKING of type int |
| NONBLOCKING_WITH_BARRIER | Constant NONBLOCKING_WITH_BARRIER of type int |
Attributes Documentation
Methods Summary
| create() | Create an empty DeviceContext. |
| destroy() | Destroy a device context. |
| duplicate() | Duplicate a the device context. |
| fork(n[, stream_type]) | Create multiple device contexts which are all logically dependent on this one. |
| getCurrent() | Return the current device context. |
| getDevice() | Get the Device which this instance is attached to. |
| getStreamType() | Return the StreamType. |
| idle() | Return whether the underlying stream for the device context is idle. |
| join(join_mode, py_sub_ctxs) | Join a set of device contexts on this one. |
| setCurrent(dctx) | Set the current device context. |
| setDevice(device) | Set the Device which this DeviceContext is attached to. |
| setFromOptions([comm]) | Configure the DeviceContext from the options database. |
| setStreamType(stream_type) | Set the StreamType. |
| setUp() | Set up the internal data structures for using the device context. |
| synchronize() | Synchronize a device context. |
| waitFor(other) | Make this instance wait for other. |
Attributes Summary
| current | The current global device context. |
| device | The device associated to the device context. |
| stream_type | The stream type. |
Methods Documentation
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:240
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:255
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:348
Not collective.
Examples
The device contexts created must be destroyed using join.
>>> dctx = PETSc.DeviceContext().getCurrent() >>> dctxs = dctx.fork(4) >>> ... # perform computations >>> # we can mix various join modes >>> dctx.join(PETSc.DeviceContext.JoinMode.SYNC, dctxs[0:2]) >>> dctx.join(PETSc.DeviceContext.JoinMode.SYNC, dctxs[2:]) >>> ... # some more computations and joins >>> # dctxs must be all destroyed with joinMode.DESTROY >>> dctx.join(PETSc.DeviceContext.JoinMode.DESTROY, dctxs)
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:399
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:519
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:302
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:268
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:363
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:448
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:535
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:317
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:500
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:283
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:336
Not collective.
Notes
The underlying stream is considered idle after this routine returns, i.e. idle will return True.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:483
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Device.pyx:378
Attributes Documentation
Source code at petsc4py/PETSc/Device.pyx:574
Source code at petsc4py/PETSc/Device.pyx:566
Source code at petsc4py/PETSc/Device.pyx:558
Dual space to a linear space.
Enumerations
| Type | The dual space types. |
The dual space types.
Attributes Summary
| BDM | Object BDM of type str |
| LAGRANGE | Object LAGRANGE of type str |
| REFINED | Object REFINED of type str |
| SIMPLE | Object SIMPLE of type str |
Attributes Documentation
Methods Summary
| create([comm]) | Create an empty DualSpace object. |
| destroy() | Destroy the DualSpace object. |
| duplicate() | Create a duplicate DualSpace object that is not set up. |
| getDM() | Return the DM representing the reference cell of a DualSpace. |
| getDimension() | Return the dimension of the dual space. |
| getFunctional(i) | Return the i-th basis functional in the dual space. |
| getInteriorDimension() | Return the interior dimension of the dual space. |
| getLagrangeContinuity() | Return whether the element is continuous. |
| getLagrangeTensor() | Return the tensor nature of the dual space. |
| getLagrangeTrimmed() | Return the trimmed nature of the dual space. |
| getNumComponents() | Return the number of components for this space. |
| getNumDof() | Return the number of degrees of freedom for each spatial dimension. |
| getOrder() | Return the order of the dual space. |
| getType() | Return the type of the dual space object. |
| setDM(dm) | Set the DM representing the reference cell. |
| setLagrangeContinuity(continuous) | Indicate whether the element is continuous. |
| setLagrangeTensor(tensor) | Set the tensor nature of the dual space. |
| setLagrangeTrimmed(trimmed) | Set the trimmed nature of the dual space. |
| setNumComponents(nc) | Set the number of components for this space. |
| setOrder(order) | Set the order of the dual space. |
| setSimpleDimension(dim) | Set the number of functionals in the dual space basis. |
| setSimpleFunctional(func, functional) | Set the given basis element for this dual space. |
| setType(dualspace_type) | Build a particular type of dual space. |
| setUp() | Construct a basis for a DualSpace. |
| view([viewer]) | View a DualSpace. |
Methods Documentation
Collective.
The type can then be set with setType.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:594
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:636
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:649
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:662
Not collective.
The dimension of the dual space, i.e. the number of basis functionals.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:696
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:826
Not collective.
The interior dimension of the dual space, i.e. the number of basis functionals assigned to the interior of the reference domain.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:847
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:864
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:896
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:928
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:712
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:810
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:778
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:744
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:679
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:878
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:910
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:942
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:726
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:792
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:962
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:980
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:758
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:582
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:617
A PETSc object that manages a finite element space.
Enumerations
| Type | The finite element types. |
The finite element types.
Attributes Summary
| BASIC | Object BASIC of type str |
| COMPOSITE | Object COMPOSITE of type str |
| OPENCL | Object OPENCL of type str |
Attributes Documentation
Methods Summary
| create([comm]) | Create an empty FE object. |
| createDefault(dim, nc, isSimplex[, qorder, ...]) | Create a FE for basic FEM computation. |
| createLagrange(dim, nc, isSimplex, k[, ...]) | Create a FE for the basic Lagrange space of degree k. |
| destroy() | Destroy the FE object. |
| getBasisSpace() | Return the Space used for the approximation of the FE solution. |
| getDimension() | Return the dimension of the finite element space on a cell. |
| getDualSpace() | Return the DualSpace used to define the inner product for the FE. |
| getFaceQuadrature() | Return the Quad used to calculate inner products on faces. |
| getNumComponents() | Return the number of components in the element. |
| getNumDof() | Return the number of DOFs. |
| getQuadrature() | Return the Quad used to calculate inner products. |
| getSpatialDimension() | Return the spatial dimension of the element. |
| getTileSizes() | Return the tile sizes for evaluation. |
| setBasisSpace(sp) | Set the Space used for the approximation of the solution. |
| setDualSpace(dspace) | Set the DualSpace used to define the inner product. |
| setFaceQuadrature(quad) | Set the Quad used to calculate inner products on faces. |
| setFromOptions() | Set parameters in a FE from the options database. |
| setNumComponents(comp) | Set the number of field components in the element. |
| setQuadrature(quad) | Set the Quad used to calculate inner products. |
| setTileSizes(blockSize, numBlocks, ...) | Set the tile sizes for evaluation. |
| setType(fe_type) | Build a particular FE. |
| setUp() | Construct data structures for the FE after the Type has been set. |
| view([viewer]) | View a FE object. |
Methods Documentation
Collective.
The type can then be set with setType.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:53
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:76
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:122
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:40
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:387
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:181
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:443
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:316
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:209
Not collective.
Return the number of DOFs (dual basis vectors) associated with mesh points on the reference cell of a given dimension.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:241
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:166
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:195
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:260
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:402
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:458
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:349
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:419
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:223
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:331
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:286
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:367
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:431
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/FE.pyx:21
A collection of indices.
IS objects are used to index into vectors and matrices and to set up vector scatters.
SEE ALSO:
Enumerations
| Type | The index set types. |
The index set types.
Attributes Summary
| BLOCK | Object BLOCK of type str |
| GENERAL | Object GENERAL of type str |
| STRIDE | Object STRIDE of type str |
Attributes Documentation
Methods Summary
| allGather() | Concatenate index sets stored across processors. |
| buildTwoSided([toindx]) | Create an index set describing a global mapping. |
| complement(nmin, nmax) | Create a complement index set. |
| copy([result]) | Copy the contents of the index set into another. |
| create([comm]) | Create an IS. |
| createBlock(bsize, indices[, comm]) | Create a blocked index set. |
| createGeneral(indices[, comm]) | Create an IS with indices. |
| createStride(size[, first, step, comm]) | Create an index set consisting of evenly spaced values. |
| destroy() | Destroy the index set. |
| difference(iset) | Return the difference between two index sets. |
| duplicate() | Create a copy of the index set. |
| embed(iset, drop) | Embed self into iset. |
| equal(iset) | Return whether the index sets have the same set of indices or not. |
| expand(iset) | Return the union of two (possibly unsorted) index sets. |
| getBlockIndices() | Return the indices of an index set with type IS.Type.BLOCK. |
| getBlockSize() | Return the number of elements in a block. |
| getIndices() | Return the indices of the index set. |
| getInfo() | Return stride information for an index set with type IS.Type.STRIDE. |
| getLocalSize() | Return the process-local length of the index set. |
| getSize() | Return the global length of an index set. |
| getSizes() | Return the local and global sizes of the index set. |
| getStride() | Return size and stride information. |
| getType() | Return the index set type associated with the IS. |
| invertPermutation([nlocal]) | Invert the index set. |
| isIdentity() | Return whether the index set has been declared as an identity. |
| isPermutation() | Return whether an index set has been declared to be a permutation. |
| isSorted() | Return whether the indices have been sorted. |
| load(viewer) | Load a stored index set. |
| renumber([mult]) | Renumber the non-negative entries of an index set, starting from 0. |
| setBlockIndices(bsize, indices) | Set the indices for an index set with type IS.Type.BLOCK. |
| setBlockSize(bs) | Set the block size of the index set. |
| setIdentity() | Mark the index set as being an identity. |
| setIndices(indices) | Set the indices of an index set. |
| setPermutation() | Mark the index set as being a permutation. |
| setStride(size[, first, step]) | Set the stride information for an index set with type IS.Type.STRIDE. |
| setType(is_type) | Set the type of the index set. |
| sort() | Sort the indices of an index set. |
| sum(iset) | Return the union of two (sorted) index sets. |
| toGeneral() | Convert the index set type to IS.Type.GENERAL. |
| union(iset) | Return the union of two (possibly unsorted) index sets. |
| view([viewer]) | Display the index set. |
Attributes Summary
| array | View of the index set as an array of integers. |
| block_size | The number of elements in a block. |
| identity | True if index set is an identity, False otherwise. |
| indices | The indices of the index set. |
| local_size | The local size of the index set. |
| permutation | True if index set is a permutation, False otherwise. |
| size | The global size of the index set. |
| sizes | The local and global sizes of the index set. |
| sorted | True if index set is sorted, False otherwise. |
Methods Documentation
Collective.
The returned index set will be the same on every processor.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:304
Collective.
This function generates an index set that contains new numbers from remote or local on the index set.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:333
Collective.
The complement set of indices is all indices that are not in the provided set (and within the provided bounds).
Notes
For a parallel index set, this will generate the local part of the complement on each process.
To generate the entire complement (on each process) of a parallel index set, first call IS.allGather and then call this method.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:674
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:253
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:88
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:171
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:142
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:204
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:75
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:650
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:239
Not collective.
The embedding is performed by finding the locations in iset that have the same indices as self.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:710
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:550
Collective.
To compute the union, expand concatenates the two index sets and removes any duplicates.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:588
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:833
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:437
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:789
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:903
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:401
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:387
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:415
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:879
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:128
Collective.
For this to be correct the index set must be a permutation.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:363
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:536
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:509
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:482
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:281
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:741
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:810
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:451
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:523
Logically collective.
The index set is assumed to be of type IS.Type.GENERAL.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:772
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:496
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:855
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:109
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:469
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:569
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:320
Collective.
This function will call either ISSum or ISExpand depending on whether or not the input sets are already sorted.
Sequential only (as ISSum is sequential only).
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:615
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:56
Attributes Documentation
Not collective.
Source code at petsc4py/PETSc/IS.pyx:1032
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1006
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:939
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1019
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:993
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:926
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:980
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:967
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:952
Insertion mode.
Most commonly used insertion modes are:
SEE ALSO:
Attributes Summary
| ADD | Constant ADD of type int |
| ADD_ALL | Constant ADD_ALL of type int |
| ADD_ALL_VALUES | Constant ADD_ALL_VALUES of type int |
| ADD_BC | Constant ADD_BC of type int |
| ADD_BC_VALUES | Constant ADD_BC_VALUES of type int |
| ADD_VALUES | Constant ADD_VALUES of type int |
| INSERT | Constant INSERT of type int |
| INSERT_ALL | Constant INSERT_ALL of type int |
| INSERT_ALL_VALUES | Constant INSERT_ALL_VALUES of type int |
| INSERT_BC | Constant INSERT_BC of type int |
| INSERT_BC_VALUES | Constant INSERT_BC_VALUES of type int |
| INSERT_VALUES | Constant INSERT_VALUES of type int |
| MAX | Constant MAX of type int |
| MAX_VALUES | Constant MAX_VALUES of type int |
| NOT_SET_VALUES | Constant NOT_SET_VALUES of type int |
Attributes Documentation
Abstract PETSc object that manages all Krylov methods.
This is the object that manages the linear solves in PETSc (even those such as direct solvers that do no use Krylov accelerators).
Notes
When a direct solver is used, but no Krylov solver is used, the KSP object is still used but with a Type.PREONLY, meaning that only application of the preconditioner is used as the linear solver.
SEE ALSO:
Enumerations
| ConvergedReason | KSP Converged Reason. |
| HPDDMType | The HPDDM Krylov solver type. |
| NormType | KSP norm type. |
| Type | KSP Type. |
KSP Converged Reason.
SEE ALSO:
Attributes Summary
| CONVERGED_ATOL | Constant CONVERGED_ATOL of type int |
| CONVERGED_ATOL_NORMAL | Constant CONVERGED_ATOL_NORMAL of type int |
| CONVERGED_HAPPY_BREAKDOWN | Constant CONVERGED_HAPPY_BREAKDOWN of type int |
| CONVERGED_ITERATING | Constant CONVERGED_ITERATING of type int |
| CONVERGED_ITS | Constant CONVERGED_ITS of type int |
| CONVERGED_NEG_CURVE | Constant CONVERGED_NEG_CURVE of type int |
| CONVERGED_RTOL | Constant CONVERGED_RTOL of type int |
| CONVERGED_RTOL_NORMAL | Constant CONVERGED_RTOL_NORMAL of type int |
| CONVERGED_STEP_LENGTH | Constant CONVERGED_STEP_LENGTH of type int |
| DIVERGED_BREAKDOWN | Constant DIVERGED_BREAKDOWN of type int |
| DIVERGED_BREAKDOWN_BICG | Constant DIVERGED_BREAKDOWN_BICG of type int |
| DIVERGED_DTOL | Constant DIVERGED_DTOL of type int |
| DIVERGED_INDEFINITE_MAT | Constant DIVERGED_INDEFINITE_MAT of type int |
| DIVERGED_INDEFINITE_PC | Constant DIVERGED_INDEFINITE_PC of type int |
| DIVERGED_MAX_IT | Constant DIVERGED_MAX_IT of type int |
| DIVERGED_NANORINF | Constant DIVERGED_NANORINF of type int |
| DIVERGED_NONSYMMETRIC | Constant DIVERGED_NONSYMMETRIC of type int |
| DIVERGED_NULL | Constant DIVERGED_NULL of type int |
| DIVERGED_PCSETUP_FAILED | Constant DIVERGED_PCSETUP_FAILED of type int |
| ITERATING | Constant ITERATING of type int |
Attributes Documentation
The HPDDM Krylov solver type.
Attributes Summary
| BCG | Constant BCG of type int |
| BFBCG | Constant BFBCG of type int |
| BGCRODR | Constant BGCRODR of type int |
| BGMRES | Constant BGMRES of type int |
| CG | Constant CG of type int |
| GCRODR | Constant GCRODR of type int |
| GMRES | Constant GMRES of type int |
| PREONLY | Constant PREONLY of type int |
Attributes Documentation
KSP norm type.
The available norm types are:
Attributes Summary
| DEFAULT | Constant DEFAULT of type int |
| NATURAL | Constant NATURAL of type int |
| NO | Constant NO of type int |
| NONE | Constant NONE of type int |
| NORM_DEFAULT | Constant NORM_DEFAULT of type int |
| NORM_NATURAL | Constant NORM_NATURAL of type int |
| NORM_NONE | Constant NORM_NONE of type int |
| NORM_PRECONDITIONED | Constant NORM_PRECONDITIONED of type int |
| NORM_UNPRECONDITIONED | Constant NORM_UNPRECONDITIONED of type int |
| PRECONDITIONED | Constant PRECONDITIONED of type int |
| UNPRECONDITIONED | Constant UNPRECONDITIONED of type int |
Attributes Documentation
KSP Type.
The available types are:
SEE ALSO:
Attributes Summary
| BCGS | Object BCGS of type str |
| BCGSL | Object BCGSL of type str |
| BICG | Object BICG of type str |
| CG | Object CG of type str |
| CGLS | Object CGLS of type str |
| CGNE | Object CGNE of type str |
| CGS | Object CGS of type str |
| CHEBYSHEV | Object CHEBYSHEV of type str |
| CR | Object CR of type str |
| DGMRES | Object DGMRES of type str |
| FBCGS | Object FBCGS of type str |
| FBCGSR | Object FBCGSR of type str |
| FCG | Object FCG of type str |
| FETIDP | Object FETIDP of type str |
| FGMRES | Object FGMRES of type str |
| GCR | Object GCR of type str |
| GLTR | Object GLTR of type str |
| GMRES | Object GMRES of type str |
| GROPPCG | Object GROPPCG of type str |
| HPDDM | Object HPDDM of type str |
| IBCGS | Object IBCGS of type str |
| LCD | Object LCD of type str |
| LGMRES | Object LGMRES of type str |
| LSQR | Object LSQR of type str |
| MINRES | Object MINRES of type str |
| NASH | Object NASH of type str |
| NONE | Object NONE of type str |
| PGMRES | Object PGMRES of type str |
| PIPEBCGS | Object PIPEBCGS of type str |
| PIPECG | Object PIPECG of type str |
| PIPECG2 | Object PIPECG2 of type str |
| PIPECGRR | Object PIPECGRR of type str |
| PIPECR | Object PIPECR of type str |
| PIPEFCG | Object PIPEFCG of type str |
| PIPEFGMRES | Object PIPEFGMRES of type str |
| PIPEGCR | Object PIPEGCR of type str |
| PIPELCG | Object PIPELCG of type str |
| PIPEPRCG | Object PIPEPRCG of type str |
| PREONLY | Object PREONLY of type str |
| PYTHON | Object PYTHON of type str |
| QCG | Object QCG of type str |
| QMRCGS | Object QMRCGS of type str |
| RICHARDSON | Object RICHARDSON of type str |
| STCG | Object STCG of type str |
| SYMMLQ | Object SYMMLQ of type str |
| TCQMR | Object TCQMR of type str |
| TFQMR | Object TFQMR of type str |
| TSIRM | Object TSIRM of type str |
Attributes Documentation
Methods Summary
| addConvergenceTest(converged[, args, kargs, ...]) | Add the function to be used to determine convergence. |
| appendOptionsPrefix(prefix) | Append to prefix used for all KSP options in the database. |
| buildResidual([r]) | Return the residual of the linear system. |
| buildSolution([x]) | Return the solution vector. |
| callConvergenceTest(its, rnorm) | Call the convergence test callback. |
| computeEigenvalues() | Compute the extreme eigenvalues for the preconditioned operator. |
| computeExtremeSingularValues() | Compute the extreme singular values for the preconditioned operator. |
| create([comm]) | Create the KSP context. |
| createPython([context, comm]) | Create a linear solver of Python type. |
| destroy() | Destroy KSP context. |
| getAppCtx() | Return the user-defined context for the linear solver. |
| getCGObjectiveValue() | Return the CG objective function value. |
| getComputeEigenvalues() | Return flag indicating whether eigenvalues will be calculated. |
| getComputeSingularValues() | Return flag indicating whether singular values will be calculated. |
| getConvergedReason() | Use reason property. |
| getConvergenceHistory() | Return array containing the residual history. |
| getConvergenceTest() | Return the function to be used to determine convergence. |
| getDM() | Return the DM that may be used by some preconditioners. |
| getErrorIfNotConverged() | Return the flag indicating the solver will error if divergent. |
| getHPDDMType() | Return the Krylov solver type. |
| getInitialGuessKnoll() | Determine whether the KSP solver is using the Knoll trick. |
| getInitialGuessNonzero() | Determine whether the KSP solver uses a zero initial guess. |
| getIterationNumber() | Use its property. |
| getMonitor() | Return function used to monitor the residual. |
| getNormType() | Return the norm that is used for convergence testing. |
| getOperators() | Return the matrix associated with the linear system. |
| getOptionsPrefix() | Return the prefix used for all KSP options in the database. |
| getPC() | Return the preconditioner. |
| getPCSide() | Return the preconditioning side. |
| getPythonContext() | Return the instance of the class implementing Python methods. |
| getPythonType() | Return the fully qualified Python name of the class used by the solver. |
| getResidualNorm() | Use norm property. |
| getRhs() | Return the right-hand side vector for the linear system. |
| getSolution() | Return the solution for the linear system to be solved. |
| getTolerances() | Return various tolerances used by the KSP convergence tests. |
| getType() | Return the KSP type as a string from the KSP object. |
| getWorkVecs([right, left]) | Create working vectors. |
| logConvergenceHistory(rnorm) | Add residual to convergence history. |
| matSolve(B, X) | Solve a linear system with multiple right-hand sides. |
| matSolveTranspose(B, X) | Solve the transpose of a linear system with multiple RHS. |
| monitor(its, rnorm) | Run the user provided monitor routines, if they exist. |
| monitorCancel() | Clear all monitors for a KSP object. |
| reset() | Resets a KSP context. |
| setAppCtx(appctx) | Set the optional user-defined context for the linear solver. |
| setComputeEigenvalues(flag) | Set a flag to compute eigenvalues. |
| setComputeOperators(operators[, args, kargs]) | Set routine to compute the linear operators. |
| setComputeRHS(rhs[, args, kargs]) | Set routine to compute the right-hand side of the linear system. |
| setComputeSingularValues(flag) | Set flag to calculate singular values. |
| setConvergedReason(reason) | Use reason property. |
| setConvergenceHistory([length, reset]) | Set the array used to hold the residual history. |
| setConvergenceTest(converged[, args, kargs]) | Set the function to be used to determine convergence. |
| setDM(dm) | Set the DM that may be used by some preconditioners. |
| setDMActive(flag) | DM should be used to generate system matrix & RHS vector. |
| setErrorIfNotConverged(flag) | Cause solve to generate an error if not converged. |
| setFromOptions() | Set KSP options from the options database. |
| setGMRESRestart(restart) | Set number of iterations at which KSP restarts. |
| setHPDDMType(hpddm_type) | Set the Krylov solver type. |
| setInitialGuessKnoll(flag) | Tell solver to use PC.apply to compute the initial guess. |
| setInitialGuessNonzero(flag) | Tell the iterative solver that the initial guess is nonzero. |
| setIterationNumber(its) | Use its property. |
| setMonitor(monitor[, args, kargs]) | Set additional function to monitor the residual. |
| setNormType(normtype) | Set the norm that is used for convergence testing. |
| setOperators([A, P]) | Set matrix associated with the linear system. |
| setOptionsPrefix(prefix) | Set the prefix used for all KSP options in the database. |
| setPC(pc) | Set the preconditioner. |
| setPCSide(side) | Set the preconditioning side. |
| setPostSolve(postsolve[, args, kargs]) | Set the function that is called at the end of each KSP.solve. |
| setPreSolve(presolve[, args, kargs]) | Set the function that is called at the beginning of each KSP.solve. |
| setPythonContext([context]) | Set the instance of the class implementing Python methods. |
| setPythonType(py_type) | Set the fully qualified Python name of the class to be used. |
| setResidualNorm(rnorm) | Use norm property. |
| setTolerances([rtol, atol, divtol, max_it]) | Set various tolerances used by the KSP convergence testers. |
| setType(ksp_type) | Build the KSP data structure for a particular Type. |
| setUp() | Set up internal data structures for an iterative solver. |
| setUpOnBlocks() | Set up the preconditioner for each block in a block method. |
| setUseFischerGuess(model, size) | Use the Paul Fischer algorithm to compute initial guesses. |
| solve(b, x) | Solve the linear system. |
| solveTranspose(b, x) | Solve the transpose of a linear system. |
| view([viewer]) | Print the KSP data structure. |
Attributes Summary
| appctx | The solver application context. |
| atol | The absolute tolerance of the solver. |
| divtol | The divergence tolerance of the solver. |
| dm | The solver DM. |
| guess_knoll | Whether solver uses Knoll trick. |
| guess_nonzero | Whether guess is non-zero. |
| history | The convergence history of the solver. |
| is_converged | Boolean indicating if the solver has converged. |
| is_diverged | Boolean indicating if the solver has failed. |
| is_iterating | Boolean indicating if the solver has not converged yet. |
| its | The current number of iterations the solver has taken. |
| mat_op | The system matrix operator. |
| mat_pc | The preconditioner operator. |
| max_it | The maximum number of iteration the solver may take. |
| norm | The norm of the residual at the current iteration. |
| norm_type | The norm used by the solver. |
| pc | The PC of the solver. |
| pc_side | The side on which preconditioning is performed. |
| reason | The converged reason. |
| rtol | The relative tolerance of the solver. |
| vec_rhs | The right-hand side vector. |
| vec_sol | The solution vector. |
Methods Documentation
Logically collective.
Notes
Cannot be mixed with a call to setConvergenceTest. It can only be called once. If called multiple times, it will generate an error.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1065
Logically collective.
Notes
A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:575
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:2063
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:2041
Collective.
Notes
This functionality is implemented in petsc4py.
Source code at petsc4py/PETSc/KSP.pyx:1121
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:2085
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:2108
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:457
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:2154
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:444
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:640
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1882
Not collective.
Return the flag indicating that the extreme eigenvalues values will be calculated via a Lanczos or Arnoldi process as the linear system is solved.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1430
Not collective.
Return the flag indicating whether the extreme singular values will be calculated via a Lanczos or Arnoldi process as the linear system is solved.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1474
Source code at petsc4py/PETSc/KSP.pyx:1876
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1188
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1108
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:654
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1946
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1914
Not collective.
This uses the Knoll trick; using PC.apply to compute the initial guess.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1550
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1516
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1266
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1390
Collective.
Return the matrix associated with the linear system and a (possibly) different one used to construct the preconditioner.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:850
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:561
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:897
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1349
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:2195
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:2225
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1960
Not collective.
Note that this may not be the solution that is stored during the iterative process.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1975
Not collective.
Return the relative, absolute, divergence, and maximum iteration tolerances used by the default KSP convergence tests.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:971
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:509
Collective.
Source code at petsc4py/PETSc/KSP.pyx:1993
Logically collective.
Source code at petsc4py/PETSc/KSP.pyx:1203
Collective.
These are stored as a Mat.Type.DENSE. Unlike solve, B and X must be different matrices.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1808
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1830
Collective.
Notes
This routine is called by the KSP implementations. It does not typically need to be called by the user.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1294
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1279
Collective.
Resets a KSP context to the kspsetupcalled = 0 state and removes any allocated Vecs and Mats.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1607
Not collective.
Notes
The user context is a way for users to attach any information to the KSP that they may need later when interacting with the solver.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:617
Logically collective.
Set a flag so that the extreme eigenvalues values will be calculated via a Lanczos or Arnoldi process as the linear system is solved.
Notes
Currently this option is not valid for all iterative methods.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1404
Logically collective.
Notes
The user provided function Operators will be called automatically at the very next call to solve. It will NOT be called at future solve calls unless either setComputeOperators or setOperators is called before that solve is called. This allows the same system to be solved several times with different right-hand side functions, but is a confusing API since one might expect it to be called for each solve.
To reuse the same preconditioner for the next solve and not compute a new one based on the most recently computed matrix call KSPSetReusePreconditioner.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:764
Logically collective.
Notes
The routine you provide will be called each time you call solve to prepare the new right-hand side for that solve.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:730
Logically collective.
Set a flag so that the extreme singular values will be calculated via a Lanczos or Arnoldi process as the linear system is solved.
Notes
Currently this option is not valid for all iterative methods.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1448
Source code at petsc4py/PETSc/KSP.pyx:1871
Not collective.
If set, this array will contain the residual norms computed at each iteration of the solver.
Notes
If length is not provided or None then a default array of length 10000 is allocated.
If the array is not long enough then once the iterations is longer than the array length solve stops recording the history.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1144
Logically collective.
Notes
Must be called after the KSP type has been set so put this after a call to setType, or setFromOptions.
The default is a combination of relative and absolute tolerances. The residual value that is tested may be an approximation; routines that need exact values should compute them.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1000
Logically collective.
Notes
If this is used then the KSP will attempt to use the DM to create the matrix and use the routine set with DM.setKSPComputeOperators. Use setDMActive(False) to instead use the matrix you have provided with setOperators.
A DM can only be used for solving one problem at a time because information about the problem is stored on the DM, even when not using interfaces like DM.setKSPComputeOperators. Use DM.clone to get a distinct DM when solving different problems using the same function space.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:671
Logically collective.
Notes
By default setDM sets the DM as active, call setDMActive(False) after setDM(dm) to not have the KSP object use the DM to generate the matrices.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:704
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1928
Collective.
This routine must be called before setUp if the user is to be allowed to set the Krylov type.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:600
Logically collective.
Suitable KSPs are: KSPGMRES, KSPFGMRES and KSPLGMRES.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:2132
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1896
Logically collective.
This is the Knoll trick.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1530
Logically collective.
Otherwise KSP assumes the initial guess is to be zero (and thus zeros it out before solving).
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1494
Source code at petsc4py/PETSc/KSP.pyx:1849
Logically collective.
Set an ADDITIONAL function to be called at every iteration to monitor the residual/error etc.
Notes
The default is to do nothing. To print the residual, or preconditioned residual if setNormType(NORM_PRECONDITIONED) was called, use monitor as the monitoring routine, with a PETSc.Viewer.ASCII as the context.
Several different monitoring routines may be set by calling setMonitor multiple times; all will be called in the order in which they were set.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1219
Logically collective.
Notes
Not all combinations of preconditioner side (see setPCSide) and norm type are supported by all Krylov methods. If only one is set, PETSc tries to automatically change the other to find a compatible pair. If no such combination is supported, PETSc will generate an error.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1363
Collective.
Set the matrix associated with the linear system and a (possibly) different one from which the preconditioner will be built.
Notes
If you know the operator A has a null space you can use Mat.setNullSpace and Mat.setTransposeNullSpace to supply the null space to A and the KSP solvers will automatically use that null space as needed during the solution process.
All future calls to setOperators must use the same size matrices!
Passing None for A or P removes the matrix that is currently used.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:809
Logically collective.
Notes
A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen. For example, to distinguish between the runtime options for two different KSP contexts, one could call ` KSPSetOptionsPrefix(ksp1, "sys1_") KSPSetOptionsPrefix(ksp2, "sys2_") `
This would enable use of different options for each system, such as ` -sys1_ksp_type gmres -sys1_ksp_rtol 1.e-3 -sys2_ksp_type bcgs -sys2_ksp_rtol 1.e-4 `
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:523
Collective.
Set the preconditioner to be used to calculate the application of the preconditioner on a vector.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:877
Logically collective.
Notes
Left preconditioning is used by default for most Krylov methods except Type.FGMRES which only supports right preconditioning.
For methods changing the side of the preconditioner changes the norm type that is used, see setNormType.
Symmetric preconditioning is currently available only for the Type.QCG method. Note, however, that symmetric preconditioning can be emulated by using either right or left preconditioning and a pre or post processing step.
Setting the PC side often affects the default norm type. See setNormType for details.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1315
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1670
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1637
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:2183
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:2210
Source code at petsc4py/PETSc/KSP.pyx:1860
Logically collective.
Set the relative, absolute, divergence, and maximum iteration tolerances used by the default KSP convergence testers.
Notes
Use None to retain the default value of any of the tolerances.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:914
Logically collective.
Notes
See Type for available methods (for instance, Type.CG or Type.GMRES).
Normally, it is best to use the setFromOptions command and then set the KSP type from the options database rather than by using this routine. Using the options database provides the user with maximum flexibility in evaluating the many different Krylov methods. This method is provided for those situations where it is necessary to set the iterative solver independently of the command line or options database. This might be the case, for example, when the choice of iterative solver changes during the execution of the program, and the user's application is taking responsibility for choosing the appropriate method. In other words, this routine is not for beginners.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:473
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1595
Collective.
Methods include: block Jacobi, block Gauss-Seidel, and overlapping Schwarz methods.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1622
Logically collective.
Use the Paul Fischer algorithm or its variants to compute initial guesses for a set of solves with related right hand sides.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1567
Collective.
Notes
If one uses setDM then x or b need not be passed. Use getSolution to access the solution in this case.
The operator is specified with setOperators.
solve will normally return without generating an error regardless of whether the linear system was solved or if constructing the preconditioner failed. Call getConvergedReason to determine if the solver converged or failed and why. The option -ksp_error_if_not_converged or function setErrorIfNotConverged will cause solve to error as soon as an error occurs in the linear solver. In inner solves, DIVERGED_MAX_IT is not treated as an error because when using nested solvers it may be fine that inner solvers in the preconditioner do not converge during the solution process.
The number of iterations can be obtained from its.
If you provide a matrix that has a Mat.setNullSpace and Mat.setTransposeNullSpace this will use that information to solve singular systems in the least squares sense with a norm minimizing solution.
Ax = b where b = bₚ + bₜ where bₜ is not in the range of A (and hence by the fundamental theorem of linear algebra is in the nullspace(Aᵀ), see Mat.setNullSpace.
KSP first removes bₜ producing the linear system Ax = bₚ (which has multiple solutions) and solves this to find the ∥x∥ minimizing solution (and hence it finds the solution x orthogonal to the nullspace(A). The algorithm is simply in each iteration of the Krylov method we remove the nullspace(A) from the search direction thus the solution which is a linear combination of the search directions has no component in the nullspace(A).
We recommend always using Type.GMRES for such singular systems. If nullspace(A) = nullspace(Aᵀ) (note symmetric matrices always satisfy this property) then both left and right preconditioning will work If nullspace(A) != nullspace(Aᵀ) then left preconditioning will work but right preconditioning may not work (or it may).
If using a direct method (e.g., via the KSP solver Type.PREONLY and a preconditioner such as PC.Type.LU or PC.Type.ILU, then its=1. See setTolerances for more details.
Understanding Convergence
The routines setMonitor and computeEigenvalues provide information on additional options to monitor convergence and print eigenvalue information.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1703
Collective.
Notes
For complex numbers this solve the non-Hermitian transpose system.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:1784
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/KSP.pyx:425
Attributes Documentation
Source code at petsc4py/PETSc/KSP.pyx:2242
Source code at petsc4py/PETSc/KSP.pyx:2335
Source code at petsc4py/PETSc/KSP.pyx:2343
Source code at petsc4py/PETSc/KSP.pyx:2252
Source code at petsc4py/PETSc/KSP.pyx:2294
Source code at petsc4py/PETSc/KSP.pyx:2286
Source code at petsc4py/PETSc/KSP.pyx:2377
Source code at petsc4py/PETSc/KSP.pyx:2397
Source code at petsc4py/PETSc/KSP.pyx:2402
Source code at petsc4py/PETSc/KSP.pyx:2392
Source code at petsc4py/PETSc/KSP.pyx:2361
Source code at petsc4py/PETSc/KSP.pyx:2274
Source code at petsc4py/PETSc/KSP.pyx:2279
Source code at petsc4py/PETSc/KSP.pyx:2351
Source code at petsc4py/PETSc/KSP.pyx:2369
Source code at petsc4py/PETSc/KSP.pyx:2317
Source code at petsc4py/PETSc/KSP.pyx:2304
Source code at petsc4py/PETSc/KSP.pyx:2309
Source code at petsc4py/PETSc/KSP.pyx:2384
Source code at petsc4py/PETSc/KSP.pyx:2327
Source code at petsc4py/PETSc/KSP.pyx:2267
Source code at petsc4py/PETSc/KSP.pyx:2262
Mapping from a local to a global ordering.
SEE ALSO:
Enumerations
| GLMapMode | Enum describing mapping behavior when global indices are missing. |
| Type | Local to global map types. |
Enum describing mapping behavior when global indices are missing.
SEE ALSO:
Attributes Summary
| DROP | Constant DROP of type int |
| MASK | Constant MASK of type int |
Attributes Documentation
Local to global map types.
Attributes Summary
| BASIC | Object BASIC of type str |
| HASH | Object HASH of type str |
Attributes Documentation
Methods Summary
| apply(indices[, result]) | Convert a locally numbered list of integers to a global numbering. |
| applyBlock(indices[, result]) | Convert a local block numbering to a global block numbering. |
| applyBlockInverse(indices[, mode]) | Compute blocked local numbering from blocked global numbering. |
| applyIS(iset) | Create an index set with global numbering from a local numbering. |
| applyInverse(indices[, mode]) | Compute local numbering from global numbering. |
| create(indices[, bsize, comm]) | Create a local-to-global mapping. |
| createIS(iset) | Create a local-to-global mapping from an index set. |
| createSF(sf, start) | Create a local-to-global mapping from a star forest. |
| destroy() | Destroy the local-to-global mapping. |
| getBlockIndices() | Return the global indices for each local block. |
| getBlockInfo() | Determine the block indices shared with neighboring processes. |
| getBlockSize() | Return the block size of the local-to-global mapping. |
| getIndices() | Return the global indices for each local point in the mapping. |
| getInfo() | Determine the indices shared with neighboring processes. |
| getSize() | Return the local size of the local-to-global mapping. |
| setFromOptions() | Set mapping options from the options database. |
| setType(lgmap_type) | Set the type of the local-to-global map. |
| view([viewer]) | View the local-to-global mapping. |
Attributes Summary
| block_indices | The global indices for each local block in the mapping. |
| block_info | Mapping describing block indices shared with neighboring processes. |
| block_size | The block size. |
| indices | The global indices for each local point in the mapping. |
| info | Mapping describing indices shared with neighboring processes. |
| size | The local size. |
Methods Documentation
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1404
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1441
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1542
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1478
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1503
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1187
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1222
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1243
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1174
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1318
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1373
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1280
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1294
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1344
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1266
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1143
Logically collective.
Notes
Use -islocaltoglobalmapping_type to set the type in the options database.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1119
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1155
Attributes Documentation
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1621
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1647
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1595
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1608
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1634
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/IS.pyx:1582
Logging support.
Methods Summary
| Class(name) | Source code at petsc4py/PETSc/Log.pyx:25 |
| Event(name[, klass]) | Source code at petsc4py/PETSc/Log.pyx:39 |
| EventDecorator([name, klass]) | Decorate a function with a PETSc event. |
| Stage(name) | Source code at petsc4py/PETSc/Log.pyx:11 |
| addFlops(flops) | Add floating point operations to the current event. |
| begin() | Turn on logging of objects and events. |
| getCPUTime() | Return the CPU time. |
| getFlops() | Return the number of flops used on this processor since the program began. |
| getTime() | Return the current time of day in seconds. |
| isActive() | Return whether logging is currently in progress. |
| logFlops(flops) | Add floating point operations to the current event. |
| view([viewer]) | Print the log. |
Methods Documentation
Source code at petsc4py/PETSc/Log.pyx:178
Not collective.
Notes
This method exists for backward compatibility.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:108
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:55
Source code at petsc4py/PETSc/Log.pyx:171
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:131
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:151
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:193
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:89
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:68
Logging support.
Methods Summary
| activate() | Activate the log class. |
| deactivate() | Deactivate the log class. |
| getActive() | Not implemented. |
| getName() | Return the log class name. |
| setActive(flag) | Activate or deactivate the log class. |
Attributes Summary
| active | Log class activation. |
| id | The log class identifier. |
| name | The log class name. |
Methods Documentation
Source code at petsc4py/PETSc/Log.pyx:444
Attributes Documentation
Source code at petsc4py/PETSc/Log.pyx:451
Source code at petsc4py/PETSc/Log.pyx:401
Source code at petsc4py/PETSc/Log.pyx:420
Logging support.
Methods Summary
| activate() | Indicate that the event should be logged. |
| begin(*objs) | Log the beginning of a user event. |
| deactivate() | Indicate that the event should not be logged. |
| end(*objs) | Log the end of a user event. |
| getActive() | Not implemented. |
| getActiveAll() | Not implemented. |
| getName() | The current event name. |
| getPerfInfo([stage]) | Get the performance information about the given event in the given event. |
| setActive(flag) | Indicate whether or not the event should be logged. |
| setActiveAll(flag) | Turn on logging of all events. |
Attributes Summary
| active | Event activation. |
| active_all | All events activation. |
| id | The log event identifier. |
| name | The current event name. |
Methods Documentation
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:552
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:496
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:564
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:515
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:643
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:581
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:614
Attributes Documentation
Source code at petsc4py/PETSc/Log.pyx:601
Source code at petsc4py/PETSc/Log.pyx:633
Source code at petsc4py/PETSc/Log.pyx:478
Source code at petsc4py/PETSc/Log.pyx:541
Logging support for different stages.
Methods Summary
| activate() | Activate the stage. |
| deactivate() | Deactivate the stage. |
| getActive() | Check if the stage is activated. |
| getName() | Return the current stage name. |
| getVisible() | Return whether the stage is visible. |
| pop() | Pop a stage from the logging stack. |
| push() | Push a stage on the logging stack. |
| setActive(flag) | Activate or deactivate the current stage. |
| setVisible(flag) | Set the visibility of the stage. |
Attributes Summary
| active | Whether the stage is activate. |
| id | The log stage identifier. |
| name | The current stage name. |
| visible | Whether the stage is visible. |
Methods Documentation
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:279
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:291
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:303
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:341
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:247
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:235
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:317
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Log.pyx:355
Attributes Documentation
Source code at petsc4py/PETSc/Log.pyx:331
Source code at petsc4py/PETSc/Log.pyx:215
Source code at petsc4py/PETSc/Log.pyx:268
Source code at petsc4py/PETSc/Log.pyx:374
Matrix object.
Mat is described in the PETSc manual.
SEE ALSO:
Enumerations
| AssemblyType | Matrix assembly type. |
| DuplicateOption | Matrix duplicate option. |
| FactorShiftType | Factored matrix shift type. |
| InfoType | Matrix info type. |
| Option | Matrix option. |
| OrderingType | Factored matrix ordering type. |
| SORType | Matrix SOR type. |
| SolverType | Factored matrix solver type. |
| Stencil | Associate structured grid coordinates with matrix indices. |
| Structure | Matrix modification structure. |
| Type | Matrix type. |
Matrix assembly type.
SEE ALSO:
Attributes Summary
| FINAL | Constant FINAL of type int |
| FINAL_ASSEMBLY | Constant FINAL_ASSEMBLY of type int |
| FLUSH | Constant FLUSH of type int |
| FLUSH_ASSEMBLY | Constant FLUSH_ASSEMBLY of type int |
Attributes Documentation
Matrix duplicate option.
SEE ALSO:
Attributes Summary
| COPY_VALUES | Constant COPY_VALUES of type int |
| DO_NOT_COPY_VALUES | Constant DO_NOT_COPY_VALUES of type int |
| SHARE_NONZERO_PATTERN | Constant SHARE_NONZERO_PATTERN of type int |
Attributes Documentation
Factored matrix shift type.
SEE ALSO:
Attributes Summary
| INBLOCKS | Constant INBLOCKS of type int |
| NONE | Constant NONE of type int |
| NONZERO | Constant NONZERO of type int |
| NZ | Constant NZ of type int |
| PD | Constant PD of type int |
| POSITIVE_DEFINITE | Constant POSITIVE_DEFINITE of type int |
Attributes Documentation
Matrix info type.
Attributes Summary
| GLOBAL_MAX | Constant GLOBAL_MAX of type int |
| GLOBAL_SUM | Constant GLOBAL_SUM of type int |
| LOCAL | Constant LOCAL of type int |
Attributes Documentation
Matrix option.
SEE ALSO:
Attributes Summary
| ERROR_LOWER_TRIANGULAR | Constant ERROR_LOWER_TRIANGULAR of type int |
| FORCE_DIAGONAL_ENTRIES | Constant FORCE_DIAGONAL_ENTRIES of type int |
| GETROW_UPPERTRIANGULAR | Constant GETROW_UPPERTRIANGULAR of type int |
| HERMITIAN | Constant HERMITIAN of type int |
| IGNORE_LOWER_TRIANGULAR | Constant IGNORE_LOWER_TRIANGULAR of type int |
| IGNORE_OFF_PROC_ENTRIES | Constant IGNORE_OFF_PROC_ENTRIES of type int |
| IGNORE_ZERO_ENTRIES | Constant IGNORE_ZERO_ENTRIES of type int |
| KEEP_NONZERO_PATTERN | Constant KEEP_NONZERO_PATTERN of type int |
| NEW_NONZERO_ALLOCATION_ERR | Constant NEW_NONZERO_ALLOCATION_ERR of type int |
| NEW_NONZERO_LOCATIONS | Constant NEW_NONZERO_LOCATIONS of type int |
| NEW_NONZERO_LOCATION_ERR | Constant NEW_NONZERO_LOCATION_ERR of type int |
| NO_OFF_PROC_ENTRIES | Constant NO_OFF_PROC_ENTRIES of type int |
| NO_OFF_PROC_ZERO_ROWS | Constant NO_OFF_PROC_ZERO_ROWS of type int |
| OPTION_MAX | Constant OPTION_MAX of type int |
| OPTION_MIN | Constant OPTION_MIN of type int |
| ROW_ORIENTED | Constant ROW_ORIENTED of type int |
| SORTED_FULL | Constant SORTED_FULL of type int |
| SPD | Constant SPD of type int |
| STRUCTURALLY_SYMMETRIC | Constant STRUCTURALLY_SYMMETRIC of type int |
| STRUCTURE_ONLY | Constant STRUCTURE_ONLY of type int |
| SUBMAT_SINGLEIS | Constant SUBMAT_SINGLEIS of type int |
| SUBSET_OFF_PROC_ENTRIES | Constant SUBSET_OFF_PROC_ENTRIES of type int |
| SYMMETRIC | Constant SYMMETRIC of type int |
| SYMMETRY_ETERNAL | Constant SYMMETRY_ETERNAL of type int |
| UNUSED_NONZERO_LOCATION_ERR | Constant UNUSED_NONZERO_LOCATION_ERR of type int |
| USE_HASH_TABLE | Constant USE_HASH_TABLE of type int |
| USE_INODES | Constant USE_INODES of type int |
Attributes Documentation
Factored matrix ordering type.
SEE ALSO:
Attributes Summary
| AMD | Object AMD of type str |
| METISND | Object METISND of type str |
| NATURAL | Object NATURAL of type str |
| ND | Object ND of type str |
| OWD | Object OWD of type str |
| QMD | Object QMD of type str |
| RCM | Object RCM of type str |
| ROWLENGTH | Object ROWLENGTH of type str |
| SPECTRAL | Object SPECTRAL of type str |
| WBM | Object WBM of type str |
Attributes Documentation
Matrix SOR type.
SEE ALSO:
Attributes Summary
| APPLY_LOWER | Constant APPLY_LOWER of type int |
| APPLY_UPPER | Constant APPLY_UPPER of type int |
| BACKWARD_SWEEP | Constant BACKWARD_SWEEP of type int |
| EISENSTAT | Constant EISENSTAT of type int |
| FORWARD_SWEEP | Constant FORWARD_SWEEP of type int |
| LOCAL_BACKWARD_SWEEP | Constant LOCAL_BACKWARD_SWEEP of type int |
| LOCAL_FORWARD_SWEEP | Constant LOCAL_FORWARD_SWEEP of type int |
| LOCAL_SYMMETRIC_SWEEP | Constant LOCAL_SYMMETRIC_SWEEP of type int |
| SYMMETRY_SWEEP | Constant SYMMETRY_SWEEP of type int |
| ZERO_INITIAL_GUESS | Constant ZERO_INITIAL_GUESS of type int |
Attributes Documentation
Factored matrix solver type.
SEE ALSO:
Attributes Summary
| BAS | Object BAS of type str |
| CHOLMOD | Object CHOLMOD of type str |
| CUDA | Object CUDA of type str |
| CUSPARSE | Object CUSPARSE of type str |
| ELEMENTAL | Object ELEMENTAL of type str |
| ESSL | Object ESSL of type str |
| KLU | Object KLU of type str |
| LUSOL | Object LUSOL of type str |
| MATLAB | Object MATLAB of type str |
| MKL_CPARDISO | Object MKL_CPARDISO of type str |
| MKL_PARDISO | Object MKL_PARDISO of type str |
| MUMPS | Object MUMPS of type str |
| PASTIX | Object PASTIX of type str |
| PETSC | Object PETSC of type str |
| SCALAPACK | Object SCALAPACK of type str |
| SPQR | Object SPQR of type str |
| STRUMPACK | Object STRUMPACK of type str |
| SUPERLU | Object SUPERLU of type str |
| SUPERLU_DIST | Object SUPERLU_DIST of type str |
| UMFPACK | Object UMFPACK of type str |
Attributes Documentation
Associate structured grid coordinates with matrix indices.
SEE ALSO:
Attributes Summary
| c | Field component. |
| field | Field component. |
| i | First logical grid coordinate. |
| index | Logical grid coordinates (i, j, k). |
| j | Second logical grid coordinate. |
| k | Third logical grid coordinate. |
Attributes Documentation
Source code at petsc4py/PETSc/Mat.pyx:317
Source code at petsc4py/PETSc/Mat.pyx:336
Source code at petsc4py/PETSc/Mat.pyx:293
Source code at petsc4py/PETSc/Mat.pyx:325
Source code at petsc4py/PETSc/Mat.pyx:301
Source code at petsc4py/PETSc/Mat.pyx:309
Matrix modification structure.
SEE ALSO:
Attributes Summary
| DIFFERENT | Constant DIFFERENT of type int |
| DIFFERENT_NONZERO_PATTERN | Constant DIFFERENT_NONZERO_PATTERN of type int |
| DIFFERENT_NZ | Constant DIFFERENT_NZ of type int |
| SAME | Constant SAME of type int |
| SAME_NONZERO_PATTERN | Constant SAME_NONZERO_PATTERN of type int |
| SAME_NZ | Constant SAME_NZ of type int |
| SUBSET | Constant SUBSET of type int |
| SUBSET_NONZERO_PATTERN | Constant SUBSET_NONZERO_PATTERN of type int |
| SUBSET_NZ | Constant SUBSET_NZ of type int |
| UNKNOWN | Constant UNKNOWN of type int |
| UNKNOWN_NONZERO_PATTERN | Constant UNKNOWN_NONZERO_PATTERN of type int |
| UNKNOWN_NZ | Constant UNKNOWN_NZ of type int |
Attributes Documentation
Matrix type.
SEE ALSO:
Attributes Summary
| AIJ | Object AIJ of type str |
| AIJCRL | Object AIJCRL of type str |
| AIJCUSPARSE | Object AIJCUSPARSE of type str |
| AIJMKL | Object AIJMKL of type str |
| AIJPERM | Object AIJPERM of type str |
| AIJSELL | Object AIJSELL of type str |
| AIJVIENNACL | Object AIJVIENNACL of type str |
| BAIJ | Object BAIJ of type str |
| BAIJMKL | Object BAIJMKL of type str |
| BLOCKMAT | Object BLOCKMAT of type str |
| COMPOSITE | Object COMPOSITE of type str |
| CONSTANTDIAGONAL | Object CONSTANTDIAGONAL of type str |
| DENSE | Object DENSE of type str |
| DENSECUDA | Object DENSECUDA of type str |
| DIAGONAL | Object DIAGONAL of type str |
| DUMMY | Object DUMMY of type str |
| ELEMENTAL | Object ELEMENTAL of type str |
| FFT | Object FFT of type str |
| FFTW | Object FFTW of type str |
| H2OPUS | Object H2OPUS of type str |
| HERMITIANTRANSPOSE | Object HERMITIANTRANSPOSE of type str |
| HYPRE | Object HYPRE of type str |
| HYPRESSTRUCT | Object HYPRESSTRUCT of type str |
| HYPRESTRUCT | Object HYPRESTRUCT of type str |
| IS | Object IS of type str |
| KAIJ | Object KAIJ of type str |
| LMVM | Object LMVM of type str |
| LMVMBADBROYDEN | Object LMVMBADBROYDEN of type str |
| LMVMBFGS | Object LMVMBFGS of type str |
| LMVMBROYDEN | Object LMVMBROYDEN of type str |
| LMVMDBFGS | Object LMVMDBFGS of type str |
| LMVMDDFP | Object LMVMDDFP of type str |
| LMVMDFP | Object LMVMDFP of type str |
| LMVMDIAGBBROYDEN | Object LMVMDIAGBBROYDEN of type str |
| LMVMDQN | Object LMVMDQN of type str |
| LMVMSR1 | Object LMVMSR1 of type str |
| LMVMSYMBADBROYDEN | Object LMVMSYMBADBROYDEN of type str |
| LMVMSYMBROYDEN | Object LMVMSYMBROYDEN of type str |
| LOCALREF | Object LOCALREF of type str |
| LRC | Object LRC of type str |
| MAIJ | Object MAIJ of type str |
| MFFD | Object MFFD of type str |
| MPIADJ | Object MPIADJ of type str |
| MPIAIJ | Object MPIAIJ of type str |
| MPIAIJCRL | Object MPIAIJCRL of type str |
| MPIAIJCUSPARSE | Object MPIAIJCUSPARSE of type str |
| MPIAIJMKL | Object MPIAIJMKL of type str |
| MPIAIJPERM | Object MPIAIJPERM of type str |
| MPIAIJSELL | Object MPIAIJSELL of type str |
| MPIAIJVIENNACL | Object MPIAIJVIENNACL of type str |
| MPIBAIJ | Object MPIBAIJ of type str |
| MPIBAIJMKL | Object MPIBAIJMKL of type str |
| MPIDENSE | Object MPIDENSE of type str |
| MPIDENSECUDA | Object MPIDENSECUDA of type str |
| MPIKAIJ | Object MPIKAIJ of type str |
| MPIMAIJ | Object MPIMAIJ of type str |
| MPISBAIJ | Object MPISBAIJ of type str |
| MPISELL | Object MPISELL of type str |
| NEST | Object NEST of type str |
| NORMAL | Object NORMAL of type str |
| NORMALHERMITIAN | Object NORMALHERMITIAN of type str |
| PREALLOCATOR | Object PREALLOCATOR of type str |
| PYTHON | Object PYTHON of type str |
| SAME | Object SAME of type str |
| SBAIJ | Object SBAIJ of type str |
| SCATTER | Object SCATTER of type str |
| SCHURCOMPLEMENT | Object SCHURCOMPLEMENT of type str |
| SELL | Object SELL of type str |
| SEQAIJ | Object SEQAIJ of type str |
| SEQAIJCRL | Object SEQAIJCRL of type str |
| SEQAIJCUSPARSE | Object SEQAIJCUSPARSE of type str |
| SEQAIJMKL | Object SEQAIJMKL of type str |
| SEQAIJPERM | Object SEQAIJPERM of type str |
| SEQAIJSELL | Object SEQAIJSELL of type str |
| SEQAIJVIENNACL | Object SEQAIJVIENNACL of type str |
| SEQBAIJ | Object SEQBAIJ of type str |
| SEQBAIJMKL | Object SEQBAIJMKL of type str |
| SEQCUFFT | Object SEQCUFFT of type str |
| SEQDENSE | Object SEQDENSE of type str |
| SEQDENSECUDA | Object SEQDENSECUDA of type str |
| SEQKAIJ | Object SEQKAIJ of type str |
| SEQMAIJ | Object SEQMAIJ of type str |
| SEQSBAIJ | Object SEQSBAIJ of type str |
| SEQSELL | Object SEQSELL of type str |
| SHELL | Object SHELL of type str |
| SUBMATRIX | Object SUBMATRIX of type str |
| TRANSPOSE | Object TRANSPOSE of type str |
Attributes Documentation
Methods Summary
| H2OpusCompress(tol) | Compress a hierarchical matrix. |
| H2OpusLowRankUpdate(U[, V, s]) | Perform a low-rank update of the form self += sUVᵀ. |
| H2OpusOrthogonalize() | Orthogonalize the basis tree of a hierarchical matrix. |
| SOR(b, x[, omega, sortype, shift, its, lits]) | Compute relaxation (SOR, Gauss-Seidel) sweeps. |
| appendOptionsPrefix([prefix]) | Append to the prefix used for searching for options in the database. |
| assemble([assembly]) | Assemble the matrix. |
| assemblyBegin([assembly]) | Begin an assembling stage of the matrix. |
| assemblyEnd([assembly]) | Complete an assembling stage of the matrix initiated with assemblyBegin. |
| axpy(alpha, X[, structure]) | Perform the matrix summation self + = ɑ·X. |
| aypx(alpha, X[, structure]) | Perform the matrix summation self = ɑ·self + X. |
| bindToCPU(flg) | Mark a matrix to temporarily stay on the CPU. |
| boundToCPU() | Query if a matrix is bound to the CPU. |
| chop(tol) | Set entries smallest of tol (in absolute values) to zero. |
| conjugate([out]) | Return the conjugate matrix. |
| convert([mat_type, out]) | Convert the matrix type. |
| copy([result, structure]) | Return a copy of the matrix. |
| create([comm]) | Create the matrix. |
| createAIJ(size[, bsize, nnz, csr, comm]) | Create a sparse Type.AIJ matrix, optionally preallocating. |
| createAIJCRL(size[, bsize, nnz, csr, comm]) | Create a sparse Type.AIJCRL matrix. |
| createAIJWithArrays(size, csr[, bsize, comm]) | Create a sparse Type.AIJ matrix with data in CSR format. |
| createBAIJ(size, bsize[, nnz, csr, comm]) | Create a sparse blocked Type.BAIJ matrix, optionally preallocating. |
| createConstantDiagonal(size, diag[, comm]) | Create a diagonal matrix of type Type.CONSTANTDIAGONAL. |
| createDense(size[, bsize, array, comm]) | Create a Type.DENSE matrix. |
| createDenseCUDA(size[, bsize, array, ...]) | Create a Type.DENSECUDA matrix with optional host and device data. |
| createDiagonal(diag) | Create a diagonal matrix of type Type.DIAGONAL. |
| createH2OpusFromMat(A[, coordinates, dist, ...]) | Create a hierarchical Type.H2OPUS matrix sampling from a provided operator. |
| createHermitianTranspose(mat) | Create a Type.HERMITIANTRANSPOSE matrix that behaves like (A*)ᵀ. |
| createIS(size[, bsize, lgmapr, lgmapc, comm]) | Create a Type.IS matrix representing globally unassembled operators. |
| createLRC(A, U, c, V) | Create a low-rank correction Type.LRC matrix representing A + UCVᵀ. |
| createNest(mats[, isrows, iscols, comm]) | Create a Type.NEST matrix containing multiple submatrices. |
| createNormal(mat) | Create a Type.NORMAL matrix representing AᵀA. |
| createNormalHermitian(mat) | Create a Type.NORMALHERMITIAN matrix representing (A*)ᵀA. |
| createPython(size[, context, comm]) | Create a Type.PYTHON matrix. |
| createSBAIJ(size, bsize[, nnz, csr, comm]) | Create a sparse Type.SBAIJ matrix in symmetric block format. |
| createScatter(scatter[, comm]) | Create a Type.SCATTER matrix from a vector scatter. |
| createSchurComplement(A00, Ap00, A01, A10[, A11]) | Create a Type.SCHURCOMPLEMENT matrix. |
| createSubMatrices(isrows[, iscols, submats]) | Return several sequential submatrices. |
| createSubMatrix(isrow[, iscol, submat]) | Return a submatrix. |
| createSubMatrixVirtual(A, isrow[, iscol]) | Create a Type.SUBMATRIX matrix that acts as a submatrix. |
| createTranspose(mat) | Create a Type.TRANSPOSE matrix that behaves like Aᵀ. |
| createVecLeft() | Return a left vector, a vector that the matrix vector product can be stored in. |
| createVecRight() | Return a right vector, a vector that the matrix can be multiplied against. |
| createVecs([side]) | Return vectors that can be used in matrix vector products. |
| destroy() | Destroy the matrix. |
| diagonalScale([L, R]) | Perform left and/or right diagonal scaling of the matrix. |
| duplicate([copy]) | Return a clone of the matrix. |
| equal(mat) | Return the result of matrix comparison. |
| factorCholesky(isperm[, options]) | Perform an in-place Cholesky factorization. |
| factorICC(isperm[, options]) | Perform an in-place an incomplete Cholesky factorization. |
| factorILU(isrow, iscol[, options]) | Perform an in-place ILU factorization. |
| factorLU(isrow, iscol[, options]) | Perform an in-place LU factorization. |
| factorNumericCholesky(mat[, options]) | Not implemented. |
| factorNumericLU(mat[, options]) | Not implemented. |
| factorSymbolicCholesky(isperm[, options]) | Not implemented. |
| factorSymbolicICC(isperm[, options]) | Not implemented. |
| factorSymbolicILU(isrow, iscol[, options]) | Not implemented. |
| factorSymbolicLU(mat, isrow, iscol[, options]) | Not implemented. |
| findZeroRows() | Return the index set of empty rows. |
| fixISLocalEmpty([fix]) | Compress out zero local rows from the local matrices. |
| getBlockSize() | Return the matrix block size. |
| getBlockSizes() | Return the row and column block sizes. |
| getColumnIJ([symmetric, compressed]) | Return the CSC representation of the local sparsity pattern. |
| getColumnVector(column[, result]) | Return the columnᵗʰ column vector of the matrix. |
| getDM() | Return the DM defining the data layout of the matrix. |
| getDenseArray([readonly]) | Return the array where the data is stored. |
| getDenseColumnVec(i[, mode]) | Return the iᵗʰ column vector of the dense matrix. |
| getDenseLDA() | Return the leading dimension of the array used by the dense matrix. |
| getDenseLocalMatrix() | Return the local part of the dense matrix. |
| getDiagonal([result]) | Return the diagonal of the matrix. |
| getDiagonalBlock() | Return the part of the matrix associated with the on-process coupling. |
| getISAllowRepeated() | Get the flag for repeated entries in the local to global map. |
| getISLocalMat() | Return the local matrix stored inside a Type.IS matrix. |
| getInertia() | Return the inertia from a factored matrix. |
| getInfo([info]) | Return summary information. |
| getLGMap() | Return the local-to-global mappings. |
| getLRCMats() | Return the constituents of a Type.LRC matrix. |
| getLocalSize() | Return the local number of rows and columns. |
| getLocalSubMatrix(isrow, iscol[, submat]) | Return a reference to a submatrix specified in local numbering. |
| getMumpsCntl(icntl) | Return the MUMPS parameter, CNTL[icntl]. |
| getMumpsIcntl(icntl) | Return the MUMPS parameter, ICNTL[icntl]. |
| getMumpsInfo(icntl) | Return the MUMPS parameter, INFO[icntl]. |
| getMumpsInfog(icntl) | Return the MUMPS parameter, INFOG[icntl]. |
| getMumpsRinfo(icntl) | Return the MUMPS parameter, RINFO[icntl]. |
| getMumpsRinfog(icntl) | Return the MUMPS parameter, RINFOG[icntl]. |
| getNearNullSpace() | Return the near-nullspace. |
| getNestISs() | Return the index sets representing the row and column spaces. |
| getNestLocalISs() | Return the local index sets representing the row and column spaces. |
| getNestSize() | Return the number of rows and columns of the matrix. |
| getNestSubMatrix(i, j) | Return a single submatrix. |
| getNullSpace() | Return the nullspace. |
| getOption(option) | Return the option value. |
| getOptionsPrefix() | Return the prefix used for searching for options in the database. |
| getOrdering(ord_type) | Return a reordering for a matrix to improve a LU factorization. |
| getOwnershipIS() | Return the ranges of rows and columns owned by each process as index sets. |
| getOwnershipRange() | Return the locally owned range of rows. |
| getOwnershipRangeColumn() | Return the locally owned range of columns. |
| getOwnershipRanges() | Return the range of rows owned by each process. |
| getOwnershipRangesColumn() | Return the range of columns owned by each process. |
| getPythonContext() | Return the instance of the class implementing the required Python methods. |
| getPythonType() | Return the fully qualified Python name of the class used by the matrix. |
| getRedundantMatrix(nsubcomm[, subcomm, out]) | Return redundant matrices on subcommunicators. |
| getRow(row) | Return the column indices and values for the requested row. |
| getRowIJ([symmetric, compressed]) | Return the CSR representation of the local sparsity pattern. |
| getRowSum([result]) | Return the row-sum vector. |
| getSchurComplementSubMatrices() | Return Schur complement sub-matrices. |
| getSize() | Return the global number of rows and columns. |
| getSizes() | Return the tuple of matrix layouts. |
| getTransposeNullSpace() | Return the transpose nullspace. |
| getType() | Return the type of the matrix. |
| getValue(row, col) | Return the value in the (row, col) position. |
| getValues(rows, cols[, values]) | Return the values in the zip(rows, cols) positions. |
| getValuesCSR() | Return the CSR representation of the local part of the matrix. |
| getVecType() | Return the vector type used by the matrix. |
| hermitianTranspose([out]) | Return the transposed Hermitian matrix. |
| imagPart([out]) | Return the imaginary part of the matrix. |
| increaseOverlap(iset[, overlap]) | Increase the overlap of a index set. |
| invertBlockDiagonal() | Return the inverse of the block-diagonal entries. |
| isAssembled() | The boolean flag indicating if the matrix is assembled. |
| isHermitian([tol]) | Return the boolean indicating if the matrix is Hermitian. |
| isHermitianKnown() | Return the 2-tuple indicating if the matrix is known to be Hermitian. |
| isStructurallySymmetric() | Return the boolean indicating if the matrix is structurally symmetric. |
| isSymmetric([tol]) | Return the boolean indicating if the matrix is symmetric. |
| isSymmetricKnown() | Return the 2-tuple indicating if the matrix is known to be symmetric. |
| isTranspose([mat, tol]) | Return the result of matrix comparison with transposition. |
| kron(mat[, result]) | Compute C, the Kronecker product of A and B. |
| load(viewer) | Load a matrix. |
| matMatMult(B, C[, result, fill]) | Perform matrix-matrix-matrix multiplication D=ABC. |
| matMult(mat[, result, fill]) | Perform matrix-matrix multiplication C=AB. |
| matSolve(B, X) | Solve AX=B, given a factored matrix A. |
| matTransposeMult(mat[, result, fill]) | Perform matrix-matrix multiplication C=ABᵀ. |
| mult(x, y) | Perform the matrix vector product y = A @ x. |
| multAdd(x, v, y) | Perform the matrix vector product with addition y = A @ x + v. |
| multHermitian(x, y) | Perform the Hermitian matrix vector product y = A^H @ x. |
| multHermitianAdd(x, v, y) | Perform the Hermitian matrix vector product with addition y = A^H @ x + v. |
| multTranspose(x, y) | Perform the transposed matrix vector product y = A^T @ x. |
| multTransposeAdd(x, v, y) | Perform the transposed matrix vector product with addition y = A^T @ x + v. |
| norm([norm_type]) | Compute the requested matrix norm. |
| permute(row, col) | Return the permuted matrix. |
| preallocatorPreallocate(A[, fill]) | Preallocate memory for a matrix using a preallocator matrix. |
| ptap(P[, result, fill]) | Creates the matrix product C = PᵀAP. |
| rart(R[, result, fill]) | Create the matrix product C = RARᵀ. |
| realPart([out]) | Return the real part of the matrix. |
| reorderForNonzeroDiagonal(isrow, iscol[, atol]) | Change a matrix ordering to remove zeros from the diagonal. |
| restoreDenseColumnVec(i[, mode]) | Restore the iᵗʰ column vector of the dense matrix. |
| restoreISLocalMat(local) | Restore the local matrix obtained with getISLocalMat. |
| restoreLocalSubMatrix(isrow, iscol, submat) | Restore a reference to a submatrix obtained with getLocalSubMatrix. |
| retrieveValues() | Retrieve a copy of the matrix values previously stored with storeValues. |
| scale(alpha) | Scale the matrix. |
| setBlockSize(bsize) | Set the matrix block size (same for rows and columns). |
| setBlockSizes(row_bsize, col_bsize) | Set the row and column block sizes. |
| setDM(dm) | Set the DM defining the data layout of the matrix. |
| setDenseLDA(lda) | Set the leading dimension of the array used by the dense matrix. |
| setDiagonal(diag[, addv]) | Set the diagonal values of the matrix. |
| setFromOptions() | Configure the matrix from the options database. |
| setISAllowRepeated([allow]) | Allow repeated entries in the local to global map. |
| setISLocalMat(local) | Set the local matrix stored inside a Type.IS. |
| setISPreallocation(nnz, onnz) | Preallocate memory for a Type.IS parallel matrix. |
| setLGMap(rmap[, cmap]) | Set the local-to-global mappings. |
| setLRCMats(A, U[, c, V]) | Set the constituents of a Type.LRC matrix. |
| setMumpsCntl(icntl, val) | Set a MUMPS parameter, CNTL[icntl] = val. |
| setMumpsIcntl(icntl, ival) | Set a MUMPS parameter, ICNTL[icntl] = ival. |
| setNearNullSpace(nsp) | Set the near-nullspace. |
| setNestVecType(vec_type) | Set the vector type for a Type.NEST matrix. |
| setNullSpace(nsp) | Set the nullspace. |
| setOption(option, flag) | Set option. |
| setOptionsPrefix([prefix]) | Set the prefix used for searching for options in the database. |
| setPreallocationCSR(csr) | Preallocate memory for the matrix with a CSR layout. |
| setPreallocationDense(array) | Set the array used for storing matrix elements for a dense matrix. |
| setPreallocationNNZ(nnz) | Preallocate memory for the matrix with a non-zero pattern. |
| setPythonContext(context) | Set the instance of the class implementing the required Python methods. |
| setPythonType(py_type) | Set the fully qualified Python name of the class to be used. |
| setRandom([random]) | Set random values in the matrix. |
| setSizes(size[, bsize]) | Set the local, global and block sizes. |
| setStencil(dims[, starts, dof]) | Set matrix stencil. |
| setTransposeNullSpace(nsp) | Set the transpose nullspace. |
| setTransposePrecursor(out) | Set transpose precursor. |
| setType(mat_type) | Set the matrix type. |
| setUnfactored() | Set a factored matrix to be treated as unfactored. |
| setUp() | Set up the internal data structures for using the matrix. |
| setValue(row, col, value[, addv]) | Set a value to the (row, col) entry of the matrix. |
| setValueBlockedStagStencil(row, col, value) | Not implemented. |
| setValueBlockedStencil(row, col, value[, addv]) | Set a block of values to row and col stencil. |
| setValueLocal(row, col, value[, addv]) | Set a value to the (row, col) entry of the matrix in local ordering. |
| setValueStagStencil(row, col, value[, addv]) | Not implemented. |
| setValueStencil(row, col, value[, addv]) | Set a value to row and col stencil. |
| setValues(rows, cols, values[, addv]) | Set values to the rows ⊗ cols entries of the matrix. |
| setValuesBlocked(rows, cols, values[, addv]) | Set values to the rows ⊗ col block entries of the matrix. |
| setValuesBlockedCSR(I, J, V[, addv]) | Set values stored in block CSR format. |
| setValuesBlockedIJV(I, J, V[, addv, rowmap]) | Set a subset of values stored in block CSR format. |
| setValuesBlockedLocal(rows, cols, values[, addv]) | Set values to the rows ⊗ col block entries of the matrix in local ordering. |
| setValuesBlockedLocalCSR(I, J, V[, addv]) | Set values stored in block CSR format. |
| setValuesBlockedLocalIJV(I, J, V[, addv, rowmap]) | Set a subset of values stored in block CSR format. |
| setValuesBlockedLocalRCV(R, C, V[, addv]) | Undocumented. |
| setValuesBlockedRCV(R, C, V[, addv]) | Undocumented. |
| setValuesCSR(I, J, V[, addv]) | Set values stored in CSR format. |
| setValuesIJV(I, J, V[, addv, rowmap]) | Set a subset of values stored in CSR format. |
| setValuesLocal(rows, cols, values[, addv]) | Set values to the rows ⊗ col entries of the matrix in local ordering. |
| setValuesLocalCSR(I, J, V[, addv]) | Set values stored in CSR format. |
| setValuesLocalIJV(I, J, V[, addv, rowmap]) | Set a subset of values stored in CSR format. |
| setValuesLocalRCV(R, C, V[, addv]) | Undocumented. |
| setValuesRCV(R, C, V[, addv]) | Undocumented. |
| setVariableBlockSizes(blocks) | Set diagonal point-blocks of the matrix. |
| setVecType(vec_type) | Set the vector type. |
| shift(alpha) | Shift the matrix. |
| solve(b, x) | Solve Ax=b, given a factored matrix. |
| solveAdd(b, y, x) | Solve x=y+A⁻¹b, given a factored matrix. |
| solveBackward(b, x) | Solve Ux=b, given a factored matrix A=LU. |
| solveForward(b, x) | Solve Lx = b, given a factored matrix A = LU. |
| solveTranspose(b, x) | Solve Aᵀx=b, given a factored matrix. |
| solveTransposeAdd(b, y, x) | Solve x=y+A⁻ᵀb, given a factored matrix. |
| storeValues() | Stash a copy of the matrix values. |
| toDLPack([mode]) | Return a DLPack PyCapsule wrapping the vector data. |
| transpose([out]) | Return the transposed matrix. |
| transposeMatMult(mat[, result, fill]) | Perform matrix-matrix multiplication C=AᵀB. |
| view([viewer]) | View the matrix. |
| zeroEntries() | Zero the entries of the matrix. |
| zeroRows(rows[, diag, x, b]) | Zero selected rows of the matrix. |
| zeroRowsColumns(rows[, diag, x, b]) | Zero selected rows and columns of the matrix. |
| zeroRowsColumnsLocal(rows[, diag, x, b]) | Zero selected rows and columns of the matrix in local ordering. |
| zeroRowsColumnsStencil(rows[, diag, x, b]) | Zero selected rows and columns of the matrix. |
| zeroRowsLocal(rows[, diag, x, b]) | Zero selected rows of the matrix in local ordering. |
Attributes Summary
| assembled | The boolean flag indicating if the matrix is assembled. |
| block_size | Matrix block size. |
| block_sizes | Matrix row and column block sizes. |
| hermitian | The boolean flag indicating if the matrix is Hermitian. |
| local_size | Matrix local size. |
| owner_range | Matrix local row range. |
| owner_ranges | Matrix row ranges. |
| size | Matrix global size. |
| sizes | Matrix local and global sizes. |
| structsymm | The boolean flag indicating if the matrix is structurally symmetric. |
| symmetric | The boolean flag indicating if the matrix is symmetric. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4992
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5011
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4979
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3825
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1751
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3338
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3302
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3320
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4153
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4176
Collective.
Once marked, perform computations on the CPU.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4520
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4540
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4121
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2215
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2071
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2026
Collective.
Once created, the user should call setType or setFromOptions before using the matrix. Alternatively, specific creation routines such as createAIJ or createBAIJ can be used.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:488
Collective.
To preallocate the matrix the user can either pass nnz or csr describing the sparsity. If neither is set then preallocation will not occur. Consult the PETSc manual for more information.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:693
Collective.
This is similar to Type.AIJ matrices but stores some additional information that improves vectorization for the matrix-vector product.
To preallocate the matrix the user can either pass nnz or csr describing the sparsity. If neither is set then preallocation will not occur. Consult the PETSc manual for more information.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:826
Collective.
Notes
For Type.SEQAIJ matrices, the csr data is not copied. For Type.MPIAIJ matrices, the csr data is not copied only in the case it represents on-process and off-process information.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:956
Collective.
To preallocate the matrix the user can either pass nnz or csr describing the sparsity. If neither is set then preallocation will not occur. Consult the PETSc manual for more information.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:738
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1561
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1047
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1083
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1594
Collective.
Notes
See MatCreateH2OpusFromMat for the appropriate database options.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1427
Collective.
Notes
The Hermitian transpose is never actually formed.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1263
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1508
Collective.
Notes
The matrix A + UCVᵀ is never actually formed.
C is a diagonal matrix (represented as a vector) of order k, where k is the number of columns of both U and V.
If A is None then the new object behaves like a low-rank matrix UCVᵀ.
Use the same matrix for V and U (or V=None) for a symmetric low-rank correction, A + UCUᵀ.
If c is None then the low-rank correction is just U*Vᵀ. If a sequential c vector is used for a parallel matrix, PETSc assumes that the values of the vector are consistently set across processors.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1288
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1360
Collective.
Notes
The product AᵀA is never actually formed. Instead A and Aᵀ are used during mult and various other matrix operations.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1188
Collective.
Notes
The product (A*)ᵀA is never actually formed.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1238
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1617
Collective.
To preallocate the matrix the user can either pass nnz or csr describing the sparsity. If neither is set then preallocation will not occur. Consult the PETSc manual for more information.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:782
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1164
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3969
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3912
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3882
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1335
Collective.
Notes
The transpose is never actually formed. Instead multTranspose is called whenever the matrix-vector product is computed.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1213
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3438
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3424
Collective.
Notes
right vectors are vectors in the column space of the matrix. left vectors are vectors in the row space of the matrix.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3385
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:475
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3577
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2004
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2259
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4684
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4717
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4650
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4612
Source code at petsc4py/PETSc/Mat.pyx:4713
Source code at petsc4py/PETSc/Mat.pyx:4646
Source code at petsc4py/PETSc/Mat.pyx:4709
Source code at petsc4py/PETSc/Mat.pyx:4742
Source code at petsc4py/PETSc/Mat.pyx:4680
Source code at petsc4py/PETSc/Mat.pyx:4642
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3371
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4817
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1874
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1888
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2518
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3458
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5570
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5375
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5428
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5361
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5413
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3513
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3854
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4803
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4836
Collective.
The matrix must have been factored by calling factorCholesky.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4746
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1984
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2784
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4918
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1844
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4024
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5096
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5060
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5111
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5131
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5151
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5171
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3686
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5502
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5523
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5488
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5544
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3632
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1802
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1737
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4556
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1969
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1902
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1936
Not collective.
The returned array is the result of exclusive scan of the local sizes.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1916
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1951
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1671
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1706
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3483
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2467
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2487
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3535
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4003
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1830
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1858
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3659
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1816
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2392
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2408
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2429
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:658
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2142
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2192
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3869
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3599
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3357
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2331
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2351
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2366
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2296
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2316
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2273
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4485
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2053
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4440
Neighborwise collective.
Notes
To determine the correct fill value, run with -info and search for the string "Fill ratio" to see the value actually needed.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4201
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5321
Neighborwise collective.
Notes
To determine the correct fill value, run with -info and search for the string "Fill ratio" to see the value actually needed.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4248
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3703
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3722
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3783
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3802
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3743
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3762
Collective.
A 2-tuple is returned if NormType.NORM_1_AND_2 is specified.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4073
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2238
Collective.
The current matrix (self) must be of type Type.PREALLOCATOR.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:933
Neighborwise collective.
Notes
To determine the correct fill value, run with -info and search for the string "Fill ratio" to see the value actually needed.
An alternative approach to this function is to use MatProductCreate and set the desired options before the computation is done.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4342
Neighborwise collective.
Notes
To determine the correct fill value, run with -info and search for the string "Fill ratio" to see the value actually needed.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4393
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2169
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4584
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5460
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4851
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4050
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3290
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4095
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:586
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:604
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5587
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5343
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3557
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1765
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4785
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4868
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4885
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2764
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4950
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5075
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5039
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3674
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:672
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3620
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1790
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1723
Collective.
Correct preallocation can result in a dramatic reduction in matrix assembly time.
Notes
Must use the block-compressed form with Type.BAIJ and Type.SBAIJ.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:899
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1140
Collective.
Correct preallocation can result in a dramatic reduction in matrix assembly time.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:873
Logically collective.
Notes
In order to use the matrix, Mat.setUp must be called after having set the context. Pass None to reset the matrix to its initial state.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1654
Collective.
Notes
In order to use the matrix, Mat.setUp must be called after having set the type.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1686
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4134
Collective.
Examples
Create a Mat with n rows and columns and the same local and global sizes.
>>> mat = PETSc.Mat().create() >>> mat.setFromOptions() >>> mat.setSizes(n)
Create a Mat with nr rows, nc columns and the same local and global sizes.
>>> mat = PETSc.Mat().create() >>> mat.setFromOptions() >>> mat.setSizes([nr, nc])
Create a Mat with nrl local rows, nrg global rows, ncl local columns and ncg global columns.
>>> mat = PETSc.Mat().create() >>> mat.setFromOptions() >>> mat.setSizes([[nrl, nrg], [ncl, ncg]])
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:533
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3022
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3647
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2130
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:514
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4771
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:1777
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2548
Source code at petsc4py/PETSc/Mat.pyx:3106
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3076
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2801
Source code at petsc4py/PETSc/Mat.pyx:3072
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3042
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2580
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2671
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2736
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2705
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2925
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2990
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2959
Source code at petsc4py/PETSc/Mat.pyx:2955
Source code at petsc4py/PETSc/Mat.pyx:2701
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2643
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2612
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2834
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2897
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2866
Source code at petsc4py/PETSc/Mat.pyx:2862
Source code at petsc4py/PETSc/Mat.pyx:2608
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:625
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:639
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4108
Neighborwise collective.
The vectors b and x cannot be the same. Most users should employ the KSP interface for linear solvers instead of working directly with matrix algebra routines.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5231
Neighborwise collective.
The vectors b and x cannot be the same.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5275
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5212
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5193
Neighborwise collective.
The vectors b and x cannot be the same.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5254
Neighborwise collective.
The vectors b and x cannot be the same.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5298
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3278
Source code at petsc4py/PETSc/Mat.pyx:5675
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2103
Neighborwise collective.
Notes
To determine the correct fill value, run with -info and search for the string "Fill ratio" to see the value actually needed.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:4295
Collective.
Notes
Viewers with type Viewer.Type.ASCII are only recommended for small matrices on small numbers of processes. Larger matrices should use a binary format like Viewer.Type.BINARY.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:450
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:2380
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3110
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3176
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3210
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3244
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:3143
Attributes Documentation
Source code at petsc4py/PETSc/Mat.pyx:5650
Source code at petsc4py/PETSc/Mat.pyx:5628
Source code at petsc4py/PETSc/Mat.pyx:5633
Source code at petsc4py/PETSc/Mat.pyx:5658
Source code at petsc4py/PETSc/Mat.pyx:5623
Source code at petsc4py/PETSc/Mat.pyx:5638
Source code at petsc4py/PETSc/Mat.pyx:5643
Source code at petsc4py/PETSc/Mat.pyx:5618
Source code at petsc4py/PETSc/Mat.pyx:5610
Source code at petsc4py/PETSc/Mat.pyx:5662
Source code at petsc4py/PETSc/Mat.pyx:5654
Object for managing the partitioning of a matrix or graph.
Enumerations
| Type | The partitioning types. |
The partitioning types.
Attributes Summary
| PARTITIONINGAVERAGE | Object PARTITIONINGAVERAGE of type str |
| PARTITIONINGCHACO | Object PARTITIONINGCHACO of type str |
| PARTITIONINGCURRENT | Object PARTITIONINGCURRENT of type str |
| PARTITIONINGHIERARCH | Object PARTITIONINGHIERARCH of type str |
| PARTITIONINGPARMETIS | Object PARTITIONINGPARMETIS of type str |
| PARTITIONINGPARTY | Object PARTITIONINGPARTY of type str |
| PARTITIONINGPTSCOTCH | Object PARTITIONINGPTSCOTCH of type str |
| PARTITIONINGSQUARE | Object PARTITIONINGSQUARE of type str |
Attributes Documentation
Methods Summary
| apply(partitioning) | Return a partitioning for the graph represented by a sparse matrix. |
| create([comm]) | Create a partitioning context. |
| destroy() | Destroy the partitioning context. |
| getType() | Return the partitioning method. |
| setAdjacency(adj) | Set the adjacency graph (matrix) of the thing to be partitioned. |
| setFromOptions() | Set parameters in the partitioner from the options database. |
| setType(matpartitioning_type) | Set the type of the partitioner to use. |
| view([viewer]) | View the partitioning data structure. |
Methods Documentation
Collective.
For each local node this tells the processor number that that node is assigned to.
SEE ALSO:
Source code at petsc4py/PETSc/MatPartitioning.pyx:144
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/MatPartitioning.pyx:62
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/MatPartitioning.pyx:49
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/MatPartitioning.pyx:100
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/MatPartitioning.pyx:126
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/MatPartitioning.pyx:114
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/MatPartitioning.pyx:81
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/MatPartitioning.pyx:29
Norm type.
Commonly used norm types:
SEE ALSO:
Attributes Summary
| FRB | Constant FRB of type int |
| FROBENIUS | Constant FROBENIUS of type int |
| INF | Constant INF of type int |
| INFINITY | Constant INFINITY of type int |
| MAX | Constant MAX of type int |
| N1 | Constant N1 of type int |
| N12 | Constant N12 of type int |
| N2 | Constant N2 of type int |
| NORM_1 | Constant NORM_1 of type int |
| NORM_1_AND_2 | Constant NORM_1_AND_2 of type int |
| NORM_2 | Constant NORM_2 of type int |
| NORM_FROBENIUS | Constant NORM_FROBENIUS of type int |
| NORM_INFINITY | Constant NORM_INFINITY of type int |
| NORM_MAX | Constant NORM_MAX of type int |
Attributes Documentation
Nullspace object.
SEE ALSO:
Methods Summary
| create([constant, vectors, comm]) | Create the null space. |
| createRigidBody(coords) | Create rigid body modes from coordinates. |
| destroy() | Destroy the null space. |
| getFunction() | Return the callback to remove the nullspace. |
| getVecs() | Return the vectors defining the null space. |
| hasConstant() | Return whether the null space contains the constant. |
| remove(vec) | Remove all components of a null space from a vector. |
| setFunction(function[, args, kargs]) | Set the callback to remove the nullspace. |
| test(mat) | Return if the claimed null space is valid for a matrix. |
| view([viewer]) | View the null space. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5799
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5835
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5786
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5926
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5904
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5890
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5940
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5856
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5957
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Mat.pyx:5767
Base class wrapping a PETSc object.
SEE ALSO:
Methods Summary
| appendOptionsPrefix(prefix) | Append to the prefix used for searching for options in the database. |
| compose(name, obj) | Associate a PETSc object using a key string. |
| decRef() | Decrement the object reference count. |
| destroy() | Destroy the object. |
| destroyOptionsHandlers() | Clear all the option handlers. |
| getAttr(name) | Return the attribute associated with a given name. |
| getClassId() | Return the class identifier of the object. |
| getClassName() | Return the class name of the object. |
| getComm() | Return the communicator of the object. |
| getDict() | Return the dictionary of attributes. |
| getId() | Return the unique identifier of the object. |
| getName() | Return the name of the object. |
| getOptionsPrefix() | Return the prefix used for searching for options in the database. |
| getRefCount() | Return the reference count of the object. |
| getTabLevel() | Return the PETSc object tab level. |
| getType() | Return the object type name. |
| incRef() | Increment the object reference count. |
| incrementTabLevel(tab[, parent]) | Increment the PETSc object tab level. |
| query(name) | Query for the PETSc object associated with a key string. |
| setAttr(name, attr) | Set an the attribute associated with a given name. |
| setFromOptions() | Configure the object from the options database. |
| setName(name) | Associate a name to the object. |
| setOptionsHandler(handler) | Set the callback for processing extra options. |
| setOptionsPrefix(prefix) | Set the prefix used for searching for options in the database. |
| setTabLevel(level) | Set the PETSc object tab level. |
| stateGet() | Return the PETSc object state. |
| stateIncrease() | Increment the PETSc object state. |
| stateSet(state) | Set the PETSc object state. |
| view([viewer]) | Display the object. |
| viewFromOptions(name[, objpre]) | View the object via command line options. |
Attributes Summary
| classid | The class identifier. |
| comm | The object communicator. |
| fortran | Fortran handle. |
| handle | Handle for ctypes support. |
| id | The object identifier. |
| klass | The class name. |
| name | The object name. |
| prefix | Options prefix. |
| refcount | Reference count. |
| type | Object type. |
Methods Documentation
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:138
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:329
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:389
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:81
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:213
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:408
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:270
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:284
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:228
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:436
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:313
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:242
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:124
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:298
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:518
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:94
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:372
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:491
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:352
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:422
Collective.
Classes that do not implement setFromOptions use this method that, in turn, calls PetscObjectSetFromOptions.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:152
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:256
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:190
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:110
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:505
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:462
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:450
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:476
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:62
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Object.pyx:167
Attributes Documentation
Source code at petsc4py/PETSc/Object.pyx:563
Source code at petsc4py/PETSc/Object.pyx:550
Source code at petsc4py/PETSc/Object.pyx:593
Source code at petsc4py/PETSc/Object.pyx:585
Source code at petsc4py/PETSc/Object.pyx:568
Source code at petsc4py/PETSc/Object.pyx:573
Source code at petsc4py/PETSc/Object.pyx:555
Source code at petsc4py/PETSc/Object.pyx:542
Source code at petsc4py/PETSc/Object.pyx:578
Source code at petsc4py/PETSc/Object.pyx:534
The options database object.
A dictionary-like object to store and operate with command line options.
Examples
Create an option database and operate with it.
>>> from petsc4py import PETSc
>>> opts = PETSc.Options()
>>> opts['a'] = 1 # insert the command-line option '-a 1'
>>> if 'a' in opts: # if the option is present
>>> val = opts['a'] # return the option value as 'str'
>>> a_int = opts.getInt('a') # return the option value as 'int'
>>> a_bool = opts.getBool('a') # return the option value as 'bool'
Read command line and use default values.
>>> from petsc4py import PETSc
>>> opts = PETSc.Options()
>>> b_float = opts.getReal('b', 1) # return the value or 1.0 if not present
Read command line options prepended with a prefix.
>>> from petsc4py import PETSc
>>> opts = PETSc.Options('prefix_')
>>> opts.getString('b', 'some_default_string') # read -prefix_b xxx
SEE ALSO:
Methods Summary
| clear() | Clear an options database. |
| create() | Create an options database. |
| delValue(name) | Delete an option from the database. |
| destroy() | Destroy an options database. |
| getAll() | Return all the options and their values. |
| getBool(name[, default]) | Return the boolean value associated with the option. |
| getBoolArray(name[, default]) | Return the boolean values associated with the option. |
| getInt(name[, default]) | Return the integer value associated with the option. |
| getIntArray(name[, default]) | Return the integer array associated with the option. |
| getReal(name[, default]) | Return the real value associated with the option. |
| getRealArray(name[, default]) | Return the real array associated with the option. |
| getScalar(name[, default]) | Return the scalar value associated with the option. |
| getScalarArray(name[, default]) | Return the scalar array associated with the option. |
| getString(name[, default]) | Return the string associated with the option. |
| hasName(name) | Return the boolean indicating if the option is in the database. |
| insertString(string) | Insert a string in the options database. |
| prefixPop() | Pop a prefix for the options database. |
| prefixPush(prefix) | Push a prefix for the options database. |
| setValue(name, value) | Set a value for an option. |
| view([viewer]) | View the options database. |
Attributes Summary
| prefix | Prefix for options. |
Methods Documentation
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:195
Source code at petsc4py/PETSc/Options.pyx:85
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:414
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:218
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:238
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:258
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:278
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:298
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:318
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:338
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:358
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:378
Source code at petsc4py/PETSc/Options.pyx:144
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:400
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:131
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:116
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:153
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Options.pyx:97
Attributes Documentation
Source code at petsc4py/PETSc/Options.pyx:67
Preconditioners.
PC is described in the PETSc manual. Calling the PC with a vector as an argument will apply the preconditioner as shown in the example below.
Examples
>>> from petsc4py import PETSc
>>> v = PETSc.Vec().createWithArray([1, 2])
>>> m = PETSc.Mat().createDense(2, array=[[1, 0], [0, 1]])
>>> pc = PETSc.PC().create()
>>> pc.setOperators(m)
>>> u = pc(v) # u is created internally
>>> pc.apply(v, u) # u can also be passed as second argument
SEE ALSO:
Enumerations
| ASMType | The ASM subtype. |
| CompositeType | The composite type. |
| DeflationSpaceType | The deflation space subtype. |
| FailedReason | The reason the preconditioner has failed. |
| FieldSplitSchurFactType | The field split Schur factorization type. |
| FieldSplitSchurPreType | The field split Schur subtype. |
| GAMGType | The GAMG subtype. |
| GASMType | The GASM subtype. |
| HPDDMCoarseCorrectionType | The HPDDM coarse correction type. |
| MGCycleType | The MG cycle type. |
| MGType | The MG subtype. |
| PatchConstructType | The patch construction type. |
| Side | The manner in which the preconditioner is applied. |
| Type | The preconditioner method. |
The ASM subtype.
Attributes Summary
| BASIC | Constant BASIC of type int |
| INTERPOLATE | Constant INTERPOLATE of type int |
| NONE | Constant NONE of type int |
| RESTRICT | Constant RESTRICT of type int |
Attributes Documentation
The composite type.
Attributes Summary
| ADDITIVE | Constant ADDITIVE of type int |
| MULTIPLICATIVE | Constant MULTIPLICATIVE of type int |
| SCHUR | Constant SCHUR of type int |
| SPECIAL | Constant SPECIAL of type int |
| SYMMETRIC_MULTIPLICATIVE | Constant SYMMETRIC_MULTIPLICATIVE of type int |
Attributes Documentation
The deflation space subtype.
Attributes Summary
| AGGREGATION | Constant AGGREGATION of type int |
| BIORTH22 | Constant BIORTH22 of type int |
| DB16 | Constant DB16 of type int |
| DB2 | Constant DB2 of type int |
| DB4 | Constant DB4 of type int |
| DB8 | Constant DB8 of type int |
| HAAR | Constant HAAR of type int |
| MEYER | Constant MEYER of type int |
| USER | Constant USER of type int |
Attributes Documentation
The reason the preconditioner has failed.
Attributes Summary
| FACTOR_NUMERIC_ZEROPIVOT | Constant FACTOR_NUMERIC_ZEROPIVOT of type int |
| FACTOR_OTHER | Constant FACTOR_OTHER of type int |
| FACTOR_OUTMEMORY | Constant FACTOR_OUTMEMORY of type int |
| FACTOR_STRUCT_ZEROPIVOT | Constant FACTOR_STRUCT_ZEROPIVOT of type int |
| NOERROR | Constant NOERROR of type int |
| SETUP_ERROR | Constant SETUP_ERROR of type int |
| SUBPC_ERROR | Constant SUBPC_ERROR of type int |
Attributes Documentation
The field split Schur factorization type.
Attributes Summary
| DIAG | Constant DIAG of type int |
| FULL | Constant FULL of type int |
| LOWER | Constant LOWER of type int |
| UPPER | Constant UPPER of type int |
Attributes Documentation
The field split Schur subtype.
Attributes Summary
| A11 | Constant A11 of type int |
| FULL | Constant FULL of type int |
| SELF | Constant SELF of type int |
| SELFP | Constant SELFP of type int |
| USER | Constant USER of type int |
Attributes Documentation
The GAMG subtype.
Attributes Summary
| AGG | Object AGG of type str |
| CLASSICAL | Object CLASSICAL of type str |
| GEO | Object GEO of type str |
Attributes Documentation
The GASM subtype.
Attributes Summary
| BASIC | Constant BASIC of type int |
| INTERPOLATE | Constant INTERPOLATE of type int |
| NONE | Constant NONE of type int |
| RESTRICT | Constant RESTRICT of type int |
Attributes Documentation
The HPDDM coarse correction type.
Attributes Summary
| ADDITIVE | Constant ADDITIVE of type int |
| BALANCED | Constant BALANCED of type int |
| DEFLATED | Constant DEFLATED of type int |
| NONE | Constant NONE of type int |
Attributes Documentation
The MG cycle type.
Attributes Summary
| V | Constant V of type int |
| W | Constant W of type int |
Attributes Documentation
The MG subtype.
Attributes Summary
| ADDITIVE | Constant ADDITIVE of type int |
| FULL | Constant FULL of type int |
| KASKADE | Constant KASKADE of type int |
| MULTIPLICATIVE | Constant MULTIPLICATIVE of type int |
Attributes Documentation
The patch construction type.
Attributes Summary
| PARDECOMP | Constant PARDECOMP of type int |
| PYTHON | Constant PYTHON of type int |
| STAR | Constant STAR of type int |
| USER | Constant USER of type int |
| VANKA | Constant VANKA of type int |
Attributes Documentation
The manner in which the preconditioner is applied.
Attributes Summary
| L | Constant L of type int |
| LEFT | Constant LEFT of type int |
| R | Constant R of type int |
| RIGHT | Constant RIGHT of type int |
| S | Constant S of type int |
| SYMMETRIC | Constant SYMMETRIC of type int |
Attributes Documentation
The preconditioner method.
Attributes Summary
| ASM | Object ASM of type str |
| BDDC | Object BDDC of type str |
| BFBT | Object BFBT of type str |
| BJACOBI | Object BJACOBI of type str |
| CHOLESKY | Object CHOLESKY of type str |
| CHOWILUVIENNACL | Object CHOWILUVIENNACL of type str |
| COMPOSITE | Object COMPOSITE of type str |
| CP | Object CP of type str |
| DEFLATION | Object DEFLATION of type str |
| EISENSTAT | Object EISENSTAT of type str |
| EXOTIC | Object EXOTIC of type str |
| FIELDSPLIT | Object FIELDSPLIT of type str |
| GALERKIN | Object GALERKIN of type str |
| GAMG | Object GAMG of type str |
| GASM | Object GASM of type str |
| H2OPUS | Object H2OPUS of type str |
| HMG | Object HMG of type str |
| HPDDM | Object HPDDM of type str |
| HYPRE | Object HYPRE of type str |
| ICC | Object ICC of type str |
| ILU | Object ILU of type str |
| JACOBI | Object JACOBI of type str |
| KACZMARZ | Object KACZMARZ of type str |
| KSP | Object KSP of type str |
| LMVM | Object LMVM of type str |
| LSC | Object LSC of type str |
| LU | Object LU of type str |
| MAT | Object MAT of type str |
| MG | Object MG of type str |
| ML | Object ML of type str |
| NN | Object NN of type str |
| NONE | Object NONE of type str |
| PARMS | Object PARMS of type str |
| PATCH | Object PATCH of type str |
| PBJACOBI | Object PBJACOBI of type str |
| PFMG | Object PFMG of type str |
| PYTHON | Object PYTHON of type str |
| QR | Object QR of type str |
| REDISTRIBUTE | Object REDISTRIBUTE of type str |
| REDUNDANT | Object REDUNDANT of type str |
| ROWSCALINGVIENNACL | Object ROWSCALINGVIENNACL of type str |
| SAVIENNACL | Object SAVIENNACL of type str |
| SHELL | Object SHELL of type str |
| SOR | Object SOR of type str |
| SPAI | Object SPAI of type str |
| SVD | Object SVD of type str |
| SYSPFMG | Object SYSPFMG of type str |
| TELESCOPE | Object TELESCOPE of type str |
| TFS | Object TFS of type str |
| VPBJACOBI | Object VPBJACOBI of type str |
Attributes Documentation
Methods Summary
| addCompositePCType(pc_type) | Add a PC of the given type to the composite PC. |
| appendOptionsPrefix(prefix) | Append to the prefix used for all the PC options. |
| apply(x, y) | Apply the PC to a vector. |
| applySymmetricLeft(x, y) | Apply the left part of a symmetric PC to a vector. |
| applySymmetricRight(x, y) | Apply the right part of a symmetric PC to a vector. |
| applyTranspose(x, y) | Apply the transpose of the PC to a vector. |
| create([comm]) | Create an empty PC. |
| createPython([context, comm]) | Create a preconditioner of Python type. |
| destroy() | Destroy the PC that was created with create. |
| getASMSubKSP() | Return the local KSP object for all blocks on this process. |
| getCompositePC(n) | Return a component of the composite PC. |
| getDM() | Return the DM associated with the PC. |
| getDeflationCoarseKSP() | Return the coarse problem KSP. |
| getDeflationPC() | Return the additional preconditioner. |
| getFactorMatrix() | Return the factored matrix. |
| getFactorSolverType() | Return the solver package used to perform the factorization. |
| getFailedReason() | Return the reason the PC terminated. |
| getFieldSplitSchurGetSubKSP() | Return the KSP for the Schur complement based splits. |
| getFieldSplitSubIS(splitname) | Return the IS associated with a given name. |
| getFieldSplitSubKSP() | Return the KSP for all splits. |
| getHPDDMCoarseCorrectionType() | Return the coarse correction type. |
| getHPDDMComplexities() | Compute the grid and operator complexities. |
| getHPDDMSTShareSubKSP() | Return true if the KSP in SLEPc ST and the subdomain solver is shared. |
| getHYPREType() | Return the Type.HYPRE type. |
| getKSP() | Return the KSP if the PC is Type.KSP. |
| getMGCoarseSolve() | Return the KSP used on the coarse grid. |
| getMGInterpolation(level) | Return the interpolation operator for the given level. |
| getMGLevels() | Return the number of MG levels. |
| getMGRScale(level) | Return the pointwise scaling for the restriction operator on the given level. |
| getMGRestriction(level) | Return the restriction operator for the given level. |
| getMGSmoother(level) | Return the KSP to be used as a smoother. |
| getMGSmootherDown(level) | Return the KSP to be used as a smoother before coarse grid correction. |
| getMGSmootherUp(level) | Return the KSP to be used as a smoother after coarse grid correction. |
| getMGType() | Return the form of multigrid. |
| getOperators() | Return the matrices associated with a linear system. |
| getOptionsPrefix() | Return the prefix used for all the PC options. |
| getPatchSubKSP() | Return the local KSP object for all blocks on this process. |
| getPythonContext() | Return the instance of the class implementing the required Python methods. |
| getPythonType() | Return the fully qualified Python name of the class used by the preconditioner. |
| getType() | Return the preconditioner type. |
| getUseAmat() | Return the flag to indicate if PC is applied to A or P. |
| matApply(x, y) | Apply the PC to many vectors stored as Mat.Type.DENSE. |
| reset() | Reset the PC, removing any allocated vectors and matrices. |
| setASMLocalSubdomains(nsd[, is_sub, is_local]) | Set the local subdomains. |
| setASMOverlap(overlap) | Set the overlap between a pair of subdomains. |
| setASMSortIndices(dosort) | Set to sort subdomain indices. |
| setASMTotalSubdomains(nsd[, is_sub, is_local]) | Set the subdomains for all processes. |
| setASMType(asmtype) | Set the type of restriction and interpolation. |
| setBDDCChangeOfBasisMat(T[, interior]) | Set a user defined change of basis for degrees of freedom. |
| setBDDCCoarseningRatio(cratio) | Set the coarsening ratio used in the multilevel version. |
| setBDDCDirichletBoundaries(bndr) | Set the IS defining Dirichlet boundaries for the global problem. |
| setBDDCDirichletBoundariesLocal(bndr) | Set the IS defining Dirichlet boundaries in local ordering. |
| setBDDCDiscreteGradient(G[, order, field, ...]) | Set the discrete gradient. |
| setBDDCDivergenceMat(div[, trans, l2l]) | Set the linear operator representing ∫ div(u)•p dx. |
| setBDDCDofsSplitting(isfields) | Set the index set(s) defining fields of the global matrix. |
| setBDDCDofsSplittingLocal(isfields) | Set the index set(s) defining fields of the local subdomain matrix. |
| setBDDCLevels(levels) | Set the maximum number of additional levels allowed. |
| setBDDCLocalAdjacency(csr) | Provide a custom connectivity graph for local dofs. |
| setBDDCNeumannBoundaries(bndr) | Set the IS defining Neumann boundaries for the global problem. |
| setBDDCNeumannBoundariesLocal(bndr) | Set the IS defining Neumann boundaries in local ordering. |
| setBDDCPrimalVerticesIS(primv) | Set additional user defined primal vertices. |
| setBDDCPrimalVerticesLocalIS(primv) | Set additional user defined primal vertices. |
| setCompositeType(ctype) | Set the type of composite preconditioner. |
| setCoordinates(coordinates) | Set the coordinates for the nodes on the local process. |
| setDM(dm) | Set the DM that may be used by some preconditioners. |
| setDeflationCoarseMat(mat) | Set the coarse problem matrix. |
| setDeflationCorrectionFactor(fact) | Set the coarse problem correction factor. |
| setDeflationInitOnly(flg) | Set to only perform the initialization. |
| setDeflationLevels(levels) | Set the maximum level of deflation nesting. |
| setDeflationProjectionNullSpaceMat(mat) | Set the projection null space matrix. |
| setDeflationReductionFactor(red) | Set the reduction factor for the preconditioner. |
| setDeflationSpace(W, transpose) | Set the deflation space matrix or its (Hermitian) transpose. |
| setDeflationSpaceToCompute(space_type, size) | Set the deflation space type. |
| setFactorLevels(levels) | Set the number of levels of fill. |
| setFactorOrdering([ord_type, nzdiag, reuse]) | Set options for the matrix factorization reordering. |
| setFactorPivot([zeropivot, inblocks]) | Set options for matrix factorization pivoting. |
| setFactorSetUpSolverType() | Set up the factorization solver. |
| setFactorShift([shift_type, amount]) | Set options for shifting diagonal entries of a matrix. |
| setFactorSolverType(solver) | Set the solver package used to perform the factorization. |
| setFailedReason(reason) | Set the reason the PC terminated. |
| setFieldSplitFields(bsize, *fields) | Sets the elements for the field split. |
| setFieldSplitIS(*fields) | Set the elements for the field split by IS. |
| setFieldSplitSchurFactType(ctype) | Set the type of approximate block factorization. |
| setFieldSplitSchurPreType(ptype[, pre]) | Set from what operator the PC is constructed. |
| setFieldSplitType(ctype) | Set the type of composition of a field split preconditioner. |
| setFromOptions() | Set various PC parameters from user options. |
| setGAMGLevels(levels) | Set the maximum number of levels. |
| setGAMGSmooths(smooths) | Set the number of smoothing steps used on all levels. |
| setGAMGType(gamgtype) | Set the type of algorithm. |
| setGASMOverlap(overlap) | Set the overlap between a pair of subdomains. |
| setGASMType(gasmtype) | Set the type of restriction and interpolation. |
| setHPDDMAuxiliaryMat(uis, uaux) | Set the auxiliary matrix used by the preconditioner. |
| setHPDDMCoarseCorrectionType(correction_type) | Set the coarse correction type. |
| setHPDDMDeflationMat(uis, U) | Set the deflation space used to assemble a coarse operator. |
| setHPDDMHasNeumannMat(has) | Set to indicate that the Mat passed to the PC is the local Neumann matrix. |
| setHPDDMRHSMat(B) | Set the right-hand side matrix of the preconditioner. |
| setHYPREAMSSetInteriorNodes(interior) | Set the list of interior nodes to a zero conductivity region. |
| setHYPREDiscreteCurl(mat) | Set the discrete curl matrix. |
| setHYPREDiscreteGradient(mat) | Set the discrete gradient matrix. |
| setHYPRESetAlphaPoissonMatrix(mat) | Set the vector Poisson matrix. |
| setHYPRESetBetaPoissonMatrix([mat]) | Set the Posson matrix. |
| setHYPRESetEdgeConstantVectors(ozz, zoz[, zzo]) | Set the representation of the constant vector fields in the edge element basis. |
| setHYPRESetInterpolations(dim[, RT_Pi_Full, ...]) | Set the interpolation matrices. |
| setHYPREType(hypretype) | Set the Type.HYPRE type. |
| setMGCycleType(cycle_type) | Set the type of cycles. |
| setMGCycleTypeOnLevel(level, cycle_type) | Set the type of cycle on the given level. |
| setMGInterpolation(level, mat) | Set the interpolation operator for the given level. |
| setMGLevels(levels) | Set the number of MG levels. |
| setMGR(level, r) | Set the vector where the residual is stored. |
| setMGRScale(level, rscale) | Set the pointwise scaling for the restriction operator on the given level. |
| setMGRestriction(level, mat) | Set the restriction operator for the given level. |
| setMGRhs(level, rhs) | Set the vector where the right-hand side is stored. |
| setMGType(mgtype) | Set the form of multigrid. |
| setMGX(level, x) | Set the vector where the solution is stored. |
| setOperators([A, P]) | Set the matrices associated with the linear system. |
| setOptionsPrefix(prefix) | Set the prefix used for all the PC options. |
| setPatchCellNumbering(sec) | Set the cell numbering. |
| setPatchComputeFunction(function[, args, kargs]) | Set compute operator callbacks. |
| setPatchComputeFunctionInteriorFacets(function) | Set compute operator callbacks. |
| setPatchComputeOperator(operator[, args, kargs]) | Set compute operator callbacks. |
| setPatchComputeOperatorInteriorFacets(operator) | Set compute operator callbacks. |
| setPatchConstructType(typ[, operator, args, ...]) | Set compute operator callbacks. |
| setPatchDiscretisationInfo(dms, bs, ...) | Set discretisation info. |
| setPythonContext(context) | Set the instance of the class implementing the required Python methods. |
| setPythonType(py_type) | Set the fully qualified Python name of the class to be used. |
| setReusePreconditioner(flag) | Set to indicate the preconditioner is to be reused. |
| setSPAIBlockSize(n) | Set the block size of the preconditioner. |
| setSPAICacheSize(size) | Set the cache size. |
| setSPAIEpsilon(val) | Set the tolerance for the preconditioner. |
| setSPAIMax(maxval) | Set the size of working buffers in the preconditioner. |
| setSPAIMaxNew(maxval) | Set the maximum number of new non-zero candidates per step. |
| setSPAINBSteps(nbsteps) | Set the maximum number of improvement steps per row. |
| setSPAISp(sym) | Set to specify a symmetric sparsity pattern. |
| setSPAIVerbose(level) | Set the verbosity level. |
| setType(pc_type) | Set the preconditioner type. |
| setUp() | Set up the internal data structures for the PC. |
| setUpOnBlocks() | Set up the PC for each block. |
| setUseAmat(flag) | Set to indicate to apply PC to A and not P. |
| view([viewer]) | View the PC object. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1665
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:355
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:581
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:641
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:660
Collective.
For complex numbers this applies the non-Hermitian transpose.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:619
Collective.
The default preconditioner for sparse matrices is ILU or ICC with 0 fill on one process and block Jacobi (BJACOBI) with ILU or ICC in parallel. For dense matrices it is always None.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:264
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:742
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:250
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:946
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1644
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:681
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2910
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2925
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1434
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1290
Not collective.
After a call to KSPCheckDot() or KSPCheckNorm() inside a KSPSolve(), or after a call to PCReduceFailedReason() this is the maximum reason over all ranks in the PC communicator and hence logically collective. Otherwise it is the local value.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:520
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1545
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1565
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1525
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2562
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2512
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2576
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1076
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1686
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1762
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1797
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1730
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1879
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1838
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1900
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1921
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1942
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1703
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:416
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:341
Not collective.
Source code at petsc4py/PETSc/PC.pyx:2372
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:779
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:808
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:308
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:458
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:600
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:553
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:860
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:842
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:961
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:903
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:824
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2165
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2220
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2256
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2273
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2129
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2103
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2324
Collective.
Not all nodes need to be listed. Unlisted nodes will belong to the complement field.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2346
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2238
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2073
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2290
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2307
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2186
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2203
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1626
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:715
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:698
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2893
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2816
Logically collective.
Sets initial guess to the solution on the deflation space but does not apply the deflation preconditioner. The additional preconditioner is still applied.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2758
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2780
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2876
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2798
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2855
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2834
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1416
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1320
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1357
Collective.
This can be called after KSP.setOperators or PC.setOperators, causes MatGetFactor to be called so then one may set the options for that particular factorization object.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1304
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1386
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1271
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:502
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1495
Logically collective.
Solve options for this split will be available under the prefix -fieldsplit_SPLITNAME_*.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1469
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1581
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1599
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1451
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:374
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1038
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1056
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1019
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:999
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:981
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2476
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2544
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2590
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2526
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2495
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1252
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1110
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1127
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1144
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1161
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1228
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1180
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1090
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1963
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1981
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1777
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1744
Logically collective.
If not provided, one will be set internally. Will be cleaned up in destroy.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2048
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1859
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1818
Logically collective.
If not provided, one will be set internally. Will be cleaned up in destroy.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2002
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:1717
Logically collective.
If not provided, one will be set internally. Will be cleaned up in destroy.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2025
Logically collective.
Passing None for A or P removes the matrix that is currently used. PETSc does not reset the matrix entries of either A or P to zero after a linear solve; the user is completely responsible for matrix assembly. See Mat.zeroEntries to zero all elements of a matrix.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:386
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:322
Source code at petsc4py/PETSc/PC.pyx:2383
Source code at petsc4py/PETSc/PC.pyx:2444
Source code at petsc4py/PETSc/PC.pyx:2452
Source code at petsc4py/PETSc/PC.pyx:2428
Source code at petsc4py/PETSc/PC.pyx:2436
Source code at petsc4py/PETSc/PC.pyx:2460
Source code at petsc4py/PETSc/PC.pyx:2387
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:767
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:794
Logically collective.
Normally if the A matrix inside a PC changes, the PC automatically updates itself using information from the changed matrix. Enable this option prevents this.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:477
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2684
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2702
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2611
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2647
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2666
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2629
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2738
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:2720
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:289
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:541
Collective.
For nested preconditioners such as BJACOBI, setUp is not called on each sub-KSP when setUp is called on the outer PC. This routine ensures it is called.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:565
Logically collective.
Sets a flag to indicate that when the preconditioner needs to apply (part of) the operator during the preconditioning process, it applies to A provided to TS.setRHSJacobian, TS.setIJacobian, SNES.setJacobian, KSP.setOperators or PC.setOperators not the P.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:432
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/PC.pyx:231
A graph partitioner.
Enumerations
| Type | The partitioner types. |
The partitioner types.
Attributes Summary
| CHACO | Object CHACO of type str |
| GATHER | Object GATHER of type str |
| MATPARTITIONING | Object MATPARTITIONING of type str |
| PARMETIS | Object PARMETIS of type str |
| PTSCOTCH | Object PTSCOTCH of type str |
| SHELL | Object SHELL of type str |
| SIMPLE | Object SIMPLE of type str |
Attributes Documentation
Methods Summary
| create([comm]) | Create an empty partitioner object. |
| destroy() | Destroy the partitioner object. |
| getType() | Return the partitioner type. |
| reset() | Reset data structures of the partitioner. |
| setFromOptions() | Set parameters in the partitioner from the options database. |
| setShellPartition(numProcs[, sizes, points]) | Set a custom partition for a mesh. |
| setType(part_type) | Build a particular type of the partitioner. |
| setUp() | Construct data structures for the partitioner. |
| view([viewer]) | View the partitioner. |
Methods Documentation
Collective.
The type can be set with setType.
SEE ALSO:
Source code at petsc4py/PETSc/Partitioner.pyx:57
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Partitioner.pyx:44
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Partitioner.pyx:99
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Partitioner.pyx:137
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Partitioner.pyx:113
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Partitioner.pyx:149
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Partitioner.pyx:80
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Partitioner.pyx:125
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Partitioner.pyx:25
Quadrature rule for integration.
Methods Summary
| create([comm]) | Create a Quad object. |
| destroy() | Destroy the Quad object. |
| duplicate() | Create a deep copy of the Quad object. |
| getData() | Return the data defining the Quad. |
| getNumComponents() | Return the number of components for functions to be integrated. |
| getOrder() | Return the order of the method in the Quad. |
| setNumComponents(nc) | Return the number of components for functions to be integrated. |
| setOrder(order) | Set the order of the method in the Quad. |
| view([viewer]) | View a Quad object. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DT.pyx:28
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DT.pyx:63
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DT.pyx:49
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DT.pyx:76
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DT.pyx:104
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DT.pyx:136
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DT.pyx:118
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/DT.pyx:150
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/DT.pyx:9
The random number generator object.
SEE ALSO:
Enumerations
| Type | The random number generator type. |
The random number generator type.
Attributes Summary
| RAND | Object RAND of type str |
| RAND48 | Object RAND48 of type str |
| RANDER48 | Object RANDER48 of type str |
| RANDOM123 | Object RANDOM123 of type str |
| SPRNG | Object SPRNG of type str |
Attributes Documentation
Methods Summary
| create([comm]) | Create a random number generator object. |
| destroy() | Destroy the random number generator object. |
| getInterval() | Return the interval containing the random numbers generated. |
| getSeed() | Return the random number generator seed. |
| getType() | Return the type of the random number generator object. |
| getValue() | Generate a scalar random number. |
| getValueReal() | Generate a real random number. |
| setFromOptions() | Configure the random number generator from the options database. |
| setInterval(interval) | Set the interval of the random number generator. |
| setSeed([seed]) | Set the seed of random number generator. |
| setType(rnd_type) | Set the type of the random number generator object. |
| view([viewer]) | View a random number generator object. |
Attributes Summary
| interval | The interval of the generated random numbers. |
| seed | The seed of the random number generator. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:74
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:61
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:199
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:166
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:112
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:138
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:152
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:126
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:214
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:180
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:93
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Random.pyx:41
Attributes Documentation
Source code at petsc4py/PETSc/Random.pyx:241
Source code at petsc4py/PETSc/Random.pyx:233
Star Forest object for communication.
SF is used for setting up and managing the communication of certain entries of arrays and Vec between MPI processes.
Enumerations
| Type | The star forest types. |
The star forest types.
Attributes Summary
| ALLGATHER | Object ALLGATHER of type str |
| ALLGATHERV | Object ALLGATHERV of type str |
| ALLTOALL | Object ALLTOALL of type str |
| BASIC | Object BASIC of type str |
| GATHER | Object GATHER of type str |
| GATHERV | Object GATHERV of type str |
| NEIGHBOR | Object NEIGHBOR of type str |
| WINDOW | Object WINDOW of type str |
Attributes Documentation
Methods Summary
| bcastBegin(unit, rootdata, leafdata, op) | Begin pointwise broadcast. |
| bcastEnd(unit, rootdata, leafdata, op) | End a broadcast & reduce operation started with bcastBegin. |
| compose(sf) | Compose a new SF. |
| computeDegree() | Compute and return the degree of each root vertex. |
| create([comm]) | Create a star forest communication context. |
| createEmbeddedLeafSF(selected) | Remove edges from all but the selected leaves. |
| createEmbeddedRootSF(selected) | Remove edges from all but the selected roots. |
| createInverse() | Create the inverse map. |
| createSectionSF(rootSection, remoteOffsets, ...) | Create an expanded SF of DOFs. |
| destroy() | Destroy the star forest. |
| distributeSection(rootSection[, leafSection]) | Create a new, reorganized Section. |
| fetchAndOpBegin(unit, rootdata, leafdata, ...) | Begin fetch and update operation. |
| fetchAndOpEnd(unit, rootdata, leafdata, ...) | End operation started in a matching call to fetchAndOpBegin. |
| gatherBegin(unit, leafdata, multirootdata) | Begin pointwise gather of all leaves into multi-roots. |
| gatherEnd(unit, leafdata, multirootdata) | End gather operation that was started with gatherBegin. |
| getGraph() | Return star forest graph. |
| getMulti() | Return the inner SF implementing gathers and scatters. |
| getType() | Return the type name of the star forest. |
| reduceBegin(unit, leafdata, rootdata, op) | Begin reduction of leafdata into rootdata. |
| reduceEnd(unit, leafdata, rootdata, op) | End a reduction operation started with reduceBegin. |
| reset() | Reset a star forest so that different sizes or neighbors can be used. |
| scatterBegin(unit, multirootdata, leafdata) | Begin pointwise scatter operation. |
| scatterEnd(unit, multirootdata, leafdata) | End scatter operation that was started with scatterBegin. |
| setFromOptions() | Set options using the options database. |
| setGraph(nroots, local, remote) | Set star forest graph. |
| setRankOrder(flag) | Sort multi-points for gathers and scatters by rank order. |
| setType(sf_type) | Set the type of the star forest. |
| setUp() | Set up communication structures. |
| view([viewer]) | View a star forest. |
Methods Documentation
Collective.
Root values are reduced to leaf values. This call has to be concluded with a call to bcastEnd.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:434
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:463
Collective.
Puts the sf under this object in a top (roots) down (leaves) view.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:413
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:279
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:63
Collective.
Does not remap indices.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:321
Collective.
Does not remap indices.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:297
Collective.
Create the inverse map given a PetscSF in which all vertices have degree 1.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:262
Collective.
Assumes the input SF relates points.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:345
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:50
Collective.
Moves from the root to the leaves of the SF.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:378
Collective.
This operation fetches values from root and updates atomically by applying an operation using the leaf value.
This call has to be completed with fetchAndOpEnd.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:642
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:678
Collective.
This call has to be completed with gatherEnd.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:592
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:618
Not collective.
The number of leaves can be determined from the size of ilocal.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:155
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:247
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:103
Collective.
This call has to be completed with call to reduceEnd.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:489
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:517
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:141
Collective.
Operation is from multi-roots to leaves. This call has to be completed with scatterEnd.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:543
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:569
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:117
Collective.
The number of leaves argument can be determined from the size of local and/or remote.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:190
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:229
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:84
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:129
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SF.pyx:31
Nonlinear equations solver.
SNES is described in the PETSc manual.
SEE ALSO:
Enumerations
| ConvergedReason | SNES solver termination reason. |
| NormSchedule | SNES norm schedule. |
| Type | SNES solver type. |
SNES solver termination reason.
SEE ALSO:
Attributes Summary
| CONVERGED_FNORM_ABS | Constant CONVERGED_FNORM_ABS of type int |
| CONVERGED_FNORM_RELATIVE | Constant CONVERGED_FNORM_RELATIVE of type int |
| CONVERGED_ITERATING | Constant CONVERGED_ITERATING of type int |
| CONVERGED_ITS | Constant CONVERGED_ITS of type int |
| CONVERGED_SNORM_RELATIVE | Constant CONVERGED_SNORM_RELATIVE of type int |
| DIVERGED_DTOL | Constant DIVERGED_DTOL of type int |
| DIVERGED_FNORM_NAN | Constant DIVERGED_FNORM_NAN of type int |
| DIVERGED_FUNCTION_COUNT | Constant DIVERGED_FUNCTION_COUNT of type int |
| DIVERGED_FUNCTION_DOMAIN | Constant DIVERGED_FUNCTION_DOMAIN of type int |
| DIVERGED_INNER | Constant DIVERGED_INNER of type int |
| DIVERGED_JACOBIAN_DOMAIN | Constant DIVERGED_JACOBIAN_DOMAIN of type int |
| DIVERGED_LINEAR_SOLVE | Constant DIVERGED_LINEAR_SOLVE of type int |
| DIVERGED_LINE_SEARCH | Constant DIVERGED_LINE_SEARCH of type int |
| DIVERGED_LOCAL_MIN | Constant DIVERGED_LOCAL_MIN of type int |
| DIVERGED_MAX_IT | Constant DIVERGED_MAX_IT of type int |
| DIVERGED_TR_DELTA | Constant DIVERGED_TR_DELTA of type int |
| ITERATING | Constant ITERATING of type int |
Attributes Documentation
SNES norm schedule.
SEE ALSO:
Attributes Summary
| ALWAYS | Constant ALWAYS of type int |
| DEFAULT | Constant DEFAULT of type int |
| FINAL_ONLY | Constant FINAL_ONLY of type int |
| INITIAL_FINAL_ONLY | Constant INITIAL_FINAL_ONLY of type int |
| INITIAL_ONLY | Constant INITIAL_ONLY of type int |
| NONE | Constant NONE of type int |
| NORM_ALWAYS | Constant NORM_ALWAYS of type int |
| NORM_DEFAULT | Constant NORM_DEFAULT of type int |
| NORM_FINAL_ONLY | Constant NORM_FINAL_ONLY of type int |
| NORM_INITIAL_FINAL_ONLY | Constant NORM_INITIAL_FINAL_ONLY of type int |
| NORM_INITIAL_ONLY | Constant NORM_INITIAL_ONLY of type int |
| NORM_NONE | Constant NORM_NONE of type int |
Attributes Documentation
SNES solver type.
SEE ALSO:
Attributes Summary
| ANDERSON | Object ANDERSON of type str |
| ASPIN | Object ASPIN of type str |
| COMPOSITE | Object COMPOSITE of type str |
| FAS | Object FAS of type str |
| KSPONLY | Object KSPONLY of type str |
| KSPTRANSPOSEONLY | Object KSPTRANSPOSEONLY of type str |
| MS | Object MS of type str |
| NASM | Object NASM of type str |
| NCG | Object NCG of type str |
| NEWTONLS | Object NEWTONLS of type str |
| NEWTONTR | Object NEWTONTR of type str |
| NGMRES | Object NGMRES of type str |
| NGS | Object NGS of type str |
| NRICHARDSON | Object NRICHARDSON of type str |
| PATCH | Object PATCH of type str |
| PYTHON | Object PYTHON of type str |
| QN | Object QN of type str |
| SHELL | Object SHELL of type str |
| VINEWTONRSLS | Object VINEWTONRSLS of type str |
| VINEWTONSSLS | Object VINEWTONSSLS of type str |
Attributes Documentation
Methods Summary
| appendOptionsPrefix(prefix) | Append to the prefix used for searching for options in the database. |
| callConvergenceTest(its, xnorm, ynorm, fnorm) | Compute the convergence test. |
| computeFunction(x, f) | Compute the function. |
| computeJacobian(x, J[, P]) | Compute the Jacobian. |
| computeNGS(x[, b]) | Compute a nonlinear Gauss-Seidel step. |
| computeObjective(x) | Compute the value of the objective function. |
| converged(its, xnorm, ynorm, fnorm) | Compute the convergence test and update the solver converged reason. |
| create([comm]) | Create a SNES solver. |
| createPython([context, comm]) | Create a nonlinear solver of Python type. |
| destroy() | Destroy the solver. |
| getApplicationContext() | Return the application context. |
| getCompositeNumber() | Return the number of solvers in the composite. |
| getCompositeSNES(n) | Return the n-th solver in the composite. |
| getConvergedReason() | Return the termination flag. |
| getConvergenceHistory() | Return the convergence history. |
| getConvergenceTest() | Return the callback to used as convergence test. |
| getDM() | Return the DM associated with the solver. |
| getDivergenceTolerance() | Get the divergence tolerance parameter used in the convergence tests. |
| getErrorIfNotConverged() | Return the flag indicating error on divergence. |
| getFASCoarseSolve() | Return the SNES used at the coarsest level of the FAS hierarchy. |
| getFASCycleSNES(level) | Return the SNES corresponding to a particular level of the FAS hierarchy. |
| getFASInjection(level) | Return the Mat used to apply the injection from level-1 to level. |
| getFASInterpolation(level) | Return the Mat used to apply the interpolation from level-1 to level. |
| getFASLevels() | Return the number of levels used. |
| getFASRestriction(level) | Return the Mat used to apply the restriction from level-1 to level. |
| getFASSmoother(level) | Return the smoother used at a given level of the FAS hierarchy. |
| getFASSmootherDown(level) | Return the downsmoother used at a given level of the FAS hierarchy. |
| getFASSmootherUp(level) | Return the upsmoother used at a given level of the FAS hierarchy. |
| getFunction() | Return the callback to compute the nonlinear function. |
| getFunctionEvaluations() | Return the current number of function evaluations. |
| getFunctionNorm() | Return the function norm. |
| getInitialGuess() | Return the callback to compute the initial guess. |
| getIterationNumber() | Return the current iteration number. |
| getJacobian() | Return the matrices used to compute the Jacobian and the callback tuple. |
| getKSP() | Return the linear solver used by the nonlinear solver. |
| getKSPFailures() | Return the current number of linear solve failures. |
| getLinearSolveIterations() | Return the total number of linear iterations. |
| getMaxFunctionEvaluations() | Return the maximum allowed number of function evaluations. |
| getMaxKSPFailures() | Return the maximum allowed number of linear solve failures. |
| getMaxStepFailures() | Return the maximum allowed number of step failures. |
| getMonitor() | Return the callback used to monitor solver convergence. |
| getNASMNumber() | Return the number of solvers in NASM. |
| getNASMSNES(n) | Return the n-th solver in NASM. |
| getNGS() | Return the nonlinear Gauss-Seidel callback tuple. |
| getNPC() | Return the nonlinear preconditioner associated with the solver. |
| getNPCSide() | Return the nonlinear preconditioning side. |
| getNormSchedule() | Return the norm schedule. |
| getObjective() | Return the objective callback tuple. |
| getOptionsPrefix() | Return the prefix used for searching for options in the database. |
| getParamsEW() | Get the parameters of the Eisenstat and Walker trick. |
| getPythonContext() | Return the instance of the class implementing the required Python methods. |
| getPythonType() | Return the fully qualified Python name of the class used by the solver. |
| getRhs() | Return the vector holding the right-hand side. |
| getSolution() | Return the vector holding the solution. |
| getSolutionUpdate() | Return the vector holding the solution update. |
| getStepFailures() | Return the current number of step failures. |
| getTRTolerances() | Return the tolerance parameters used for the trust region. |
| getTRUpdateParameters() | Return the update parameters used for the trust region. |
| getTolerances() | Return the tolerance parameters used in the solver convergence tests. |
| getType() | Return the type of the solver. |
| getUpdate() | Return the callback to compute the update at the beginning of each step. |
| getUseEW() | Return the flag indicating if the solver uses the Eisenstat-Walker trick. |
| getUseFD() | Return true if the solver uses color finite-differencing for the Jacobian. |
| getUseKSP() | Return the flag indicating if the solver uses a linear solver. |
| getUseMF() | Return the flag indicating if the solver uses matrix-free finite-differencing. |
| getVIInactiveSet() | Return the index set for the inactive set. |
| hasNPC() | Return a boolean indicating whether the solver has a nonlinear preconditioner. |
| logConvergenceHistory(norm[, linear_its]) | Log residual norm and linear iterations. |
| monitor(its, rnorm) | Monitor the solver. |
| monitorCancel() | Cancel all the monitors of the solver. |
| reset() | Reset the solver. |
| setApplicationContext(appctx) | Set the application context. |
| setConvergedReason(reason) | Set the termination flag. |
| setConvergenceHistory([length, reset]) | Set the convergence history. |
| setConvergenceTest(converged[, args, kargs]) | Set the callback to use as convergence test. |
| setDM(dm) | Associate a DM with the solver. |
| setDivergenceTolerance(dtol) | Set the divergence tolerance parameter used in the convergence tests. |
| setErrorIfNotConverged(flag) | Immediately generate an error if the solver has not converged. |
| setFASInjection(level, mat) | Set the Mat to be used to apply the injection from level-1 to level. |
| setFASInterpolation(level, mat) | Set the Mat to be used to apply the interpolation from level-1 to level. |
| setFASLevels(levels[, comms]) | Set the number of levels to use with FAS. |
| setFASRScale(level, vec) | Set the scaling factor of the restriction operator from level to level-1. |
| setFASRestriction(level, mat) | Set the Mat to be used to apply the restriction from level-1 to level. |
| setForceIteration(force) | Force solve to take at least one iteration. |
| setFromOptions() | Configure the solver from the options database. |
| setFunction(function[, f, args, kargs]) | Set the callback to compute the nonlinear function. |
| setFunctionNorm(norm) | Set the function norm value. |
| setInitialGuess(initialguess[, args, kargs]) | Set the callback to compute the initial guess. |
| setIterationNumber(its) | Set the current iteration number. |
| setJacobian(jacobian[, J, P, args, kargs]) | Set the callback to compute the Jacobian. |
| setKSP(ksp) | Set the linear solver that will be used by the nonlinear solver. |
| setLineSearchPreCheck(precheck[, args, kargs]) | Set the callback that will be called before applying the linesearch. |
| setMaxFunctionEvaluations(max_funcs) | Set the maximum allowed number of function evaluations. |
| setMaxKSPFailures(max_fails) | Set the maximum allowed number of linear solve failures. |
| setMaxStepFailures(max_fails) | Set the maximum allowed number of step failures. |
| setMonitor(monitor[, args, kargs]) | Set the callback used to monitor solver convergence. |
| setNGS(ngs[, args, kargs]) | Set the callback to compute nonlinear Gauss-Seidel. |
| setNPC(snes) | Set the nonlinear preconditioner. |
| setNPCSide(side) | Set the nonlinear preconditioning side. |
| setNormSchedule(normsched) | Set the norm schedule. |
| setObjective(objective[, args, kargs]) | Set the callback to compute the objective function. |
| setOptionsPrefix(prefix) | Set the prefix used for searching for options in the database. |
| setParamsEW([version, rtol_0, rtol_max, ...]) | Set the parameters for the Eisenstat and Walker trick. |
| setPatchCellNumbering(sec) | Set cell patch numbering. |
| setPatchComputeFunction(function[, args, kargs]) | Set patch compute function. |
| setPatchComputeOperator(operator[, args, kargs]) | Set patch compute operator. |
| setPatchConstructType(typ[, operator, args, ...]) | Set patch construct type. |
| setPatchDiscretisationInfo(dms, bs, ...) | Set patch discretisation information. |
| setPythonContext(context) | Set the instance of the class implementing the required Python methods. |
| setPythonType(py_type) | Set the fully qualified Python name of the class to be used. |
| setResetCounters([reset]) | Set the flag to reset the counters. |
| setSolution(vec) | Set the vector used to store the solution. |
| setTRTolerances([delta_min, delta_max, delta_0]) | Set the tolerance parameters used for the trust region. |
| setTRUpdateParameters([eta1, eta2, eta3, t1, t2]) | Set the update parameters used for the trust region. |
| setTolerances([rtol, atol, stol, max_it]) | Set the tolerance parameters used in the solver convergence tests. |
| setType(snes_type) | Set the type of the solver. |
| setUp() | Set up the internal data structures for using the solver. |
| setUpMatrices() | Ensures that matrices are available for Newton-like methods. |
| setUpdate(update[, args, kargs]) | Set the callback to compute update at the beginning of each step. |
| setUseEW([flag]) | Tell the solver to use the Eisenstat-Walker trick. |
| setUseFD([flag]) | Set the boolean flag to use coloring finite-differencing for Jacobian assembly. |
| setUseKSP([flag]) | Set the boolean flag indicating to use a linear solver. |
| setUseMF([flag]) | Set the boolean flag indicating to use matrix-free finite-differencing. |
| setVariableBounds(xl, xu) | Set the vector for the variable bounds. |
| solve([b, x]) | Solve the nonlinear equations. |
| view([viewer]) | View the solver. |
Attributes Summary
| appctx | Application context. |
| atol | Absolute residual tolerance. |
| dm | DM. |
| history | Convergence history. |
| is_converged | Boolean indicating if the solver has converged. |
| is_diverged | Boolean indicating if the solver has failed. |
| is_iterating | Boolean indicating if the solver has not converged yet. |
| its | Number of iterations. |
| ksp | Linear solver. |
| max_funcs | Maximum number of function evaluations. |
| max_it | Maximum number of iterations. |
| norm | Function norm. |
| npc | Nonlinear preconditioner. |
| reason | Converged reason. |
| rtol | Relative residual tolerance. |
| stol | Solution update tolerance. |
| use_ew | Use the Eisenstat-Walker trick. |
| use_fd | Boolean indicating if the solver uses coloring finite-differencing. |
| use_ksp | Boolean indicating if the solver uses a linear solver. |
| use_mf | Boolean indicating if the solver uses matrix-free finite-differencing. |
| vec_rhs | Right-hand side vector. |
| vec_sol | Solution vector. |
| vec_upd | Update vector. |
Methods Documentation
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:227
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1326
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1027
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1046
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1133
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1069
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1356
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:145
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2179
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:132
Source code at petsc4py/PETSc/SNES.pyx:264
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2280
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2263
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1739
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1407
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1314
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:279
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1239
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1766
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:594
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:577
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:500
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:440
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:563
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:470
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:609
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:626
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:643
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:843
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1560
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1837
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:796
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1795
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:955
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1936
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1642
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1851
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1544
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1628
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1587
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1479
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2312
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2296
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1119
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:662
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:715
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1265
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1013
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:213
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2040
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2216
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2246
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1865
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1880
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1907
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1601
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:337
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:396
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1195
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:185
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:904
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1974
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2134
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2078
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2107
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2162
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:677
Source code at petsc4py/PETSc/SNES.pyx:1425
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1506
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1491
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1691
Source code at petsc4py/PETSc/SNES.pyx:255
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1726
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1383
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1279
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:296
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1222
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1753
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:486
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:426
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:529
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:516
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:456
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1809
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:241
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:808
Collective.
This is only of use to implementers of custom SNES types.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1822
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:765
Collective.
This is only of use to implementers of custom SNES types.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1780
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:916
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1924
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:731
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1529
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1615
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1574
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1446
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1088
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:691
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:703
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1253
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:982
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:199
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1988
Source code at petsc4py/PETSc/SNES.pyx:2328
Source code at petsc4py/PETSc/SNES.pyx:2381
Source code at petsc4py/PETSc/SNES.pyx:2373
Source code at petsc4py/PETSc/SNES.pyx:2389
Source code at petsc4py/PETSc/SNES.pyx:2332
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2204
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2231
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1431
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1895
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:310
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:361
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1156
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:166
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1665
Collective.
This is only of use to implementers of custom SNES types.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1677
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:873
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1951
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2121
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2065
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2094
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:2150
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:1703
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/SNES.pyx:113
Attributes Documentation
Source code at petsc4py/PETSc/SNES.pyx:2405
Source code at petsc4py/PETSc/SNES.pyx:2486
Source code at petsc4py/PETSc/SNES.pyx:2415
Source code at petsc4py/PETSc/SNES.pyx:2538
Source code at petsc4py/PETSc/SNES.pyx:2558
Source code at petsc4py/PETSc/SNES.pyx:2563
Source code at petsc4py/PETSc/SNES.pyx:2553
Source code at petsc4py/PETSc/SNES.pyx:2522
Source code at petsc4py/PETSc/SNES.pyx:2452
Source code at petsc4py/PETSc/SNES.pyx:2512
Source code at petsc4py/PETSc/SNES.pyx:2502
Source code at petsc4py/PETSc/SNES.pyx:2530
Source code at petsc4py/PETSc/SNES.pyx:2425
Source code at petsc4py/PETSc/SNES.pyx:2545
Source code at petsc4py/PETSc/SNES.pyx:2478
Source code at petsc4py/PETSc/SNES.pyx:2494
Source code at petsc4py/PETSc/SNES.pyx:2468
Source code at petsc4py/PETSc/SNES.pyx:2578
Source code at petsc4py/PETSc/SNES.pyx:2460
Source code at petsc4py/PETSc/SNES.pyx:2570
Source code at petsc4py/PETSc/SNES.pyx:2445
Source code at petsc4py/PETSc/SNES.pyx:2435
Source code at petsc4py/PETSc/SNES.pyx:2440
Scatter object.
The object used to perform data movement between vectors. Scatter is described in the PETSc manual.
SEE ALSO:
Enumerations
| Mode | Scatter mode. |
| Type | Scatter type. |
Scatter mode.
Most commonly used scatter modes are:
SEE ALSO:
Attributes Summary
| FORWARD | Constant FORWARD of type int |
| FORWARD_LOCAL | Constant FORWARD_LOCAL of type int |
| REVERSE | Constant REVERSE of type int |
| REVERSE_LOCAL | Constant REVERSE_LOCAL of type int |
| SCATTER_FORWARD | Constant SCATTER_FORWARD of type int |
| SCATTER_FORWARD_LOCAL | Constant SCATTER_FORWARD_LOCAL of type int |
| SCATTER_REVERSE | Constant SCATTER_REVERSE of type int |
| SCATTER_REVERSE_LOCAL | Constant SCATTER_REVERSE_LOCAL of type int |
Attributes Documentation
Scatter type.
SEE ALSO:
Attributes Summary
| ALLGATHER | Object ALLGATHER of type str |
| ALLGATHERV | Object ALLGATHERV of type str |
| ALLTOALL | Object ALLTOALL of type str |
| BASIC | Object BASIC of type str |
| GATHER | Object GATHER of type str |
| GATHERV | Object GATHERV of type str |
| NEIGHBOR | Object NEIGHBOR of type str |
| WINDOW | Object WINDOW of type str |
Attributes Documentation
Methods Summary
| begin(vec_from, vec_to[, addv, mode]) | Begin a generalized scatter from one vector into another. |
| copy() | Return a copy of the scatter. |
| create(vec_from, is_from, vec_to, is_to) | Create a scatter object. |
| destroy() | Destroy the scatter. |
| end(vec_from, vec_to[, addv, mode]) | Complete a generalized scatter from one vector into another. |
| getType() | Return the type of the scatter. |
| scatter(vec_from, vec_to[, addv, mode]) | Perform a generalized scatter from one vector into another. |
| setFromOptions() | Configure the scatter from the options database. |
| setType(scatter_type) | Set the type of the scatter. |
| setUp() | Set up the internal data structures for using the scatter. |
| toAll(vec) | Create a scatter that communicates a vector to all sharing processes. |
| toZero(vec) | Create a scatter that communicates a vector to rank zero. |
| view([viewer]) | View the scatter. |
Methods Documentation
Collective.
This call has to be concluded with a call to end. For additional details on the Parameters, see scatter.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:262
Source code at petsc4py/PETSc/Scatter.pyx:199
Collective.
Examples
The scatter object can be used to repeatedly perform data movement. It is the PETSc equivalent of NumPy-like indexing and slicing, with support for parallel communications:
>>> revmode = PETSc.Scatter.Mode.REVERSE >>> v1 = PETSc.Vec().createWithArray([1, 2, 3]) >>> v2 = PETSc.Vec().createWithArray([0, 0, 0]) >>> sct = PETSc.Scatter().create(v1,None,v2,None) >>> sct.scatter(v1,v2) # v2[:] = v1[:] >>> sct.scatter(v2,v1,mode=revmode) # v1[:] = v2[:]
>>> revmode = PETSc.Scatter.Mode.REVERSE >>> v1 = PETSc.Vec().createWithArray([1, 2, 3, 4]) >>> v2 = PETSc.Vec().createWithArray([0, 0]) >>> is1 = PETSc.IS().createStride(2, 3, -2) >>> sct = PETSc.Scatter().create(v1,is1,v2,None) >>> sct.scatter(v1,v2) # v2[:] = v1[3:0:-2] >>> sct.scatter(v2,v1,mode=revmode) # v1[3:0:-2] = v2[:]
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:90
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:77
Collective.
This call has to be preceded by a call to begin. For additional details on the Parameters, see scatter.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:285
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:160
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:308
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:174
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:146
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:186
Collective.
Notes
The created scatter will have the same communicator of vec. The method also returns an output vector of appropriate size to contain the result of the operation.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:205
Collective.
Notes
The created scatter will have the same communicator of vec. The method also returns an output vector of appropriate size to contain the result of the operation.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:233
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Scatter.pyx:58
Scatter mode.
Most commonly used scatter modes are:
SEE ALSO:
Attributes Summary
| FORWARD | Constant FORWARD of type int |
| FORWARD_LOCAL | Constant FORWARD_LOCAL of type int |
| REVERSE | Constant REVERSE of type int |
| REVERSE_LOCAL | Constant REVERSE_LOCAL of type int |
| SCATTER_FORWARD | Constant SCATTER_FORWARD of type int |
| SCATTER_FORWARD_LOCAL | Constant SCATTER_FORWARD_LOCAL of type int |
| SCATTER_REVERSE | Constant SCATTER_REVERSE of type int |
| SCATTER_REVERSE_LOCAL | Constant SCATTER_REVERSE_LOCAL of type int |
Attributes Documentation
Mapping from integers in a range to unstructured set of integers.
Methods Summary
| addConstraintDof(point, numDof) | Increment the number of constrained DOFs for a given point. |
| addDof(point, numDof) | Add numDof degrees of freedom associated with a given point. |
| addFieldConstraintDof(point, field, numDof) | Add numDof constrained DOFs for a given field on a point. |
| addFieldDof(point, field, numDof) | Add numDof DOFs associated with a field on a given point. |
| clone() | Return a copy of the section. |
| create([comm]) | Allocate a section and set the map contents to the default. |
| createGlobalSection(sf) | Create a section describing the global field layout. |
| destroy() | Destroy a section. |
| getChart() | Return the range in which points (indices) lie for this section. |
| getConstrainedStorageSize() | Return the size capable of holding all unconstrained DOFs in a section. |
| getConstraintDof(point) | Return the number of constrained DOFs associated with a given point. |
| getConstraintIndices(point) | Return the point DOFs numbers which are constrained for a given point. |
| getDof(point) | Return the number of degrees of freedom for a given point. |
| getFieldComponents(field) | Return the number of field components for the given field. |
| getFieldConstraintDof(point, field) | Return the number of constrained DOFs for a given field on a point. |
| getFieldConstraintIndices(point, field) | Return the field DOFs numbers, in [0, DOFs), which are constrained. |
| getFieldDof(point, field) | Return the number of DOFs associated with a field on a given point. |
| getFieldName(field) | Return the name of a field in the section. |
| getFieldOffset(point, field) | Return the offset for the field DOFs on the given point. |
| getMaxDof() | Return the maximum number of DOFs for any point in the section. |
| getNumFields() | Return the number of fields in a section. |
| getOffset(point) | Return the offset for the DOFs associated with the given point. |
| getOffsetRange() | Return the full range of offsets, [start, end), for a section. |
| getPermutation() | Return the permutation that was set with setPermutation. |
| getStorageSize() | Return the size capable of holding all the DOFs defined in a section. |
| reset() | Free all section data. |
| setChart(pStart, pEnd) | Set the range in which points (indices) lie for this section. |
| setConstraintDof(point, numDof) | Set the number of constrained DOFs associated with a given point. |
| setConstraintIndices(point, indices) | Set the point DOFs numbers, in [0, DOFs), which are constrained. |
| setDof(point, numDof) | Set the number of degrees of freedom associated with a given point. |
| setFieldComponents(field, numComp) | Set the number of field components for the given field. |
| setFieldConstraintDof(point, field, numDof) | Set the number of constrained DOFs for a given field on a point. |
| setFieldConstraintIndices(point, field, indices) | Set the field DOFs numbers, in [0, DOFs), which are constrained. |
| setFieldDof(point, field, numDof) | Set the number of DOFs associated with a field on a given point. |
| setFieldName(field, fieldName) | Set the name of a field in the section. |
| setFieldOffset(point, field, offset) | Set the offset for the DOFs on the given field at a point. |
| setNumFields(numFields) | Set the number of fields in a section. |
| setOffset(point, offset) | Set the offset for the DOFs associated with the given point. |
| setPermutation(perm) | Set the permutation for [0, pEnd - pStart). |
| setUp() | Calculate offsets. |
| view([viewer]) | View the section. |
Methods Documentation
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:485
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:354
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:557
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:421
Collective.
The copy is shallow, if possible.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:80
Collective.
Typical calling sequence: - create - setNumFields - setChart - setDof - setUp - getOffset - destroy
The Section object and methods are intended to be used in the PETSc Vec and Mat implementations. The indices returned by the Section are appropriate for the kind of Vec it is associated with. For example, if the vector being indexed is a local vector, we call the section a local section. If the section indexes a global vector, we call it a global section. For parallel vectors, like global vectors, we use negative indices to indicate DOFs owned by other processes.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:42
Collective.
The section describes the global field layout using the local section and an SF describing the section point overlap.
If we have a set of local sections defining the layout of a set of local vectors, and also an SF to determine which section points are shared and the ownership, we can calculate a global section defining the parallel data layout, and the associated global vector.
This gives negative sizes and offsets to points not owned by this process.
includeConstraints and localOffsets parameters of the C API are always set to False.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:846
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:29
Not collective.
The range is [pStart, pEnd), i.e., from the first point to one past the last point.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:238
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:720
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:445
Not collective.
The range is in [0, DOFs).
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:586
Not collective.
In a global section, this value will be negative for points not owned by this process.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:311
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:198
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:506
Not collective.
The constrained DOFs are sorted in ascending order.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:634
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:375
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:156
Not collective.
In a global section, this offset will be negative for points not owned by this process.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:779
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:692
Not collective.
Returns 0 if no fields were defined.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:122
Not collective.
In a global section, this offset will be negative for points not owned by this process.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:734
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:831
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:279
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:706
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:110
Not collective.
The range is [pStart, pEnd), i.e., from the first point to one past the last point.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:255
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:464
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:610
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:333
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:217
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:528
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:661
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:397
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:176
Not collective.
The user usually does not call this function, but uses setUp.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:805
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:138
Not collective.
The user usually does not call this function, but uses setUp.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:756
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:294
Not collective.
Offsets are based on the number of degrees of freedom for each point.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:96
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Section.pyx:10
Function space object.
Enumerations
| Type | The function space types. |
The function space types.
Attributes Summary
| POINT | Object POINT of type str |
| POLYNOMIAL | Object POLYNOMIAL of type str |
| PTRIMMED | Object PTRIMMED of type str |
| SUBSPACE | Object SUBSPACE of type str |
| SUM | Object SUM of type str |
| TENSOR | Object TENSOR of type str |
| WXY | Object WXY of type str |
Attributes Documentation
Methods Summary
| create([comm]) | Create an empty Space object. |
| destroy() | Destroy the Space object. |
| getDegree() | Return the polynomial degrees that characterize this space. |
| getDimension() | Return the number of basis vectors. |
| getNumComponents() | Return the number of components for this space. |
| getNumVariables() | Return the number of variables for this space. |
| getPTrimmedFormDegree() | Return the form degree of the trimmed polynomials. |
| getPointPoints() | Return the evaluation points for the space as the points of a quad. |
| getPolynomialTensor() | Return whether a function space is a space of tensor polynomials. |
| getSumConcatenate() | Return the concatenate flag for this space. |
| getSumNumSubspaces() | Return the number of spaces in the sum. |
| getSumSubspace(s) | Return a space in the sum. |
| getTensorNumSubspaces() | Return the number of spaces in the tensor product. |
| getTensorSubspace(s) | Return a space in the tensor product. |
| getType() | Return the type of the space object. |
| setDegree(degree, maxDegree) | Set the degree of approximation for this space. |
| setFromOptions() | Set parameters in Space from the options database. |
| setNumComponents(nc) | Set the number of components for this space. |
| setNumVariables(n) | Set the number of variables for this space. |
| setPTrimmedFormDegree(formDegree) | Set the form degree of the trimmed polynomials. |
| setPointPoints(quad) | Set the evaluation points for the space to be based on a quad. |
| setPolynomialTensor(tensor) | Set whether a function space is a space of tensor polynomials. |
| setSumConcatenate(concatenate) | Set the concatenate flag for this space. |
| setSumNumSubspaces(numSumSpaces) | Set the number of spaces in the sum. |
| setSumSubspace(s, subsp) | Set a space in the sum. |
| setTensorNumSubspaces(numTensSpaces) | Set the number of spaces in the tensor product. |
| setTensorSubspace(s, subsp) | Set a space in the tensor product. |
| setType(space_type) | Build a particular type of space. |
| setUp() | Construct data structures for the Space. |
| view([viewer]) | View a Space. |
Methods Documentation
Collective.
The type can then be set with setType.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:36
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:59
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:117
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:103
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:195
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:163
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:546
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:513
Not collective.
Return True if a function space is a space of tensor polynomials (the space is spanned by polynomials whose degree in each variable is bounded by the given order), as opposed to polynomials (the space is spanned by polynomials whose total degree—summing over all variables is bounded by the given order).
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:448
Not collective.
A concatenated sum space will have the number of components equal to the sum of the number of components of all subspaces. A non-concatenated, or direct sum space will have the same number of components as its subspaces.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:261
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:304
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:318
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:376
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:410
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:227
Logically collective.
One of degree and maxDegree can be None.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:138
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:91
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:209
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:177
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:528
Logically collective.
Sets the evaluation points for the space to coincide with the points of a quadrature rule.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:493
Logically collective.
Set to True for a function space which is a space of tensor polynomials (the space is spanned by polynomials whose degree in each variable is bounded by the given order), as opposed to polynomials (the space is spanned by polynomials whose total degree—summing over all variables is bounded by the given order).
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:468
Logically collective.
A concatenated sum space will have the number of components equal to the sum of the number of components of all subspaces. A non-concatenated, or direct sum space will have the same number of components as its subspaces.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:280
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:358
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:338
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:430
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:390
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:241
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:24
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Space.pyx:72
System utilities.
Methods Summary
| Print(*args[, sep, end, comm]) | Print output from the first processor of a communicator. |
| getDefaultComm() | Get the default MPI communicator used to create PETSc objects. |
| getVersion([devel, date, author]) | Return PETSc version information. |
| getVersionInfo() | Return PETSc version information. |
| hasExternalPackage(package) | Return whether PETSc has support for external package. |
| infoAllow(flag[, filename, mode]) | Enables or disables PETSc info messages. |
| isFinalized() | Return whether PETSc has been finalized. |
| isInitialized() | Return whether PETSc has been initialized. |
| popErrorHandler() | Remove the current error handler. |
| popSignalHandler() | Remove the current signal handler. |
| pushErrorHandler(errhandler) | Set the current error handler. |
| registerCitation(citation) | Register BibTeX citation. |
| setDefaultComm(comm) | Set the default MPI communicator used to create PETSc objects. |
| sleep([seconds]) | Sleep some number of seconds. |
| splitOwnership(size[, bsize, comm]) | Given a global (or local) size determines a local (or global) size. |
| syncFlush([comm]) | Flush output from previous syncPrint calls. |
| syncPrint(*args[, sep, end, flush, comm]) | Print synchronized output from several processors of a communicator. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:155
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:116
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:7
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:62
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:449
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:392
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:101
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:88
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:366
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:379
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:331
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:426
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:131
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:310
Collective.
Notes
The size argument corresponds to the full size of the vector. That is, an array with 10 blocks and a block size of 3 will have a size of 30, not 10.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:261
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:240
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Sys.pyx:197
Optimization solver.
TAO is described in the PETSc manual.
SEE ALSO:
Enumerations
| BNCGType | TAO Bound Constrained Conjugate Gradient (BNCG) Update Type. |
| ConvergedReason | TAO solver termination reason. |
| Type | TAO solver type. |
TAO Bound Constrained Conjugate Gradient (BNCG) Update Type.
Attributes Summary
| DK | Constant DK of type int |
| DY | Constant DY of type int |
| FR | Constant FR of type int |
| GD | Constant GD of type int |
| HS | Constant HS of type int |
| HZ | Constant HZ of type int |
| KD | Constant KD of type int |
| PCGD | Constant PCGD of type int |
| PRP | Constant PRP of type int |
| PRP_PLUS | Constant PRP_PLUS of type int |
| SSML_BFGS | Constant SSML_BFGS of type int |
| SSML_BRDN | Constant SSML_BRDN of type int |
| SSML_DFP | Constant SSML_DFP of type int |
Attributes Documentation
TAO solver termination reason.
SEE ALSO:
Attributes Summary
| CONTINUE_ITERATING | Constant CONTINUE_ITERATING of type int |
| CONVERGED_GATOL | Constant CONVERGED_GATOL of type int |
| CONVERGED_GRTOL | Constant CONVERGED_GRTOL of type int |
| CONVERGED_GTTOL | Constant CONVERGED_GTTOL of type int |
| CONVERGED_ITERATING | Constant CONVERGED_ITERATING of type int |
| CONVERGED_MINF | Constant CONVERGED_MINF of type int |
| CONVERGED_STEPTOL | Constant CONVERGED_STEPTOL of type int |
| CONVERGED_USER | Constant CONVERGED_USER of type int |
| DIVERGED_LS_FAILURE | Constant DIVERGED_LS_FAILURE of type int |
| DIVERGED_MAXFCN | Constant DIVERGED_MAXFCN of type int |
| DIVERGED_MAXITS | Constant DIVERGED_MAXITS of type int |
| DIVERGED_NAN | Constant DIVERGED_NAN of type int |
| DIVERGED_TR_REDUCTION | Constant DIVERGED_TR_REDUCTION of type int |
| DIVERGED_USER | Constant DIVERGED_USER of type int |
| ITERATING | Constant ITERATING of type int |
Attributes Documentation
TAO solver type.
SEE ALSO:
Attributes Summary
| ADMM | Object ADMM of type str |
| ALMM | Object ALMM of type str |
| ASFLS | Object ASFLS of type str |
| ASILS | Object ASILS of type str |
| BLMVM | Object BLMVM of type str |
| BMRM | Object BMRM of type str |
| BNCG | Object BNCG of type str |
| BNLS | Object BNLS of type str |
| BNTL | Object BNTL of type str |
| BNTR | Object BNTR of type str |
| BQNKLS | Object BQNKLS of type str |
| BQNKTL | Object BQNKTL of type str |
| BQNKTR | Object BQNKTR of type str |
| BQNLS | Object BQNLS of type str |
| BQPIP | Object BQPIP of type str |
| BRGN | Object BRGN of type str |
| CG | Object CG of type str |
| GPCG | Object GPCG of type str |
| IPM | Object IPM of type str |
| LCL | Object LCL of type str |
| LMVM | Object LMVM of type str |
| NLS | Object NLS of type str |
| NM | Object NM of type str |
| NTL | Object NTL of type str |
| NTR | Object NTR of type str |
| OWLQN | Object OWLQN of type str |
| PDIPM | Object PDIPM of type str |
| POUNDERS | Object POUNDERS of type str |
| PYTHON | Object PYTHON of type str |
| SHELL | Object SHELL of type str |
| SSFLS | Object SSFLS of type str |
| SSILS | Object SSILS of type str |
| TRON | Object TRON of type str |
Attributes Documentation
Methods Summary
| appendOptionsPrefix(prefix) | Append to the prefix used for searching for options in the database. |
| cancelMonitor() | Cancel all the monitors of the solver. |
| computeConstraints(x, c) | Compute the vector corresponding to the constraints. |
| computeDualVariables(xl, xu) | Compute the dual vectors corresponding to variables' bounds. |
| computeGradient(x, g) | Compute the gradient of the objective function. |
| computeHessian(x, H[, P]) | Compute the Hessian of the objective function. |
| computeJacobian(x, J[, P]) | Compute the Jacobian. |
| computeObjective(x) | Compute the value of the objective function. |
| computeObjectiveGradient(x, g) | Compute the gradient of the objective function and its value. |
| computeResidual(x, f) | Compute the residual. |
| computeVariableBounds(xl, xu) | Compute the vectors corresponding to variables' bounds. |
| create([comm]) | Create a TAO solver. |
| createPython([context, comm]) | Create an optimization solver of Python type. |
| destroy() | Destroy the solver. |
| getAppCtx() | Return the application context. |
| getBNCGType() | Return the type of the BNCG solver. |
| getBRGNDampingVector() | Return the damping vector. |
| getBRGNSubsolver() | Return the subsolver inside the BRGN solver. |
| getConstraintTolerances() | Return the constraints tolerance parameters used in the convergence tests. |
| getConvergedReason() | Return the termination flag. |
| getConvergenceTest() | Return the callback used to test for solver convergence. |
| getGradient() | Return the vector used to store the gradient and the evaluation callback. |
| getGradientNorm() | Return the matrix used to compute inner products. |
| getHessian() | Return the matrices used to store the Hessian and the evaluation callback. |
| getIterationNumber() | Return the current iteration number. |
| getKSP() | Return the linear solver used by the nonlinear solver. |
| getLMVMH0() | Return the initial Hessian for the quasi-Newton approximation. |
| getLMVMH0KSP() | Return the KSP for the inverse of the initial Hessian approximation. |
| getLineSearch() | Return the TAO Line Search object. |
| getMaximumFunctionEvaluations() | Return the maximum number of objective evaluations within the solver. |
| getMaximumIterations() | Return the maximum number of solver iterations. |
| getMonitor() | Return the callback used to monitor solver convergence. |
| getObjectiveAndGradient() | Return the vector used to store the gradient and the evaluation callback. |
| getObjectiveValue() | Return the current value of the objective function. |
| getOptionsPrefix() | Return the prefix used for searching for options in the database. |
| getPythonContext() | Return the instance of the class implementing the required Python methods. |
| getPythonType() | Return the fully qualified Python name of the class used by the solver. |
| getSolution() | Return the vector holding the solution. |
| getSolutionNorm() | Return the objective function value and the norms of gradient and constraints. |
| getSolutionStatus() | Return the solution status. |
| getTolerances() | Return the tolerance parameters used in the solver convergence tests. |
| getType() | Return the type of the solver. |
| getUpdate() | Return the callback to compute the update. |
| getVariableBounds() | Return the upper and lower bounds vectors. |
| monitor([its, f, res, cnorm, step]) | Monitor the solver. |
| setAppCtx(appctx) | Set the application context. |
| setBNCGType(cg_type) | Set the type of the BNCG solver. |
| setBRGNDictionaryMatrix(D) | Set the dictionary matrix. |
| setBRGNRegularizerHessian(hessian[, H, ...]) | Set the callback to compute the regularizer Hessian. |
| setBRGNRegularizerObjectiveGradient(objgrad) | Set the callback to compute the regularizer objective and gradient. |
| setBRGNRegularizerWeight(weight) | Set the regularizer weight. |
| setBRGNSmoothL1Epsilon(epsilon) | Set the smooth L1 epsilon. |
| setConstraintTolerances([catol, crtol]) | Set the constraints tolerance parameters used in the solver convergence tests. |
| setConstraints(constraints[, C, args, kargs]) | Set the callback to compute constraints. |
| setConvergedReason(reason) | Set the termination flag. |
| setConvergenceTest(converged[, args, kargs]) | Set the callback used to test for solver convergence. |
| setEqualityConstraints(equality_constraints, c) | Set equality constraints callback. |
| setFromOptions() | Configure the solver from the options database. |
| setGradient(gradient[, g, args, kargs]) | Set the gradient evaluation callback. |
| setGradientNorm(mat) | Set the matrix used to compute inner products. |
| setHessian(hessian[, H, P, args, kargs]) | Set the callback to compute the Hessian matrix. |
| setInitialTrustRegionRadius(radius) | Set the initial trust region radius. |
| setIterationNumber(its) | Set the current iteration number. |
| setJacobian(jacobian[, J, P, args, kargs]) | Set the callback to compute the Jacobian. |
| setJacobianDesign(jacobian_design[, J, ...]) | Set Jacobian design callback. |
| setJacobianEquality(jacobian_equality[, J, ...]) | Set Jacobian equality constraints callback. |
| setJacobianResidual(jacobian[, J, P, args, ...]) | Set the callback to compute the least-squares residual Jacobian. |
| setJacobianState(jacobian_state[, J, P, I, ...]) | Set Jacobian state callback. |
| setLMVMH0(mat) | Set the initial Hessian for the quasi-Newton approximation. |
| setMaximumFunctionEvaluations(mit) | Set the maximum number of objective evaluations within the solver. |
| setMaximumIterations(mit) | Set the maximum number of solver iterations. |
| setMonitor(monitor[, args, kargs]) | Set the callback used to monitor solver convergence. |
| setObjective(objective[, args, kargs]) | Set the objective function evaluation callback. |
| setObjectiveGradient(objgrad[, g, args, kargs]) | Set the objective function and gradient evaluation callback. |
| setOptionsPrefix(prefix) | Set the prefix used for searching for options in the database. |
| setPythonContext(context) | Set the instance of the class implementing the required Python methods. |
| setPythonType(py_type) | Set the fully qualified Python name of the class to be used. |
| setResidual(residual, R[, args, kargs]) | Set the residual evaluation callback for least-squares applications. |
| setSolution(x) | Set the vector used to store the solution. |
| setStateDesignIS([state, design]) | Set the index sets indicating state and design variables. |
| setTolerances([gatol, grtol, gttol]) | Set the tolerance parameters used in the solver convergence tests. |
| setType(tao_type) | Set the type of the solver. |
| setUp() | Set up the internal data structures for using the solver. |
| setUpdate(update[, args, kargs]) | Set the callback to compute update at each optimization step. |
| setVariableBounds(varbounds[, args, kargs]) | Set the upper and lower bounds for the optimization problem. |
| solve([x]) | Solve the optimization problem. |
| view([viewer]) | View the solver. |
Attributes Summary
| appctx | Application context. |
| cnorm | Constraints norm. |
| converged | Boolean indicating if the solver has converged. |
| ctol | Broken. |
| diverged | Boolean indicating if the solver has failed. |
| ftol | Broken. |
| function | Objective value. |
| gnorm | Gradient norm. |
| gradient | Gradient vector. |
| gtol | Broken. |
| iterating | Boolean indicating if the solver has not converged yet. |
| its | Number of iterations. |
| ksp | Linear solver. |
| objective | Objective value. |
| reason | Converged reason. |
| solution | Solution vector. |
Methods Documentation
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:213
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1220
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:887
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:851
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:810
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:906
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:929
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:772
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:829
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:791
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:863
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:145
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1662
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:132
Source code at petsc4py/PETSc/TAO.pyx:286
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1416
Not collective.
Source code at petsc4py/PETSc/TAO.pyx:1647
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1564
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1091
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1165
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1140
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:416
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1331
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:578
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1443
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1547
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1358
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1373
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1744
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1051
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1024
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1208
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:462
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1457
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:227
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1699
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1729
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1304
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1487
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1512
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:987
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:185
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:758
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1388
Collective.
This function should be called without arguments, unless users want to modify the values internally stored by the solver.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1234
Source code at petsc4py/PETSc/TAO.pyx:282
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1403
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1635
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1595
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1579
Collective.
Source code at petsc4py/PETSc/TAO.pyx:1613
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1622
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1065
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:514
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1152
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1112
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:689
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:241
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:387
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1319
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:543
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:267
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1430
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:596
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:669
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:707
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:354
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:645
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1346
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1038
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1011
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1179
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:302
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:432
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:199
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1687
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1714
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:327
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:290
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:630
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:954
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:166
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:253
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:729
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:478
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1285
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:113
Attributes Documentation
Source code at petsc4py/PETSc/TAO.pyx:1765
Source code at petsc4py/PETSc/TAO.pyx:1834
Source code at petsc4py/PETSc/TAO.pyx:1871
Source code at petsc4py/PETSc/TAO.pyx:1809
Source code at petsc4py/PETSc/TAO.pyx:1876
Source code at petsc4py/PETSc/TAO.pyx:1783
Source code at petsc4py/PETSc/TAO.pyx:1849
Source code at petsc4py/PETSc/TAO.pyx:1829
Source code at petsc4py/PETSc/TAO.pyx:1854
Source code at petsc4py/PETSc/TAO.pyx:1796
Source code at petsc4py/PETSc/TAO.pyx:1866
Source code at petsc4py/PETSc/TAO.pyx:1824
Source code at petsc4py/PETSc/TAO.pyx:1775
Source code at petsc4py/PETSc/TAO.pyx:1844
Source code at petsc4py/PETSc/TAO.pyx:1861
Source code at petsc4py/PETSc/TAO.pyx:1839
TAO Line Search.
Enumerations
| ConvergedReason | TAO Line Search Termination Reasons. |
| Type | TAO Line Search Types. |
TAO Line Search Termination Reasons.
Attributes Summary
| CONTINUE_SEARCH | Constant CONTINUE_SEARCH of type int |
| FAILED_ASCENT | Constant FAILED_ASCENT of type int |
| FAILED_BADPARAMETER | Constant FAILED_BADPARAMETER of type int |
| FAILED_INFORNAN | Constant FAILED_INFORNAN of type int |
| HALTED_LOWERBOUND | Constant HALTED_LOWERBOUND of type int |
| HALTED_MAXFCN | Constant HALTED_MAXFCN of type int |
| HALTED_OTHER | Constant HALTED_OTHER of type int |
| HALTED_RTOL | Constant HALTED_RTOL of type int |
| HALTED_UPPERBOUND | Constant HALTED_UPPERBOUND of type int |
| HALTED_USER | Constant HALTED_USER of type int |
| SUCCESS | Constant SUCCESS of type int |
| SUCCESS_USER | Constant SUCCESS_USER of type int |
Attributes Documentation
TAO Line Search Types.
Attributes Summary
| ARMIJO | Object ARMIJO of type str |
| GPCG | Object GPCG of type str |
| IPM | Object IPM of type str |
| MORETHUENTE | Object MORETHUENTE of type str |
| OWARMIJO | Object OWARMIJO of type str |
| UNIT | Object UNIT of type str |
Attributes Documentation
Methods Summary
| apply(x, g, s) | Performs a line-search in a given step direction. |
| create([comm]) | Create a TAO linesearch. |
| destroy() | Destroy the linesearch object. |
| getOptionsPrefix() | Return the prefix used for searching for options in the database. |
| getType() | Return the type of the linesearch. |
| setFromOptions() | Configure the linesearch from the options database. |
| setGradient(gradient[, args, kargs]) | Set the gradient evaluation callback. |
| setObjective(objective[, args, kargs]) | Set the objective function evaluation callback. |
| setObjectiveGradient(objgrad[, args, kargs]) | Set the objective function and gradient evaluation callback. |
| setOptionsPrefix([prefix]) | Set the prefix used for searching for options in the database. |
| setType(ls_type) | Set the type of the linesearch. |
| setUp() | Set up the internal data structures for using the linesearch. |
| useTAORoutine(tao) | Use the objective and gradient evaluation routines from the given Tao object. |
| view([viewer]) | View the linesearch object. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:2161
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1964
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1951
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:2056
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:2004
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:2018
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:2095
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:2070
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:2122
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:2042
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1985
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:2030
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:2149
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TAO.pyx:1932
ODE integrator.
TS is described in the PETSc manual.
SEE ALSO:
Enumerations
| ARKIMEXType | The ARKIMEX subtype. |
| ConvergedReason | The reason the time step is converging. |
| DIRKType | The DIRK subtype. |
| EquationType | Distinguishes among types of explicit and implicit equations. |
| ExactFinalTime | The method for ending time stepping. |
| ProblemType | Distinguishes linear and nonlinear problems. |
| RKType | The RK subtype. |
| Type | The time stepping method. |
The ARKIMEX subtype.
Attributes Summary
| ARKIMEX1BEE | Object ARKIMEX1BEE of type str |
| ARKIMEX2C | Object ARKIMEX2C of type str |
| ARKIMEX2D | Object ARKIMEX2D of type str |
| ARKIMEX2E | Object ARKIMEX2E of type str |
| ARKIMEX3 | Object ARKIMEX3 of type str |
| ARKIMEX4 | Object ARKIMEX4 of type str |
| ARKIMEX5 | Object ARKIMEX5 of type str |
| ARKIMEXA2 | Object ARKIMEXA2 of type str |
| ARKIMEXARS122 | Object ARKIMEXARS122 of type str |
| ARKIMEXARS443 | Object ARKIMEXARS443 of type str |
| ARKIMEXBPR3 | Object ARKIMEXBPR3 of type str |
| ARKIMEXL2 | Object ARKIMEXL2 of type str |
| ARKIMEXPRSSP2 | Object ARKIMEXPRSSP2 of type str |
Attributes Documentation
The reason the time step is converging.
Attributes Summary
| CONVERGED_EVENT | Constant CONVERGED_EVENT of type int |
| CONVERGED_ITERATING | Constant CONVERGED_ITERATING of type int |
| CONVERGED_ITS | Constant CONVERGED_ITS of type int |
| CONVERGED_TIME | Constant CONVERGED_TIME of type int |
| CONVERGED_USER | Constant CONVERGED_USER of type int |
| DIVERGED_NONLINEAR_SOLVE | Constant DIVERGED_NONLINEAR_SOLVE of type int |
| DIVERGED_STEP_REJECTED | Constant DIVERGED_STEP_REJECTED of type int |
| ITERATING | Constant ITERATING of type int |
Attributes Documentation
The DIRK subtype.
Attributes Summary
| DIRK657A | Object DIRK657A of type str |
| DIRK658A | Object DIRK658A of type str |
| DIRK7510SAL | Object DIRK7510SAL of type str |
| DIRK759A | Object DIRK759A of type str |
| DIRK8614A | Object DIRK8614A of type str |
| DIRK8616SAL | Object DIRK8616SAL of type str |
| DIRKES122SAL | Object DIRKES122SAL of type str |
| DIRKES213SAL | Object DIRKES213SAL of type str |
| DIRKES324SAL | Object DIRKES324SAL of type str |
| DIRKES325SAL | Object DIRKES325SAL of type str |
| DIRKES648SA | Object DIRKES648SA of type str |
| DIRKES7510SA | Object DIRKES7510SA of type str |
| DIRKES8516SAL | Object DIRKES8516SAL of type str |
| DIRKS212 | Object DIRKS212 of type str |
| DIRKS659A | Object DIRKS659A of type str |
| DIRKS7511SAL | Object DIRKS7511SAL of type str |
Attributes Documentation
Distinguishes among types of explicit and implicit equations.
Attributes Summary
| DAE_IMPLICIT_INDEX1 | Constant DAE_IMPLICIT_INDEX1 of type int |
| DAE_IMPLICIT_INDEX2 | Constant DAE_IMPLICIT_INDEX2 of type int |
| DAE_IMPLICIT_INDEX3 | Constant DAE_IMPLICIT_INDEX3 of type int |
| DAE_IMPLICIT_INDEXHI | Constant DAE_IMPLICIT_INDEXHI of type int |
| DAE_SEMI_EXPLICIT_INDEX1 | Constant DAE_SEMI_EXPLICIT_INDEX1 of type int |
| DAE_SEMI_EXPLICIT_INDEX2 | Constant DAE_SEMI_EXPLICIT_INDEX2 of type int |
| DAE_SEMI_EXPLICIT_INDEX3 | Constant DAE_SEMI_EXPLICIT_INDEX3 of type int |
| DAE_SEMI_EXPLICIT_INDEXHI | Constant DAE_SEMI_EXPLICIT_INDEXHI of type int |
| EXPLICIT | Constant EXPLICIT of type int |
| IMPLICIT | Constant IMPLICIT of type int |
| ODE_EXPLICIT | Constant ODE_EXPLICIT of type int |
| ODE_IMPLICIT | Constant ODE_IMPLICIT of type int |
| UNSPECIFIED | Constant UNSPECIFIED of type int |
Attributes Documentation
The method for ending time stepping.
Attributes Summary
| INTERPOLATE | Constant INTERPOLATE of type int |
| MATCHSTEP | Constant MATCHSTEP of type int |
| STEPOVER | Constant STEPOVER of type int |
| UNSPECIFIED | Constant UNSPECIFIED of type int |
Attributes Documentation
Distinguishes linear and nonlinear problems.
Attributes Summary
| LINEAR | Constant LINEAR of type int |
| NONLINEAR | Constant NONLINEAR of type int |
Attributes Documentation
The RK subtype.
Attributes Summary
| RK1FE | Object RK1FE of type str |
| RK2A | Object RK2A of type str |
| RK2B | Object RK2B of type str |
| RK3 | Object RK3 of type str |
| RK3BS | Object RK3BS of type str |
| RK4 | Object RK4 of type str |
| RK5BS | Object RK5BS of type str |
| RK5DP | Object RK5DP of type str |
| RK5F | Object RK5F of type str |
| RK6VR | Object RK6VR of type str |
| RK7VR | Object RK7VR of type str |
| RK8VR | Object RK8VR of type str |
Attributes Documentation
The time stepping method.
Attributes Summary
| ALPHA | Object ALPHA of type str |
| ALPHA2 | Object ALPHA2 of type str |
| ARKIMEX | Object ARKIMEX of type str |
| BASICSYMPLECTIC | Object BASICSYMPLECTIC of type str |
| BDF | Object BDF of type str |
| BE | Object BE of type str |
| BEULER | Object BEULER of type str |
| CN | Object CN of type str |
| CRANK_NICOLSON | Object CRANK_NICOLSON of type str |
| DIRK | Object DIRK of type str |
| DISCGRAD | Object DISCGRAD of type str |
| EIMEX | Object EIMEX of type str |
| EULER | Object EULER of type str |
| FE | Object FE of type str |
| GLEE | Object GLEE of type str |
| GLLE | Object GLLE of type str |
| MIMEX | Object MIMEX of type str |
| MPRK | Object MPRK of type str |
| PSEUDO | Object PSEUDO of type str |
| PYTHON | Object PYTHON of type str |
| RADAU5 | Object RADAU5 of type str |
| RK | Object RK of type str |
| ROSW | Object ROSW of type str |
| RUNGE_KUTTA | Object RUNGE_KUTTA of type str |
| SSP | Object SSP of type str |
| SUNDIALS | Object SUNDIALS of type str |
| TH | Object TH of type str |
| THETA | Object THETA of type str |
Attributes Documentation
Methods Summary
| adjointReset() | Reset a TS, removing any allocated vectors and matrices. |
| adjointSetSteps(adjoint_steps) | Set the number of steps the adjoint solver should take backward in time. |
| adjointSetUp() | Set up the internal data structures for the later use of an adjoint solver. |
| adjointSolve() | Solve the discrete adjoint problem for an ODE/DAE. |
| adjointStep() | Step one time step backward in the adjoint run. |
| appendOptionsPrefix(prefix) | Append to the prefix used for all the TS options. |
| clone() | Return a shallow clone of the TS object. |
| computeI2Function(t, x, xdot, xdotdot, f) | Evaluate the DAE residual in implicit form. |
| computeI2Jacobian(t, x, xdot, xdotdot, v, a, J) | Evaluate the Jacobian of the DAE. |
| computeIFunction(t, x, xdot, f[, imex]) | Evaluate the DAE residual written in implicit form. |
| computeIJacobian(t, x, xdot, a, J[, P, imex]) | Evaluate the Jacobian of the DAE. |
| computeIJacobianP(t, x, xdot, a, J[, imex]) | Evaluate the Jacobian with respect to parameters. |
| computeRHSFunction(t, x, f) | Evaluate the right-hand side function. |
| computeRHSFunctionLinear(t, x, f) | Evaluate the right-hand side via the user-provided Jacobian. |
| computeRHSJacobian(t, x, J[, P]) | Compute the Jacobian matrix that has been set with setRHSJacobian. |
| computeRHSJacobianConstant(t, x, J[, P]) | Reuse a Jacobian that is time-independent. |
| computeRHSJacobianP(t, x, J) | Run the user-defined JacobianP function. |
| create([comm]) | Create an empty TS. |
| createPython([context, comm]) | Create an integrator of Python type. |
| createQuadratureTS([forward]) | Create a sub TS that evaluates integrals over time. |
| destroy() | Destroy the TS that was created with create. |
| getARKIMEXType() | Return the Type.ARKIMEX scheme. |
| getAlphaParams() | Return the algorithmic parameters for Type.ALPHA. |
| getAppCtx() | Return the application context. |
| getConvergedReason() | Return the reason the TS step was stopped. |
| getCostGradients() | Return the cost gradients. |
| getCostIntegral() | Return a vector of values of the integral term in the cost functions. |
| getDIRKType() | Return the Type.DIRK scheme. |
| getDM() | Return the DM associated with the TS. |
| getEquationType() | Get the type of the equation that TS is solving. |
| getI2Function() | Return the vector and function which computes the residual. |
| getI2Jacobian() | Return the matrices and function which computes the Jacobian. |
| getIFunction() | Return the vector and function which computes the implicit residual. |
| getIJacobian() | Return the matrices and function which computes the implicit Jacobian. |
| getKSP() | Return the KSP associated with the TS. |
| getKSPIterations() | Return the total number of linear iterations used by the TS. |
| getMaxSteps() | Return the maximum number of steps to use. |
| getMaxTime() | Return the maximum (final) time. |
| getMonitor() | Return the monitor. |
| getNumEvents() | Return the number of events. |
| getOptionsPrefix() | Return the prefix used for all the TS options. |
| getPostStep() | Return the poststep function. |
| getPreStep() | Return the prestep function. |
| getPrevTime() | Return the starting time of the previously completed step. |
| getProblemType() | Return the type of problem to be solved. |
| getPythonContext() | Return the instance of the class implementing the required Python methods. |
| getPythonType() | Return the fully qualified Python name of the class used by the solver. |
| getQuadratureTS() | Return the sub TS that evaluates integrals over time. |
| getRHSFunction() | Return the vector where the rhs is stored and the function used to compute it. |
| getRHSJacobian() | Return the Jacobian and the function used to compute them. |
| getRKType() | Return the Type.RK scheme. |
| getSNES() | Return the SNES associated with the TS. |
| getSNESFailures() | Return the total number of failed SNES solves in the TS. |
| getSNESIterations() | Return the total number of nonlinear iterations used by the TS. |
| getSolution() | Return the solution at the present timestep. |
| getSolution2() | Return the solution and time derivative at the present timestep. |
| getSolveTime() | Return the time after a call to solve. |
| getStepLimits() | Return the minimum and maximum allowed time step sizes. |
| getStepNumber() | Return the number of time steps completed. |
| getStepRejections() | Return the total number of rejected steps. |
| getTheta() | Return the abscissa of the stage in (0, 1] for Type.THETA. |
| getThetaEndpoint() | Return whether the endpoint variable of Type.THETA is used. |
| getTime() | Return the time of the most recently completed step. |
| getTimeSpan() | Return the time span. |
| getTimeSpanSolutions() | Return the solutions at the times in the time span. |
| getTimeStep() | Return the duration of the current timestep. |
| getTolerances() | Return the tolerances for local truncation error. |
| getType() | Return the TS type. |
| interpolate(t, u) | Interpolate the solution to a given time. |
| load(viewer) | Load a TS that has been stored in binary with view. |
| monitor(step, time[, u]) | Monitor the solve. |
| monitorCancel() | Clear all the monitors that have been set. |
| removeTrajectory() | Remove the internal TS trajectory object. |
| reset() | Reset the TS, removing any allocated vectors and matrices. |
| restartStep() | Flag the solver to restart the next step. |
| rollBack() | Roll back one time step. |
| setARKIMEXFastSlowSplit(flag) | Use ARKIMEX for solving a fast-slow system. |
| setARKIMEXFullyImplicit(flag) | Solve both parts of the equation implicitly. |
| setARKIMEXType(ts_type) | Set the type of Type.ARKIMEX scheme. |
| setAlphaParams([alpha_m, alpha_f, gamma]) | Set the algorithmic parameters for Type.ALPHA. |
| setAlphaRadius(radius) | Set the spectral radius for Type.ALPHA. |
| setAppCtx(appctx) | Set the application context. |
| setConvergedReason(reason) | Set the reason for handling the convergence of solve. |
| setCostGradients(vl[, vm]) | Set the cost gradients. |
| setDIRKType(ts_type) | Set the type of Type.DIRK scheme. |
| setDM(dm) | Set the DM that may be used by some nonlinear solvers or preconditioners. |
| setEquationType(eqtype) | Set the type of the equation that TS is solving. |
| setErrorIfStepFails([flag]) | Immediately error is no step succeeds. |
| setEventHandler(direction, terminate, indicator) | Set a function used for detecting events. |
| setEventTolerances([tol, vtol]) | Set tolerances for event zero crossings when using event handler. |
| setExactFinalTime(option) | Set method of computing the final time step. |
| setFromOptions() | Set various TS parameters from user options. |
| setI2Function(function[, f, args, kargs]) | Set the function to compute the 2nd order DAE. |
| setI2Jacobian(jacobian[, J, P, args, kargs]) | Set the function to compute the Jacobian of the 2nd order DAE. |
| setIFunction(function[, f, args, kargs]) | Set the function representing the DAE to be solved. |
| setIJacobian(jacobian[, J, P, args, kargs]) | Set the function to compute the Jacobian. |
| setIJacobianP(jacobian[, J, args, kargs]) | Set the function that computes the Jacobian. |
| setMaxSNESFailures(n) | Set the maximum number of SNES solves failures allowed. |
| setMaxStepRejections(n) | Set the maximum number of step rejections before a time step fails. |
| setMaxSteps(max_steps) | Set the maximum number of steps to use. |
| setMaxTime(max_time) | Set the maximum (final) time. |
| setMonitor(monitor[, args, kargs]) | Set an additional monitor to the TS. |
| setOptionsPrefix(prefix) | Set the prefix used for all the TS options. |
| setPostStep(poststep[, args, kargs]) | Set a function to be called at the end of each time step. |
| setPreStep(prestep[, args, kargs]) | Set a function to be called at the beginning of each time step. |
| setProblemType(ptype) | Set the type of problem to be solved. |
| setPythonContext(context) | Set the instance of the class implementing the required Python methods. |
| setPythonType(py_type) | Set the fully qualified Python name of the class to be used. |
| setRHSFunction(function[, f, args, kargs]) | Set the routine for evaluating the function G in U_t = G(t, u). |
| setRHSJacobian(jacobian[, J, P, args, kargs]) | Set the function to compute the Jacobian of G in U_t = G(U, t). |
| setRHSJacobianP(jacobianp[, A, args, kargs]) | Set the function that computes the Jacobian with respect to the parameters. |
| setRHSSplitIFunction(splitname, function[, ...]) | Set the split implicit functions. |
| setRHSSplitIJacobian(splitname, jacobian[, ...]) | Set the Jacobian for the split implicit function. |
| setRHSSplitIS(splitname, iss) | Set the index set for the specified split. |
| setRHSSplitRHSFunction(splitname, function) | Set the split right-hand-side functions. |
| setRKType(ts_type) | Set the type of the Runge-Kutta scheme. |
| setSaveTrajectory() | Enable to save solutions as an internal TS trajectory. |
| setSolution(u) | Set the initial solution vector. |
| setSolution2(u, v) | Set the initial solution and its time derivative. |
| setStepLimits(hmin, hmax) | Set the minimum and maximum allowed step sizes. |
| setStepNumber(step_number) | Set the number of steps completed. |
| setTheta(theta) | Set the abscissa of the stage in (0, 1] for Type.THETA. |
| setThetaEndpoint([flag]) | Set to use the endpoint variant of Type.THETA. |
| setTime(t) | Set the time. |
| setTimeSpan(tspan) | Set the time span. |
| setTimeStep(time_step) | Set the duration of the timestep. |
| setTolerances([rtol, atol]) | Set tolerances for local truncation error when using an adaptive controller. |
| setType(ts_type) | Set the method to be used as the TS solver. |
| setUp() | Set up the internal data structures for the TS. |
| solve([u]) | Step the requested number of timesteps. |
| step() | Take one step. |
| view([viewer]) | Print the TS object. |
Attributes Summary
| appctx | Application context. |
| atol | The absolute tolerance. |
| converged | Indicates the TS has converged. |
| diverged | Indicates the TS has stopped. |
| dm | The DM. |
| equation_type | The equation type. |
| iterating | Indicates the TS is still iterating. |
| ksp | The KSP. |
| max_steps | The maximum number of steps. |
| max_time | The maximum time. |
| problem_type | The problem type. |
| reason | The converged reason. |
| rtol | The relative tolerance. |
| snes | The SNES. |
| step_number | The current step number. |
| time | The current time. |
| time_step | The current time step size. |
| vec_sol | The solution vector. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2849
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2795
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2813
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2825
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2837
Logically collective.
Notes
A hyphen must not be given at the beginning of the prefix name.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:539
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:243
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1142
Collective.
If F(t, U, V, A)=0 is the DAE, the required Jacobian is dF/dU + v dF/dV + a dF/dA.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1169
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:927
Collective.
If F(t, U, Udot)=0 is the DAE, the required Jacobian is dF/dU + shift*dF/dUdot
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:957
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:997
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:674
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:696
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:718
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:744
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2773
Collective.
The problem type can then be set with setProblemType and the type of solver can then be set with setType.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:219
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2863
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2692
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:206
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:389
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:3070
Source code at petsc4py/PETSc/TS.pyx:589
Not collective.
Can only be called once solve is complete.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2090
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2634
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2573
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:426
Not collective.
Only valid if nonlinear solvers or preconditioners are used which use the DM.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1589
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:488
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1218
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1234
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1031
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1047
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1572
Not collective.
This counter is reset to zero for each successive call to solve.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1857
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1826
Not collective.
Defaults to 5.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1790
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2142
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2289
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:525
Source code at petsc4py/PETSc/TS.pyx:2382
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2338
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1664
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:457
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2900
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2929
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2713
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:770
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:786
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:375
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1557
Not collective.
This counter is reset to zero for each successive call to solve.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1931
Not collective.
This counter is reset to zero for each successive call to solve.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1840
Not collective.
It is valid to call this routine inside the function that you are evaluating in order to move to the new timestep. This vector is not changed until the solution at the next timestep has been calculated.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1428
Not collective.
It is valid to call this routine inside the function that you are evaluating in order to move to the new timestep. These vectors are not changed until the solution at the next timestep has been calculated.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1466
Not collective.
This time corresponds to the final time set with setMaxTime.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1678
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2523
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1754
Not collective.
This counter is reset to zero for each successive call to solve.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1896
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2967
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2999
Not collective.
When called during time step evaluation (e.g. during residual evaluation or via hooks set using setPreStep or setPostStep), the time returned is at the start of the step.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1646
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1521
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1537
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1713
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2013
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:361
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2480
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:189
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2169
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2154
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2561
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2398
Collective.
Multistep methods like TSBDF or Runge-Kutta methods with FSAL property require restarting the solver in the event of discontinuities. These discontinuities may be introduced as a consequence of explicitly modifications to the solution vector (which PETSc attempts to detect and handle) or problem coefficients (which PETSc is not able to detect). For the sake of correctness and maximum safety, users are expected to call TSRestart() whenever they introduce discontinuities in callback routines (e.g. prestep and poststep routines, or implicit/rhs function routines with discontinuous source terms).
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2426
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2449
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:344
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:326
Logically collective.
Notes
-ts_arkimex_type sets scheme type from the commandline.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:303
Logically collective.
Users should call setAlphaRadius.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:3037
Logically collective.
Notes
-ts_alpha_radius can be used to set this from the commandline.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:3015
Not collective.
Source code at petsc4py/PETSc/TS.pyx:576
Logically collective.
Can only be called when solve is active and reason must contain common value.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2069
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2588
Logically collective.
Notes
-ts_dirk_type sets scheme type from the commandline.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:403
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1609
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:471
Not collective.
Notes
-ts_error_if_step_fails to enable from the commandline.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1948
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2198
Logically collective.
setEventHandler must have already been called.
Notes
-ts_event_tol can be used to set values from the commandline.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2253
Logically collective.
Notes
-ts_exact_final_time may be used to specify from the commandline.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2047
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:562
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1063
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1100
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:804
Logically collective.
Set the function to compute the matrix dF/dU + a*dF/dU_t where F(t, U, U_t) is the function provided with setIFunction.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:841
Logically collective.
Set the function that computes the Jacobian of F with respect to the parameters P where F(Udot, U, t) = G(U, P, t), as well as the location to store the matrix.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:886
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1913
Not collective.
Notes
-ts_max_reject can be used to set this from the commandline
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1874
Logically collective.
Defaults to 5000.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1806
Logically collective.
Notes
-ts_max_time sets the max time from the commandline
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1768
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2108
Logically collective.
Notes
A hyphen must not be given at the beginning of the prefix name.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:502
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2350
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2305
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:440
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2888
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2915
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:595
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:632
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2655
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1316
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1360
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1251
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1272
Logically collective.
Notes
-ts_rk_type sets scheme type from the commandline.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:280
Collective.
This routine should be called after all TS options have been set.
Notes
-ts_save_trajectory can be used to save a trajectory to a file.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2542
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1411
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1447
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2500
Logically collective.
For most uses of the TS solvers the user need not explicitly call setStepNumber, as the step counter is appropriately updated in solve/step/rollBack. Power users may call this routine to reinitialize timestepping by setting the step counter to zero (and time to the initial time) to solve a similar problem with different initial conditions or parameters. It may also be used to continue timestepping from a previously interrupted run in such a way that TS monitors will be called with a initial nonzero step counter.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1727
Logically collective.
Notes
-ts_theta_theta can be used to set a value from the commandline.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2945
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2981
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1628
Collective.
The solution will be computed and stored for each time requested in the span. The times must be all increasing and correspond to the intermediate points for time integration. ExactFinalTime.MATCHSTEP must be used to make the last time step in each sub-interval match the intermediate points specified. The intermediate solutions are saved in a vector array that can be accessed with getTimeSpanSolutions.
Notes
-ts_time_span <t0, ..., tf> sets the time span from the commandline
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1489
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1695
Logically collective.
Notes
-ts_rtol and -ts_atol may be used to set values from the commandline.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:1970
Collective.
Notes
-ts_type sets the method from the commandline
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:257
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2386
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2461
Collective.
The preferred interface for the TS solvers is solve. If you need to execute code at the beginning or ending of each step, use setPreStep and setPostStep respectively.
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:2410
Collective.
Notes
-ts_view calls TSView at the end of TSStep
SEE ALSO:
Source code at petsc4py/PETSc/TS.pyx:166
Attributes Documentation
Source code at petsc4py/PETSc/TS.pyx:3086
Source code at petsc4py/PETSc/TS.pyx:3189
Source code at petsc4py/PETSc/TS.pyx:3210
Source code at petsc4py/PETSc/TS.pyx:3215
Source code at petsc4py/PETSc/TS.pyx:3096
Source code at petsc4py/PETSc/TS.pyx:3114
Source code at petsc4py/PETSc/TS.pyx:3205
Source code at petsc4py/PETSc/TS.pyx:3127
Source code at petsc4py/PETSc/TS.pyx:3171
Source code at petsc4py/PETSc/TS.pyx:3163
Source code at petsc4py/PETSc/TS.pyx:3106
Source code at petsc4py/PETSc/TS.pyx:3197
Source code at petsc4py/PETSc/TS.pyx:3181
Source code at petsc4py/PETSc/TS.pyx:3122
Source code at petsc4py/PETSc/TS.pyx:3155
Source code at petsc4py/PETSc/TS.pyx:3139
Source code at petsc4py/PETSc/TS.pyx:3147
Source code at petsc4py/PETSc/TS.pyx:3132
A vector object.
SEE ALSO:
Enumerations
| Option | Vector assembly option. |
| Type | The vector type. |
Vector assembly option.
Attributes Summary
| IGNORE_NEGATIVE_INDICES | Constant IGNORE_NEGATIVE_INDICES of type int |
| IGNORE_OFF_PROC_ENTRIES | Constant IGNORE_OFF_PROC_ENTRIES of type int |
Attributes Documentation
The vector type.
Attributes Summary
| CUDA | Object CUDA of type str |
| HIP | Object HIP of type str |
| KOKKOS | Object KOKKOS of type str |
| MPI | Object MPI of type str |
| MPICUDA | Object MPICUDA of type str |
| MPIHIP | Object MPIHIP of type str |
| MPIKOKKOS | Object MPIKOKKOS of type str |
| MPIVIENNACL | Object MPIVIENNACL of type str |
| NEST | Object NEST of type str |
| SEQ | Object SEQ of type str |
| SEQCUDA | Object SEQCUDA of type str |
| SEQHIP | Object SEQHIP of type str |
| SEQKOKKOS | Object SEQKOKKOS of type str |
| SEQVIENNACL | Object SEQVIENNACL of type str |
| SHARED | Object SHARED of type str |
| STANDARD | Object STANDARD of type str |
| VIENNACL | Object VIENNACL of type str |
Attributes Documentation
Methods Summary
| abs() | Replace each entry (xₙ) in the vector by abs|xₙ|. |
| appendOptionsPrefix(prefix) | Append to the prefix used for searching for options in the database. |
| assemble() | Assemble the vector. |
| assemblyBegin() | Begin an assembling stage of the vector. |
| assemblyEnd() | Finish the assembling stage initiated with assemblyBegin. |
| attachDLPackInfo([vec, dltensor]) | Attach tensor information from another vector or DLPack tensor. |
| axpby(alpha, beta, x) | Compute and store y = ɑ·x + β·y. |
| axpy(alpha, x) | Compute and store y = ɑ·x + y. |
| aypx(alpha, x) | Compute and store y = x + ɑ·y. |
| bindToCPU(flg) | Bind vector operations execution on the CPU. |
| boundToCPU() | Return whether the vector has been bound to the CPU. |
| chop(tol) | Set all vector entries less than some absolute tolerance to zero. |
| clearDLPackInfo() | Clear tensor information. |
| concatenate(vecs) | Concatenate vectors into a single vector. |
| conjugate() | Conjugate the vector. |
| copy([result]) | Return a copy of the vector. |
| create([comm]) | Create a vector object. |
| createCUDAWithArrays([cpuarray, cudahandle, ...]) | Create a Type.CUDA vector with optional arrays. |
| createGhost(ghosts, size[, bsize, comm]) | Create a parallel vector with ghost padding on each processor. |
| createGhostWithArray(ghosts, array[, size, ...]) | Create a parallel vector with ghost padding and provided arrays. |
| createHIPWithArrays([cpuarray, hiphandle, ...]) | Create a Type.HIP vector with optional arrays. |
| createLocalVector() | Create a local vector. |
| createMPI(size[, bsize, comm]) | Create a parallel Type.MPI vector. |
| createNest(vecs[, isets, comm]) | Create a Type.NEST vector containing multiple nested subvectors. |
| createSeq(size[, bsize, comm]) | Create a sequential Type.SEQ vector. |
| createShared(size[, bsize, comm]) | Create a Type.SHARED vector that uses shared memory. |
| createViennaCLWithArrays([cpuarray, ...]) | Create a Type.VIENNACL vector with optional arrays. |
| createWithArray(array[, size, bsize, comm]) | Create a vector using a provided array. |
| createWithDLPack(dltensor[, size, bsize, comm]) | Create a vector wrapping a DLPack object, sharing the same memory. |
| destroy() | Destroy the vector. |
| dot(vec) | Return the dot product with vec. |
| dotBegin(vec) | Begin computing the dot product. |
| dotEnd(vec) | Finish computing the dot product initiated with dotBegin. |
| dotNorm2(vec) | Return the dot product with vec and its squared norm. |
| duplicate([array]) | Create a new vector with the same type, optionally with data. |
| equal(vec) | Return whether the vector is equal to another. |
| exp() | Replace each entry (xₙ) in the vector by exp(xₙ). |
| getArray([readonly]) | Return local portion of the vector as an ndarray. |
| getBlockSize() | Return the block size of the vector. |
| getBuffer([readonly]) | Return a buffered view of the local portion of the vector. |
| getCLContextHandle() | Return the OpenCL context associated with the vector. |
| getCLMemHandle([mode]) | Return the OpenCL buffer associated with the vector. |
| getCLQueueHandle() | Return the OpenCL command queue associated with the vector. |
| getCUDAHandle([mode]) | Return a pointer to the device buffer. |
| getDM() | Return the DM associated to the vector. |
| getGhostIS() | Return ghosting indices of a ghost vector. |
| getHIPHandle([mode]) | Return a pointer to the device buffer. |
| getLGMap() | Return the local-to-global mapping. |
| getLocalSize() | Return the local size of the vector. |
| getLocalVector(lvec[, readonly]) | Maps the local portion of the vector into a local vector. |
| getNestSubVecs() | Return all the vectors contained in the nested vector. |
| getOffloadMask() | Return the offloading status of the vector. |
| getOptionsPrefix() | Return the prefix used for searching for options in the database. |
| getOwnershipRange() | Return the locally owned range of indices (start, end). |
| getOwnershipRanges() | Return the range of indices owned by each process. |
| getSize() | Return the global size of the vector. |
| getSizes() | Return the vector sizes. |
| getSubVector(iset[, subvec]) | Return a subvector from given indices. |
| getType() | Return the type of the vector. |
| getValue(index) | Return a single value from the vector. |
| getValues(indices[, values]) | Return values from certain locations in the vector. |
| getValuesStagStencil(indices[, values]) | Not implemented. |
| ghostUpdate([addv, mode]) | Update ghosted vector entries. |
| ghostUpdateBegin([addv, mode]) | Begin updating ghosted vector entries. |
| ghostUpdateEnd([addv, mode]) | Finish updating ghosted vector entries initiated with ghostUpdateBegin. |
| isaxpy(idx, alpha, x) | Add a scaled reduced-space vector to a subset of the vector. |
| isset(idx, alpha) | Set specific elements of the vector to the same value. |
| load(viewer) | Load a vector. |
| localForm() | Return a context manager for viewing ghost vectors in local form. |
| log() | Replace each entry in the vector by its natural logarithm. |
| mDot(vecs[, out]) | Compute Xᴴ·y with X an array of vectors. |
| mDotBegin(vecs, out) | Starts a split phase multiple dot product computation. |
| mDotEnd(vecs, out) | Ends a split phase multiple dot product computation. |
| max() | Return the vector entry with maximum real part and its location. |
| maxPointwiseDivide(vec) | Return the maximum of the component-wise absolute value division. |
| maxpy(alphas, vecs) | Compute and store y = Σₙ(ɑₙ·Xₙ) + y with X an array of vectors. |
| min() | Return the vector entry with minimum real part and its location. |
| mtDot(vecs[, out]) | Compute Xᵀ·y with X an array of vectors. |
| mtDotBegin(vecs, out) | Starts a split phase transpose multiple dot product computation. |
| mtDotEnd(vecs, out) | Ends a split phase transpose multiple dot product computation. |
| norm([norm_type]) | Compute the vector norm. |
| normBegin([norm_type]) | Begin computing the vector norm. |
| normEnd([norm_type]) | Finish computations initiated with normBegin. |
| normalize() | Normalize the vector by its 2-norm. |
| permute(order[, invert]) | Permute the vector in-place with a provided ordering. |
| placeArray(array) | Set the local portion of the vector to a provided array. |
| pointwiseDivide(x, y) | Compute and store the component-wise division of two vectors. |
| pointwiseMax(x, y) | Compute and store the component-wise maximum of two vectors. |
| pointwiseMaxAbs(x, y) | Compute and store the component-wise maximum absolute values. |
| pointwiseMin(x, y) | Compute and store the component-wise minimum of two vectors. |
| pointwiseMult(x, y) | Compute and store the component-wise multiplication of two vectors. |
| reciprocal() | Replace each entry in the vector by its reciprocal. |
| resetArray([force]) | Reset the vector to use its default array. |
| restoreCLMemHandle() | Restore a pointer to the OpenCL buffer obtained with getCLMemHandle. |
| restoreCUDAHandle(handle[, mode]) | Restore a pointer to the device buffer obtained with getCUDAHandle. |
| restoreHIPHandle(handle[, mode]) | Restore a pointer to the device buffer obtained with getHIPHandle. |
| restoreLocalVector(lvec[, readonly]) | Unmap a local access obtained with getLocalVector. |
| restoreSubVector(iset, subvec) | Restore a subvector extracted using getSubVector. |
| scale(alpha) | Scale all entries of the vector. |
| set(alpha) | Set all components of the vector to the same value. |
| setArray(array) | Set values for the local portion of the vector. |
| setBlockSize(bsize) | Set the block size of the vector. |
| setDM(dm) | Associate a DM to the vector. |
| setFromOptions() | Configure the vector from the options database. |
| setLGMap(lgmap) | Set the local-to-global mapping. |
| setMPIGhost(ghosts) | Set the ghost points for a ghosted vector. |
| setNestSubVecs(sx[, idxm]) | Set the component vectors at specified indices in the nested vector. |
| setOption(option, flag) | Set option. |
| setOptionsPrefix(prefix) | Set the prefix used for searching for options in the database. |
| setRandom([random]) | Set all components of the vector to random numbers. |
| setSizes(size[, bsize]) | Set the local and global sizes of the vector. |
| setType(vec_type) | Set the vector type. |
| setUp() | Set up the internal data structures for using the vector. |
| setValue(index, value[, addv]) | Insert or add a single value in the vector. |
| setValueLocal(index, value[, addv]) | Insert or add a single value in the vector using a local numbering. |
| setValues(indices, values[, addv]) | Insert or add multiple values in the vector. |
| setValuesBlocked(indices, values[, addv]) | Insert or add blocks of values in the vector. |
| setValuesBlockedLocal(indices, values[, addv]) | Insert or add blocks of values in the vector with a local numbering. |
| setValuesLocal(indices, values[, addv]) | Insert or add multiple values in the vector with a local numbering. |
| setValuesStagStencil(indices, values[, addv]) | Not implemented. |
| shift(alpha) | Shift all entries in the vector. |
| sqrtabs() | Replace each entry (xₙ) in the vector by √|xₙ|. |
| strideGather(field, vec[, addv]) | Insert component values into a single-component vector. |
| strideMax(field) | Return the maximum of entries in a subvector. |
| strideMin(field) | Return the minimum of entries in a subvector. |
| strideNorm(field[, norm_type]) | Return the norm of entries in a subvector. |
| strideScale(field, alpha) | Scale a component of the vector. |
| strideScatter(field, vec[, addv]) | Scatter entries into a component of another vector. |
| strideSum(field) | Sum subvector entries. |
| sum() | Return the sum of all the entries of the vector. |
| swap(vec) | Swap the content of two vectors. |
| tDot(vec) | Return the indefinite dot product with vec. |
| tDotBegin(vec) | Begin computing the indefinite dot product. |
| tDotEnd(vec) | Finish computing the indefinite dot product initiated with tDotBegin. |
| toDLPack([mode]) | Return a DLPack PyCapsule wrapping the vector data. |
| view([viewer]) | Display the vector. |
| waxpy(alpha, x, y) | Compute and store w = ɑ·x + y. |
| zeroEntries() | Set all entries in the vector to zero. |
Attributes Summary
| array | Alias for array_w. |
| array_r | Read-only ndarray containing the local portion of the vector. |
| array_w | Writeable ndarray containing the local portion of the vector. |
| block_size | The block size. |
| buffer | Alias for buffer_w. |
| buffer_r | Read-only buffered view of the local portion of the vector. |
| buffer_w | Writeable buffered view of the local portion of the vector. |
| local_size | The local vector size. |
| owner_range | The locally owned range of indices in the form [low, high). |
| owner_ranges | The range of indices owned by each process. |
| size | The global vector size. |
| sizes | The local and global vector sizes. |
Methods Documentation
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2293
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1028
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3047
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3023
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3035
Logically collective.
This tensor information is required when converting a Vec to a DLPack object.
Notes
This operation does not copy any data from vec or dltensor.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:643
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2524
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2460
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2504
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1396
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1409
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1732
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:705
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3536
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2305
Logically collective.
This operation copies vector entries to the new vector.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1707
Collective.
After creation the vector type can then be set with setType.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:176
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:370
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:819
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:861
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:428
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1204
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:283
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:952
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:247
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:918
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:486
Collective.
This method will create either a Type.SEQ or Type.MPI depending on the size of the communicator.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:319
Collective.
This operation does not modify the storage of the original tensor and should be used with contiguous tensors only. If the tensor is stored in row-major order (e.g. PyTorch tensors), the resulting vector will look like an unrolled tensor using row-major order.
The resulting vector type will be one of Type.SEQ, Type.MPI, Type.SEQCUDA, Type.MPICUDA, Type.SEQHIP or Type.MPIHIP depending on the type of dltensor and the number of processes in the communicator.
Source code at petsc4py/PETSc/Vec.pyx:545
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:163
Collective.
For complex numbers this computes yᴴ·x with self as x, vec as y and where yᴴ denotes the conjugate transpose of y.
Use tDot for the indefinite form yᵀ·x where yᵀ denotes the transpose of y.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1787
Collective.
This should be paired with a call to dotEnd.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1812
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1832
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2151
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1682
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1768
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2257
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1313
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1149
Logically collective.
Examples
Accessing the data with a context manager:
>>> vec = PETSc.Vec().createWithArray([1, 2, 3]) >>> with vec.getBuffer() as arr: ... arr array([1., 2., 3.])
Converting the buffer to an ndarray:
>>> buf = PETSc.Vec().createWithArray([1, 2, 3]).getBuffer() >>> np.asarray(buf) array([1., 2., 3.])
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1270
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1593
Not collective.
Notes
This method may incur a host-to-device copy if the device data is out of date and mode is "r" or "rw".
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1633
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1613
Not collective.
The returned pointer should be released using restoreCUDAHandle with the same access mode.
Notes
This method may incur a host-to-device copy if the device data is out of date and mode is "r" or "rw".
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1423
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3519
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3385
Not collective.
The returned pointer should be released using restoreHIPHandle with the same access mode.
Notes
This method may incur a host-to-device copy if the device data is out of date and mode is "r" or "rw".
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1495
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2899
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1107
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1223
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3451
Not collective.
Common return values include:
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1567
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1014
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1163
Not collective.
The returned array is the result of exclusive scan of the local sizes.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1184
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1093
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1121
Collective.
Once finished with the subvector it should be returned with restoreSubVector.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3406
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1079
Not collective.
Only values locally stored may be accessed.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2720
Not collective.
Only values locally stored may be accessed.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2742
Source code at petsc4py/PETSc/Vec.pyx:2767
Neighborwise collective.
Examples
To accumulate ghost region values onto owning processes:
>>> vec.ghostUpdate(InsertMode.ADD_VALUES, ScatterMode.REVERSE)
Update ghost regions:
>>> vec.ghostUpdate(InsertMode.INSERT_VALUES, ScatterMode.FORWARD)
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3331
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3297
Neighborwise collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3314
Logically collective.
This is equivalent to y[idx[i]] += alpha*x[i].
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2480
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2383
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1750
Logically collective.
Notes
This operation does not perform a copy. To obtain up-to-date ghost values ghostUpdateBegin and ghostUpdateEnd must be called first.
Non-ghost values can be found at values[0:nlocal] and ghost values at values[nlocal:nlocal+nghost].
Examples
>>> with vec.localForm() as lf: ... # compute with lf
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3264
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2269
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1902
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1935
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1965
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2203
Logically collective.
Equivalent to result = max_i abs(x[i] / y[i]).
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2696
Logically collective.
Equivalent to y[:] = alphas[i]*vecs[i, :] + y[:].
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2569
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2180
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1996
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2029
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2059
Collective.
A 2-tuple is returned if NormType.NORM_1_AND_2 is specified.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2090
Collective.
This should be paired with a call to normEnd.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2112
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2131
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2226
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2337
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1345
Logically collective.
Equivalent to w[i] = x[i] / y[i].
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2618
Logically collective.
Equivalent to w[i] = max(x[i], y[i]).
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2658
Logically collective.
Equivalent to w[i] = max(abs(x[i]), abs(y[i])).
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2677
Logically collective.
Equivalent to w[i] = min(x[i], y[i]).
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2639
Logically collective.
Equivalent to w[i] = x[i] * y[i].
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2599
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2245
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1366
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1670
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1462
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1534
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1246
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3432
Collective.
This method sets each entry (xₙ) in the vector to ɑ·xₙ.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2403
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2370
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1333
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1136
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3507
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1042
Logically collective.
This allows users to insert vector entries using a local numbering with setValuesLocal.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2884
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3366
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3473
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1067
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1000
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2317
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:218
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:199
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1054
Not collective.
Notes
The values may be cached so assemblyBegin and assemblyEnd must be called after all calls of this method are completed.
Multiple calls to setValue cannot be made with different values for addv without intermediate calls to assemblyBegin and assemblyEnd.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2771
Not collective.
Notes
The values may be cached so assemblyBegin and assemblyEnd must be called after all calls of this method are completed.
Multiple calls to setValueLocal cannot be made with different values for addv without intermediate calls to assemblyBegin and assemblyEnd.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2914
Not collective.
Notes
The values may be cached so assemblyBegin and assemblyEnd must be called after all calls of this method are completed.
Multiple calls to setValues cannot be made with different values for addv without intermediate calls to assemblyBegin and assemblyEnd.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2808
Not collective.
Equivalent to x[bs*indices[i]+j] = y[bs*i+j] for 0 <= i < len(indices), 0 <= j < bs and bs block_size.
Notes
The values may be cached so assemblyBegin and assemblyEnd must be called after all calls of this method are completed.
Multiple calls to setValuesBlocked cannot be made with different values for addv without intermediate calls to assemblyBegin and assemblyEnd.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2842
Not collective.
Equivalent to x[bs*indices[i]+j] = y[bs*i+j] for 0 <= i < len(indices), 0 <= j < bs and bs block_size.
Notes
The values may be cached so assemblyBegin and assemblyEnd must be called after all calls of this method are completed.
Multiple calls to setValuesBlockedLocal cannot be made with different values for addv without intermediate calls to assemblyBegin and assemblyEnd.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2985
Not collective.
Notes
The values may be cached so assemblyBegin and assemblyEnd must be called after all calls of this method are completed.
Multiple calls to setValuesLocal cannot be made with different values for addv without intermediate calls to assemblyBegin and assemblyEnd.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2951
Source code at petsc4py/PETSc/Vec.pyx:2880
Collective.
This method sets each entry (xₙ) in the vector to xₙ + ɑ.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2423
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2281
Collective.
The current vector is expected to be multi-component (block_size greater than 1) and the target vector is expected to be single-component.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3231
Collective.
Equivalent to max(x[field], x[field+bs], x[field+2*bs], ...) where bs is block_size.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3137
Collective.
Equivalent to min(x[field], x[field+bs], x[field+2*bs], ...) where bs is block_size.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3106
Collective.
Equivalent to norm(x[field], x[field+bs], x[field+2*bs], ...) where bs is block_size.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3168
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3062
Collective.
The current vector is expected to be single-component (block_size of 1) and the target vector is expected to be multi-component.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3200
Collective.
Equivalent to sum(x[field], x[field+bs], x[field+2*bs], ...) where bs is block_size.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:3083
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2166
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2443
Collective.
This computes yᵀ·x with self as x, vec as y and where yᵀ denotes the transpose of y.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1846
Collective.
This should be paired with a call to tDotEnd.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1868
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:1888
Collective.
Notes
It is important that the access mode is respected by the consumer as this is not enforced internally.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:726
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:144
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2547
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Vec.pyx:2358
Attributes Documentation
Source code at petsc4py/PETSc/Vec.pyx:3642
Source code at petsc4py/PETSc/Vec.pyx:3632
Source code at petsc4py/PETSc/Vec.pyx:3623
Source code at petsc4py/PETSc/Vec.pyx:3598
Source code at petsc4py/PETSc/Vec.pyx:3637
Source code at petsc4py/PETSc/Vec.pyx:3618
Source code at petsc4py/PETSc/Vec.pyx:3613
Source code at petsc4py/PETSc/Vec.pyx:3593
Source code at petsc4py/PETSc/Vec.pyx:3603
Source code at petsc4py/PETSc/Vec.pyx:3608
Source code at petsc4py/PETSc/Vec.pyx:3588
Source code at petsc4py/PETSc/Vec.pyx:3580
Viewer object.
Viewer is described in the PETSc manual.
Viewers can be called as functions where the argument specified is the PETSc object to be viewed. See the example below.
Examples
>>> from petsc4py import PETSc >>> u = PETSc.Vec().createWithArray([1,2]) >>> v = PETSc.Viewer() >>> v(u) Vec Object: 1 MPI process
type: seq 1. 2.
SEE ALSO:
Enumerations
| DrawSize | Window size. |
| FileMode | Viewer file mode. |
| Format | Viewer format. |
| Type | Viewer type. |
Window size.
Attributes Summary
| FULL | Constant FULL of type int |
| FULL_SIZE | Constant FULL_SIZE of type int |
| HALF | Constant HALF of type int |
| HALF_SIZE | Constant HALF_SIZE of type int |
| QUARTER | Constant QUARTER of type int |
| QUARTER_SIZE | Constant QUARTER_SIZE of type int |
| THIRD | Constant THIRD of type int |
| THIRD_SIZE | Constant THIRD_SIZE of type int |
Attributes Documentation
Viewer file mode.
Attributes Summary
| A | Constant A of type int |
| APPEND | Constant APPEND of type int |
| APPEND_UPDATE | Constant APPEND_UPDATE of type int |
| AU | Constant AU of type int |
| R | Constant R of type int |
| READ | Constant READ of type int |
| U | Constant U of type int |
| UA | Constant UA of type int |
| UPDATE | Constant UPDATE of type int |
| W | Constant W of type int |
| WRITE | Constant WRITE of type int |
Attributes Documentation
Viewer format.
Attributes Summary
| ASCII_COMMON | Constant ASCII_COMMON of type int |
| ASCII_CSV | Constant ASCII_CSV of type int |
| ASCII_DENSE | Constant ASCII_DENSE of type int |
| ASCII_FACTOR_INFO | Constant ASCII_FACTOR_INFO of type int |
| ASCII_GLVIS | Constant ASCII_GLVIS of type int |
| ASCII_IMPL | Constant ASCII_IMPL of type int |
| ASCII_INDEX | Constant ASCII_INDEX of type int |
| ASCII_INFO | Constant ASCII_INFO of type int |
| ASCII_INFO_DETAIL | Constant ASCII_INFO_DETAIL of type int |
| ASCII_LATEX | Constant ASCII_LATEX of type int |
| ASCII_MATHEMATICA | Constant ASCII_MATHEMATICA of type int |
| ASCII_MATLAB | Constant ASCII_MATLAB of type int |
| ASCII_MATRIXMARKET | Constant ASCII_MATRIXMARKET of type int |
| ASCII_PCICE | Constant ASCII_PCICE of type int |
| ASCII_PYTHON | Constant ASCII_PYTHON of type int |
| ASCII_SYMMODU | Constant ASCII_SYMMODU of type int |
| ASCII_VTK | Constant ASCII_VTK of type int |
| ASCII_VTK_CELL | Constant ASCII_VTK_CELL of type int |
| ASCII_VTK_COORDS | Constant ASCII_VTK_COORDS of type int |
| ASCII_XML | Constant ASCII_XML of type int |
| BINARY_MATLAB | Constant BINARY_MATLAB of type int |
| DEFAULT | Constant DEFAULT of type int |
| DRAW_BASIC | Constant DRAW_BASIC of type int |
| DRAW_CONTOUR | Constant DRAW_CONTOUR of type int |
| DRAW_LG | Constant DRAW_LG of type int |
| DRAW_LG_XRANGE | Constant DRAW_LG_XRANGE of type int |
| DRAW_PORTS | Constant DRAW_PORTS of type int |
| FAILED | Constant FAILED of type int |
| HDF5_MAT | Constant HDF5_MAT of type int |
| HDF5_PETSC | Constant HDF5_PETSC of type int |
| HDF5_VIZ | Constant HDF5_VIZ of type int |
| HDF5_XDMF | Constant HDF5_XDMF of type int |
| LOAD_BALANCE | Constant LOAD_BALANCE of type int |
| NATIVE | Constant NATIVE of type int |
| NOFORMAT | Constant NOFORMAT of type int |
| VTK_VTR | Constant VTK_VTR of type int |
| VTK_VTS | Constant VTK_VTS of type int |
| VTK_VTU | Constant VTK_VTU of type int |
Attributes Documentation
Viewer type.
Attributes Summary
| ADIOS | Object ADIOS of type str |
| ASCII | Object ASCII of type str |
| BINARY | Object BINARY of type str |
| DRAW | Object DRAW of type str |
| EXODUSII | Object EXODUSII of type str |
| GLVIS | Object GLVIS of type str |
| HDF5 | Object HDF5 of type str |
| MATHEMATICA | Object MATHEMATICA of type str |
| MATLAB | Object MATLAB of type str |
| SAWS | Object SAWS of type str |
| SOCKET | Object SOCKET of type str |
| STRING | Object STRING of type str |
| VTK | Object VTK of type str |
| VU | Object VU of type str |
Attributes Documentation
Methods Summary
| ASCII(name[, comm]) | Return an ASCII viewer associated with the communicator. |
| BINARY([comm]) | Return the default Type.BINARY viewer associated with the communicator. |
| DRAW([comm]) | Return the default Type.DRAW viewer associated with the communicator. |
| STDERR([comm]) | Return the standard error viewer associated with the communicator. |
| STDOUT([comm]) | Return the standard output viewer associated with the communicator. |
| addASCIITab(tabs) | Increment the ASCII tab level. |
| clearDraw() | Reset graphics. |
| create([comm]) | Create a viewer. |
| createASCII(name[, mode, comm]) | Create a viewer of type Type.ASCII. |
| createBinary(name[, mode, comm]) | Create a viewer of type Type.BINARY. |
| createDraw([display, title, position, size, ...]) | Create a Type.DRAW viewer. |
| createHDF5(name[, mode, comm]) | Create a viewer of type Type.HDF5. |
| createMPIIO(name[, mode, comm]) | Create a viewer of type Type.BINARY supporting MPI-IO. |
| createVTK(name[, mode, comm]) | Create a viewer of type Type.VTK. |
| destroy() | Destroy the viewer. |
| flush() | Flush the viewer. |
| getASCIITab() | Return the ASCII tab level. |
| getFileMode() | Return the file mode. |
| getFileName() | Return file name. |
| getFormat() | Return the format of the viewer. |
| getSubViewer([comm]) | Return a viewer defined on a subcommunicator. |
| getType() | Return the type of the viewer. |
| popASCIISynchronized() | Disallow ASCII synchronized calls. |
| popASCIITab() | Pop an additional tab level pushed via pushASCIITab. |
| popFormat() | Pop format from the viewer. |
| printfASCII(msg) | Print a message. |
| printfASCIISynchronized(msg) | Print a synchronized message. |
| pushASCIISynchronized() | Allow ASCII synchronized calls. |
| pushASCIITab() | Push an additional tab level. |
| pushFormat(format) | Push format to the viewer. |
| restoreSubViewer(sub) | Restore a viewer defined on a subcommunicator. |
| setASCIITab(tabs) | Set ASCII tab level. |
| setDrawInfo([display, title, position, size]) | Set window information for a Type.DRAW viewer. |
| setFileMode(mode) | Set file mode. |
| setFileName(name) | Set file name. |
| setType(vwr_type) | Set the type of the viewer. |
| subtractASCIITab(tabs) | Decrement the ASCII tab level. |
| useASCIITabs(flag) | Enable/disable the use of ASCII tabs. |
| view([obj]) | View the viewer. |
Methods Documentation
Collective.
Source code at petsc4py/PETSc/Viewer.pyx:580
Collective.
Source code at petsc4py/PETSc/Viewer.pyx:601
Collective.
Source code at petsc4py/PETSc/Viewer.pyx:619
Collective.
Source code at petsc4py/PETSc/Viewer.pyx:562
Collective.
Source code at petsc4py/PETSc/Viewer.pyx:544
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:666
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:897
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:180
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:201
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:239
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:381
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:345
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:272
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:309
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:167
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:785
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:652
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:809
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:837
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:464
Collective.
Notes
Users must call restoreSubViewer when done.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:502
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:450
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:705
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:730
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:490
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:755
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:769
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:692
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:718
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:478
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:526
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:639
Collective.
Source code at petsc4py/PETSc/Viewer.pyx:853
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:797
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:823
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:431
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:679
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:742
Collective.
Notes
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:139
Viewer object for HDF5 file formats.
Viewer is described in the PETSc manual.
SEE ALSO:
Methods Summary
| create(name[, mode, comm]) | Create a viewer of type Type.HDF5. |
| getGroup() | Return the current group. |
| getTimestep() | Return the current time step. |
| incrementTimestep() | Increment the time step. |
| popGroup() | Pop the current group from the stack. |
| popTimestepping() | Deactivate the timestepping mode. |
| pushGroup(group) | Set the current group. |
| pushTimestepping() | Activate the timestepping mode. |
| setTimestep(timestep) | Set the current time step. |
Methods Documentation
Collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:922
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:1049
Not collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:982
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:1010
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:1037
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:970
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:1023
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:958
Logically collective.
SEE ALSO:
Source code at petsc4py/PETSc/Viewer.pyx:997
Exceptions
| Error | PETSc Error. |
Functions
| garbage_cleanup([comm]) | Clean up unused PETSc objects. |
| garbage_view([comm]) | Print summary of the garbage PETSc objects. |
Collective.
Notes
If the communicator comm if not provided or it is None, then COMM_WORLD is used.
Source code at petsc4py/PETSc/cyclicgc.pxi:39
Collective.
Notes
Print out garbage summary on each rank of the communicator comm. If no communicator is provided then COMM_WORLD is used.
Source code at petsc4py/PETSc/cyclicgc.pxi:63
Attributes
| DECIDE | Constant DECIDE of type int |
| DEFAULT | Constant DEFAULT of type int |
| DETERMINE | Constant DETERMINE of type int |
| CURRENT | Constant CURRENT of type int |
| UNLIMITED | Constant UNLIMITED of type int |
| INFINITY | Object INFINITY of type float |
| NINFINITY | Object NINFINITY of type float |
| PINFINITY | Object PINFINITY of type float |
| COMM_NULL | Object COMM_NULL of type Comm |
| COMM_SELF | Object COMM_SELF of type Comm |
| COMM_WORLD | Object COMM_WORLD of type Comm |
Here we discuss details about Python-aware PETSc types that can be used within the library.
In particular, we discuss matrices, preconditioners, Krylov solvers, nonlinear solvers and ODE integrators.
The low-level, Cython implementation exposing the Python methods is in src/petsc4py/PETSc/libpetsc4py.pyx.
The scripts used here can be found at demo/python_types.
PETSc provides a convenient way to compute the action of linear operators coded in Python through the petsc4py.PETSc.Mat.Type.PYTHON type.
In addition to the matrix action, the implementation can expose additional methods for use within the library. A template class for the supported methods is given below.
from petsc4py.typing import Scalar from petsc4py.PETSc import Mat from petsc4py.PETSc import Vec from petsc4py.PETSc import IS from petsc4py.PETSc import InsertMode from petsc4py.PETSc import NormType from petsc4py.PETSc import Viewer # A template class with the Python methods supported by MATPYTHON class MatPythonProtocol:
def mult(self, A: Mat, x: Vec, y: Vec) -> None:
"""Matrix vector multiplication: y = A @ x."""
...
def multAdd(self, A: Mat, x: Vec, y: Vec, z: Vec) -> None:
"""Matrix vector multiplication: z = A @ x + y."""
...
def multTranspose(self, A: Mat, x: Vec, y: Vec) -> None:
"""Transposed matrix vector multiplication: y = A^T @ x."""
...
def multTransposeAdd(self, A: Mat, x: Vec, y: Vec, z: Vec) -> None:
"""Transposed matrix vector multiplication: z = A^T @ x + y."""
...
def multHermitian(self, A: Mat, x: Vec, y: Vec) -> None:
"""Hermitian matrix vector multiplication: y = A^H @ x."""
...
def multHermitianAdd(self, A: Mat, x: Vec, y: Vec, z: Vec) -> None:
"""Hermitian matrix vector multiplication: z = A^H @ x + y."""
...
def view(self, A: Mat, viewer: Viewer) -> None:
"""View the matrix."""
...
def setFromOptions(self, A: Mat) -> None:
"""Process command line for customization."""
...
def multDiagonalBlock(self, A: Mat, x: Vec, y: Vec) -> None:
"""Perform the on-process matrix vector multiplication."""
...
def createVecs(self, A: Mat) -> tuple[Vec, Vec]:
"""Return tuple of vectors (x,y) suitable for A @ x = y."""
...
def scale(self, A: Mat, s: Scalar) -> None:
"""Scale the matrix by a scalar."""
...
def shift(self, A: Mat, s: Scalar) -> None:
"""Shift the matrix by a scalar."""
...
def createSubMatrix(self, A: Mat, r: IS, c: IS, out: Mat) -> Mat:
"""Return the submatrix corresponding to r rows and c columns.
Matrix out must be reused if not None.
"""
...
def zeroRowsColumns(self, A: Mat, r: IS, diag: Scalar, x: Vec, b: Vec) -> None:
"""Zero rows and columns of the matrix corresponding to the index set r.
Insert diag on the diagonal and modify vectors x and b accordingly if not None.
"""
...
def getDiagonal(self, A: Mat, d: Vec) -> None:
"""Compute the diagonal of the matrix: d = diag(A)."""
...
def setDiagonal(self, A: Mat, d: Vec, im: InsertMode) -> None:
"""Set the diagonal of the matrix."""
...
def missingDiagonal(self, A: Mat, d: Vec, im: InsertMode) -> tuple[bool, int]:
"""Return a flag indicating if the matrix is missing a diagonal entry and the location."""
...
def diagonalScale(self, A: Mat, L: Vec, R: Vec) -> None:
"""Perform left and right diagonal scaling if vectors are not None.
A = diag(L)@A@diag(R).
"""
...
def getDiagonalBlock(self, A: Mat) -> Mat:
"""Return the on-process matrix."""
...
def setUp(self, A: Mat) -> None:
"""Perform the required setup."""
...
def duplicate(self, A: Mat, op: Mat.DuplicateOption) -> Mat:
"""Duplicate the matrix."""
...
def copy(self, A: Mat, B: Mat, op: Mat.Structure) -> None:
"""Copy the matrix: B = A."""
...
def productSetFromOptions(
self, A: Mat, prodtype: str, X: Mat, Y: Mat, Z: Mat
) -> bool:
"""The boolean flag indicating if the matrix supports prodtype."""
...
def productSymbolic(
self, A: Mat, product: Mat, producttype: str, X: Mat, Y: Mat, Z: Mat
) -> None:
"""Perform the symbolic stage of the requested matrix product."""
...
def productNumeric(
self, A: Mat, product: Mat, producttype: str, X: Mat, Y: Mat, Z: Mat
) -> None:
"""Perform the numeric stage of the requested matrix product."""
...
def zeroEntries(self, A: Mat) -> None:
"""Set the matrix to zero."""
...
def norm(self, A: Mat, normtype: NormType) -> float:
"""Compute the norm of the matrix."""
...
def solve(self, A: Mat, y: Vec, x: Vec) -> None:
"""Solve the equation: x = inv(A) y."""
...
def solveAdd(self, A: Mat, y: Vec, z: Vec, x: Vec) -> None:
"""Solve the equation: x = inv(A) y + z."""
...
def solveTranspose(self, A: Mat, y: Vec, x: Vec) -> None:
"""Solve the equation: x = inv(A)^T y."""
...
def solveTransposeAdd(self, A: Mat, y: Vec, z: Vec, x: Vec) -> None:
"""Solve the equation: x = inv(A)^T y + z."""
...
def SOR(
self,
A: Mat,
b: Vec,
omega: float,
sortype: Mat.SORType,
shift: float,
its: int,
lits: int,
x: Vec,
) -> None:
"""Perform SOR iterations."""
...
def conjugate(self, A: Mat) -> None:
"""Perform the conjugation of the matrix: A = conj(A)."""
...
def imagPart(self, A: Mat) -> None:
"""Set real part to zero. A = imag(A)."""
...
def realPart(self, A: Mat) -> None:
"""Set imaginary part to zero. A = real(A)."""
...
In the example below, we create an operator that applies the Laplacian operator on a two-dimensional grid, and use it to solve the associated linear system. The default preconditioner in the script is petsc4py.PETSc.PC.Type.JACOBI which needs to access the diagonal of the matrix.
# ------------------------------------------------------------------------ # # Poisson problem. This problem is modeled by the partial # differential equation # # -Laplacian(u) = 1, 0 < x,y < 1, # # with boundary conditions # # u = 0 for x = 0, x = 1, y = 0, y = 1 # # A finite difference approximation with the usual 5-point stencil # is used to discretize the boundary value problem to obtain a # nonlinear system of equations. The problem is solved in a 2D # rectangular domain, using distributed arrays (DAs) to partition # the parallel grid. # # ------------------------------------------------------------------------ # We first import petsc4py and sys to initialize PETSc import sys import petsc4py petsc4py.init(sys.argv) # Import the PETSc module from petsc4py import PETSc # Here we define a class representing the discretized operator # This allows us to apply the operator "matrix-free" class Poisson2D:
def __init__(self, da):
self.da = da
self.localX = da.createLocalVec()
# This is the method that PETSc will look for when applying
# the operator. `X` is the PETSc input vector, `Y` the output vector,
# while `mat` is the PETSc matrix holding the PETSc datastructures.
def mult(self, mat, X, Y):
# Grid sizes
mx, my = self.da.getSizes()
hx, hy = (1.0 / m for m in [mx, my])
# Bounds for the local part of the grid this process owns
(xs, xe), (ys, ye) = self.da.getRanges()
# Map global vector to local vectors
self.da.globalToLocal(X, self.localX)
# We can access the vector data as NumPy arrays
x = self.da.getVecArray(self.localX)
y = self.da.getVecArray(Y)
# Loop on the local grid and compute the local action of the operator
for j in range(ys, ye):
for i in range(xs, xe):
u = x[i, j] # center
u_e = u_w = u_n = u_s = 0
if i > 0:
u_w = x[i - 1, j] # west
if i < mx - 1:
u_e = x[i + 1, j] # east
if j > 0:
u_s = x[i, j - 1] # south
if j < ny - 1:
u_n = x[i, j + 1] # north
u_xx = (-u_e + 2 * u - u_w) * hy / hx
u_yy = (-u_n + 2 * u - u_s) * hx / hy
y[i, j] = u_xx + u_yy
# This is the method that PETSc will look for when the diagonal of the matrix is needed.
def getDiagonal(self, mat, D):
mx, my = self.da.getSizes()
hx, hy = (1.0 / m for m in [mx, my])
(xs, xe), (ys, ye) = self.da.getRanges()
d = self.da.getVecArray(D)
# Loop on the local grid and compute the diagonal
for j in range(ys, ye):
for i in range(xs, xe):
d[i, j] = 2 * hy / hx + 2 * hx / hy
# The class can contain other methods that PETSc won't use
def formRHS(self, B):
b = self.da.getVecArray(B)
mx, my = self.da.getSizes()
hx, hy = (1.0 / m for m in [mx, my])
(xs, xe), (ys, ye) = self.da.getRanges()
for j in range(ys, ye):
for i in range(xs, xe):
b[i, j] = 1 * hx * hy # Access the option database and read options from the command line OptDB = PETSc.Options() nx, ny = OptDB.getIntArray(
'grid', (16, 16) ) # Read `-grid <int,int>`, defaults to 16,16 # Create the distributed memory implementation for structured grid da = PETSc.DMDA().create([nx, ny], stencil_width=1) # Create vectors to hold the solution and the right-hand side x = da.createGlobalVec() b = da.createGlobalVec() # Instantiate an object of our Poisson2D class pde = Poisson2D(da) # Create a PETSc matrix of type Python using `pde` as context A = PETSc.Mat().create(comm=da.comm) A.setSizes([x.getSizes(), b.getSizes()]) A.setType(PETSc.Mat.Type.PYTHON) A.setPythonContext(pde) A.setUp() # Create a Conjugate Gradient Krylov solver ksp = PETSc.KSP().create() ksp.setType(PETSc.KSP.Type.CG) # Use diagonal preconditioning ksp.getPC().setType(PETSc.PC.Type.JACOBI) # Allow command-line customization ksp.setFromOptions() # Assemble right-hand side and solve the linear system pde.formRHS(b) ksp.setOperators(A) ksp.solve(b, x) # Here we programmatically visualize the solution if OptDB.getBool('plot', True):
# Modify the option database: keep the X window open for 1 second
OptDB['draw_pause'] = 1
# Obtain a viewer of type DRAW
draw = PETSc.Viewer.DRAW(x.comm)
# View the vector in the X window
draw(x) # We can also visualize the solution by command line options # For example, we can dump a VTK file with: # # $ python poisson2d.py -plot 0 -view_solution vtk:sol.vts: # # or obtain the same visualization as programmatically done above as: # # $ python poisson2d.py -plot 0 -view_solution draw -draw_pause 1 # x.viewFromOptions('-view_solution')
The protocol for the petsc4py.PETSc.PC.Type.PYTHON preconditioner is:
from petsc4py.PETSc import KSP from petsc4py.PETSc import PC from petsc4py.PETSc import Mat from petsc4py.PETSc import Vec from petsc4py.PETSc import Viewer # A template class with the Python methods supported by PCPYTHON class PCPythonProtocol:
def apply(self, pc: PC, b: Vec, x: Vec) -> None:
"""Apply the preconditioner on vector b, return in x."""
...
def applySymmetricLeft(self, pc: PC, b: Vec, x: Vec) -> None:
"""Apply the symmetric left part of the preconditioner on vector b, return in x."""
...
def applySymmetricRight(self, pc: PC, b: Vec, x: Vec) -> None:
"""Apply the symmetric right part of the preconditioner on vector b, return in x."""
...
def applyTranspose(self, pc: PC, b: Vec, x: Vec) -> None:
"""Apply the transposed preconditioner on vector b, return in x."""
...
def applyMat(self, pc: PC, B: Mat, X: Mat) -> None:
"""Apply the preconditioner on a block of right-hand sides B, return in X."""
...
def preSolve(self, pc: PC, ksp: KSP, b: Vec, x: Vec) -> None:
"""Callback called at the beginning of a Krylov method.
This method is allowed to modify the right-hand side b and the initial guess x.
"""
...
def postSolve(self, pc: PC, ksp: KSP, b: Vec, x: Vec) -> None:
"""Callback called at the end of a Krylov method.
This method is allowed to modify the right-hand side b and the solution x.
"""
def view(self, pc: PC, viewer: Viewer) -> None:
"""View the preconditioner."""
...
def setFromOptions(self, pc: PC) -> None:
"""Process command line for customization."""
...
def setUp(self, pc: PC) -> None:
"""Perform the required setup."""
...
def reset(self, pc: PC) -> None:
"""Reset the preconditioner."""
...
In the example below, we create a Jacobi preconditioner, which needs to access the diagonal of the matrix. The action of the preconditioner consists of the pointwise multiplication of the inverse diagonal with the input vector.
# The user-defined Python class implementing the Jacobi method. class myJacobi:
# Setup the internal data. In this case, we access the matrix diagonal.
def setUp(self, pc):
_, P = pc.getOperators()
self.D = P.getDiagonal()
# Apply the preconditioner
def apply(self, pc, x, y):
y.pointwiseDivide(x, self.D)
We can run the script used to test our matrix class and use command line arguments to specify that our preconditioner should be used:
$ python mat.py -pc_type python -pc_python_type pc.myJacobi -ksp_view KSP Object: 1 MPI process
type: cg
maximum iterations=10000, initial guess is zero
tolerances: relative=1e-05, absolute=1e-50, divergence=10000.
left preconditioning
using PRECONDITIONED norm type for convergence test PC Object: 1 MPI process
type: python
Python: pc.myJacobi
linear system matrix = precond matrix:
Mat Object: 1 MPI process
type: python
rows=256, cols=256
Python: __main__.Poisson2D
The protocol for the petsc4py.PETSc.KSP.Type.PYTHON Krylov solver is:
from petsc4py.PETSc import KSP from petsc4py.PETSc import Vec from petsc4py.PETSc import Viewer # A template class with the Python methods supported by KSPPYTHON class KSPPythonProtocol:
def solve(self, ksp: KSP, b: Vec, x: Vec) -> None:
"""Solve the linear system with right-hand side b. Return solution in x."""
...
def solveTranspose(self, ksp: KSP, b: Vec, x: Vec) -> None:
"""Solve the transposed linear system with right-hand side b. Return solution in x."""
...
def view(self, ksp: KSP, viewer: Viewer) -> None:
"""View the Krylov solver."""
...
def setFromOptions(self, ksp: KSP) -> None:
"""Process command line for customization."""
...
def setUp(self, ksp: KSP) -> None:
"""Perform the required setup."""
...
def buildSolution(self, ksp: KSP, x: Vec) -> None:
"""Compute the solution vector."""
...
def buildResidual(self, ksp: KSP, t: Vec, r: Vec) -> None:
"""Compute the residual vector, return it in r. t is a scratch working vector."""
...
def reset(self, ksp: KSP) -> None:
"""Reset the Krylov solver."""
...
A very powerful feature of PETSc is that objects can be configured via command-line options. In this way, one can choose the method to be used or set different parameters without changing the source code. See the PETSc manual for additional information.
In order to use command-line options in a petsc4py program, it is important to initialize the module as follows:
# We first import petsc4py and sys to initialize PETSc import sys, petsc4py petsc4py.init(sys.argv) # Import the PETSc module from petsc4py import PETSc
Then one can provide command-line options when running a script:
$ python foo.py -ksp_type gmres -ksp_gmres_restart 100 -ksp_view
When the above initialization method is not possible, PETSc options can be also specified via environment variables or configuration files, e.g.:
$ PETSC_OPTIONS='-ksp_type gmres -ksp_gmres_restart 100 -ksp_view' python foo.py
Command-line options can be read via an instance of the Options class. For instance:
OptDB = PETSc.Options()
n = OptDB.getInt('n', 16)
eta = OptDB.getReal('eta', 0.014)
alpha = OptDB.getScalar('alpha', -12.3)
In this way, if the script is run with
$ python foo.py -n 50 -alpha 8.8
the options, n and alpha will get the values 50 and 8.8, respectively, while eta will be assigned the value specified as default, 0.014.
The options database is accessible also as a Python dictionary, so that one can for instance override, insert or delete an option:
OptDB['draw_pause'] = 1 del OptDB['draw_pause']
Subject to exceptions given below, new contributions to petsc4py must include type annotations for function parameters and results, and docstrings on every class, function and method.
The documentation should be consistent with the corresponding C API documentation, including copying text where this is appropriate. More in-depth documentation from the C API (such as extended discussions of algorithmic or performance factors) should not be copied.
Docstrings are to be written in numpydoc:format format.
The first line of a class, function or method docstring must be a short description of the method in imperative mood ("Return the norm of the matrix.") "Return" is to be preferred over "Get" in this sentence. A blank line must follow this description. Use one-liner descriptions for properties.
If the corresponding C API documentation of a method lists a function as being collective, then this information must be repeated on the next line of the docstring. Valid strings are: "Not collective.", "Logically collective.", "Collective.", "Neighborwise collective.", or "Collective the first time it is called".
The initial description section can contain more information if this is useful. In particular, if there is a PETSc manual chapter about a class, then this should be referred to from here.
Use double backticks around literals (like strings and numbers), e.g., ``2``, ``"foo"``.
Reference PETSc functions simply using backticks, e.g., KSP refers to the PETSc C documentation for KSP. Do not use URLs in docstrings. Always use Intersphinx references.
The following sections describe the use of numpydoc sections. Other sections allowed by numpydoc may be included if they are useful.
This is required for methods unless there are no parameters, or it will be completely obvious to even a novice user what the parameters do.
If a class has a non-trivial constructor, the arguments of the constructor and their types must be explicitly documented within this section.
For methods, types should only be specified in this section if for some reason the types provided by typing prove to be inadequate. If no type is being specified, do not include a colon (:) to the right of the parameter name.
Use Sys.getDefaultComm when specifying the default communicator.
This should only be specified if the return value is not obvious from the initial description and typing.
If a "Returns" section is required, the type of the returned items must be specified, even if this duplicates typing information.
If any of the following apply, then this section is required. The order of entries is as follows. Other links are permitted in this section if they add information useful to users.
Every setFromOptions must include the link `petsc_options`.
Any closely related part of the petsc4py API not already linked in the docstring should appear (e.g. setters and getters should cross-refer).
If there is a corresponding C API documentation page, this must be linked from the "See also" section, e.g. `petsc.MatSetValues`.
End docstring with an empty line - "closing three quotation marks must be on a line by itself, preferably preceded by a blank line"
If returning self, use -> Self in function signature.
Type hints are not required when the static type signature includes a PETSc type (e.g. Vec x). These will be automatically generated. This will also work for = None. When using type hints, use spacing around the equals in any = None.
Communicators in type signatures must use Python typing instead of c-typing (i.e. comm: Comm not Comm comm). This is because communicators can come from mpi4py and not just the petsc4py.PETSc.Comm class.
For petsc4py native types that are strings, the type is argument: KSP.Type | str (not e.g.: KSPType argument). If the type is strictly an enum the | str can be omitted. Full signature example:
def setType(self, ksp_type: KSP.Type | str) -> None:
If a NumPy array is returned, use ArrayBool/ArrayInt/ArrayReal/ArrayScalar as the return type.
Lisandro Dalcin
| March 12, 2025 | 3.22 |