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 - the PF
  • prefix - the prefix string to prepend to all PF option requests

Level: advanced

See also: PF, PFSetFromOptions(), PFSetOptionsPrefix(), PFGetOptionsPrefix()

External Links

source
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 context
  • n - 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

source
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 context
  • x - input vector (or NULL for the vector (0,1, .... N-1)

Output Parameter:

  • y - output vector

Level: beginner

See also: PF, PFApply(), PFCreate(), PFDestroy(), PFSetType(), PFSet()

External Links

source
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 communicator
  • dimin - dimension of the space you are mapping from
  • dimout - 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

source
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

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

Output Parameter:

  • prefix - pointer to the prefix string used, is returned

Level: advanced

See also: PF, PFSetFromOptions(), PFSetOptionsPrefix(), PFAppendOptionsPrefix()

External Links

source
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

source
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

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

See also: PF, PFRegisterAll(), PFRegisterDestroy()

External Links

source
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 context
  • apply - function to apply to an array
  • applyvec - function to apply to a Vec
  • view - function that prints information about the PF
  • destroy - function to free the private function context
  • ctx - private function context

Level: beginner

See also: PF, PFCreate(), PFDestroy(), PFSetType(), PFApply(), PFApplyVec()

External Links

source
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

source
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 - the PF context
  • prefix - the prefix string to prepend to all PF option requests

Level: advanced

See also: PF, PFSetFromOptions(), PFAppendOptionsPrefix(), PFGetOptionsPrefix()

External Links

source
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, see PFType for available methods (for instance, PFCONSTANT)
  • ctx - optional type dependent context

Options Database Key:

  • -pf_type (constant|mat|string|quick|identity|matlab) - Set the PFType

Level: intermediate

See also: PF, PFSet(), PFRegister(), PFCreate(), DMDACreatePF(), PFType, PFGetType()

External Links

source
PETSc.LibPETSc.PFStringSetFunction — Method
PFStringSetFunction(petsclib::PetscLibType, pf::AbstractPF, string::String)

Creates a function from a string

Collective

Input Parameters:

  • pf - the function object
  • string - the string that defines the function

Level: intermediate

See also: PFSetFromOptions()

External Links

source
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 - the PF context
  • viewer - optional visualization context

Level: developer

See also: PF, PetscViewerCreate(), PetscViewerASCIIOpen()

External Links

source
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 - the PF context
  • obj - Optional object that provides the prefix used to search the options database
  • name - command line option

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: PF, PFView, PetscObjectViewFromOptions(), PFCreate()

External Links

source

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 the PetscPartitioner object

Output Parameter:

  • part - The PetscPartitioner object

Level: beginner

See also: PetscPartitionerSetType(), PetscPartitionerDestroy()

External Links

source
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 - The PetscPartitioner
  • targetSection - The PetscSection describing the absolute weight of each partition (can be NULL)
  • dm - The mesh DM

Output Parameters:

  • partSection - The PetscSection giving the division of points by partition
  • partition - The list of points by partition

Level: developer

See also: DM, DMPLEX, PetscPartitioner, PetscSection, DMPlexDistribute(), PetscPartitionerCreate(), PetscSectionCreate(), PetscSectionSetChart(), PetscPartitionerPartition()

External Links

source
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

source
PETSc.LibPETSc.PetscPartitionerMatPartitioningGetMatPartitioning — Method
mp::MatPartitioning = PetscPartitionerMatPartitioningGetMatPartitioning(petsclib::PetscLibType, part::PetscPartitioner)

Get a MatPartitioning instance wrapped by this PetscPartitioner.

Not Collective

Input Parameter:

  • part - The PetscPartitioner

Output Parameter:

  • mp - The MatPartitioning

Level: developer

See also: DMPlexDistribute(), PetscPartitionerCreate()

External Links

source
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 - The PetscPartitioner
  • nparts - Number of partitions
  • numVertices - Number of vertices in the local part of the graph
  • start - 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 be NULL)
  • edgeSection - PetscSection describing the absolute weight of each local edge (can be NULL)
  • targetSection - PetscSection describing the absolute weight of each partition (can be NULL)

Output Parameters:

  • partSection - The PetscSection giving the division of points by partition
  • partition - 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

source
PETSc.LibPETSc.PetscPartitionerSetFromOptions — Method
PetscPartitionerSetFromOptions(petsclib::PetscLibType, part::PetscPartitioner)

sets parameters in a PetscPartitioner from the options database

Collective

Input Parameter:

  • part - the PetscPartitioner object to set options for

Options Database Keys:

  • -petscpartitioner_type type - Sets the PetscPartitionerType
  • -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, see PetscOptionsCreateViewer()

Level: developer

See also: PetscPartitionerView(), PetscPartitionerSetType(), PetscPartitionerPartition()

External Links

source
PETSc.LibPETSc.PetscPartitionerSetType — Method
PetscPartitionerSetType(petsclib::PetscLibType, part::PetscPartitioner, name::String)

Builds a particular PetscPartitioner

Collective

Input Parameters:

  • part - The PetscPartitioner object
  • name - The kind of partitioner

Options Database Key:

  • -petscpartitioner_type type - Sets the PetscPartitionerType

Level: intermediate

See also: PetscPartitionerGetType(), PetscPartitionerCreate()

External Links

source
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 - The PetscPartitioner
  • size - The number of partitions
  • sizes - array of length size (or NULL) providing the number of points in each partition
  • points - array of length sum(sizes) (may be NULL iff sizes is NULL), 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

source
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 - the PetscPartitioner object
  • obj - Optional PetscObject that provides the options prefix
  • name - command line option

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: PetscPartitionerView(), PetscObjectViewFromOptions()

External Links

source

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 - the PetscRegressor solver context
  • p - the prefix string to prepend to all PetscRegressor option requests

Level: advanced

See also: PetscRegressor, PetscRegressorSetFromOptions(), PetscRegressorSetOptionsPrefix(), PetscRegressorGetOptionsPrefix()

External Links

source
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 the PetscRegressor object

Output Parameter:

  • newregressor - the new PetscRegressor object

Level: beginner

See also: PetscRegressorFit(), PetscRegressorPredict(), PetscRegressor

External Links

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

Level: beginner

See also: PetscRegressorCreate(), PetscRegressorSetUp(), PetscRegressorReset(), PetscRegressor

External Links

source
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 - the PetscRegressor context
  • X - 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

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

Output Parameter:

  • p - pointer to the prefix string used is returned

See also: PetscRegressor, PetscRegressorSetFromOptions(), PetscRegressorSetOptionsPrefix(), PetscRegressorAppendOptionsPrefix()

External Links

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

Level: beginner

See also: PetscRegressorLinearGetKSP()

External Links

source
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 - the PetscRegressor solver context

Output Parameter:

  • type - the PetscRegressorType

Level: intermediate

See also: PetscRegressor, PetscRegressorType, PetscRegressorSetType()

External Links

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

Output Parameter:

  • ksp - the KSP context

Level: beginner

See also: PetscRegressorGetTao()

External Links

source
PETSc.LibPETSc.PetscRegressorLinearGetType — Method
type::PetscRegressorLinearType = PetscRegressorLinearGetType(petsclib::PetscLibType, regressor::PetscRegressor)

Return the type for the PETSCREGRESSORLINEAR solver

Input Parameter:

  • regressor - the PetscRegressor solver context

Output Parameter:

  • type - PETSCREGRESSORLINEAR type

Level: advanced

See also: PetscRegressor, PETSCREGRESSORLINEAR, PetscRegressorLinearSetType(), PetscRegressorLinearType

External Links

source
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 - the PetscRegressor context
  • flg - PETSC_TRUE to calculate the intercept, PETSC_FALSE to assume mean-centered data (default is PETSC_TRUE)

Level: intermediate

Options Database Key:

  • regressor_linear_fit_intercept (true|false) - fit the intercept

See also: PetscRegressor, PetscRegressorFit()

External Links

source
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 - the PetscRegressor context (should be of type PETSCREGRESSORLINEAR)
  • 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

source
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 - the PetscRegressor context
  • flg - PETSC_TRUE to use a KSP, PETSC_FALSE to use a Tao object (default is false)

Options Database Key:

  • regressor_linear_use_ksp (true|false) - use KSP

Level: intermediate

See also: PetscRegressor, PetscRegressorLinearGetKSP(), KSPLSQR, PCQR, MATSOLVERSPQR, MatSolverType, MATSEQDENSE, PCSVD

External Links

source
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 - the PetscRegressor context (for which PetscRegressorFit() 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

source
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 from PetscRegressorCreate()

Level: intermediate

See also: PetscRegressorCreate(), PetscRegressorSetUp(), PetscRegressorFit(), PetscRegressorPredict(), PetscRegressorDestroy()

External Links

source
PETSc.LibPETSc.PetscRegressorSetFromOptions — Method
PetscRegressorSetFromOptions(petsclib::PetscLibType, regressor::PetscRegressor)

Sets PetscRegressor options from the options database.

Collective

Input Parameter:

  • regressor - the PetscRegressor context

Options Database Keys:

  • -regressor_type (linear) - the particular type of regressor to be used

Level: beginner

See also: PetscRegressor, PetscRegressorCreate()

External Links

source
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 - the PetscRegressor context
  • p - the prefix string to prepend to all PetscRegressor option requests

Level: advanced

See also: PetscRegressor, PetscRegressorSetFromOptions(), PetscRegressorAppendOptionsPrefix(), PetscRegressorGetOptionsPrefix()

External Links

source
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 - the PetscRegressor context
  • weight - the regularizer weight

Options Database Key:

  • regressor_regularizer_weight weight - sets the regularizer's weight

Level: beginner

See also: PetscRegressorSetType

External Links

source
PETSc.LibPETSc.PetscRegressorSetType — Method
PetscRegressorSetType(petsclib::PetscLibType, regressor::PetscRegressor, type::String)

Sets the type for the regressor.

Collective

Input Parameters:

  • regressor - the PetscRegressor context
  • type - 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

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

See also: PetscRegressorCreate(), PetscRegressorFit(), PetscRegressorDestroy()

External Links

source
PETSc.LibPETSc.PetscRegressorView — Method
PetscRegressorView(petsclib::PetscLibType, regressor::PetscRegressor, viewer::PetscViewer)

Prints information about the PetscRegressor object

Collective

Input Parameters:

  • regressor - the PetscRegressor context
  • viewer - a PetscViewer context

Options Database Key:

  • -regressor_view - Calls PetscRegressorView() at the end of PetscRegressorFit()

Level: beginner

See also: PetscRegressor, PetscViewerASCIIOpen()

External Links

source
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 - the PetscRegressor context
  • obj - Optional object that provides the prefix for the options database
  • name - command line option

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: PetscRegressor, PetscRegressorView, PetscObjectViewFromOptions(), PetscRegressorCreate()

External Links

source

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 - the PetscDA context
  • p - the prefix string to prepend to all PetscDA option requests

Level: advanced

See also: PetscDA, PetscDASetFromOptions(), PetscDASetOptionsPrefix(), PetscDAGetOptionsPrefix()

External Links

source
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 created PetscDA object

Level: beginner

See also: PetscDADestroy(), PetscDASetType(), PetscDASetUp()

External Links

source
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 the PetscDA object to destroy

Level: beginner

See also: PetscDACreate()

External Links

source
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 - the PetscDA context
  • observation - observation vector y in R^P
  • H - observation operator matrix (P x N), sparse AIJ format

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleForecast(), PetscDASetObsErrorVariance()

External Links

source
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 - the PetscDA context
  • U - 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

source
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 - the PetscDA context
  • sdel - input vector S^T-delta

Output Parameter:

  • w - output vector w = T^{-1} * sdel

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleTFactor(), PetscDAEnsembleApplySqrtTInverse()

External Links

source
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 - the PetscDA context
  • mean_in - optional mean state vector (pass NULL to compute internally)

Output Parameter:

  • anomalies_out - location to store the newly created anomalies matrix

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleComputeMean()

External Links

source
PETSc.LibPETSc.PetscDAEnsembleComputeMean — Method
PetscDAEnsembleComputeMean(petsclib::PetscLibType, da::PetscDA, mean::AbstractPetscVec)

Computes ensemble mean for a PetscDA

Collective

Input Parameter:

  • da - the PetscDA context

Output Parameter:

  • mean - vector that will hold the ensemble mean

Level: intermediate

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleComputeAnomalies()

External Links

source
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 matrix
  • y_mean - mean of observations
  • r_inv_sqrt - R^{-1/2}
  • m - ensemble size
  • scale - 1/sqrt(m-1)

Output Parameter:

  • S - normalized innovation matrix

Level: developer

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDASetSizes(), PetscDAGetSizes()

External Links

source
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 - the PetscDA context
  • model - routine that evaluates the model map f(input, output; ctx)
  • ctx - optional context for model

Level: intermediate

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleAnalysis()

External Links

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

Output Parameter:

  • inflation - the inflation factor

Level: intermediate

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleSetInflation()

External Links

source
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 - the PetscDA context
  • member_idx - index of the requested member (0 <= idx < ensemble_size)

Output Parameter:

  • member - read-only vector view; call PetscDAEnsembleRestoreMember() when done

Level: intermediate

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleRestoreMember(), PetscDAEnsembleSetMember()

External Links

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

Output Parameters:

  • ensemble_size - number of ensemble members

Level: beginner

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDASetSizes(), PetscDAGetSizes()

External Links

source
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 - the PetscDA object

Output Parameter:

  • type - on output, the configured PetscDASqrtType

Level: advanced

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleSetSqrtType()

External Links

source
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 context
  • x0 - Background state
  • obs_error_std - Standard deviation for perturbations
  • rng - Random number generator

Level: beginner

See also: PETSCDAETKF, PETSCDALETKF, PetscDA

External Links

source
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 - the PetscDA context
  • member_idx - index that was previously requested
  • member - location that holds the view to restore

Level: intermediate

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleGetMember()

External Links

source
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 - the PetscDA context
  • inflation - the inflation factor (must be >= 1.0)

Level: intermediate

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleGetInflation()

External Links

source
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 - the PetscDA context
  • member_idx - index of the entry to modify
  • member - vector containing the new state values

Level: intermediate

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleGetMember()

External Links

source
PETSc.LibPETSc.PetscDAEnsembleSetSize — Method
PetscDAEnsembleSetSize(petsclib::PetscLibType, da::PetscDA, ensemble_size::PetscInt)

Sets the ensemble dimensions used by a PetscDA.

Collective

Input Parameters:

  • da - the PetscDA context
  • ensemble_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

source
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 - the PetscDA object
  • type - either PETSCDA_SQRT_CHOLESKY or PETSCDA_SQRT_EIGEN

Options Database Key:

  • -petscda_ensemble_sqrt_type <cholesky or eigen> - set the PetscDASqrtType

Level: advanced

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDASqrtType, PetscDAEnsembleGetSqrtType()

External Links

source
PETSc.LibPETSc.PetscDAEnsembleTFactor — Method
PetscDAEnsembleTFactor(petsclib::PetscLibType, da::PetscDA, S::AbstractPetscMat)

Compute and store factorization of T matrix

Collective

Input Parameters:

  • da - the PetscDA context
  • S - normalized innovation matrix (obs_size x m)

See also: PetscDA, PETSCDAETKF, PETSCDALETKF, PetscDAEnsembleApplyTInverse(), PetscDAEnsembleApplySqrtTInverse()

External Links

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

Output Parameter:

  • ndof - number of degrees of freedom per grid point

Level: intermediate

See also: PetscDA, PetscDASetNDOF()

External Links

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

Output Parameter:

  • obs_error_var - pointer to the variance vector managed by the PetscDA

Level: beginner

See also: PetscDASetObsErrorVariance()

External Links

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

Output Parameter:

  • p - pointer to the prefix string used

Level: advanced

See also: PetscDA, PetscDASetFromOptions(), PetscDASetOptionsPrefix(), PetscDAAppendOptionsPrefix()

External Links

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

Output Parameters:

  • state_size - number of state components (may be NULL)
  • obs_size - number of observation components (may be NULL)

Level: beginner

See also: PetscDASetSizes()

External Links

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

Output Parameter:

  • type - pointer that will receive the type name (may be NULL)

Level: intermediate

See also: PetscDASetType()

External Links

source
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

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

Output Parameter:

  • n_obs_vertex - number of observations per vertex

Level: advanced

See also: PETSCDALETKF, PetscDA, PetscDALETKFSetObsPerVertex()

External Links

source
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 - the PetscDA context
  • Q - the localization matrix (N x P)
  • H - the observation operator matrix (P x N)

Level: advanced

See also: PETSCDALETKF, PetscDA

External Links

source
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 - the PetscDA context
  • n_obs_vertex - number of observations per vertex

Level: advanced

See also: PETSCDALETKF, PetscDA, PetscDALETKFSetLocalization()

External Links

source
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 implementation
  • function - routine that creates the implementation and installs method table

Level: developer

See also: PetscDARegisterAll(), PetscDASetType()

External Links

source
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 - the PetscDA context
  • local_state_size - number of local state components (or PETSC_DECIDE)
  • local_obs_size - number of local observation components (or PETSC_DECIDE)

Level: beginner

See also: PetscDASetSizes(), PetscDASetUp()

External Links

source
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 - the PetscDA context
  • ndof - 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

source
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 - the PetscDA context
  • obs_error_var - vector containing observation error variances (assumes R is a diagonal matrix)

See also: PetscDAGetObsErrorVariance()

External Links

source
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 - the PetscDA context
  • p - the prefix string to prepend to all PetscDA option requests

Level: advanced

See also: PetscDA, PetscDASetFromOptions(), PetscDAAppendOptionsPrefix(), PetscDAGetOptionsPrefix()

External Links

source
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 - the PetscDA context
  • state_size - number of state components
  • obs_size - number of observation components

Level: beginner

See also: PetscDAGetSizes(), PetscDASetUp(), PetscDAEnsembleSetSize()

External Links

source
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 - the PetscDA context
  • type - name of the implementation (for example PETSCDAETKF)

Level: intermediate

See also: PetscDAGetType(), PetscDARegister()

External Links

source
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 - the PetscDA context to assemble

Level: beginner

See also: PetscDASetSizes(), PetscDASetType()

External Links

source
PETSc.LibPETSc.PetscDAView — Method
PetscDAView(petsclib::PetscLibType, da::PetscDA, viewer::PetscViewer)

Views a PetscDA and its implementation-specific data structure.

Collective

Input Parameters:

  • da - the PetscDA context
  • viewer - the PetscViewer to use (or NULL for standard output)

Level: beginner

See also: PetscDAViewFromOptions()

External Links

source
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 - the PetscDA context
  • obj - optional object that provides the prefix for options
  • name - option name to check

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: beginner

See also: PetscDAView(), PetscObjectViewFromOptions()

External Links

source
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 is PETSC_TRUE
  • found - the string matches one of the data types

Level: advanced

See also: PetscDataType, PetscDataTypeToMPIDataType(), PetscDataTypeGetSize()

External Links

source
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 example PETSC_DOUBLE)

Output Parameter:

  • size - the size in bytes (for example the size of PETSC_DOUBLE is 8)

Level: advanced

See also: PetscDataType, PetscDataTypeToMPIDataType()

External Links

source
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 example PETSC_DOUBLE)

Output Parameter:

  • htype - the HDF5 datatype

Level: advanced

See also: PetscDataType, PetscHDF5DataTypeToPetscDataType()

External Links

source

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 - the Characteristic context

Level: beginner

See also: Characteristic, CharacteristicDestroy()

External Links

source
PETSc.LibPETSc.CharacteristicDestroy — Method
CharacteristicDestroy(petsclib::PetscLibType, c::Union{Characteristic, Ref{Characteristic}})

Destroys a Characteristic context created with CharacteristicCreate()

Collective

Input Parameter:

  • c - the Characteristic context

Level: beginner

See also: Characteristic, CharacteristicCreate()

External Links

source
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

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

Level: advanced

See also: CharacteristicRegisterAll(), CharacteristicRegisterDestroy()

External Links

source
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 - the Characteristic context
  • da - the DM describing the layout of the field vector
  • v - the field vector to be advected
  • numComponents - the number of field components to interpolate
  • components - the indices of the field components in v
  • interp - the interpolation routine, called with the global vector
  • ctx - context passed to the interpolation routine

Calling sequence of interp:

  • v - the field Vec from which to interpolate
  • interpIndices - the coordinates at which to interpolate
  • numComponents - the number of components to interpolate
  • components - the indices of the components in v
  • values - the interpolated values, one per component per point
  • ctx - the application context

Level: developer

See also: Characteristic, CharacteristicSetFieldInterpolationLocal(), CharacteristicSetVelocityInterpolation()

External Links

source
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 - the Characteristic context
  • da - the DM describing the layout of the field vector
  • v - the field vector to be advected
  • numComponents - the number of field components to interpolate
  • components - the indices of the field components in v
  • interp - the interpolation routine, called with a local array pointer rather than a Vec
  • ctx - context passed to the interpolation routine

Calling sequence of interp:

  • array - the locally-accessible array of the field vector obtained from the DM
  • interpIndices - the coordinates at which to interpolate
  • numComponents - the number of components to interpolate
  • components - the indices of the components in the array
  • values - the interpolated values, one per component per point
  • ctx - the application context

Level: developer

See also: Characteristic, CharacteristicSetFieldInterpolation(), CharacteristicSetVelocityInterpolationLocal()

External Links

source
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 context
  • type - 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

source
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

source
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 - the Characteristic context
  • da - the DM describing the layout of the velocity vectors
  • v - the current velocity vector
  • vOld - the previous-time-step velocity vector
  • numComponents - the number of velocity components to interpolate
  • components - the indices of the velocity components in v and vOld
  • interp - the interpolation routine, called with the global vector
  • ctx - context passed to the interpolation routine

Calling sequence of interp:

  • v - the velocity Vec from which to interpolate
  • interpIndices - the coordinates at which to interpolate
  • numComponents - the number of components to interpolate
  • components - the indices of the components in v
  • values - the interpolated values, one per component per point
  • ctx - the application context

Level: developer

See also: Characteristic, CharacteristicSetVelocityInterpolationLocal(), CharacteristicSetFieldInterpolation()

External Links

source
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 - the Characteristic context
  • da - the DM describing the layout of the velocity vectors
  • v - the current velocity vector
  • vOld - the previous-time-step velocity vector
  • numComponents - the number of velocity components to interpolate
  • components - the indices of the velocity components in v and vOld
  • interp - the interpolation routine, called with a local array pointer rather than a Vec
  • ctx - context passed to the interpolation routine

Calling sequence of interp:

  • array - the locally-accessible array of the velocity vector obtained from the DM
  • interpIndices - the coordinates at which to interpolate
  • numComponents - the number of components to interpolate
  • components - the indices of the components in the array
  • values - the interpolated values, one per component per point
  • ctx - the application context

Level: developer

See also: Characteristic, CharacteristicSetVelocityInterpolation(), CharacteristicSetFieldInterpolationLocal()

External Links

source
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 from CharacteristicCreate()
  • dt - the time-step
  • solution - vector holding the solution

Level: developer

See also: Characteristic, CharacteristicCreate(), CharacteristicDestroy()

External Links

source