PF, PetscPartitioner, PetscRegressor, PetscDA, Characteristic - Low-level Interface
- PF: mathematical functions applied pointwise to arrays and vectors (
PFApply) - PetscPartitioner: graph partitioners used by
DMPlexDistribute(simple, ParMETIS, PTScotch, ...) - PetscRegressor: regression models (linear, ridge, lasso) fitted with Tao
- PetscDA: data assimilation (ensemble methods), new in PETSc 3.25
- Characteristic: the method of characteristics for semi-Lagrangian advection on a
DMDA
Basic Usage
using PETSc, MPI
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
# A pointwise function R^1 -> R^1: the identity
pf = LibPETSc.PFCreate(petsclib, MPI.COMM_SELF, 1, 1)
LibPETSc.PFSetType(petsclib, pf, LibPETSc.PFIDENTITY, C_NULL)
x = [1.0, 2.0, 3.0]
y = LibPETSc.PFApply(petsclib, pf, 3, x) # y == x
LibPETSc.PFDestroy(petsclib, pf)
# The partitioner used when distributing a DMPlex
part = LibPETSc.PetscPartitionerCreate(petsclib, MPI.COMM_WORLD)
LibPETSc.PetscPartitionerSetType(petsclib, part, LibPETSc.PETSCPARTITIONERSIMPLE)
LibPETSc.PetscPartitionerDestroy(petsclib, part)
PETSc.finalize(petsclib)Function Reference
PF
PETSc.LibPETSc.PFAppendOptionsPrefix — Method
PFAppendOptionsPrefix(petsclib::PetscLibType, pf::AbstractPF, prefix::String)Appends to the prefix used for searching for all PF options in the database.
Logically Collective
Input Parameters:
pf- thePFprefix- the prefix string to prepend to allPFoption requests
Level: advanced
See also: PF, PFSetFromOptions(), PFSetOptionsPrefix(), PFGetOptionsPrefix()
External Links
- PETSc Manual:
PF/PFAppendOptionsPrefix
PETSc.LibPETSc.PFApply — Method
y::PetscScalar = PFApply(petsclib::PetscLibType, pf::AbstractPF, n::PetscInt, x::Vector{PetscScalar})Applies the mathematical function to an array of values.
Collective
Input Parameters:
pf- the function contextn- number of pointwise function evaluations to perform, each pointwise function evaluation
is a function of dimin variables and computes dimout variables where dimin and dimout are defined in the call to PFCreate()
x- input array
Output Parameter:
y- output array
Level: beginner
See also: PF, PFApplyVec(), PFCreate(), PFDestroy(), PFSetType(), PFSet()
External Links
- PETSc Manual:
PF/PFApply
PETSc.LibPETSc.PFApplyVec — Method
PFApplyVec(petsclib::PetscLibType, pf::AbstractPF, x::AbstractPetscVec, y::AbstractPetscVec)Applies the mathematical function to a vector
Collective
Input Parameters:
pf- the function contextx- input vector (orNULLfor the vector (0,1, .... N-1)
Output Parameter:
y- output vector
Level: beginner
See also: PF, PFApply(), PFCreate(), PFDestroy(), PFSetType(), PFSet()
External Links
- PETSc Manual:
PF/PFApplyVec
PETSc.LibPETSc.PFCreate — Method
pf::PF = PFCreate(petsclib::PetscLibType, comm::MPI_Comm, dimin::PetscInt, dimout::PetscInt)Creates a mathematical function context.
Collective
Input Parameters:
comm- MPI communicatordimin- dimension of the space you are mapping fromdimout- dimension of the space you are mapping to
Output Parameter:
pf- the function context
Level: developer
See also: PF, PFSet(), PFApply(), PFDestroy(), PFApplyVec()
External Links
- PETSc Manual:
PF/PFCreate
PETSc.LibPETSc.PFDestroy — Method
PFDestroy(petsclib::PetscLibType, pf::AbstractPF)Destroys PF context that was created with PFCreate().
Collective
Input Parameter:
pf- the function context
Level: beginner
See also: PF, PFCreate(), PFSet(), PFSetType()
External Links
- PETSc Manual:
PF/PFDestroy
PETSc.LibPETSc.PFFinalizePackage — Method
PFFinalizePackage(petsclib::PetscLibType)This function destroys everything in the PETSc PF package. It is called from PetscFinalize().
Level: developer
See also: PF, PetscFinalize()
External Links
- PETSc Manual:
PF/PFFinalizePackage
PETSc.LibPETSc.PFGetOptionsPrefix — Method
prefix::String = PFGetOptionsPrefix(petsclib::PetscLibType, pf::AbstractPF)Gets the prefix used for searching for all PF options in the database.
Not Collective
Input Parameter:
pf- thePF
Output Parameter:
prefix- pointer to the prefix string used, is returned
Level: advanced
See also: PF, PFSetFromOptions(), PFSetOptionsPrefix(), PFAppendOptionsPrefix()
External Links
- PETSc Manual:
PF/PFGetOptionsPrefix
PETSc.LibPETSc.PFGetType — Method
type::String = PFGetType(petsclib::PetscLibType, pf::AbstractPF)Gets the PFType name (as a string) from the PF context.
Not Collective
Input Parameter:
pf- the function context
Output Parameter:
type- name of function
Level: intermediate
See also: PF, PFSetType(), PFType, PetscObjectTypeCompare(), PetscObjectTypeCompareAny()
External Links
- PETSc Manual:
PF/PFGetType
PETSc.LibPETSc.PFInitializePackage — Method
PFInitializePackage(petsclib::PetscLibType)This function initializes everything in the PF package. It is called from PetscDLLibraryRegister_petscvec() when using dynamic libraries, and on the first call to PFCreate() when using shared or static libraries.
Level: developer
See also: PF, PetscInitialize()
External Links
- PETSc Manual:
PF/PFInitializePackage
PETSc.LibPETSc.PFRegister — Method
PFRegister(petsclib::PetscLibType, sname::String, fnc::external)Adds a method to the mathematical function package.
Not Collective
Input Parameters:
sname- name of a new user-defined solverfunction- routine to create method context
See also: PF, PFRegisterAll(), PFRegisterDestroy()
External Links
- PETSc Manual:
PF/PFRegister
PETSc.LibPETSc.PFSet — Method
PFSet(petsclib::PetscLibType, pf::AbstractPF, apply::external, applyvec::external, view::external, destroy::external, ctx::Ptr{Cvoid})Sets the C/C++/Fortran functions to be used by the PF function
Collective
Input Parameters:
pf- the function contextapply- function to apply to an arrayapplyvec- function to apply to a Vecview- function that prints information about thePFdestroy- function to free the private function contextctx- private function context
Level: beginner
See also: PF, PFCreate(), PFDestroy(), PFSetType(), PFApply(), PFApplyVec()
External Links
- PETSc Manual:
PF/PFSet
PETSc.LibPETSc.PFSetFromOptions — Method
PFSetFromOptions(petsclib::PetscLibType, pf::AbstractPF)Sets PF options from the options database.
Collective
Input Parameters:
pf- the mathematical function context
Level: intermediate
See also: PF
External Links
- PETSc Manual:
PF/PFSetFromOptions
PETSc.LibPETSc.PFSetOptionsPrefix — Method
PFSetOptionsPrefix(petsclib::PetscLibType, pf::AbstractPF, prefix::String)Sets the prefix used for searching for all PF options in the database.
Logically Collective
Input Parameters:
pf- thePFcontextprefix- the prefix string to prepend to allPFoption requests
Level: advanced
See also: PF, PFSetFromOptions(), PFAppendOptionsPrefix(), PFGetOptionsPrefix()
External Links
- PETSc Manual:
PF/PFSetOptionsPrefix
PETSc.LibPETSc.PFSetType — Method
PFSetType(petsclib::PetscLibType, pf::AbstractPF, type::String, ctx::Ptr{Cvoid})Builds PF for a particular function
Collective
Input Parameters:
pf- the function context.type- a known type, seePFTypefor available methods (for instance,PFCONSTANT)ctx- optional type dependent context
Options Database Key:
-pf_type (constant|mat|string|quick|identity|matlab)- Set thePFType
Level: intermediate
See also: PF, PFSet(), PFRegister(), PFCreate(), DMDACreatePF(), PFType, PFGetType()
External Links
- PETSc Manual:
PF/PFSetType
PETSc.LibPETSc.PFStringSetFunction — Method
PFStringSetFunction(petsclib::PetscLibType, pf::AbstractPF, string::String)Creates a function from a string
Collective
Input Parameters:
pf- the function objectstring- the string that defines the function
Level: intermediate
See also: PFSetFromOptions()
External Links
- PETSc Manual:
PF/PFStringSetFunction
PETSc.LibPETSc.PFView — Method
PFView(petsclib::PetscLibType, pf::AbstractPF, viewer::PetscViewer)Prints information about a mathematical function
Collective unless viewer is PETSC_VIEWER_STDOUT_SELF
Input Parameters:
pf- thePFcontextviewer- optional visualization context
Level: developer
See also: PF, PetscViewerCreate(), PetscViewerASCIIOpen()
External Links
- PETSc Manual:
PF/PFView
PETSc.LibPETSc.PFViewFromOptions — Method
PFViewFromOptions(petsclib::PetscLibType, A::AbstractPF, obj, name::String)View a PF based on options set in the options database
Collective
Input Parameters:
A- thePFcontextobj- Optional object that provides the prefix used to search the options databasename- command line option
Options Database Key:
-name [viewertype][:...]- option name and values. SeePetscObjectViewFromOptions()for the possible arguments
Level: intermediate
See also: PF, PFView, PetscObjectViewFromOptions(), PFCreate()
External Links
- PETSc Manual:
PF/PFViewFromOptions
PetscPartitioner
PETSc.LibPETSc.PetscPartitionerCreate — Method
part::PetscPartitioner = PetscPartitionerCreate(petsclib::PetscLibType, comm::MPI_Comm)Creates an empty PetscPartitioner object. The type can then be set with PetscPartitionerSetType().
Collective
Input Parameter:
comm- The communicator for thePetscPartitionerobject
Output Parameter:
part- ThePetscPartitionerobject
Level: beginner
See also: PetscPartitionerSetType(), PetscPartitionerDestroy()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerCreate
PETSc.LibPETSc.PetscPartitionerDMPlexPartition — Method
partition::IS = PetscPartitionerDMPlexPartition(petsclib::PetscLibType, part::PetscPartitioner, dm::AbstractPetscDM, targetSection::PetscSection, partSection::PetscSection)Create a non-overlapping partition of the cells in the mesh
Collective
Input Parameters:
part- ThePetscPartitionertargetSection- ThePetscSectiondescribing the absolute weight of each partition (can beNULL)dm- The meshDM
Output Parameters:
partSection- ThePetscSectiongiving the division of points by partitionpartition- The list of points by partition
Level: developer
See also: DM, DMPLEX, PetscPartitioner, PetscSection, DMPlexDistribute(), PetscPartitionerCreate(), PetscSectionCreate(), PetscSectionSetChart(), PetscPartitionerPartition()
External Links
- PETSc Manual:
DMPlex/PetscPartitionerDMPlexPartition
PETSc.LibPETSc.PetscPartitionerDestroy — Method
PetscPartitionerDestroy(petsclib::PetscLibType, part::Union{PetscPartitioner, Ref{PetscPartitioner}})Destroys a PetscPartitioner object
Collective
Input Parameter:
part- thePetscPartitionerobject to destroy
Level: developer
See also: PetscPartitionerView()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerDestroy
PETSc.LibPETSc.PetscPartitionerFinalizePackage — Method
PetscPartitionerFinalizePackage(petsclib::PetscLibType)This function finalizes everything in the PetscPartitioner package. It is called from PetscFinalize().
Level: developer
See also: PetscInitialize()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerFinalizePackage
PETSc.LibPETSc.PetscPartitionerGetType — Method
name::String = PetscPartitionerGetType(petsclib::PetscLibType, part::PetscPartitioner)Gets the PetscPartitioner type name (as a string) from the object.
Not Collective
Input Parameter:
part- The PetscPartitioner
Output Parameter:
name- The PetscPartitioner type name
Level: intermediate
See also: PetscPartitionerSetType(), PetscPartitionerCreate()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerGetType
PETSc.LibPETSc.PetscPartitionerInitializePackage — Method
PetscPartitionerInitializePackage(petsclib::PetscLibType)This function initializes everything in the PetscPartitioner package.
Level: developer
See also: PetscInitialize()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerInitializePackage
PETSc.LibPETSc.PetscPartitionerMatPartitioningGetMatPartitioning — Method
mp::MatPartitioning = PetscPartitionerMatPartitioningGetMatPartitioning(petsclib::PetscLibType, part::PetscPartitioner)Get a MatPartitioning instance wrapped by this PetscPartitioner.
Not Collective
Input Parameter:
part- ThePetscPartitioner
Output Parameter:
mp- TheMatPartitioning
Level: developer
See also: DMPlexDistribute(), PetscPartitionerCreate()
External Links
PETSc.LibPETSc.PetscPartitionerPartition — Method
partition::IS = PetscPartitionerPartition(petsclib::PetscLibType, part::PetscPartitioner, nparts::PetscInt, numVertices::PetscInt, start::Vector{PetscInt}, adjacency::Vector{PetscInt}, vertexSection::PetscSection, edgeSection::PetscSection, targetSection::PetscSection, partSection::PetscSection)Partition a graph
Collective
Input Parameters:
part- ThePetscPartitionernparts- Number of partitionsnumVertices- Number of vertices in the local part of the graphstart- row pointers for the local part of the graph (CSR style)adjacency- adjacency list (CSR style)vertexSection- PetscSection describing the absolute weight of each local vertex (can beNULL)edgeSection- PetscSection describing the absolute weight of each local edge (can beNULL)targetSection- PetscSection describing the absolute weight of each partition (can beNULL)
Output Parameters:
partSection- ThePetscSectiongiving the division of points by partitionpartition- The list of points by partition
Options Database Keys:
-petscpartitioner_view- View the partitioner information-petscpartitioner_view_graph- View the graph we are partitioning
Level: developer
See also: PetscPartitionerCreate(), PetscPartitionerSetType(), PetscSectionCreate(), PetscSectionSetChart(), PetscSectionSetDof()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerPartition
PETSc.LibPETSc.PetscPartitionerRegister — Method
PetscPartitionerRegister(petsclib::PetscLibType, sname::String, fnc::external)Adds a new PetscPartitioner implementation
Not Collective, No Fortran Support
Input Parameters:
sname- The name of a new user-defined creation routinefunction- The creation routine
See also: PetscPartitionerRegisterAll()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerRegister
PETSc.LibPETSc.PetscPartitionerReset — Method
PetscPartitionerReset(petsclib::PetscLibType, part::PetscPartitioner)Resets data structures for the PetscPartitioner
Collective
Input Parameter:
part- thePetscPartitionerobject to reset
Level: developer
See also: PetscPartitionerSetUp(), PetscPartitionerDestroy()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerReset
PETSc.LibPETSc.PetscPartitionerSetFromOptions — Method
PetscPartitionerSetFromOptions(petsclib::PetscLibType, part::PetscPartitioner)sets parameters in a PetscPartitioner from the options database
Collective
Input Parameter:
part- thePetscPartitionerobject to set options for
Options Database Keys:
-petscpartitioner_type type- Sets thePetscPartitionerType-petscpartitioner_use_vertex_weights- Uses weights associated with the graph vertices-petscpartitioner_view_graph- View the graph each time PetscPartitionerPartition is called. Viewer can be customized, seePetscOptionsCreateViewer()
Level: developer
See also: PetscPartitionerView(), PetscPartitionerSetType(), PetscPartitionerPartition()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerSetFromOptions
PETSc.LibPETSc.PetscPartitionerSetType — Method
PetscPartitionerSetType(petsclib::PetscLibType, part::PetscPartitioner, name::String)Builds a particular PetscPartitioner
Collective
Input Parameters:
part- ThePetscPartitionerobjectname- The kind of partitioner
Options Database Key:
-petscpartitioner_type type- Sets thePetscPartitionerType
Level: intermediate
See also: PetscPartitionerGetType(), PetscPartitionerCreate()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerSetType
PETSc.LibPETSc.PetscPartitionerSetUp — Method
PetscPartitionerSetUp(petsclib::PetscLibType, part::PetscPartitioner)Construct data structures for the PetscPartitioner
Collective
Input Parameter:
part- thePetscPartitionerobject to setup
Level: developer
See also: PetscPartitionerView(), PetscPartitionerDestroy()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerSetUp
PETSc.LibPETSc.PetscPartitionerShellGetRandom — Method
random::PetscBool = PetscPartitionerShellGetRandom(petsclib::PetscLibType, part::PetscPartitioner)get the flag to use a random partition
Collective
Input Parameter:
part- ThePetscPartitioner
Output Parameter:
random- The flag to use a random partition
Level: intermediate
See also: PetscPartitionerShellSetRandom(), PetscPartitionerCreate()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerShellGetRandom
PETSc.LibPETSc.PetscPartitionerShellSetPartition — Method
PetscPartitionerShellSetPartition(petsclib::PetscLibType, part::PetscPartitioner, size::PetscInt, sizes::Vector{PetscInt}, points::Vector{PetscInt})Set an artificial partition for a mesh
Collective
Input Parameters:
part- ThePetscPartitionersize- The number of partitionssizes- array of length size (orNULL) providing the number of points in each partitionpoints- array of length sum(sizes) (may beNULLiff sizes isNULL), a permutation of the points that groups those assigned to each partition in order (i.e., partition 0 first, partition 1 next, etc.)
Level: developer
See also: DMPlexDistribute(), PetscPartitionerCreate()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerShellSetPartition
PETSc.LibPETSc.PetscPartitionerShellSetRandom — Method
PetscPartitionerShellSetRandom(petsclib::PetscLibType, part::PetscPartitioner, random::PetscBool)Set the flag to use a random partition
Collective
Input Parameters:
part- ThePetscPartitionerrandom- The flag to use a random partition
Level: intermediate
See also: PetscPartitionerShellGetRandom(), PetscPartitionerCreate()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerShellSetRandom
PETSc.LibPETSc.PetscPartitionerView — Method
PetscPartitionerView(petsclib::PetscLibType, part::PetscPartitioner, v::PetscViewer)Views a PetscPartitioner
Collective
Input Parameters:
part- thePetscPartitionerobject to viewv- the viewer
Level: developer
See also: PetscPartitionerDestroy()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerView
PETSc.LibPETSc.PetscPartitionerViewFromOptions — Method
PetscPartitionerViewFromOptions(petsclib::PetscLibType, A::PetscPartitioner, obj, name::String)View a PetscPartitioner object based on options in the options database
Collective
Input Parameters:
A- thePetscPartitionerobjectobj- OptionalPetscObjectthat provides the options prefixname- command line option
Options Database Key:
-name [viewertype][:...]- option name and values. SeePetscObjectViewFromOptions()for the possible arguments
Level: intermediate
See also: PetscPartitionerView(), PetscObjectViewFromOptions()
External Links
- PETSc Manual:
MatGraphOperations/PetscPartitionerViewFromOptions
PetscRegressor
PETSc.LibPETSc.PetscRegressorAppendOptionsPrefix — Method
PetscRegressorAppendOptionsPrefix(petsclib::PetscLibType, regressor::PetscRegressor, p::String)Appends to the prefix used for searching for all PetscRegressor options in the database.
Logically Collective
Input Parameters:
regressor- thePetscRegressorsolver contextp- the prefix string to prepend to allPetscRegressoroption requests
Level: advanced
See also: PetscRegressor, PetscRegressorSetFromOptions(), PetscRegressorSetOptionsPrefix(), PetscRegressorGetOptionsPrefix()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorAppendOptionsPrefix
PETSc.LibPETSc.PetscRegressorCreate — Method
newregressor::PetscRegressor = PetscRegressorCreate(petsclib::PetscLibType, comm::MPI_Comm)Creates a PetscRegressor object.
Collective
Input Parameter:
comm- the MPI communicator that will share thePetscRegressorobject
Output Parameter:
newregressor- the newPetscRegressorobject
Level: beginner
See also: PetscRegressorFit(), PetscRegressorPredict(), PetscRegressor
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorCreate
PETSc.LibPETSc.PetscRegressorDestroy — Method
PetscRegressorDestroy(petsclib::PetscLibType, regressor::Union{PetscRegressor, Ref{PetscRegressor}})Destroys the regressor context that was created with PetscRegressorCreate().
Collective
Input Parameter:
regressor- thePetscRegressorcontext
Level: beginner
See also: PetscRegressorCreate(), PetscRegressorSetUp(), PetscRegressorReset(), PetscRegressor
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorDestroy
PETSc.LibPETSc.PetscRegressorFinalizePackage — Method
PetscRegressorFinalizePackage(petsclib::PetscLibType)Finalize PetscRegressor package; it is called from PetscFinalize()
Logically Collective
Level: developer
See also: PetscRegressorInitializePackage()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorFinalizePackage
PETSc.LibPETSc.PetscRegressorFit — Method
PetscRegressorFit(petsclib::PetscLibType, regressor::PetscRegressor, X::AbstractPetscMat, y::AbstractPetscVec)Fit, or train, a regressor from a training dataset
Collective
Input Parameters:
regressor- thePetscRegressorcontextX- matrix of training data (of dimension [number of samples] x [number of features])y- vector of target values from the training dataset
Level: beginner
See also: PetscRegressorCreate(), PetscRegressorSetUp(), PetscRegressorDestroy(), PetscRegressorPredict()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorFit
PETSc.LibPETSc.PetscRegressorGetOptionsPrefix — Method
p::String = PetscRegressorGetOptionsPrefix(petsclib::PetscLibType, regressor::PetscRegressor)Gets the prefix used for searching for all PetscRegressor options in the database
Not Collective
Input Parameter:
regressor- thePetscRegressorcontext
Output Parameter:
p- pointer to the prefix string used is returned
See also: PetscRegressor, PetscRegressorSetFromOptions(), PetscRegressorSetOptionsPrefix(), PetscRegressorAppendOptionsPrefix()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorGetOptionsPrefix
PETSc.LibPETSc.PetscRegressorGetTao — Method
tao::Tao = PetscRegressorGetTao(petsclib::PetscLibType, regressor::PetscRegressor)Returns the Tao context for a PetscRegressor object.
Not Collective, but if the PetscRegressor is parallel, then the Tao object is parallel
Input Parameter:
regressor- the regressor context
Output Parameter:
tao- theTaocontext
Level: beginner
See also: PetscRegressorLinearGetKSP()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorGetTao
PETSc.LibPETSc.PetscRegressorGetType — Method
type::String = PetscRegressorGetType(petsclib::PetscLibType, regressor::PetscRegressor)Gets the current PetscRegressorType being used in the PetscRegressor object
Not Collective
Input Parameter:
regressor- thePetscRegressorsolver context
Output Parameter:
type- thePetscRegressorType
Level: intermediate
See also: PetscRegressor, PetscRegressorType, PetscRegressorSetType()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorGetType
PETSc.LibPETSc.PetscRegressorInitializePackage — Method
PetscRegressorInitializePackage(petsclib::PetscLibType)Initialize PetscRegressor package
Logically Collective
Level: developer
See also: PetscRegressorFinalizePackage()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorInitializePackage
PETSc.LibPETSc.PetscRegressorLinearGetKSP — Method
ksp::KSP = PetscRegressorLinearGetKSP(petsclib::PetscLibType, regressor::PetscRegressor)Returns the KSP context for a PETSCREGRESSORLINEAR object.
Not Collective, but if the PetscRegressor is parallel, then the KSP object is parallel
Input Parameter:
regressor- thePetscRegressorcontext
Output Parameter:
ksp- theKSPcontext
Level: beginner
See also: PetscRegressorGetTao()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorLinearGetKSP
PETSc.LibPETSc.PetscRegressorLinearGetType — Method
type::PetscRegressorLinearType = PetscRegressorLinearGetType(petsclib::PetscLibType, regressor::PetscRegressor)Return the type for the PETSCREGRESSORLINEAR solver
Input Parameter:
regressor- thePetscRegressorsolver context
Output Parameter:
type-PETSCREGRESSORLINEARtype
Level: advanced
See also: PetscRegressor, PETSCREGRESSORLINEAR, PetscRegressorLinearSetType(), PetscRegressorLinearType
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorLinearGetType
PETSc.LibPETSc.PetscRegressorLinearSetFitIntercept — Method
PetscRegressorLinearSetFitIntercept(petsclib::PetscLibType, regressor::PetscRegressor, flg::PetscBool)Set a flag to indicate that the intercept (also known as the "bias" or "offset") should be calculated; data are assumed to be mean-centered if false.
Logically Collective
Input Parameters:
regressor- thePetscRegressorcontextflg-PETSC_TRUEto calculate the intercept,PETSC_FALSEto assume mean-centered data (default isPETSC_TRUE)
Level: intermediate
Options Database Key:
regressor_linear_fit_intercept (true|false)- fit the intercept
See also: PetscRegressor, PetscRegressorFit()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorLinearSetFitIntercept
PETSc.LibPETSc.PetscRegressorLinearSetType — Method
PetscRegressorLinearSetType(petsclib::PetscLibType, regressor::PetscRegressor, type::PetscRegressorLinearType)Sets the type of linear regression to be performed
Logically Collective
Input Parameters:
regressor- thePetscRegressorcontext (should be of typePETSCREGRESSORLINEAR)type- a known linear regression method
Options Database Key:
-regressor_linear_type- Sets the linear regression method; use -help for a list of available methods
(for instance "-regressorlineartype ols" or "-regressorlineartype lasso")
Level: intermediate
See also: PetscRegressorLinearGetType(), PetscRegressorLinearType, PetscRegressorSetType(), REGRESSOR_LINEAR_OLS, REGRESSOR_LINEAR_LASSO, REGRESSOR_LINEAR_RIDGE
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorLinearSetType
PETSc.LibPETSc.PetscRegressorLinearSetUseKSP — Method
PetscRegressorLinearSetUseKSP(petsclib::PetscLibType, regressor::PetscRegressor, flg::PetscBool)Set a flag to indicate that a KSP object, instead of a Tao one, should be used to fit the linear regressor
Logically Collective
Input Parameters:
regressor- thePetscRegressorcontextflg-PETSC_TRUEto use aKSP,PETSC_FALSEto use aTaoobject (default is false)
Options Database Key:
regressor_linear_use_ksp (true|false)- useKSP
Level: intermediate
See also: PetscRegressor, PetscRegressorLinearGetKSP(), KSPLSQR, PCQR, MATSOLVERSPQR, MatSolverType, MATSEQDENSE, PCSVD
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorLinearSetUseKSP
PETSc.LibPETSc.PetscRegressorPredict — Method
PetscRegressorPredict(petsclib::PetscLibType, regressor::PetscRegressor, X::AbstractPetscMat, y::AbstractPetscVec)Compute predictions (that is, perform inference) using a fitted regression model.
Collective
Input Parameters:
regressor- thePetscRegressorcontext (for whichPetscRegressorFit()must have been called)X- data matrix of unlabeled observations
Output Parameter:
y- vector of predicted labels
Level: beginner
See also: PetscRegressorFit(), PetscRegressorDestroy()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorPredict
PETSc.LibPETSc.PetscRegressorRegister — Method
PetscRegressorRegister(petsclib::PetscLibType, sname::String, fnc::external)Adds a method to the PetscRegressor package.
Not collective
Input Parameters:
sname- name of a new user-defined regressorfunction- routine to create method context
See also: PetscRegressorRegisterAll()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorRegister
PETSc.LibPETSc.PetscRegressorReset — Method
PetscRegressorReset(petsclib::PetscLibType, regressor::PetscRegressor)Resets a PetscRegressor context by removing any allocated Vec and Mat. Any options set in the object remain.
Collective
Input Parameter:
regressor- context obtained fromPetscRegressorCreate()
Level: intermediate
See also: PetscRegressorCreate(), PetscRegressorSetUp(), PetscRegressorFit(), PetscRegressorPredict(), PetscRegressorDestroy()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorReset
PETSc.LibPETSc.PetscRegressorSetFromOptions — Method
PetscRegressorSetFromOptions(petsclib::PetscLibType, regressor::PetscRegressor)Sets PetscRegressor options from the options database.
Collective
Input Parameter:
regressor- thePetscRegressorcontext
Options Database Keys:
-regressor_type (linear)- the particular type of regressor to be used
Level: beginner
See also: PetscRegressor, PetscRegressorCreate()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorSetFromOptions
PETSc.LibPETSc.PetscRegressorSetOptionsPrefix — Method
PetscRegressorSetOptionsPrefix(petsclib::PetscLibType, regressor::PetscRegressor, p::String)Sets the prefix used for searching for all PetscRegressor options in the database.
Logically Collective
Input Parameters:
regressor- thePetscRegressorcontextp- the prefix string to prepend to all PetscRegressor option requests
Level: advanced
See also: PetscRegressor, PetscRegressorSetFromOptions(), PetscRegressorAppendOptionsPrefix(), PetscRegressorGetOptionsPrefix()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorSetOptionsPrefix
PETSc.LibPETSc.PetscRegressorSetRegularizerWeight — Method
PetscRegressorSetRegularizerWeight(petsclib::PetscLibType, regressor::PetscRegressor, weight::PetscReal)Sets the weight to be used for the regularizer for a PetscRegressor context
Logically Collective
Input Parameters:
regressor- thePetscRegressorcontextweight- the regularizer weight
Options Database Key:
regressor_regularizer_weight weight- sets the regularizer's weight
Level: beginner
See also: PetscRegressorSetType
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorSetRegularizerWeight
PETSc.LibPETSc.PetscRegressorSetType — Method
PetscRegressorSetType(petsclib::PetscLibType, regressor::PetscRegressor, type::String)Sets the type for the regressor.
Collective
Input Parameters:
regressor- thePetscRegressorcontexttype- a known regression method
Options Database Key:
-regressor_type type- Sets the type of regressor; use -help for a list of available types
Level: intermediate
See also: PetscRegressorType
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorSetType
PETSc.LibPETSc.PetscRegressorSetUp — Method
PetscRegressorSetUp(petsclib::PetscLibType, regressor::PetscRegressor)Sets up the internal data structures for the later use of a regressor.
Collective
Input Parameter:
regressor- thePetscRegressorcontext
See also: PetscRegressorCreate(), PetscRegressorFit(), PetscRegressorDestroy()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorSetUp
PETSc.LibPETSc.PetscRegressorView — Method
PetscRegressorView(petsclib::PetscLibType, regressor::PetscRegressor, viewer::PetscViewer)Prints information about the PetscRegressor object
Collective
Input Parameters:
regressor- thePetscRegressorcontextviewer- aPetscViewercontext
Options Database Key:
-regressor_view- CallsPetscRegressorView()at the end ofPetscRegressorFit()
Level: beginner
See also: PetscRegressor, PetscViewerASCIIOpen()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorView
PETSc.LibPETSc.PetscRegressorViewFromOptions — Method
PetscRegressorViewFromOptions(petsclib::PetscLibType, A::PetscRegressor, obj, name::String)View a PetscRegressor object based on values in the options database
Collective
Input Parameters:
A- thePetscRegressorcontextobj- Optional object that provides the prefix for the options databasename- command line option
Options Database Key:
-name [viewertype][:...]- option name and values. SeePetscObjectViewFromOptions()for the possible arguments
Level: intermediate
See also: PetscRegressor, PetscRegressorView, PetscObjectViewFromOptions(), PetscRegressorCreate()
External Links
- PETSc Manual:
PetscRegressor/PetscRegressorViewFromOptions
PetscDA
PETSc.LibPETSc.PetscDAAppendOptionsPrefix — Method
PetscDAAppendOptionsPrefix(petsclib::PetscLibType, das::PetscDA, p::String)Appends to the prefix used for searching for all PetscDA options in the database.
Logically Collective
Input Parameters:
das- thePetscDAcontextp- the prefix string to prepend to allPetscDAoption requests
Level: advanced
See also: PetscDA, PetscDASetFromOptions(), PetscDASetOptionsPrefix(), PetscDAGetOptionsPrefix()
External Links
- PETSc Manual:
PetscDA/PetscDAAppendOptionsPrefix
PETSc.LibPETSc.PetscDACreate — Method
da_out::PetscDA = PetscDACreate(petsclib::PetscLibType, comm::MPI_Comm)Creates a new PetscDA object for data assimilation.
Collective
Input Parameter:
comm- MPI communicator used to create the object
Output Parameter:
da_out- newly createdPetscDAobject
Level: beginner
See also: PetscDADestroy(), PetscDASetType(), PetscDASetUp()
External Links
- PETSc Manual:
PetscDA/PetscDACreate
PETSc.LibPETSc.PetscDADestroy — Method
PetscDADestroy(petsclib::PetscLibType, da::Union{PetscDA, Ref{PetscDA}})Destroys a PetscDA object and releases its resources.
Collective
Input Parameter:
da- pointer to thePetscDAobject to destroy
Level: beginner
See also: PetscDACreate()
External Links
- PETSc Manual:
PetscDA/PetscDADestroy
PETSc.LibPETSc.PetscDAEnsembleAnalysis — Method
PetscDAEnsembleAnalysis(petsclib::PetscLibType, da::PetscDA, observation::AbstractPetscVec, H::AbstractPetscMat)Executes the analysis (update) step using sparse observation matrix H
Collective
Input Parameters:
da- thePetscDAcontextobservation- observation vector y in R^PH- observation operator matrix (P x N), sparse AIJ format
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleForecast(), PetscDASetObsErrorVariance()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleAnalysis
PETSc.LibPETSc.PetscDAEnsembleApplySqrtTInverse — Method
PetscDAEnsembleApplySqrtTInverse(petsclib::PetscLibType, da::PetscDA, U::AbstractPetscMat, Y::AbstractPetscMat)Apply T^{-1/2} to a matrix U [Alg 6.4 line 9]
Collective
Input Parameters:
da- thePetscDAcontextU- input matrix (usually Identity, but can be general)
Output Parameter:
Y- output matrix Y = T^{-1/2} * U
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleTFactor(), PetscDAEnsembleApplyTInverse()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleApplySqrtTInverse
PETSc.LibPETSc.PetscDAEnsembleApplyTInverse — Method
PetscDAEnsembleApplyTInverse(petsclib::PetscLibType, da::PetscDA, sdel::AbstractPetscVec, w::AbstractPetscVec)Apply T^{-1} to a vector [Alg 6.4 line 8]
Collective
Input Parameters:
da- thePetscDAcontextsdel- input vector S^T-delta
Output Parameter:
w- output vector w = T^{-1} * sdel
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleTFactor(), PetscDAEnsembleApplySqrtTInverse()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleApplyTInverse
PETSc.LibPETSc.PetscDAEnsembleComputeAnomalies — Method
anomalies_out::PetscMat = PetscDAEnsembleComputeAnomalies(petsclib::PetscLibType, da::PetscDA, mean_in::AbstractPetscVec)Forms the state-space anomalies matrix for a PetscDA.
Collective
Input Parameters:
da- thePetscDAcontextmean_in- optional mean state vector (passNULLto compute internally)
Output Parameter:
anomalies_out- location to store the newly created anomalies matrix
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleComputeMean()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleComputeAnomalies
PETSc.LibPETSc.PetscDAEnsembleComputeMean — Method
PetscDAEnsembleComputeMean(petsclib::PetscLibType, da::PetscDA, mean::AbstractPetscVec)Computes ensemble mean for a PetscDA
Collective
Input Parameter:
da- thePetscDAcontext
Output Parameter:
mean- vector that will hold the ensemble mean
Level: intermediate
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleComputeAnomalies()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleComputeMean
PETSc.LibPETSc.PetscDAEnsembleComputeNormalizedInnovationMatrix — Method
PetscDAEnsembleComputeNormalizedInnovationMatrix(petsclib::PetscLibType, Z::AbstractPetscMat, y_mean::AbstractPetscVec, r_inv_sqrt::AbstractPetscVec, m::PetscInt, scale::PetscScalar, S::AbstractPetscMat)Computes S = R^{-1/2}(Z - y_mean * 1')/sqrt(m-1) [Alg 6.4 line 5]
Collective
Input Parameters:
Z- observation ensemble matrixy_mean- mean of observationsr_inv_sqrt- R^{-1/2}m- ensemble sizescale- 1/sqrt(m-1)
Output Parameter:
S- normalized innovation matrix
Level: developer
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDASetSizes(), PetscDAGetSizes()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleComputeNormalizedInnovationMatrix
PETSc.LibPETSc.PetscDAEnsembleForecast — Method
PetscDAEnsembleForecast(petsclib::PetscLibType, da::PetscDA, model::external, ctx::Ptr{Cvoid})Advances every ensemble member through the user-supplied forecast model.
Collective
Input Parameters:
da- thePetscDAcontextmodel- routine that evaluates the model mapf(input, output; ctx)ctx- optional context formodel
Level: intermediate
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleAnalysis()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleForecast
PETSc.LibPETSc.PetscDAEnsembleGetInflation — Method
inflation::PetscReal = PetscDAEnsembleGetInflation(petsclib::PetscLibType, da::PetscDA)Gets the inflation factor for the data assimilation method.
Not Collective
Input Parameter:
da- thePetscDAcontext
Output Parameter:
inflation- the inflation factor
Level: intermediate
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleSetInflation()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleGetInflation
PETSc.LibPETSc.PetscDAEnsembleGetMember — Method
member::PetscVec = PetscDAEnsembleGetMember(petsclib::PetscLibType, da::PetscDA, member_idx::PetscInt)Returns a read-only view of an ensemble member stored in the PetscDA.
Collective
Input Parameters:
da- thePetscDAcontextmember_idx- index of the requested member (0 <= idx < ensemble_size)
Output Parameter:
member- read-only vector view; callPetscDAEnsembleRestoreMember()when done
Level: intermediate
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleRestoreMember(), PetscDAEnsembleSetMember()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleGetMember
PETSc.LibPETSc.PetscDAEnsembleGetSize — Method
ensemble_size::PetscInt = PetscDAEnsembleGetSize(petsclib::PetscLibType, da::PetscDA)Retrieves the dimension of the ensemble in a PetscDA.
Not Collective
Input Parameter:
da- thePetscDAcontext
Output Parameters:
ensemble_size- number of ensemble members
Level: beginner
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDASetSizes(), PetscDAGetSizes()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleGetSize
PETSc.LibPETSc.PetscDAEnsembleGetSqrtType — Method
type::PetscDASqrtType = PetscDAEnsembleGetSqrtType(petsclib::PetscLibType, da::PetscDA)Retrieves the current square-root implementation configured for analysis.
Not Collective
Input Parameters:
da- thePetscDAobject
Output Parameter:
type- on output, the configuredPetscDASqrtType
Level: advanced
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleSetSqrtType()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleGetSqrtType
PETSc.LibPETSc.PetscDAEnsembleInitialize — Method
PetscDAEnsembleInitialize(petsclib::PetscLibType, da::PetscDA, x0::AbstractPetscVec, obs_error_std::PetscReal, rng::PetscRandom)Initialize ensemble members with Gaussian perturbations
Input Parameters:
da- PetscDA contextx0- Background stateobs_error_std- Standard deviation for perturbationsrng- Random number generator
Level: beginner
See also: PETSCDAETKF, PETSCDALETKF, PetscDA
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleInitialize
PETSc.LibPETSc.PetscDAEnsembleRestoreMember — Method
PetscDAEnsembleRestoreMember(petsclib::PetscLibType, da::PetscDA, member_idx::PetscInt, member::AbstractPetscVec)Returns a column view obtained with PetscDAEnsembleGetMember().
Collective
Input Parameters:
da- thePetscDAcontextmember_idx- index that was previously requestedmember- location that holds the view to restore
Level: intermediate
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleGetMember()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleRestoreMember
PETSc.LibPETSc.PetscDAEnsembleSetInflation — Method
PetscDAEnsembleSetInflation(petsclib::PetscLibType, da::PetscDA, inflation::PetscReal)Sets the inflation factor for the data assimilation method.
Logically Collective
Input Parameters:
da- thePetscDAcontextinflation- the inflation factor (must be >= 1.0)
Level: intermediate
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleGetInflation()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleSetInflation
PETSc.LibPETSc.PetscDAEnsembleSetMember — Method
PetscDAEnsembleSetMember(petsclib::PetscLibType, da::PetscDA, member_idx::PetscInt, member::AbstractPetscVec)Overwrites an ensemble member with user-provided state data.
Collective
Input Parameters:
da- thePetscDAcontextmember_idx- index of the entry to modifymember- vector containing the new state values
Level: intermediate
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleGetMember()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleSetMember
PETSc.LibPETSc.PetscDAEnsembleSetSize — Method
PetscDAEnsembleSetSize(petsclib::PetscLibType, da::PetscDA, ensemble_size::PetscInt)Sets the ensemble dimensions used by a PetscDA.
Collective
Input Parameters:
da- thePetscDAcontextensemble_size- number of ensemble members
Options Database Key:
-petscda_ensemble_size <size>- number of ensemble members
Level: beginner
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAGetSizes(), PetscDASetSizes(), PetscDASetUp()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleSetSize
PETSc.LibPETSc.PetscDAEnsembleSetSqrtType — Method
PetscDAEnsembleSetSqrtType(petsclib::PetscLibType, da::PetscDA, type::PetscDASqrtType)Selects the reduced-space square-root algorithm used during analysis.
Logically Collective
Input Parameters:
da- thePetscDAobjecttype- eitherPETSCDA_SQRT_CHOLESKYorPETSCDA_SQRT_EIGEN
Options Database Key:
-petscda_ensemble_sqrt_type <cholesky or eigen>- set thePetscDASqrtType
Level: advanced
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDASqrtType, PetscDAEnsembleGetSqrtType()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleSetSqrtType
PETSc.LibPETSc.PetscDAEnsembleTFactor — Method
PetscDAEnsembleTFactor(petsclib::PetscLibType, da::PetscDA, S::AbstractPetscMat)Compute and store factorization of T matrix
Collective
Input Parameters:
da- thePetscDAcontextS- normalized innovation matrix (obs_size x m)
See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleApplyTInverse(), PetscDAEnsembleApplySqrtTInverse()
External Links
- PETSc Manual:
PetscDA/PetscDAEnsembleTFactor
PETSc.LibPETSc.PetscDAFinalizePackage — Method
PetscDAFinalizePackage(petsclib::PetscLibType)This function finalizes everything in the PetscDA package. It is called from PetscFinalize().
Logically Collective
Level: developer
See also: PetscDAInitializePackage(), PetscInitialize()
External Links
- PETSc Manual:
PetscDA/PetscDAFinalizePackage
PETSc.LibPETSc.PetscDAGetNDOF — Method
ndof::PetscInt = PetscDAGetNDOF(petsclib::PetscLibType, da::PetscDA)Get the number of degrees of freedom per grid point
Not Collective
Input Parameter:
da- thePetscDAcontext
Output Parameter:
ndof- number of degrees of freedom per grid point
Level: intermediate
See also: PetscDA, PetscDASetNDOF()
External Links
- PETSc Manual:
PetscDA/PetscDAGetNDOF
PETSc.LibPETSc.PetscDAGetObsErrorVariance — Method
obs_error_var::PetscVec = PetscDAGetObsErrorVariance(petsclib::PetscLibType, da::PetscDA)Returns a borrowed reference to the observation-error variance vector.
Not Collective
Input Parameter:
da- thePetscDAcontext
Output Parameter:
obs_error_var- pointer to the variance vector managed by thePetscDA
Level: beginner
See also: PetscDASetObsErrorVariance()
External Links
- PETSc Manual:
PetscDA/PetscDAGetObsErrorVariance
PETSc.LibPETSc.PetscDAGetOptionsPrefix — Method
p::String = PetscDAGetOptionsPrefix(petsclib::PetscLibType, das::PetscDA)Gets the prefix used for searching for all PetscDA options in the database
Not Collective
Input Parameter:
das- thePetscDAcontext
Output Parameter:
p- pointer to the prefix string used
Level: advanced
See also: PetscDA, PetscDASetFromOptions(), PetscDASetOptionsPrefix(), PetscDAAppendOptionsPrefix()
External Links
- PETSc Manual:
PetscDA/PetscDAGetOptionsPrefix
PETSc.LibPETSc.PetscDAGetSizes — Method
state_size::PetscInt,obs_size::PetscInt = PetscDAGetSizes(petsclib::PetscLibType, da::PetscDA)Retrieves the state size and observation size from a PetscDA.
Not Collective
Input Parameter:
da- thePetscDAcontext
Output Parameters:
state_size- number of state components (may beNULL)obs_size- number of observation components (may beNULL)
Level: beginner
See also: PetscDASetSizes()
External Links
- PETSc Manual:
PetscDA/PetscDAGetSizes
PETSc.LibPETSc.PetscDAGetType — Method
type::String = PetscDAGetType(petsclib::PetscLibType, da::PetscDA)Gets the name of the implementation currently associated with a PetscDA.
Not Collective
Input Parameter:
da- thePetscDAcontext
Output Parameter:
type- pointer that will receive the type name (may beNULL)
Level: intermediate
See also: PetscDASetType()
External Links
- PETSc Manual:
PetscDA/PetscDAGetType
PETSc.LibPETSc.PetscDAInitializePackage — Method
PetscDAInitializePackage(petsclib::PetscLibType)This function initializes everything in the PetscDA package. called on the first call to PetscDACreate() when using static or shared libraries.
Logically Collective
Level: developer
See also: PetscDAFinalizePackage(), PetscInitialize()
External Links
- PETSc Manual:
PetscDA/PetscDAInitializePackage
PETSc.LibPETSc.PetscDALETKFGetLocalizationMatrix — Method
PetscDALETKFGetLocalizationMatrix(petsclib::PetscLibType, n_obs_vertex::PetscInt, n_dof::PetscInt, Vecxyz::Vector{<:AbstractPetscVec}, bd::Vector{PetscReal}, H::AbstractPetscMat, Q::AbstractPetscMat)External Links
- PETSc Manual:
PC/PetscDALETKFGetLocalizationMatrix
PETSc.LibPETSc.PetscDALETKFGetObsPerVertex — Method
n_obs_vertex::PetscInt = PetscDALETKFGetObsPerVertex(petsclib::PetscLibType, da::PetscDA)Gets the number of local observations per vertex for the LETKF algorithm.
Not Collective
Input Parameter:
da- thePetscDAcontext
Output Parameter:
n_obs_vertex- number of observations per vertex
Level: advanced
See also: PETSCDALETKF, PetscDA, PetscDALETKFSetObsPerVertex()
External Links
- PETSc Manual:
PetscDA/PetscDALETKFGetObsPerVertex
PETSc.LibPETSc.PetscDALETKFSetLocalization — Method
PetscDALETKFSetLocalization(petsclib::PetscLibType, da::PetscDA, Q::AbstractPetscMat, H::AbstractPetscMat)Sets the localization matrix for the LETKF algorithm.
Collective
Input Parameters:
da- thePetscDAcontextQ- the localization matrix (N x P)H- the observation operator matrix (P x N)
Level: advanced
See also: PETSCDALETKF, PetscDA
External Links
- PETSc Manual:
PetscDA/PetscDALETKFSetLocalization
PETSc.LibPETSc.PetscDALETKFSetObsPerVertex — Method
PetscDALETKFSetObsPerVertex(petsclib::PetscLibType, da::PetscDA, n_obs_vertex::PetscInt)Sets the number of local observations per vertex for the LETKF algorithm.
Logically Collective
Input Parameters:
da- thePetscDAcontextn_obs_vertex- number of observations per vertex
Level: advanced
See also: PETSCDALETKF, PetscDA, PetscDALETKFSetLocalization()
External Links
- PETSc Manual:
PetscDA/PetscDALETKFSetObsPerVertex
PETSc.LibPETSc.PetscDARegister — Method
PetscDARegister(petsclib::PetscLibType, sname::String, fnc::external)Registers a constructor for a PetscDA implementation with the dispatcher.
Not Collective
Input Parameters:
sname- name associated with the implementationfunction- routine that creates the implementation and installs method table
Level: developer
See also: PetscDARegisterAll(), PetscDASetType()
External Links
- PETSc Manual:
PetscDA/PetscDARegister
PETSc.LibPETSc.PetscDARegisterAll — Method
PetscDARegisterAll(petsclib::PetscLibType)Registers all data assimilation backends that were compiled in.
Not Collective
Level: developer
See also: PetscDARegister()
External Links
- PETSc Manual:
PetscDA/PetscDARegisterAll
PETSc.LibPETSc.PetscDASetFromOptions — Method
PetscDASetFromOptions(petsclib::PetscLibType, da::PetscDA)Configures a PetscDA object from the options database.
Collective
Input Parameter:
da- thePetscDAcontext to set up
Level: intermediate
See also: PetscDASetType(), PetscObjectOptionsBegin()
External Links
- PETSc Manual:
PetscDA/PetscDASetFromOptions
PETSc.LibPETSc.PetscDASetLocalSizes — Method
PetscDASetLocalSizes(petsclib::PetscLibType, da::PetscDA, local_state_size::PetscInt, local_obs_size::PetscInt)Sets the local state and observation dimensions used by a PetscDA.
Collective
Input Parameters:
da- thePetscDAcontextlocal_state_size- number of local state components (orPETSC_DECIDE)local_obs_size- number of local observation components (orPETSC_DECIDE)
Level: beginner
See also: PetscDASetSizes(), PetscDASetUp()
External Links
- PETSc Manual:
PetscDA/PetscDASetLocalSizes
PETSc.LibPETSc.PetscDASetNDOF — Method
PetscDASetNDOF(petsclib::PetscLibType, da::PetscDA, ndof::PetscInt)Set the number of degrees of freedom per grid point
Logically Collective
Input Parameters:
da- thePetscDAcontextndof- number of degrees of freedom per grid point (e.g., 2 for shallow water with h and hu)
Level: intermediate
See also: PetscDA, PetscDAGetNDOF(), PetscDASetUp(), PetscDASetSizes()
External Links
- PETSc Manual:
PetscDA/PetscDASetNDOF
PETSc.LibPETSc.PetscDASetObsErrorVariance — Method
PetscDASetObsErrorVariance(petsclib::PetscLibType, da::PetscDA, obs_error_var::AbstractPetscVec)Sets the observation-error variances associated with a PetscDA.
Collective
Input Parameters:
da- thePetscDAcontextobs_error_var- vector containing observation error variances (assumes R is a diagonal matrix)
See also: PetscDAGetObsErrorVariance()
External Links
- PETSc Manual:
PetscDA/PetscDASetObsErrorVariance
PETSc.LibPETSc.PetscDASetOptionsPrefix — Method
PetscDASetOptionsPrefix(petsclib::PetscLibType, das::PetscDA, p::String)Sets the prefix used for searching for all PetscDA options in the database.
Logically Collective
Input Parameters:
das- thePetscDAcontextp- the prefix string to prepend to all PetscDA option requests
Level: advanced
See also: PetscDA, PetscDASetFromOptions(), PetscDAAppendOptionsPrefix(), PetscDAGetOptionsPrefix()
External Links
- PETSc Manual:
PetscDA/PetscDASetOptionsPrefix
PETSc.LibPETSc.PetscDASetSizes — Method
PetscDASetSizes(petsclib::PetscLibType, da::PetscDA, state_size::PetscInt, obs_size::PetscInt)Sets the state and observation sizes for a PetscDA
Collective
Input Parameters:
da- thePetscDAcontextstate_size- number of state componentsobs_size- number of observation components
Level: beginner
See also: PetscDAGetSizes(), PetscDASetUp(), PetscDAEnsembleSetSize()
External Links
- PETSc Manual:
PetscDA/PetscDASetSizes
PETSc.LibPETSc.PetscDASetType — Method
PetscDASetType(petsclib::PetscLibType, da::PetscDA, type::String)Sets the data assimilation implementation used by a PetscDA object.
Collective
Input Parameters:
da- thePetscDAcontexttype- name of the implementation (for examplePETSCDAETKF)
Level: intermediate
See also: PetscDAGetType(), PetscDARegister()
External Links
- PETSc Manual:
PetscDA/PetscDASetType
PETSc.LibPETSc.PetscDASetUp — Method
PetscDASetUp(petsclib::PetscLibType, da::PetscDA)Allocates internal data structures for a PetscDA based on the previously provided sizes.
Collective
Input Parameter:
da- thePetscDAcontext to assemble
Level: beginner
See also: PetscDASetSizes(), PetscDASetType()
External Links
- PETSc Manual:
PetscDA/PetscDASetUp
PETSc.LibPETSc.PetscDAView — Method
PetscDAView(petsclib::PetscLibType, da::PetscDA, viewer::PetscViewer)Views a PetscDA and its implementation-specific data structure.
Collective
Input Parameters:
da- thePetscDAcontextviewer- thePetscViewerto use (orNULLfor standard output)
Level: beginner
See also: PetscDAViewFromOptions()
External Links
- PETSc Manual:
PetscDA/PetscDAView
PETSc.LibPETSc.PetscDAViewFromOptions — Method
PetscDAViewFromOptions(petsclib::PetscLibType, da::PetscDA, obj, name::String)Processes command-line options to determine if a PetscDA should be viewed.
Collective
Input Parameters:
da- thePetscDAcontextobj- optional object that provides the prefix for optionsname- option name to check
Options Database Key:
-name [viewertype][:...]- option name and values. SeePetscObjectViewFromOptions()for the possible arguments
Level: beginner
See also: PetscDAView(), PetscObjectViewFromOptions()
External Links
- PETSc Manual:
PetscDA/PetscDAViewFromOptions
PETSc.LibPETSc.PetscDataTypeFromString — Method
ptype::PetscDataType,found::PetscBool = PetscDataTypeFromString(petsclib::PetscLibType, name::String)Gets the enum value of a PETSc datatype represented as a string
Not Collective
Input Parameter:
name- the PETSc datatype name (for example, "double" or "real")
Output Parameters:
ptype- the enum value, only valid if found isPETSC_TRUEfound- the string matches one of the data types
Level: advanced
See also: PetscDataType, PetscDataTypeToMPIDataType(), PetscDataTypeGetSize()
External Links
- PETSc Manual:
Sys/PetscDataTypeFromString
PETSc.LibPETSc.PetscDataTypeGetSize — Method
size::Csize_t = PetscDataTypeGetSize(petsclib::PetscLibType, ptype::PetscDataType)Gets the size (in bytes) of a PETSc datatype
Not Collective
Input Parameter:
ptype- the PETSc datatype name (for examplePETSC_DOUBLE)
Output Parameter:
size- the size in bytes (for example the size ofPETSC_DOUBLEis 8)
Level: advanced
See also: PetscDataType, PetscDataTypeToMPIDataType()
External Links
- PETSc Manual:
Sys/PetscDataTypeGetSize
PETSc.LibPETSc.PetscDataTypeToHDF5DataType — Method
htype::hid_t = PetscDataTypeToHDF5DataType(petsclib::PetscLibType, ptype::PetscDataType)Converts the PETSc name of a datatype to its HDF5 name.
Not Collective
Input Parameter:
ptype- the PETSc datatype name (for examplePETSC_DOUBLE)
Output Parameter:
htype- the HDF5 datatype
Level: advanced
See also: PetscDataType, PetscHDF5DataTypeToPetscDataType()
External Links
- PETSc Manual:
Viewer/PetscDataTypeToHDF5DataType
Characteristic
PETSc.LibPETSc.CharacteristicCreate — Method
c::Characteristic = CharacteristicCreate(petsclib::PetscLibType, comm::MPI_Comm)Creates a Characteristic context for use with the Method of Characteristics
Collective
Input Parameter:
comm- MPI communicator
Output Parameter:
c- theCharacteristiccontext
Level: beginner
See also: Characteristic, CharacteristicDestroy()
External Links
- PETSc Manual:
Characteristic/CharacteristicCreate
PETSc.LibPETSc.CharacteristicDestroy — Method
CharacteristicDestroy(petsclib::PetscLibType, c::Union{Characteristic, Ref{Characteristic}})Destroys a Characteristic context created with CharacteristicCreate()
Collective
Input Parameter:
c- theCharacteristiccontext
Level: beginner
See also: Characteristic, CharacteristicCreate()
External Links
- PETSc Manual:
Characteristic/CharacteristicDestroy
PETSc.LibPETSc.CharacteristicFinalizePackage — Method
CharacteristicFinalizePackage(petsclib::PetscLibType)This function destroys everything in the Characteristics package. It is called from PetscFinalize().
Level: developer
See also: PetscFinalize(), CharacteristicInitializePackage()
External Links
- PETSc Manual:
Characteristic/CharacteristicFinalizePackage
PETSc.LibPETSc.CharacteristicInitializePackage — Method
CharacteristicInitializePackage(petsclib::PetscLibType)This function initializes everything in the Characteristic package. It is called from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to CharacteristicCreate() when using static libraries.
Level: developer
See also: PetscInitialize(), CharacteristicFinalizePackage()
External Links
- PETSc Manual:
Sys/CharacteristicInitializePackage
PETSc.LibPETSc.CharacteristicRegister — Method
CharacteristicRegister(petsclib::PetscLibType, sname::String, fnc::external)Adds an approarch to the method of characteristics package.
Not Collective, No Fortran Support
Input Parameters:
sname- name of a new approachfunction- routine to create method context
Level: advanced
See also: CharacteristicRegisterAll(), CharacteristicRegisterDestroy()
External Links
- PETSc Manual:
Characteristic/CharacteristicRegister
PETSc.LibPETSc.CharacteristicSetFieldInterpolation — Method
CharacteristicSetFieldInterpolation(petsclib::PetscLibType, c::Characteristic, da::AbstractPetscDM, v::AbstractPetscVec, numComponents::PetscInt, components::Vector{PetscInt}, interp::external, ctx::Ptr{Cvoid})Sets the routine used to interpolate the field being advected at the foot of a characteristic
Not Collective
Input Parameters:
c- theCharacteristiccontextda- theDMdescribing the layout of the field vectorv- the field vector to be advectednumComponents- the number of field components to interpolatecomponents- the indices of the field components invinterp- the interpolation routine, called with the global vectorctx- context passed to the interpolation routine
Calling sequence of interp:
v- the fieldVecfrom which to interpolateinterpIndices- the coordinates at which to interpolatenumComponents- the number of components to interpolatecomponents- the indices of the components invvalues- the interpolated values, one per component per pointctx- the application context
Level: developer
See also: Characteristic, CharacteristicSetFieldInterpolationLocal(), CharacteristicSetVelocityInterpolation()
External Links
- PETSc Manual:
Characteristic/CharacteristicSetFieldInterpolation
PETSc.LibPETSc.CharacteristicSetFieldInterpolationLocal — Method
CharacteristicSetFieldInterpolationLocal(petsclib::PetscLibType, c::Characteristic, da::AbstractPetscDM, v::AbstractPetscVec, numComponents::PetscInt, components::Vector{PetscInt}, interp::external, ctx::Ptr{Cvoid})Sets the routine used to interpolate the field being advected at the foot of a characteristic using a locally-accessible array
Not Collective
Input Parameters:
c- theCharacteristiccontextda- theDMdescribing the layout of the field vectorv- the field vector to be advectednumComponents- the number of field components to interpolatecomponents- the indices of the field components invinterp- the interpolation routine, called with a local array pointer rather than aVecctx- context passed to the interpolation routine
Calling sequence of interp:
array- the locally-accessible array of the field vector obtained from theDMinterpIndices- the coordinates at which to interpolatenumComponents- the number of components to interpolatecomponents- the indices of the components in the arrayvalues- the interpolated values, one per component per pointctx- the application context
Level: developer
See also: Characteristic, CharacteristicSetFieldInterpolation(), CharacteristicSetVelocityInterpolationLocal()
External Links
- PETSc Manual:
Characteristic/CharacteristicSetFieldInterpolationLocal
PETSc.LibPETSc.CharacteristicSetType — Method
CharacteristicSetType(petsclib::PetscLibType, c::Characteristic, type::String)Builds Characteristic for a particular solver.
Logically Collective
Input Parameters:
c- the method of characteristics contexttype- a known method
Options Database Key:
-characteristic_type method- Sets the method; use -help for a list
of available methods
Level: intermediate
See also: CharacteristicType
External Links
- PETSc Manual:
Characteristic/CharacteristicSetType
PETSc.LibPETSc.CharacteristicSetUp — Method
CharacteristicSetUp(petsclib::PetscLibType, c::Characteristic)Sets up the internal data structures for the later use of a Charactoristic .
Collective
Input Parameter:
c- context obtained from CharacteristicCreate()
Level: developer
See also: Characteristic, CharacteristicCreate(), CharacteristicSolve(), CharacteristicDestroy()
External Links
- PETSc Manual:
Characteristic/CharacteristicSetUp
PETSc.LibPETSc.CharacteristicSetVelocityInterpolation — Method
CharacteristicSetVelocityInterpolation(petsclib::PetscLibType, c::Characteristic, da::AbstractPetscDM, v::AbstractPetscVec, vOld::AbstractPetscVec, numComponents::PetscInt, components::Vector{PetscInt}, interp::external, ctx::Ptr{Cvoid})Sets the routine used to interpolate the velocity field at points along a characteristic
Not Collective
Input Parameters:
c- theCharacteristiccontextda- theDMdescribing the layout of the velocity vectorsv- the current velocity vectorvOld- the previous-time-step velocity vectornumComponents- the number of velocity components to interpolatecomponents- the indices of the velocity components invandvOldinterp- the interpolation routine, called with the global vectorctx- context passed to the interpolation routine
Calling sequence of interp:
v- the velocityVecfrom which to interpolateinterpIndices- the coordinates at which to interpolatenumComponents- the number of components to interpolatecomponents- the indices of the components invvalues- the interpolated values, one per component per pointctx- the application context
Level: developer
See also: Characteristic, CharacteristicSetVelocityInterpolationLocal(), CharacteristicSetFieldInterpolation()
External Links
- PETSc Manual:
Characteristic/CharacteristicSetVelocityInterpolation
PETSc.LibPETSc.CharacteristicSetVelocityInterpolationLocal — Method
CharacteristicSetVelocityInterpolationLocal(petsclib::PetscLibType, c::Characteristic, da::AbstractPetscDM, v::AbstractPetscVec, vOld::AbstractPetscVec, numComponents::PetscInt, components::Vector{PetscInt}, interp::external, ctx::Ptr{Cvoid})Sets the routine used to interpolate the velocity field along a characteristic using a locally-accessible array
Not Collective
Input Parameters:
c- theCharacteristiccontextda- theDMdescribing the layout of the velocity vectorsv- the current velocity vectorvOld- the previous-time-step velocity vectornumComponents- the number of velocity components to interpolatecomponents- the indices of the velocity components invandvOldinterp- the interpolation routine, called with a local array pointer rather than aVecctx- context passed to the interpolation routine
Calling sequence of interp:
array- the locally-accessible array of the velocity vector obtained from theDMinterpIndices- the coordinates at which to interpolatenumComponents- the number of components to interpolatecomponents- the indices of the components in the arrayvalues- the interpolated values, one per component per pointctx- the application context
Level: developer
See also: Characteristic, CharacteristicSetVelocityInterpolation(), CharacteristicSetFieldInterpolationLocal()
External Links
PETSc.LibPETSc.CharacteristicSolve — Method
CharacteristicSolve(petsclib::PetscLibType, c::Characteristic, dt::PetscReal, solution::AbstractPetscVec)Apply the Method of Characteristics solver
Collective
Input Parameters:
c- context obtained fromCharacteristicCreate()dt- the time-stepsolution- vector holding the solution
Level: developer
See also: Characteristic, CharacteristicCreate(), CharacteristicDestroy()
External Links
- PETSc Manual:
Characteristic/CharacteristicSolve