DM (Domain Management)

The DM (Domain Management) object encapsulates the relationship between a mesh data structure and the algebraic objects (vectors, matrices). It provides a common interface for structured and unstructured meshes, particles, networks, and other geometric/topological structures.

Overview

The DM abstraction in PETSc manages:

  • Topology and geometry of computational domains
  • Mapping between geometric entities and degrees of freedom
  • Distribution of data across MPI processes
  • Multi-level representations for multigrid
  • Field definitions and discretizations

Basic Usage Pattern

using PETSc, MPI

# Initialize
petsclib = PETSc.petsclibs[1]
PETSc.initialize(petsclib)

# Create a DM (specific type created via DMDACreate, DMPlexCreate, etc.)
# See subtype-specific pages for creation functions

# Setup the DM
LibPETSc.DMSetFromOptions(petsclib, dm)
LibPETSc.DMSetUp(petsclib, dm)

# Create global vectors
x = LibPETSc.DMCreateGlobalVector(petsclib, dm)

# Create matrices
A = LibPETSc.DMCreateMatrix(petsclib, dm)

# Use the DM...

# Cleanup
LibPETSc.VecDestroy(petsclib, x)
LibPETSc.MatDestroy(petsclib, A)
LibPETSc.DMDestroy(petsclib, dm)
PETSc.finalize(petsclib)

DM Subtypes

PETSc provides several DM implementations for different problem types:

  • DMDA: Structured grids (1D, 2D, 3D) with regular topology
  • DMPlex: Unstructured meshes using Sieve/DMPlex topology
  • DMStag: Staggered grids for staggered finite differences
  • DMSwarm: Particle methods and particle-in-cell
  • DMForest: Adaptive mesh refinement with forest-of-octrees
  • DMNetwork: Network/graph-based problems
  • DMShell and others: User-defined and composite DM types

General DM Functions

The following functions work across all DM types:

PETSc.LibPETSc.DMAdaptInterpolator — Method
InAdapt::PetscMat = DMAdaptInterpolator(petsclib::PetscLibType, dmc::AbstractPetscDM, dmf::AbstractPetscDM, In::AbstractPetscMat, smoother::AbstractKSP, MF::AbstractPetscMat, MC::AbstractPetscMat, user::Ptr{Cvoid})

Adapts a grid interpolator so that it accurately reproduces a set of sample fine-grid vectors

Collective

Input Parameters:

  • dmc - the coarse DM
  • dmf - the fine DM
  • In - the input (unadapted) interpolation matrix from dmc to dmf
  • smoother - a KSP whose operator provides the fine-grid matrix used to weight modes by their Rayleigh quotient
  • MF - a dense matrix whose columns are fine-grid sample vectors
  • MC - a dense matrix whose columns are the corresponding coarse-grid sample vectors (may be NULL, in which case In^T MF is used)
  • user - unused application context

Output Parameter:

  • InAdapt - the adapted interpolation matrix (created inside the routine)

Options Database Key:

  • -dm_interpolator_adapt_debug flag - print diagnostic information about the least-squares systems solved for each row

Level: developer

See also: DM, Mat, KSP, DMCheckInterpolator(), DMCreateInterpolation(), PCMG

External Links

source
PETSc.LibPETSc.DMAdaptLabel — Method
dmAdapt::PetscDM = DMAdaptLabel(petsclib::PetscLibType, dm::AbstractPetscDM, label::DMLabel)

Adapt a DM based on a DMLabel with values interpreted as coarsening and refining flags. Specific implementations of DM maybe have specialized flags, but all implementations should accept flag values DM_ADAPT_DETERMINE, DM_ADAPT_KEEP, DM_ADAPT_REFINE, and, DM_ADAPT_COARSEN.

Collective

Input Parameters:

  • dm - the pre-adaptation DM object
  • label - label with the flags

Output Parameters:

  • dmAdapt - the adapted DM object: may be NULL if an adapted DM could not be produced.

Level: intermediate

See also: DM, DMAdaptMetric(), DMCoarsen(), DMRefine()

External Links

source
PETSc.LibPETSc.DMAdaptMetric — Method
dmAdapt::PetscDM = DMAdaptMetric(petsclib::PetscLibType, dm::AbstractPetscDM, metric::AbstractPetscVec, bdLabel::DMLabel, rgLabel::DMLabel)

Generates a mesh adapted to the specified metric field.

Input Parameters:

  • dm - The DM object
  • metric - The metric to which the mesh is adapted, defined vertex-wise.
  • bdLabel - Label for boundary tags, which will be preserved in the output mesh. bdLabel should be NULL if there is no such label, and should be different from "boundary".
  • rgLabel - Label for cell tags, which will be preserved in the output mesh. rgLabel should be NULL if there is no such label, and should be different from "regions".

Output Parameter:

  • dmAdapt - Pointer to the DM object containing the adapted mesh

See also: DMAdaptLabel(), DMCoarsen(), DMRefine()

External Links

source
PETSc.LibPETSc.DMAddBoundary — Method
bd::PetscInt = DMAddBoundary(petsclib::PetscLibType, dm::AbstractPetscDM, type::DMBoundaryConditionType, name::String, label::DMLabel, Nv::PetscInt, values::Vector{PetscInt}, field::PetscInt, Nc::PetscInt, comps::Vector{PetscInt}, bcFunc::Ptr{Cvoid}, bcFunc_t::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Add a boundary condition, for a single field, to a model represented by a DM

Collective

Input Parameters:

  • dm - The DM, with a PetscDS that matches the problem being constrained
  • type - The type of condition, e.g. DM_BC_ESSENTIAL_ANALYTIC, DM_BC_ESSENTIAL_FIELD (Dirichlet), or DM_BC_NATURAL (Neumann)
  • name - The BC name
  • label - The label defining constrained points
  • Nv - The number of DMLabel values for constrained points
  • values - An array of values for constrained points
  • field - The field to constrain
  • Nc - The number of constrained field components (0 will constrain all components)
  • comps - An array of constrained component numbers
  • bcFunc - A pointwise function giving boundary values
  • bcFunc_t - A pointwise function giving the time derivative of the boundary values, or NULL
  • ctx - An optional application context for bcFunc

Output Parameter:

  • bd - (Optional) Boundary number

Options Database Keys:

  • -bc_NAME values - Overrides the boundary ids for boundary named NAME
  • -bc_NAME_comp comps - Overrides the boundary components for boundary named NAME

Level: intermediate

See also: DM, DSGetBoundary(), PetscDSAddBoundary()

External Links

source
PETSc.LibPETSc.DMAddField — Method
DMAddField(petsclib::PetscLibType, dm::AbstractPetscDM, label::DMLabel, disc)

Add a field to a DM object. A field is a function space defined by of a set of discretization points (geometric entities) and a discretization object that defines the function space associated with those points.

Logically Collective

Input Parameters:

  • dm - The DM
  • label - The label indicating the support of the field, or NULL for the entire mesh
  • disc - The discretization object

Level: intermediate

See also: DM, DMSetLabel(), DMSetField(), DMGetField(), PetscFE

External Links

source
PETSc.LibPETSc.DMAddLabel — Method
DMAddLabel(petsclib::PetscLibType, dm::AbstractPetscDM, label::DMLabel)

Add the label to this DM

Not Collective

Input Parameters:

  • dm - The DM object
  • label - The DMLabel

Level: developer

See also: DM, DMLabel, DMCreateLabel(), DMHasLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMAppendOptionsPrefix — Method
DMAppendOptionsPrefix(petsclib::PetscLibType, dm::AbstractPetscDM, prefix::String)

Appends an additional string to an already existing prefix used for searching for DM options in the options database.

Logically Collective

Input Parameters:

  • dm - the DM context
  • prefix - the string to append to the current prefix

Level: advanced

See also: DM, DMSetOptionsPrefix(), DMGetOptionsPrefix(), PetscObjectAppendOptionsPrefix(), DMSetFromOptions()

External Links

source
PETSc.LibPETSc.DMCheckInterpolator — Method
DMCheckInterpolator(petsclib::PetscLibType, dmf::AbstractPetscDM, In::AbstractPetscMat, MC::AbstractPetscMat, MF::AbstractPetscMat, tol::PetscReal)

Check that an interpolation matrix accurately reproduces a set of sample fine-grid vectors

Collective

Input Parameters:

  • dmf - the fine DM
  • In - the interpolation matrix from a coarse DM to dmf
  • MC - a dense matrix whose columns are coarse-grid sample vectors
  • MF - a dense matrix whose columns are the corresponding fine-grid sample vectors
  • tol - tolerance on the maximum 2-norm of vf - I vc across all sample vectors

Options Database Key:

  • -dm_interpolator_adapt_error view - view the coarse, fine, and error vectors for each sample

Level: developer

See also: DM, Mat, DMAdaptInterpolator(), DMCreateInterpolation(), PCMG

External Links

source
PETSc.LibPETSc.DMClearAuxiliaryVec — Method
DMClearAuxiliaryVec(petsclib::PetscLibType, dm::AbstractPetscDM)

Destroys the auxiliary vector information and creates a new empty one

Not Collective

Input Parameter:

  • dm - The DM

Level: advanced

See also: DM, DMCopyAuxiliaryVec(), DMGetNumAuxiliaryVec(), DMGetAuxiliaryVec(), DMSetAuxiliaryVec()

External Links

source
PETSc.LibPETSc.DMClearDS — Method
DMClearDS(petsclib::PetscLibType, dm::AbstractPetscDM)

Remove all discrete systems from the DM

Logically Collective

Input Parameter:

  • dm - The DM

Level: intermediate

See also: DM, DMGetNumDS(), DMGetDS(), DMSetField()

External Links

source
PETSc.LibPETSc.DMClearFields — Method
DMClearFields(petsclib::PetscLibType, dm::AbstractPetscDM)

Remove all fields from the DM

Logically Collective

Input Parameter:

  • dm - The DM

Level: intermediate

See also: DM, DMGetNumFields(), DMSetNumFields(), DMSetField()

External Links

source
PETSc.LibPETSc.DMClearGlobalVectors — Method
DMClearGlobalVectors(petsclib::PetscLibType, dm::AbstractPetscDM)

Destroys all the global vectors that have been created for DMGetGlobalVector() calls in this DM

Collective

Input Parameter:

  • dm - the DM

Level: developer

See also: DM, DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMCreateLocalVector(), DMRestoreLocalVector(), VecStrideMax(), VecStrideMin(), VecStrideNorm(), DMClearLocalVectors()

External Links

source
PETSc.LibPETSc.DMClearLabelStratum — Method
DMClearLabelStratum(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, value::PetscInt)

Remove all points from a stratum from a DMLabel

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name
  • value - The label value for this point

Output Parameter:

Level: beginner

See also: DM, DMLabel, DMLabelClearStratum(), DMSetLabelValue(), DMGetStratumIS(), DMClearLabelValue()

External Links

source
PETSc.LibPETSc.DMClearLabelValue — Method
DMClearLabelValue(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, point::PetscInt, value::PetscInt)

Remove a point from a DMLabel with given value

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name
  • point - The mesh point
  • value - The label value for this point

Level: beginner

See also: DM, DMLabelClearValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMClearLocalVectors — Method
DMClearLocalVectors(petsclib::PetscLibType, dm::AbstractPetscDM)

Destroys all the local vectors that have been created for DMGetLocalVector() calls in this DM

Collective

Input Parameter:

  • dm - the DM

Level: developer

See also: DM, DMCreateLocalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMLocalToLocalBegin(), DMLocalToLocalEnd(), DMRestoreLocalVector(), VecStrideMax(), VecStrideMin(), VecStrideNorm(), DMClearGlobalVectors()

External Links

source
PETSc.LibPETSc.DMClearNamedGlobalVectors — Method
DMClearNamedGlobalVectors(petsclib::PetscLibType, dm::AbstractPetscDM)

Destroys all the named global vectors that have been created with DMGetNamedGlobalVector() in this DM

Collective

Input Parameter:

  • dm - the DM

Level: developer

See also: DM, DMGetNamedGlobalVector(), DMGetNamedLocalVector(), DMClearNamedLocalVectors()

External Links

source
PETSc.LibPETSc.DMClearNamedLocalVectors — Method
DMClearNamedLocalVectors(petsclib::PetscLibType, dm::AbstractPetscDM)

Destroys all the named local vectors that have been created with DMGetNamedLocalVector() in this DM

Collective

Input Parameter:

  • dm - the DM

Level: developer

See also: DM, DMGetNamedGlobalVector(), DMGetNamedLocalVector(), DMClearNamedGlobalVectors()

External Links

source
PETSc.LibPETSc.DMClone — Method
newdm::PetscDM = DMClone(petsclib::PetscLibType, dm::AbstractPetscDM)

Creates a DM object with the same topology as the original.

Collective

Input Parameter:

  • dm - The original DM object

Output Parameter:

  • newdm - The new DM object

Level: beginner

See also: DM, DMDestroy(), DMCreate(), DMSetType(), DMSetLocalSection(), DMSetGlobalSection(), DMPLEX, DMConvert()

External Links

source
PETSc.LibPETSc.DMCoarsen — Method
dmc::PetscDM = DMCoarsen(petsclib::PetscLibType, dm::AbstractPetscDM, comm::MPI_Comm)

Coarsens a DM object using a standard, non-adaptive coarsening of the underlying mesh

Collective

Input Parameters:

  • dm - the DM object
  • comm - the communicator to contain the new DM object (or MPI_COMM_NULL)

Output Parameter:

  • dmc - the coarsened DM

Level: developer

See also: DM, DMRefine(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateDomainDecomposition(), DMCoarsenHookAdd(), DMCoarsenHookRemove()

External Links

source
PETSc.LibPETSc.DMCoarsenHierarchy — Method
DMCoarsenHierarchy(petsclib::PetscLibType, dm::AbstractPetscDM, nlevels::PetscInt, dmc::Vector{<:AbstractPetscDM})

Coarsens a DM object, all levels at once

Collective

Input Parameters:

  • dm - the DM object
  • nlevels - the number of levels of coarsening

Output Parameter:

  • dmc - the coarsened DM hierarchy

Level: developer

See also: DM, DMCoarsen(), DMRefineHierarchy(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMCoarsenHookAdd — Method
DMCoarsenHookAdd(petsclib::PetscLibType, fine::AbstractPetscDM, coarsenhook::external, restricthook::external, ctx::Ptr{Cvoid})

adds a callback to be run when restricting a nonlinear problem to the coarse grid

Logically Collective; No Fortran Support

Input Parameters:

  • fine - DM on which to run a hook when restricting to a coarser level
  • coarsenhook - function to run when setting up a coarser level
  • restricthook - function to run to update data on coarser levels (called once per SNESSolve())
  • ctx - [optional] application context for provide data for the hooks (may be NULL)

Calling sequence of coarsenhook:

  • fine - fine level DM
  • coarse - coarse level DM to restrict problem to
  • ctx - optional application function context

Calling sequence of restricthook:

  • fine - fine level DM
  • mrestrict - matrix restricting a fine-level solution to the coarse grid, usually the transpose of the interpolation
  • rscale - scaling vector for restriction
  • inject - matrix restricting by injection
  • coarse - coarse level DM to update
  • ctx - optional application function context

Level: advanced

See also: DM, DMCoarsenHookRemove(), DMRefineHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMCoarsenHookRemove — Method
DMCoarsenHookRemove(petsclib::PetscLibType, fine::AbstractPetscDM, coarsenhook::external, restricthook::external, ctx::Ptr{Cvoid})

remove a callback set with DMCoarsenHookAdd()

Logically Collective; No Fortran Support

Input Parameters:

  • fine - DM on which to run a hook when restricting to a coarser level
  • coarsenhook - function to run when setting up a coarser level
  • restricthook - function to run to update data on coarser levels
  • ctx - [optional] application context for provide data for the hooks (may be NULL)

Calling sequence of coarsenhook:

  • fine - fine level DM
  • coarse - coarse level DM to restrict problem to
  • ctx - optional application function context

Calling sequence of restricthook:

  • fine - fine level DM
  • rstrict - matrix restricting a fine-level solution to the coarse grid, usually the transpose of the interpolation
  • rscale - scaling vector for restriction
  • inject - matrix restricting by injection
  • coarse - coarse level DM to update
  • ctx - optional application function context

Level: advanced

See also: DM, DMCoarsenHookAdd(), DMRefineHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMCompareLabels — Method
equal::PetscBool,message::Ptr{Cchar} = DMCompareLabels(petsclib::PetscLibType, dm0::AbstractPetscDM, dm1::AbstractPetscDM)

Compare labels between two DM objects

Collective; No Fortran Support

Input Parameters:

  • dm0 - First DM object
  • dm1 - Second DM object

Output Parameters:

  • equal - (Optional) Flag whether labels of dm0 and dm1 are the same
  • message - (Optional) Message describing the difference, or NULL if there is no difference

Level: intermediate

See also: DM, DMLabel, DMAddLabel(), DMCopyLabelsMode, DMLabelCompare()

External Links

source
PETSc.LibPETSc.DMComputeError — Method
errorVec::PetscVec = DMComputeError(petsclib::PetscLibType, dm::AbstractPetscDM, sol::AbstractPetscVec, errors::Vector{PetscReal})

Computes the error assuming the user has provided the exact solution functions

Collective

Input Parameters:

  • dm - The DM
  • sol - The solution vector

Input/Output Parameter:

  • errors - An array of length Nf, the number of fields, or NULL for no output; on output

contains the error in each field

Output Parameter:

  • errorVec - A vector to hold the cellwise error (may be NULL)

Level: developer

See also: DM, DMMonitorSet(), DMGetRegionNumDS(), PetscDSGetExactSolution(), DMGetOutputSequenceNumber()

External Links

source
PETSc.LibPETSc.DMComputeExactSolution — Method
DMComputeExactSolution(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, u::AbstractPetscVec, u_t::AbstractPetscVec)

Compute the exact solution for a given DM, using the PetscDS information.

Collective

Input Parameters:

  • dm - The DM
  • time - The time

Output Parameters:

  • u - The vector will be filled with exact solution values, or NULL
  • u_t - The vector will be filled with the time derivative of exact solution values, or NULL

Level: developer

See also: DM, PetscDSSetExactSolution()

External Links

source
PETSc.LibPETSc.DMComputeL2Diff — Method
DMComputeL2Diff(petsclib, dm, time, funcs, ctxs, X) -> PetscReal

Compute the L² norm of the difference between the global vector X and the pointwise exact functions funcs. ctxs is a Vector{Ptr{Cvoid}} of context pointers (use C_NULL entries for no context).

source
PETSc.LibPETSc.DMComputeL2FieldDiff — Method
DMComputeL2FieldDiff(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, noname::Ptr{Cvoid})

This function computes the L2 difference between a function u and an FEM interpolant solution uh, separated into field components.

Collective

Input Parameters:

  • dm - The DM
  • time - The time
  • funcs - The functions to evaluate for each field component
  • ctxs - Optional array of contexts to pass to each function, or NULL.
  • X - The coefficient vector u_h, a global vector

Output Parameter:

  • diff - The array of differences, ||u^f - u^fh||2

Level: developer

See also: DM, DMProjectFunction(), DMComputeL2GradientDiff()

External Links

source
PETSc.LibPETSc.DMComputeL2GradientDiff — Method
DMComputeL2GradientDiff(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, noname::Ptr{Cvoid})

This function computes the L2 difference between the gradient of a function u and an FEM interpolant solution grad uh.

Collective

Input Parameters:

  • dm - The DM
  • time - The time
  • funcs - The gradient functions to evaluate for each field component
  • ctxs - Optional array of contexts to pass to each function, or NULL.
  • X - The coefficient vector u_h, a global vector
  • n - The vector to project along

Output Parameter:

  • diff - The diff ||(grad u - grad uh) . n||2

Level: developer

See also: DM, DMProjectFunction(), DMComputeL2Diff(), DMComputeL2FieldDiff()

External Links

source
PETSc.LibPETSc.DMComputeVariableBounds — Method
DMComputeVariableBounds(petsclib::PetscLibType, dm::AbstractPetscDM, xl::AbstractPetscVec, xu::AbstractPetscVec)

compute variable bounds used by SNESVI.

Logically Collective

Input Parameter:

  • dm - the DM object

Output Parameters:

  • xl - lower bound
  • xu - upper bound

Level: advanced

See also: DM, DMHasVariableBounds(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMGetApplicationContext()

External Links

source
PETSc.LibPETSc.DMConvert — Method
M::PetscDM = DMConvert(petsclib::PetscLibType, dm::AbstractPetscDM, newtype::String)

Converts a DM to another DM, either of the same or different type.

Collective

Input Parameters:

  • dm - the DM
  • newtype - new DM type (use "same" for the same type)

Output Parameter:

  • M - pointer to new DM

Level: intermediate

See also: DM, DMSetType(), DMCreate(), DMClone()

External Links

source
PETSc.LibPETSc.DMCopyAuxiliaryVec — Method
DMCopyAuxiliaryVec(petsclib::PetscLibType, dm::AbstractPetscDM, dmNew::AbstractPetscDM)

Copy the auxiliary vector data on a DM to a new DM

Not Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • dmNew - The new DM, now with the same auxiliary data

Level: advanced

See also: DM, DMClearAuxiliaryVec(), DMGetNumAuxiliaryVec(), DMGetAuxiliaryVec(), DMSetAuxiliaryVec()

External Links

source
PETSc.LibPETSc.DMCopyDMKSP — Method
DMCopyDMKSP(petsclib::PetscLibType, dmsrc::AbstractPetscDM, dmdest::AbstractPetscDM)

copies a DM DMKSP context to a new DM

Logically Collective

Input Parameters:

  • dmsrc - DM to obtain context from
  • dmdest - DM to add context to

Level: developer

See also: DMKSP, DM, KSP, DMGetDMKSP(), KSPSetDM()

External Links

source
PETSc.LibPETSc.DMCopyDMSNES — Method
DMCopyDMSNES(petsclib::PetscLibType, dmsrc::AbstractPetscDM, dmdest::AbstractPetscDM)

copies a DMSNES context to a new DM

Logically Collective

Input Parameters:

  • dmsrc - DM to obtain context from
  • dmdest - DM to add context to

Level: developer

See also: DMSNES, DMGetDMSNES(), SNESSetDM()

External Links

source
PETSc.LibPETSc.DMCopyDS — Method
DMCopyDS(petsclib::PetscLibType, dm::AbstractPetscDM, minDegree::PetscInt, maxDegree::PetscInt, newdm::AbstractPetscDM)

Copy the discrete systems for the DM into another DM

Collective

Input Parameters:

  • dm - The DM
  • minDegree - Minimum degree for a discretization, or PETSC_DETERMINE for no limit
  • maxDegree - Maximum degree for a discretization, or PETSC_DETERMINE for no limit

Output Parameter:

  • newdm - The DM

Level: advanced

See also: DM, DMCopyFields(), DMAddField(), DMGetDS(), DMGetCellDS(), DMGetRegionDS(), DMSetRegionDS()

External Links

source
PETSc.LibPETSc.DMCopyDisc — Method
DMCopyDisc(petsclib::PetscLibType, dm::AbstractPetscDM, newdm::AbstractPetscDM)

Copy the fields and discrete systems for the DM into another DM

Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • newdm - The DM

Level: advanced

See also: DM, DMCopyFields(), DMCopyDS()

External Links

source
PETSc.LibPETSc.DMCopyFields — Method
DMCopyFields(petsclib::PetscLibType, dm::AbstractPetscDM, minDegree::PetscInt, maxDegree::PetscInt, newdm::AbstractPetscDM)

Copy the discretizations for the DM into another DM

Collective

Input Parameters:

  • dm - The DM
  • minDegree - Minimum degree for a discretization, or PETSC_DETERMINE for no limit
  • maxDegree - Maximum degree for a discretization, or PETSC_DETERMINE for no limit

Output Parameter:

  • newdm - The DM

Level: advanced

See also: DM, DMGetField(), DMSetField(), DMAddField(), DMCopyDS(), DMGetDS(), DMGetCellDS()

External Links

source
PETSc.LibPETSc.DMCopyLabels — Method
DMCopyLabels(petsclib::PetscLibType, dmA::AbstractPetscDM, dmB::AbstractPetscDM, mode::PetscCopyMode, all::PetscBool, emode::DMCopyLabelsMode)

Copy labels from one DM mesh to another DM with a superset of the points

Collective

Input Parameters:

  • dmA - The DM object with initial labels
  • dmB - The DM object to which labels are copied
  • mode - Copy labels by pointers (PETSC_OWN_POINTER) or duplicate them (PETSC_COPY_VALUES)
  • all - Copy all labels including "depth", "dim", and "celltype" (PETSC_TRUE) which are otherwise ignored (PETSC_FALSE)
  • emode - How to behave when a DMLabel in the source and destination DMs with the same name is encountered (see DMCopyLabelsMode)

Level: intermediate

See also: DM, DMLabel, DMAddLabel(), DMCopyLabelsMode

External Links

source
PETSc.LibPETSc.DMCopyTransform — Method
DMCopyTransform(petsclib::PetscLibType, dm::AbstractPetscDM, newdm::AbstractPetscDM)

Copy the basis transform context and callbacks from dm to newdm

Not Collective

Input Parameter:

  • dm - the source DM

Output Parameter:

  • newdm - the destination DM

Level: developer

See also: DM, DMCopyDS(), DMCopyDisc()

External Links

source
PETSc.LibPETSc.DMCreate — Method
dm::PetscDM = DMCreate(petsclib::PetscLibType, comm::MPI_Comm)

Creates an empty DM object. DMs are the abstract objects in PETSc that mediate between meshes and discretizations and the algebraic solvers, time integrators, and optimization algorithms in PETSc.

Collective

Input Parameter:

  • comm - The communicator for the DM object

Output Parameter:

  • dm - The DM object

Level: beginner

See also: DM, DMSetType(), DMType, DMDACreate(), DMDA, DMSLICED, DMCOMPOSITE, DMPLEX, DMMOAB, DMNETWORK

External Links

source
PETSc.LibPETSc.DMCreateColoring — Method
coloring::ISColoring = DMCreateColoring(petsclib::PetscLibType, dm::AbstractPetscDM, ctype::ISColoringType)

Gets coloring of a graph associated with the DM. Often the graph represents the operator matrix associated with the discretization of a PDE on the DM.

Collective

Input Parameters:

  • dm - the DM object
  • ctype - IS_COLORING_LOCAL or IS_COLORING_GLOBAL

Output Parameter:

  • coloring - the coloring

Level: developer

See also: DM, ISColoring, DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateMatrix(), DMCreateMassMatrix(), DMSetMatType(), MatColoring, MatFDColoringCreate()

External Links

source
PETSc.LibPETSc.DMCreateDS — Method
DMCreateDS(petsclib::PetscLibType, dm::AbstractPetscDM)

Create the discrete systems for the DM based upon the fields added to the DM

Collective

Input Parameter:

  • dm - The DM

Options Database Key:

  • -dm_petscds_view - View all the PetscDS objects in this DM

Level: intermediate

See also: DM, DMSetField, DMAddField(), DMGetDS(), DMGetCellDS(), DMGetRegionDS(), DMSetRegionDS()

External Links

source
PETSc.LibPETSc.DMCreateDomainDecomposition — Method
n::PetscInt,namelist::Vector{String},innerislist::Vector{IS},outerislist::Vector{IS},dmlist::Vector{PetscDM} = DMCreateDomainDecomposition(petsclib::PetscLibType, dm::AbstractPetscDM)

Returns lists of IS objects defining a decomposition of a problem into subproblems corresponding to restrictions to pairs of nested subdomains.

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameters:

  • n - The number of subproblems in the domain decomposition (or NULL if not requested), also the length of the four arrays below
  • namelist - The name for each subdomain (or NULL if not requested)
  • innerislist - The global indices for each inner subdomain (or NULL, if not requested)
  • outerislist - The global indices for each outer subdomain (or NULL, if not requested)
  • dmlist - The DMs for each subdomain subproblem (or NULL, if not requested; if NULL is returned, no DMs are defined)

Level: intermediate

See also: DM, DMCreateFieldDecomposition(), DMDestroy(), DMCreateDomainDecompositionScatters(), DMView(), DMCreateInterpolation(), DMSubDomainHookAdd(), DMSubDomainHookRemove(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMRefine(), DMCoarsen()

External Links

source
PETSc.LibPETSc.DMCreateDomainDecompositionScatters — Method
iscat::Vector{VecScatter},oscat::Vector{VecScatter},gscat::Vector{VecScatter} = DMCreateDomainDecompositionScatters(petsclib::PetscLibType, dm::AbstractPetscDM, n::PetscInt, subdms::Vector{<:AbstractPetscDM})

Returns scatters to the subdomain vectors from the global vector for subdomains created with DMCreateDomainDecomposition()

Not Collective

Input Parameters:

  • dm - the DM object
  • n - the number of subdomains
  • subdms - the local subdomains

Output Parameters:

  • iscat - scatter from global vector to nonoverlapping global vector entries on subdomain
  • oscat - scatter from global vector to overlapping global vector entries on subdomain
  • gscat - scatter from global vector to local vector on subdomain (fills in ghosts)

Level: developer

See also: DM, DMCreateDomainDecomposition(), DMDestroy(), DMView(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMCreateFieldIS()

External Links

source
PETSc.LibPETSc.DMCreateFEDefault — Method
fem::PetscFE = DMCreateFEDefault(petsclib::PetscLibType, dm::AbstractPetscDM, Nc::PetscInt, prefix::String, qorder::PetscInt)

Create a PetscFE based on the celltype for the mesh

Not Collective

Input Parameters:

  • dm - The DM
  • Nc - The number of components for the field
  • prefix - The options prefix for the output PetscFE, or NULL
  • qorder - The quadrature order or PETSC_DETERMINE to use PetscSpace polynomial degree

Output Parameter:

  • fem - The PetscFE

Level: intermediate

See also: DM, PetscFECreateByCell(), DMAddField(), DMCreateDS(), DMGetCellDS(), DMGetRegionDS()

External Links

source
PETSc.LibPETSc.DMCreateFieldDecomposition — Method
len::PetscInt,namelist::String,islist::Vector{IS},dmlist::Vector{PetscDM} = DMCreateFieldDecomposition(petsclib::PetscLibType, dm::AbstractPetscDM)

Returns a list of IS objects defining a decomposition of a problem into subproblems corresponding to different fields.

Not Collective; No Fortran Support

Input Parameter:

  • dm - the DM object

Output Parameters:

  • len - The number of fields (or NULL if not requested)
  • namelist - The name for each field (or NULL if not requested)
  • islist - The global indices for each field (or NULL if not requested)
  • dmlist - The DMs for each field subproblem (or NULL, if not requested; if NULL is returned, no DMs are defined)

Level: intermediate

See also: DM, DMAddField(), DMCreateFieldIS(), DMCreateSubDM(), DMCreateDomainDecomposition(), DMDestroy(), DMView(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMRefine(), DMCoarsen()

External Links

source
PETSc.LibPETSc.DMCreateFieldIS — Method
numFields::PetscInt,fieldNames::Vector{String},fields::Vector{IS} = DMCreateFieldIS(petsclib::PetscLibType, dm::AbstractPetscDM)

Creates a set of IS objects with the global indices of dofs for each field defined with DMAddField()

Not Collective; No Fortran Support

Input Parameter:

  • dm - the DM object

Output Parameters:

  • numFields - The number of fields (or NULL if not requested)
  • fieldNames - The name of each field (or NULL if not requested)
  • fields - The global indices for each field (or NULL if not requested)

Level: intermediate

Note: The names come back as Julia Strings and the C arrays are freed here. Every entry of fields is owned by the caller and should be destroyed with ISDestroy() (or PETSc.destroy!).

Developer Note: It is not clear why both this function and DMCreateFieldDecomposition() exist. Having two seems redundant and confusing. This function should likely be removed.

See also:

DM, DMAddField(), DMGetField(), DMDestroy(), DMView(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateFieldDecomposition()

External Links

source
PETSc.LibPETSc.DMCreateGlobalVector — Method
vec::PetscVec = DMCreateGlobalVector(petsclib::PetscLibType, dm::AbstractPetscDM)

Creates a global vector from a DM object. A global vector is a parallel vector that has no duplicate values shared between MPI ranks, that is it has no ghost locations.

Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • vec - the global vector

Level: beginner

See also: DM, Vec, DMCreateLocalVector(), DMGetGlobalVector(), DMDestroy(), DMView(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd()

External Links

source
PETSc.LibPETSc.DMCreateGradientMatrix — Method
mat::PetscMat = DMCreateGradientMatrix(petsclib::PetscLibType, dmc::AbstractPetscDM, dmf::AbstractPetscDM)

Gets the gradient matrix between two DM objects, M(ic)j = \int \partialc \phii \psij where the \phi are Galerkin basis functions for a Galerkin finite element model on the DM

Collective

Input Parameters:

  • dmc - the target DM object
  • dmf - the source DM object, can be NULL

Output Parameter:

  • mat - the gradient matrix

Level: developer

See also: DM, DMCreateMassMatrix(), DMCreateMassMatrixLumped(), DMCreateMatrix(), DMRefine(), DMCoarsen(), DMCreateRestriction(), DMCreateInterpolation(), DMCreateInjection()

External Links

source
PETSc.LibPETSc.DMCreateInjection — Method
mat::PetscMat = DMCreateInjection(petsclib::PetscLibType, dac::AbstractPetscDM, daf::AbstractPetscDM)

Gets injection matrix between two DM objects.

Collective

Input Parameters:

  • dac - the DM object
  • daf - the second, finer DM object

Output Parameter:

  • mat - the injection

Level: developer

See also: DM, DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMCreateInterpolation(), DMCreateRestriction(), MatRestrict(), MatInterpolate()

External Links

source
PETSc.LibPETSc.DMCreateInterpolation — Method
mat::PetscMat,vec::PetscVec = DMCreateInterpolation(petsclib::PetscLibType, dmc::AbstractPetscDM, dmf::AbstractPetscDM)

Gets the interpolation matrix between two DM objects. The resulting matrix map degrees of freedom in the vector obtained by DMCreateGlobalVector() on the coarse DM to similar vectors on the fine grid DM.

Collective

Input Parameters:

  • dmc - the DM object
  • dmf - the second, finer DM object

Output Parameters:

  • mat - the interpolation
  • vec - the scaling (optional, pass NULL if not needed), see DMCreateInterpolationScale()

Level: developer

See also: DM, DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMRefine(), DMCoarsen(), DMCreateRestriction(), DMCreateInterpolationScale()

External Links

source
PETSc.LibPETSc.DMCreateInterpolationScale — Method
scale::PetscVec = DMCreateInterpolationScale(petsclib::PetscLibType, dac::AbstractPetscDM, daf::AbstractPetscDM, mat::AbstractPetscMat)

Forms L = 1/(R*1) where 1 is the vector of all ones, and R is the transpose of the interpolation between the DM.

Input Parameters:

  • dac - DM that defines a coarse mesh
  • daf - DM that defines a fine mesh
  • mat - the restriction (or interpolation operator) from fine to coarse

Output Parameter:

  • scale - the scaled vector

Level: advanced

See also: DM, MatRestrict(), MatInterpolate(), DMCreateInterpolation(), DMCreateRestriction(), DMCreateGlobalVector()

External Links

source
PETSc.LibPETSc.DMCreateLabel — Method
DMCreateLabel(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

Create a label of the given name if it does not already exist in the DM

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name

Level: intermediate

See also: DM, DMLabelCreate(), DMHasLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMCreateLabelAtIndex — Method
DMCreateLabelAtIndex(petsclib::PetscLibType, dm::AbstractPetscDM, l::PetscInt, name::String)

Create a label of the given name at the given index. If it already exists in the DM, move it to this index.

Not Collective

Input Parameters:

  • dm - The DM object
  • l - The index for the label
  • name - The label name

Level: intermediate

See also: DM, DMCreateLabel(), DMLabelCreate(), DMHasLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMCreateLocalVector — Method
vec::PetscVec = DMCreateLocalVector(petsclib::PetscLibType, dm::AbstractPetscDM)

Creates a local vector from a DM object.

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • vec - the local vector

Level: beginner

See also: DM, Vec, DMCreateGlobalVector(), DMGetLocalVector(), DMDestroy(), DMView(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd()

External Links

source
PETSc.LibPETSc.DMCreateMassMatrix — Method
mat::PetscMat = DMCreateMassMatrix(petsclib::PetscLibType, dmc::AbstractPetscDM, dmf::AbstractPetscDM)

Gets the mass matrix between two DM objects, Mij = \int \phii \psi_j where the \phi are Galerkin basis functions for a a Galerkin finite element model on the DM

Collective

Input Parameters:

  • dmc - the target DM object
  • dmf - the source DM object, can be NULL

Output Parameter:

  • mat - the mass matrix

Level: developer

See also: DM, DMCreateMassMatrixLumped(), DMCreateMatrix(), DMRefine(), DMCoarsen(), DMCreateRestriction(), DMCreateInterpolation(), DMCreateInjection()

External Links

source
PETSc.LibPETSc.DMCreateMassMatrixLumped — Method
llm::PetscVec,lm::PetscVec = DMCreateMassMatrixLumped(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the lumped mass matrix for a given DM

Collective

Input Parameter:

  • dm - the DM object

Output Parameters:

  • llm - the local lumped mass matrix, which is a diagonal matrix, represented as a vector
  • lm - the global lumped mass matrix, which is a diagonal matrix, represented as a vector

Level: developer

See also: DM, DMCreateMassMatrix(), DMCreateMatrix(), DMRefine(), DMCoarsen(), DMCreateRestriction(), DMCreateInterpolation(), DMCreateInjection()

External Links

source
PETSc.LibPETSc.DMCreateMatrix — Method
mat::PetscMat = DMCreateMatrix(petsclib::PetscLibType, dm::AbstractPetscDM)

Creates a matrix of appropriate size and nonzero structure for a DM. The matrix is most commonly used to store the Jacobian of a discrete PDE operator.

Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • mat - the matrix

Options Database Key:

  • -dm_preallocate_only (true|false) - Only preallocate the matrix for DMCreateMatrix() and DMCreateMassMatrix(), but do not fill its nonzero structure

Level: beginner

See also: DM, DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMSetMatType(), DMCreateMassMatrix()

External Links

source
PETSc.LibPETSc.DMCreateRestriction — Method
mat::PetscMat = DMCreateRestriction(petsclib::PetscLibType, dmc::AbstractPetscDM, dmf::AbstractPetscDM)

Gets restriction matrix between two DM objects. The resulting matrix map degrees of freedom in the vector obtained by DMCreateGlobalVector() on the fine DM to similar vectors on the coarse grid DM.

Collective

Input Parameters:

  • dmc - the DM object
  • dmf - the second, finer DM object

Output Parameter:

  • mat - the restriction

Level: developer

See also: DM, DMRestrict(), DMInterpolate(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMRefine(), DMCoarsen(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMCreateSectionPermutation — Method
perm::IS,blockStarts::PetscBT = DMCreateSectionPermutation(petsclib::PetscLibType, dm::AbstractPetscDM)

Create a permutation of the PetscSection chart and optionally a block structure.

Input Parameter:

  • dm - The DM

Output Parameters:

  • perm - A permutation of the mesh points in the chart
  • blockStarts - A high bit is set for the point that begins every block, or NULL for default blocking

Level: developer

See also: DM, PetscSection, DMGetLocalSection(), DMGetGlobalSection()

External Links

source
PETSc.LibPETSc.DMCreateSectionSF — Method
DMCreateSectionSF(petsclib::PetscLibType, dm::AbstractPetscDM, localSection::PetscSection, globalSection::PetscSection)

Create the PetscSF encoding the parallel dof overlap for the DM based upon the PetscSections describing the data layout.

Input Parameters:

  • dm - The DM
  • localSection - PetscSection describing the local data layout
  • globalSection - PetscSection describing the global data layout

Level: developer

See also: DM, DMGetSectionSF(), DMSetSectionSF(), DMGetLocalSection(), DMGetGlobalSection()

External Links

source
PETSc.LibPETSc.DMCreateSectionSubDM — Method
is::IS,subdm::PetscDM = DMCreateSectionSubDM(petsclib::PetscLibType, dm::AbstractPetscDM, numFields::PetscInt, fields::Vector{PetscInt}, numComps::Vector{PetscInt}, comps::Vector{PetscInt})

Returns an IS and subDM containing a PetscSection that encapsulates a subproblem defined by a subset of the fields in a PetscSection in the DM.

Not Collective

Input Parameters:

  • dm - The DM object
  • numFields - The number of fields to incorporate into subdm
  • fields - The field numbers of the selected fields
  • numComps - The number of components from each field to incorporate into subdm, or PETSC_DECIDE for all components
  • comps - The component numbers of the selected fields (omitted for PTESC_DECIDE fields)

Output Parameters:

  • is - The global indices for the subproblem or NULL
  • subdm - The DM for the subproblem, which must already have be cloned from dm or NULL

Level: intermediate

See also: DMCreateSubDM(), DMGetLocalSection(), DMPlexSetMigrationSF(), DMView()

External Links

source
PETSc.LibPETSc.DMCreateSectionSuperDM — Method
is::Vector{IS},superdm::PetscDM = DMCreateSectionSuperDM(petsclib::PetscLibType, dms::Vector{<:AbstractPetscDM}, len::PetscInt)

Returns an arrays of IS and a DM containing a PetscSection that encapsulates a superproblem defined by the array of DM and their PetscSection

Not Collective

Input Parameters:

  • dms - The DM objects, the must all have the same topology; for example obtained with DMClone()
  • len - The number of DM in dms

Output Parameters:

  • is - The global indices for the subproblem, or NULL
  • superdm - The DM for the superproblem, which must already have be cloned and contain the same topology as the dms

Level: intermediate

See also: DMCreateSuperDM(), DMGetLocalSection(), DMPlexSetMigrationSF(), DMView()

External Links

source
PETSc.LibPETSc.DMCreateSubDM — Method
is::IS,subdm::PetscDM = DMCreateSubDM(petsclib::PetscLibType, dm::AbstractPetscDM, numFields::PetscInt, fields::Vector{PetscInt})

Returns an IS and DM encapsulating a subproblem defined by the fields passed in. The fields are defined by DMCreateFieldIS().

Not collective

Input Parameters:

  • dm - The DM object
  • numFields - The number of fields to select
  • fields - The field numbers of the selected fields

Output Parameters:

  • is - The global indices for all the degrees of freedom in the new sub DM, use NULL if not needed
  • subdm - The DM for the subproblem, use NULL if not needed

Level: intermediate

See also: DM, DMCreateFieldIS(), DMCreateFieldDecomposition(), DMAddField(), DMCreateSuperDM(), IS, VecISCopy(), DMPlexSetMigrationSF(), DMDestroy(), DMView(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix()

External Links

source
PETSc.LibPETSc.DMCreateSuperDM — Method
is::Vector{IS},superdm::PetscDM = DMCreateSuperDM(petsclib::PetscLibType, dms::Vector{<:AbstractPetscDM}, n::PetscInt)

Returns an arrays of IS and a single DM encapsulating a superproblem defined by multiple DMs passed in.

Not collective

Input Parameters:

  • dms - The DM objects
  • n - The number of DMs

Output Parameters:

  • is - The global indices for each of subproblem within the super DM, or NULL, its length is n
  • superdm - The DM for the superproblem

Level: intermediate

See also: DM, DMCreateSubDM(), DMPlexSetMigrationSF(), DMDestroy(), DMView(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMCreateFieldIS(), DMCreateDomainDecomposition()

External Links

source
PETSc.LibPETSc.DMDestroy — Method
DMDestroy(petsclib::PetscLibType, dm::AbstractPetscDM)

Destroys a DM.

Collective

Input Parameter:

  • dm - the DM object to destroy

Level: developer

See also: DM, DMCreate(), DMType, DMSetType(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix()

External Links

source
PETSc.LibPETSc.DMDestroyVI — Method
DMDestroyVI(petsclib::PetscLibType, dm::AbstractPetscDM)

Frees the DM_SNESVI object contained in the DM and resets any function pointers the reduced-space SNESVI code composed onto it

Not Collective

Input Parameter:

  • dm - the DM from which the VI context should be removed (may be NULL)

Level: developer

See also: DM, SNESVINEWTONRSLS, SNESVISetVariableBounds(), PetscObjectCompose()

External Links

source
PETSc.LibPETSc.DMExtrude — Method
dme::PetscDM = DMExtrude(petsclib::PetscLibType, dm::AbstractPetscDM, layers::PetscInt)

Extrude a DM object from a surface

Collective

Input Parameters:

  • dm - the DM object
  • layers - the number of extruded cell layers

Output Parameter:

  • dme - the extruded DM, or NULL

Level: developer

See also: DM, DMRefine(), DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector()

External Links

source
PETSc.LibPETSc.DMFindRegionNum — Method
num::PetscInt = DMFindRegionNum(petsclib::PetscLibType, dm::AbstractPetscDM, ds::PetscDS)

Find the region number for a given PetscDS, or -1 if it is not found.

Not Collective

Input Parameters:

  • dm - The DM
  • ds - The PetscDS defined on the given region

Output Parameter:

  • num - The region number, in [0, Nds), or -1 if not found

Level: advanced

See also: DM, DMGetRegionNumDS(), DMGetRegionDS(), DMSetRegionDS(), DMGetDS(), DMGetCellDS()

External Links

source
PETSc.LibPETSc.DMGenerateRegister — Method
DMGenerateRegister(petsclib::PetscLibType, sname::String, fnc::external, rfnc::external, alfnc::external, dim::PetscInt)

Adds a grid generator to DM

Not Collective, No Fortran Support

Input Parameters:

  • sname - name of a new user-defined grid generator
  • fnc - generator function
  • rfnc - refinement function
  • alfnc - adapt by label function
  • dim - dimension of boundary of domain

See also: DM, DMGenerateRegisterAll(), DMPlexGenerate(), DMGenerateRegisterDestroy()

External Links

source
PETSc.LibPETSc.DMGeomModelRegister — Method
DMGeomModelRegister(petsclib::PetscLibType, sname::String, fnc::external)

Adds a geometry model to DM

Not Collective, No Fortran Support

Input Parameters:

  • sname - name of a new user-defined geometry model
  • fnc - geometry model function

See also: DM, DMGeomModelRegisterAll(), DMPlexGeomModel(), DMGeomModelRegisterDestroy()

External Links

source
PETSc.LibPETSc.DMGetAdjacency — Method
useCone::PetscBool,useClosure::PetscBool = DMGetAdjacency(petsclib::PetscLibType, dm::AbstractPetscDM, f::PetscInt)

Returns the flags for determining variable influence

Not Collective

Input Parameters:

  • dm - The DM object
  • f - The field number, or PETSC_DEFAULT for the default adjacency

Output Parameters:

  • useCone - Flag for variable influence starting with the cone operation
  • useClosure - Flag for variable influence using transitive closure

Level: developer

See also: DM, DMSetAdjacency(), DMGetField(), DMSetField()

External Links

source
PETSc.LibPETSc.DMGetApplicationContext — Method
ctx::Ptr{Cvoid} = DMGetApplicationContext(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets an application context from a DM object provided with DMSetApplicationContext()

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • ctx - a pointer to the application context

Level: intermediate

See also: DM, DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix()

External Links

source
PETSc.LibPETSc.DMGetAuxiliaryLabels — Method
DMGetAuxiliaryLabels(petsclib::PetscLibType, dm::AbstractPetscDM, labels::Vector{DMLabel}, values::Vector{PetscInt}, parts::Vector{PetscInt})

Get the labels, values, and parts for all auxiliary vectors in this DM

Not Collective

Input Parameter:

  • dm - The DM

Output Parameters:

  • labels - The DMLabels for each Vec
  • values - The label values for each Vec
  • parts - The equation parts for each Vec

Level: advanced

See also: DM, DMClearAuxiliaryVec(), DMGetNumAuxiliaryVec(), DMGetAuxiliaryVec(), DMSetAuxiliaryVec(), DMCopyAuxiliaryVec()

External Links

source
PETSc.LibPETSc.DMGetAuxiliaryVec — Method
aux::PetscVec = DMGetAuxiliaryVec(petsclib::PetscLibType, dm::AbstractPetscDM, label::DMLabel, value::PetscInt, part::PetscInt)

Get the auxiliary vector for region specified by the given label and value, and equation part

Not Collective

Input Parameters:

  • dm - The DM
  • label - The DMLabel
  • value - The label value indicating the region
  • part - The equation part, or 0 if unused

Output Parameter:

  • aux - The Vec holding auxiliary field data

Level: advanced

See also: DM, DMClearAuxiliaryVec(), DMSetAuxiliaryVec(), DMGetNumAuxiliaryVec(), DMGetAuxiliaryLabels()

External Links

source
PETSc.LibPETSc.DMGetBasicAdjacency — Method
useCone::PetscBool,useClosure::PetscBool = DMGetBasicAdjacency(petsclib::PetscLibType, dm::AbstractPetscDM)

Returns the flags for determining variable influence, using either the default or field 0 if it is defined

Not collective

Input Parameter:

  • dm - The DM object

Output Parameters:

  • useCone - Flag for variable influence starting with the cone operation
  • useClosure - Flag for variable influence using transitive closure

Level: developer

See also: DM, DMSetBasicAdjacency(), DMGetField(), DMSetField()

External Links

source
PETSc.LibPETSc.DMGetBlockSize — Method
bs::PetscInt = DMGetBlockSize(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the inherent block size associated with a DM

Not Collective

Input Parameter:

  • dm - the DM with block structure

Output Parameter:

  • bs - the block size, 1 implies no exploitable block structure

Level: intermediate

See also: DM, ISCreateBlock(), VecSetBlockSize(), MatSetBlockSize(), DMGetLocalToGlobalMapping()

External Links

source
PETSc.LibPETSc.DMGetBlockingType — Method
btype::DMBlockingType = DMGetBlockingType(petsclib::PetscLibType, dm::AbstractPetscDM)

get the blocking granularity to be used for variable block size DMCreateMatrix() is called

Not Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • btype - block by topological point or field node

Level: advanced

See also: DM, DMCreateMatrix(), MatSetVariableBlockSizes()

External Links

source
PETSc.LibPETSc.DMGetBoundingBox — Method
DMGetBoundingBox(petsclib::PetscLibType, dm::AbstractPetscDM, gmin::Vector{PetscReal}, gmax::Vector{PetscReal})

Returns the global bounding box for the DM.

Collective

Input Parameter:

  • dm - the DM

Output Parameters:

  • gmin - global minimum coordinates (length coord dim, optional)
  • gmax - global maximum coordinates (length coord dim, optional)

Level: beginner

See also: DM, DMGetLocalBoundingBox(), DMGetCoordinates(), DMGetCoordinatesLocal()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinateDM — Method
cdm::PetscDM = DMGetCellCoordinateDM(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the DM that prescribes cellwise coordinate layout and scatters between global and local cellwise coordinates

Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • cdm - cellwise coordinate DM, or NULL if they are not defined

Level: intermediate

See also: DM, DMSetCellCoordinateDM(), DMSetCellCoordinates(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMGetCellCoordinatesLocal(), DMLocalizeCoordinates(), DMSetCoordinateDM(), DMGetCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinateSection — Method
section::PetscSection = DMGetCellCoordinateSection(petsclib::PetscLibType, dm::AbstractPetscDM)

Retrieve the PetscSection of cellwise coordinate values over the mesh.

Collective

Input Parameter:

  • dm - The DM object

Output Parameter:

  • section - The PetscSection object, or NULL if no cellwise coordinates are defined

Level: intermediate

See also: DM, DMGetCoordinateSection(), DMSetCellCoordinateSection(), DMGetCellCoordinateDM(), DMGetCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinates — Method
c::PetscVec = DMGetCellCoordinates(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets a global vector with the cellwise coordinates associated with the DM.

Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • c - global coordinate vector

Level: intermediate

See also: DM, DMGetCoordinates(), DMSetCellCoordinates(), DMGetCellCoordinatesLocal(), DMGetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinatesLocal — Method
c::PetscVec = DMGetCellCoordinatesLocal(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets a local vector with the cellwise coordinates associated with the DM.

Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • c - coordinate vector

Level: intermediate

See also: DM, DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMSetCellCoordinates(), DMGetCellCoordinateDM(), DMGetCellCoordinatesLocalNoncollective()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinatesLocalNoncollective — Method
c::PetscVec = DMGetCellCoordinatesLocalNoncollective(petsclib::PetscLibType, dm::AbstractPetscDM)

Non-collective version of DMGetCellCoordinatesLocal(). Fails if global cellwise coordinates have been set and DMGetCellCoordinatesLocalSetUp() not called.

Not Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • c - cellwise coordinate vector

Level: advanced

See also: DM, DMGetCellCoordinatesLocalSetUp(), DMGetCellCoordinatesLocal(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMSetCellCoordinates(), DMGetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinatesLocalSetUp — Method
DMGetCellCoordinatesLocalSetUp(petsclib::PetscLibType, dm::AbstractPetscDM)

Prepares a local vector of cellwise coordinates, so that DMGetCellCoordinatesLocalNoncollective() can be used as non-collective afterwards.

Collective

Input Parameter:

  • dm - the DM

Level: advanced

See also: DM, DMGetCellCoordinatesLocalNoncollective()

External Links

source
PETSc.LibPETSc.DMGetCellDS — Method
ds::PetscDS,dsIn::PetscDS = DMGetCellDS(petsclib::PetscLibType, dm::AbstractPetscDM, point::PetscInt)

Get the PetscDS defined on a given cell

Not Collective

Input Parameters:

  • dm - The DM
  • point - Cell for the PetscDS

Output Parameters:

  • ds - The PetscDS defined on the given cell
  • dsIn - The PetscDS for input on the given cell, or NULL if the same ds

Level: developer

See also: DM, DMGetDS(), DMSetRegionDS()

External Links

source
PETSc.LibPETSc.DMGetCoarseDM — Method
cdm::PetscDM = DMGetCoarseDM(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the coarse DMfrom which this DM was obtained by refinement

Not Collective

Input Parameter:

  • dm - The DM object

Output Parameter:

  • cdm - The coarse DM

Level: intermediate

See also: DM, DMSetCoarseDM(), DMCoarsen()

External Links

source
PETSc.LibPETSc.DMGetCoarsenLevel — Method
level::PetscInt = DMGetCoarsenLevel(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the number of coarsenings that have generated this DM.

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • level - number of coarsenings

Level: developer

See also: DM, DMCoarsen(), DMSetCoarsenLevel(), DMGetRefineLevel(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMGetCompatibility — Method
compatible::PetscBool,set::PetscBool = DMGetCompatibility(petsclib::PetscLibType, dm1::AbstractPetscDM, dm2::AbstractPetscDM)

determine if two DMs are compatible

Collective

Input Parameters:

  • dm1 - the first DM
  • dm2 - the second DM

Output Parameters:

  • compatible - whether or not the two DMs are compatible
  • set - whether or not the compatible value was actually determined and set

Level: advanced

See also: DM, DMDACreateCompatibleDMDA(), DMStagCreateCompatibleDMStag()

External Links

source
PETSc.LibPETSc.DMGetCoordinateDM — Method
cdm::PetscDM = DMGetCoordinateDM(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the DM that prescribes coordinate layout and scatters between global and local coordinates

Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • cdm - coordinate DM

Level: intermediate

See also: DM, DMSetCoordinateDM(), DMSetCoordinates(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMGSetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCoordinateDim — Method
dim::PetscInt = DMGetCoordinateDim(petsclib::PetscLibType, dm::AbstractPetscDM)

Retrieve the dimension of the embedding space for coordinate values. For example a mesh on the surface of a sphere would have a 3 dimensional embedding space

Not Collective

Input Parameter:

  • dm - The DM object

Output Parameter:

  • dim - The embedding dimension

Level: intermediate

See also: DM, DMSetCoordinateDim(), DMGetCoordinateSection(), DMGetCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMGetCoordinateField — Method
field::DMField = DMGetCoordinateField(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the DMField representation of the mesh coordinates

Not Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • field - the DMField describing the coordinates

Level: advanced

See also: DM, DMField, DMSetCoordinateField(), DMGetCoordinateDM(), DMGetCoordinates()

External Links

source
PETSc.LibPETSc.DMGetCoordinateSection — Method
section::PetscSection = DMGetCoordinateSection(petsclib::PetscLibType, dm::AbstractPetscDM)

Retrieve the PetscSection of coordinate values over the mesh.

Collective

Input Parameter:

  • dm - The DM object

Output Parameter:

  • section - The PetscSection object

Level: intermediate

See also: DM, DMGetCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMGetCoordinates — Method
c::PetscVec = DMGetCoordinates(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets a global vector with the coordinates associated with the DM.

Collective if the global vector with coordinates has not been set yet but the local vector with coordinates has been set

Input Parameter:

  • dm - the DM

Output Parameter:

  • c - global coordinate vector

Level: intermediate

See also: DM, DMDA, DMSetCoordinates(), DMGetCoordinatesLocal(), DMGetCoordinateDM(), DMDASetUniformCoordinates()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocal — Method
c::PetscVec = DMGetCoordinatesLocal(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets a local vector with the coordinates associated with the DM.

Collective the first time it is called

Input Parameter:

  • dm - the DM

Output Parameter:

  • c - coordinate vector

Level: intermediate

See also: DM, DMSetCoordinatesLocal(), DMGetCoordinates(), DMSetCoordinates(), DMGetCoordinateDM(), DMGetCoordinatesLocalNoncollective()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalNoncollective — Method
c::PetscVec = DMGetCoordinatesLocalNoncollective(petsclib::PetscLibType, dm::AbstractPetscDM)

Non-collective version of DMGetCoordinatesLocal(). Fails if global coordinates have been set and DMGetCoordinatesLocalSetUp() not called.

Not Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • c - coordinate vector

Level: advanced

See also: DM, DMGetCoordinatesLocalSetUp(), DMGetCoordinatesLocal(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMSetCoordinates(), DMGetCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalSetUp — Method
DMGetCoordinatesLocalSetUp(petsclib::PetscLibType, dm::AbstractPetscDM)

Prepares a local vector of coordinates, so that DMGetCoordinatesLocalNoncollective() can be used as non-collective afterwards.

Collective

Input Parameter:

  • dm - the DM

Level: advanced

See also: DM, DMSetCoordinates(), DMGetCoordinatesLocalNoncollective()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalTuple — Method
pCoordSection::PetscSection,pCoord::PetscVec = DMGetCoordinatesLocalTuple(petsclib::PetscLibType, dm::AbstractPetscDM, p::AbstractIS)

Gets a local vector with the coordinates of specified points and the section describing its layout.

Not Collective

Input Parameters:

  • dm - the DM
  • p - the IS of points whose coordinates will be returned

Output Parameters:

  • pCoordSection - the PetscSection describing the layout of pCoord, i.e. each point corresponds to one point in p, and DOFs correspond to coordinates
  • pCoord - the Vec with coordinates of points in p

Level: advanced

See also: DM, DMDA, DMSetCoordinatesLocal(), DMGetCoordinatesLocal(), DMGetCoordinatesLocalNoncollective(), DMGetCoordinatesLocalSetUp(), DMGetCoordinates(), DMSetCoordinates(), DMGetCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalized — Method
areLocalized::PetscBool = DMGetCoordinatesLocalized(petsclib::PetscLibType, dm::AbstractPetscDM)

Check if the DM coordinates have been localized for cells

Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • areLocalized - PETSC_TRUE if localized

Level: developer

See also: DM, DMLocalizeCoordinates(), DMSetPeriodicity(), DMGetCoordinatesLocalizedLocal()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalizedLocal — Method
areLocalized::PetscBool = DMGetCoordinatesLocalizedLocal(petsclib::PetscLibType, dm::AbstractPetscDM)

Check if the DM coordinates have been localized for cells on this process

Not Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • areLocalized - PETSC_TRUE if localized

Level: developer

See also: DM, DMLocalizeCoordinates(), DMGetCoordinatesLocalized(), DMSetPeriodicity()

External Links

source
PETSc.LibPETSc.DMGetDS — Method
ds::PetscDS = DMGetDS(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the default PetscDS

Not Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • ds - The default PetscDS

Level: intermediate

See also: DM, DMGetCellDS(), DMGetRegionDS()

External Links

source
PETSc.LibPETSc.DMGetDefaultConstraints — Method
section::PetscSection,mat::PetscMat,bias::PetscVec = DMGetDefaultConstraints(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the PetscSection and Mat that specify the local constraint interpolation. See DMSetDefaultConstraints() for a description of the purpose of constraint interpolation.

not Collective

Input Parameter:

  • dm - The DM

Output Parameters:

  • section - The PetscSection describing the range of the constraint matrix: relates rows of the constraint matrix to dofs of the default section. Returns NULL if there are no local constraints.
  • mat - The Mat that interpolates local constraints: its width should be the layout size of the default section. Returns NULL if there are no local constraints.
  • bias - Vector containing bias to be added to constrained dofs

Level: advanced

See also: DM, DMSetDefaultConstraints()

External Links

source
PETSc.LibPETSc.DMGetDimPoints — Method
pStart::PetscInt,pEnd::PetscInt = DMGetDimPoints(petsclib::PetscLibType, dm::AbstractPetscDM, dim::PetscInt)

Get the half-open interval for all points of a given dimension

Collective

Input Parameters:

  • dm - the DM
  • dim - the dimension

Output Parameters:

  • pStart - The first point of the given dimension
  • pEnd - The first point following points of the given dimension

Level: intermediate

See also: DM, DMPLEX, DMPlexGetDepthStratum(), DMPlexGetHeightStratum()

External Links

source
PETSc.LibPETSc.DMGetDimension — Method
dim::PetscInt = DMGetDimension(petsclib::PetscLibType, dm::AbstractPetscDM)

Return the topological dimension of the DM

Not Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • dim - The topological dimension

Level: beginner

See also: DM, DMSetDimension(), DMCreate()

External Links

source
PETSc.LibPETSc.DMGetEnclosurePoint — Method
pA::PetscInt = DMGetEnclosurePoint(petsclib::PetscLibType, dmA::AbstractPetscDM, dmB::AbstractPetscDM, etype::DMEnclosureType, pB::PetscInt)

Get the point pA in dmA which corresponds to the point pB in dmB

Input Parameters:

  • dmA - The first DM
  • dmB - The second DM
  • etype - The type of enclosure relation that dmA has to dmB
  • pB - A point of dmB

Output Parameter:

  • pA - The corresponding point of dmA

Level: intermediate

See also: DM, DMPLEX, DMGetEnclosureRelation()

External Links

source
PETSc.LibPETSc.DMGetEnclosureRelation — Method
rel::DMEnclosureType = DMGetEnclosureRelation(petsclib::PetscLibType, dmA::AbstractPetscDM, dmB::AbstractPetscDM)

Get the relationship between dmA and dmB

Input Parameters:

  • dmA - The first DM
  • dmB - The second DM

Output Parameter:

  • rel - The relation of dmA to dmB

Level: intermediate

See also: DM, DMPLEX, DMGetEnclosurePoint()

External Links

source
PETSc.LibPETSc.DMGetField — Method
label::DMLabel,disc::PetscObject = DMGetField(petsclib::PetscLibType, dm::AbstractPetscDM, f::PetscInt)

Return the DMLabel and discretization object for a given DM field

Not Collective

Input Parameters:

  • dm - The DM
  • f - The field number

Output Parameters:

  • label - The label indicating the support of the field, or NULL for the entire mesh (pass in NULL if not needed)
  • disc - The discretization object (pass in NULL if not needed)

Level: intermediate

See also: DM, DMAddField(), DMSetField()

External Links

source
PETSc.LibPETSc.DMGetFieldAvoidTensor — Method
avoidTensor::PetscBool = DMGetFieldAvoidTensor(petsclib::PetscLibType, dm::AbstractPetscDM, f::PetscInt)

Get flag to avoid defining the field on tensor cells

Not Collective

Input Parameters:

  • dm - The DM
  • f - The field index

Output Parameter:

  • avoidTensor - The flag to avoid defining the field on tensor cells

Level: intermediate

See also: DM, DMAddField(), DMSetField(), DMGetField(), DMSetFieldAvoidTensor()

External Links

source
PETSc.LibPETSc.DMGetFineDM — Method
fdm::PetscDM = DMGetFineDM(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the fine mesh from which this DM was obtained by coarsening

Input Parameter:

  • dm - The DM object

Output Parameter:

  • fdm - The fine DM

Level: intermediate

See also: DM, DMSetFineDM(), DMCoarsen(), DMRefine()

External Links

source
PETSc.LibPETSc.DMGetFirstLabeledPoint — Method
point::PetscInt,ds::PetscDS = DMGetFirstLabeledPoint(petsclib::PetscLibType, dm::AbstractPetscDM, odm::AbstractPetscDM, label::DMLabel, numIds::PetscInt, ids::Vector{PetscInt}, height::PetscInt)

Find first labeled point in odm such that the corresponding point in dm has the specified height. Return point and the corresponding ds.

Input Parameters:

  • dm - the DM
  • odm - the enclosing DM
  • label - label for DM domain, or NULL for whole domain
  • numIds - the number of ids
  • ids - An array of the label ids in sequence for the domain
  • height - Height of target cells in DMPLEX topology

Output Parameters:

  • point - the first labeled point
  • ds - the PetscDS corresponding to the first labeled point

Level: developer

See also: DM, DMPLEX, DMPlexSetActivePoint(), DMLabel, PetscDS

External Links

source
PETSc.LibPETSc.DMGetGlobalSection — Method
section::PetscSection = DMGetGlobalSection(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the PetscSection encoding the global data layout for the DM.

Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • section - The PetscSection

Level: intermediate

See also: DM, DMSetLocalSection(), DMGetLocalSection()

External Links

source
PETSc.LibPETSc.DMGetGlobalVector — Method
g::PetscVec = DMGetGlobalVector(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets a PETSc vector that may be used with the DM global routines.

Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • g - the global vector

Level: beginner

See also: DM, DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMCreateLocalVector(), DMRestoreLocalVector(), VecStrideMax(), VecStrideMin(), VecStrideNorm(), DMClearGlobalVectors(), DMGetNamedGlobalVector(), DMGetNamedLocalVector()

External Links

source
PETSc.LibPETSc.DMGetISColoringType — Method
ctype::ISColoringType = DMGetISColoringType(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the type of coloring, IS_COLORING_GLOBAL or IS_COLORING_LOCAL that is created by the DM

Logically Collective

Input Parameter:

  • dm - the DM context

Output Parameter:

  • ctype - the matrix type

Level: intermediate

See also: DM, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateMatrix(), DMCreateMassMatrix(), DMSetMatrixPreallocateOnly(), MatType, DMGetMatType(), ISColoringType, IS_COLORING_GLOBAL, IS_COLORING_LOCAL

External Links

source
PETSc.LibPETSc.DMGetLabel — Method
label::DMLabel = DMGetLabel(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

Return the label of a given name, or NULL, from a DM

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name

Output Parameter:

  • label - The DMLabel, or NULL if the label is absent

Default labels in a DMPLEX:

  • "depth" - Holds the depth (co-dimension) of each mesh point
  • "celltype" - Holds the topological type of each cell
  • "ghost" - If the DM is distributed with overlap, this marks the cells and faces in the overlap
  • "Cell Sets" - Mirrors the cell sets defined by GMsh and ExodusII
  • "Face Sets" - Mirrors the face sets defined by GMsh and ExodusII
  • "Vertex Sets" - Mirrors the vertex sets defined by GMsh

Level: intermediate

See also: DM, DMLabel, DMHasLabel(), DMGetLabelByNum(), DMAddLabel(), DMCreateLabel(), DMPlexGetDepthLabel(), DMPlexGetCellType()

External Links

source
PETSc.LibPETSc.DMGetLabelByNum — Method
label::DMLabel = DMGetLabelByNum(petsclib::PetscLibType, dm::AbstractPetscDM, n::PetscInt)

Return the nth label on a DM

Not Collective

Input Parameters:

  • dm - The DM object
  • n - the label number

Output Parameter:

  • label - the label

Level: intermediate

See also: DM, DMLabel, DMAddLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMGetLabelIdIS — Method
ids::IS = DMGetLabelIdIS(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

Get the DMLabelGetValueIS() from a DMLabel in the DM

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name

Output Parameter:

  • ids - The integer ids, or NULL if the label does not exist

Level: beginner

See also: DM, DMLabelGetValueIS(), DMGetLabelSize()

External Links

source
PETSc.LibPETSc.DMGetLabelName — Method
name::String = DMGetLabelName(petsclib::PetscLibType, dm::AbstractPetscDM, n::PetscInt)

Return the name of nth label

Not Collective

Input Parameters:

  • dm - The DM object
  • n - the label number

Output Parameter:

  • name - the label name

Level: intermediate

See also: DM, DMLabel, DMGetLabelByNum(), DMGetLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMGetLabelOutput — Method
output::PetscBool = DMGetLabelOutput(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

Get the output flag for a given label

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name

Output Parameter:

  • output - The flag for output

Level: developer

See also: DM, DMLabel, DMSetLabelOutput(), DMCreateLabel(), DMHasLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMGetLabelSize — Method
size::PetscInt = DMGetLabelSize(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

Get the value of DMLabelGetNumValues() of a DMLabel in the DM

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name

Output Parameter:

  • size - The number of different integer ids, or 0 if the label does not exist

Level: beginner

See also: DM, DMLabelGetNumValues(), DMSetLabelValue(), DMGetLabel()

External Links

source
PETSc.LibPETSc.DMGetLabelValue — Method
value::PetscInt = DMGetLabelValue(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, point::PetscInt)

Get the value in a DMLabel for the given point, with -1 as the default

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name
  • point - The mesh point

Output Parameter:

  • value - The label value for this point, or -1 if the point is not in the label

Level: beginner

See also: DM, DMLabelGetValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMGetLocalBoundingBox — Method
DMGetLocalBoundingBox(petsclib::PetscLibType, dm::AbstractPetscDM, lmin::Vector{PetscReal}, lmax::Vector{PetscReal})

Returns the bounding box for the piece of the DM on this process.

Not Collective

Input Parameter:

  • dm - the DM

Output Parameters:

  • lmin - local minimum coordinates (length coord dim, optional)
  • lmax - local maximum coordinates (length coord dim, optional)

Level: beginner

See also: DM, DMGetCoordinates(), DMGetCoordinatesLocal(), DMGetBoundingBox()

External Links

source
PETSc.LibPETSc.DMGetLocalSection — Method
section::PetscSection = DMGetLocalSection(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the PetscSection encoding the local data layout for the DM.

Input Parameter:

  • dm - The DM

Output Parameter:

  • section - The PetscSection

Options Database Key:

  • -dm_petscsection_view - View the section created by the DM

Level: intermediate

See also: DM, DMSetLocalSection(), DMGetGlobalSection()

External Links

source
PETSc.LibPETSc.DMGetLocalToGlobalMapping — Method
ltog::ISLocalToGlobalMapping = DMGetLocalToGlobalMapping(petsclib::PetscLibType, dm::AbstractPetscDM)

Accesses the local-to-global mapping in a DM.

Collective

Input Parameter:

  • dm - the DM that provides the mapping

Output Parameter:

  • ltog - the mapping

Level: advanced

See also: DM, DMCreateLocalVector(), DMCreateGlobalVector(), VecSetLocalToGlobalMapping(), MatSetLocalToGlobalMapping(), DMCreateMatrix()

External Links

source
PETSc.LibPETSc.DMGetLocalVector — Method
g::PetscVec = DMGetLocalVector(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets a PETSc vector that may be used with the DM local routines. This vector has spaces for the ghost values.

Not Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • g - the local vector

Level: beginner

See also: DM, DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMCreateLocalVector(), DMRestoreLocalVector(), VecStrideMax(), VecStrideMin(), VecStrideNorm(), DMClearLocalVectors(), DMGetNamedGlobalVector(), DMGetNamedLocalVector()

External Links

source
PETSc.LibPETSc.DMGetMatType — Method
ctype::String = DMGetMatType(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the type of matrix that would be created with DMCreateMatrix()

Logically Collective

Input Parameter:

  • dm - the DM context

Output Parameter:

  • ctype - the matrix type

Level: intermediate

See also: DM, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateMatrix(), DMCreateMassMatrix(), DMSetMatrixPreallocateOnly(), MatType, DMSetMatType()

External Links

source
PETSc.LibPETSc.DMGetNamedGlobalVector — Method
X::PetscVec = DMGetNamedGlobalVector(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

get access to a named, persistent global vector

Collective

Input Parameters:

  • dm - DM to hold named vectors
  • name - unique name for X

Output Parameter:

  • X - named Vec

Level: developer

See also: DM, DMRestoreNamedGlobalVector(), DMHasNamedGlobalVector(), DMClearNamedGlobalVectors(), DMGetGlobalVector(), DMGetLocalVector()

External Links

source
PETSc.LibPETSc.DMGetNamedLocalVector — Method
X::PetscVec = DMGetNamedLocalVector(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

get access to a named, persistent local vector

Not Collective

Input Parameters:

  • dm - DM to hold named vectors
  • name - unique name for X

Output Parameter:

  • X - named Vec

Level: developer

See also: DM, DMGetNamedGlobalVector(), DMRestoreNamedLocalVector(), DMHasNamedLocalVector(), DMClearNamedLocalVectors(), DMGetGlobalVector(), DMGetLocalVector()

External Links

source
PETSc.LibPETSc.DMGetNaturalSF — Method
sf::PetscSF = DMGetNaturalSF(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the PetscSF encoding the map back to the original mesh ordering

Input Parameter:

  • dm - The DM

Output Parameter:

  • sf - The PetscSF

Level: intermediate

See also: DM, DMSetNaturalSF(), DMSetUseNatural(), DMGetUseNatural(), DMPlexCreateGlobalToNaturalSF(), DMPlexDistribute()

External Links

source
PETSc.LibPETSc.DMGetNearNullSpaceConstructor — Method
DMGetNearNullSpaceConstructor(petsclib::PetscLibType, dm::AbstractPetscDM, field::PetscInt, noname::Ptr{Cvoid})

Return the callback function which constructs the near-nullspace for a given field, defined with DMAddField()

Not Collective; No Fortran Support

Input Parameters:

  • dm - The DM
  • field - The field number for the nullspace

Output Parameter:

  • nullsp - A callback to create the near-nullspace

Calling sequence of nullsp:

  • dm - The present DM
  • origField - The field number given above, in the original DM
  • field - The field number in dm
  • nullSpace - The nullspace for the given field

Level: intermediate

See also: DM, DMAddField(), DMGetField(), DMSetNearNullSpaceConstructor(), DMSetNullSpaceConstructor(), DMGetNullSpaceConstructor(), DMCreateSubDM(), MatNullSpace, DMCreateSuperDM()

External Links

source
PETSc.LibPETSc.DMGetNeighbors — Method
nranks::PetscInt,ranks::Vector{PetscMPIInt} = DMGetNeighbors(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets an array containing the MPI ranks of all the processes neighbors

Not Collective

Input Parameter:

  • dm - The DM

Output Parameters:

  • nranks - the number of neighbours
  • ranks - the neighbors ranks

Level: beginner

See also: DM, DMDAGetNeighbors(), PetscSFGetRootRanks()

External Links

source
PETSc.LibPETSc.DMGetNullSpaceConstructor — Method
DMGetNullSpaceConstructor(petsclib::PetscLibType, dm::AbstractPetscDM, field::PetscInt, noname::Ptr{Cvoid})

Return the callback function which constructs the nullspace for a given field, defined with DMAddField()

Not Collective; No Fortran Support

Input Parameters:

  • dm - The DM
  • field - The field number for the nullspace

Output Parameter:

  • nullsp - A callback to create the nullspace

Calling sequence of nullsp:

  • dm - The present DM
  • origField - The field number given above, in the original DM
  • field - The field number in dm
  • nullSpace - The nullspace for the given field

Level: intermediate

See also: DM, DMAddField(), DMGetField(), DMSetNullSpaceConstructor(), DMSetNearNullSpaceConstructor(), DMGetNearNullSpaceConstructor(), DMCreateSubDM(), DMCreateSuperDM()

External Links

source
PETSc.LibPETSc.DMGetNumAuxiliaryVec — Method
numAux::PetscInt = DMGetNumAuxiliaryVec(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the number of auxiliary vectors associated with this DM

Not Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • numAux - The number of auxiliary data vectors

Level: advanced

See also: DM, DMClearAuxiliaryVec(), DMSetAuxiliaryVec(), DMGetAuxiliaryLabels(), DMGetAuxiliaryVec()

External Links

source
PETSc.LibPETSc.DMGetNumDS — Method
Nds::PetscInt = DMGetNumDS(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the number of discrete systems in the DM

Not Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • Nds - The number of PetscDS objects

Level: intermediate

See also: DM, DMGetDS(), DMGetCellDS()

External Links

source
PETSc.LibPETSc.DMGetNumFields — Method
numFields::PetscInt = DMGetNumFields(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the number of fields in the DM

Not Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • numFields - The number of fields

Level: intermediate

See also: DM, DMSetNumFields(), DMSetField()

External Links

source
PETSc.LibPETSc.DMGetNumLabels — Method
numLabels::PetscInt = DMGetNumLabels(petsclib::PetscLibType, dm::AbstractPetscDM)

Return the number of labels defined by on the DM

Not Collective

Input Parameter:

  • dm - The DM object

Output Parameter:

  • numLabels - the number of Labels

Level: intermediate

See also: DM, DMLabel, DMGetLabelByNum(), DMGetLabelName(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMGetOptionsPrefix — Method
prefix::String = DMGetOptionsPrefix(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the prefix used for searching for all DM options in the options database.

Not Collective

Input Parameter:

  • dm - the DM context

Output Parameter:

  • prefix - pointer to the prefix string used is returned

Level: advanced

See also: DM, DMSetOptionsPrefix(), DMAppendOptionsPrefix(), DMSetFromOptions()

External Links

source
PETSc.LibPETSc.DMGetOutputDM — Method
odm::PetscDM = DMGetOutputDM(petsclib::PetscLibType, dm::AbstractPetscDM)

Retrieve the DM associated with the layout for output

Collective

Input Parameter:

  • dm - The original DM

Output Parameter:

  • odm - The DM which provides the layout for output

Level: intermediate

See also: DM, VecView(), DMGetGlobalSection(), DMCreateGlobalVector(), PetscSectionHasConstraints(), DMSetGlobalSection()

External Links

source
PETSc.LibPETSc.DMGetOutputSequenceLength — Method
len::PetscInt = DMGetOutputSequenceLength(petsclib::PetscLibType, dm::AbstractPetscDM, viewer::PetscViewer, name::String)

Retrieve the number of sequence values from a PetscViewer

Input Parameters:

  • dm - The original DM
  • viewer - The PetscViewer to get it from
  • name - The sequence name

Output Parameter:

  • len - The length of the output sequence

Level: intermediate

See also: DM, DMGetOutputSequenceNumber(), DMSetOutputSequenceNumber(), VecView()

External Links

source
PETSc.LibPETSc.DMGetOutputSequenceNumber — Method
num::PetscInt,val::PetscReal = DMGetOutputSequenceNumber(petsclib::PetscLibType, dm::AbstractPetscDM)

Retrieve the sequence number/value for output

Input Parameter:

  • dm - The original DM

Output Parameters:

  • num - The output sequence number
  • val - The output sequence value

Level: intermediate

See also: DM, VecView()

External Links

source
PETSc.LibPETSc.DMGetPeriodicity — Method
maxCell::Ptr{PetscReal},Lstart::Ptr{PetscReal},L::Ptr{PetscReal} = DMGetPeriodicity(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the description of mesh periodicity

Not collective

Input Parameter:

  • dm - The DM object

Output Parameters:

  • maxCell - Over distances greater than this, we can assume a point has crossed over to another sheet, when trying to localize cell coordinates
  • Lstart - If we assume the mesh is a torus, this is the start of each coordinate, or NULL for 0.0
  • L - If we assume the mesh is a torus, this is the length of each coordinate, otherwise it is < 0.0

Level: developer

See also: DM

External Links

source
PETSc.LibPETSc.DMGetPointSF — Method
sf::PetscSF = DMGetPointSF(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the PetscSF encoding the parallel section point overlap for the DM.

Not collective but the resulting PetscSF is collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • sf - The PetscSF

Level: intermediate

See also: DM, DMSetPointSF(), DMGetSectionSF(), DMSetSectionSF(), DMCreateSectionSF()

External Links

source
PETSc.LibPETSc.DMGetRefineLevel — Method
level::PetscInt = DMGetRefineLevel(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the number of refinements that have generated this DM from some initial DM.

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • level - number of refinements

Level: developer

See also: DM, DMRefine(), DMCoarsen(), DMGetCoarsenLevel(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMGetRegionDS — Method
fields::IS,ds::PetscDS,dsIn::PetscDS = DMGetRegionDS(petsclib::PetscLibType, dm::AbstractPetscDM, label::DMLabel)

Get the PetscDS for a given mesh region, defined by a DMLabel

Not Collective

Input Parameters:

  • dm - The DM
  • label - The DMLabel defining the mesh region, or NULL for the entire mesh

Output Parameters:

  • fields - The IS containing the DM field numbers for the fields in this PetscDS, or NULL
  • ds - The PetscDS defined on the given region, or NULL
  • dsIn - The PetscDS for input in the given region, or NULL

Level: advanced

See also: DM, DMGetRegionNumDS(), DMSetRegionDS(), DMGetDS(), DMGetCellDS()

External Links

source
PETSc.LibPETSc.DMGetRegionNumDS — Method
label::DMLabel,fields::IS,ds::PetscDS,dsIn::PetscDS = DMGetRegionNumDS(petsclib::PetscLibType, dm::AbstractPetscDM, num::PetscInt)

Get the PetscDS for a given mesh region, defined by the region number

Not Collective

Input Parameters:

  • dm - The DM
  • num - The region number, in [0, Nds)

Output Parameters:

  • label - The region label, or NULL
  • fields - The IS containing the DM field numbers for the fields in this PetscDS, or NULL
  • ds - The PetscDS defined on the given region, or NULL
  • dsIn - The PetscDS for input in the given region, or NULL

Level: advanced

See also: DM, DMGetRegionDS(), DMSetRegionDS(), DMGetDS(), DMGetCellDS()

External Links

source
PETSc.LibPETSc.DMGetSectionSF — Method
sf::PetscSF = DMGetSectionSF(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the PetscSF encoding the parallel dof overlap for the DM. If it has not been set, it is created from the default PetscSection layouts in the DM.

Input Parameter:

  • dm - The DM

Output Parameter:

  • sf - The PetscSF

Level: intermediate

See also: DM, DMSetSectionSF(), DMCreateSectionSF()

External Links

source
PETSc.LibPETSc.DMGetSparseLocalize — Method
sparse::PetscBool = DMGetSparseLocalize(petsclib::PetscLibType, dm::AbstractPetscDM)

Check if the DM coordinates should be localized only for cells near the periodic boundary.

Not collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • sparse - PETSC_TRUE if only cells near the periodic boundary are localized

Level: intermediate

See also: DMSetSparseLocalize(), DMLocalizeCoordinates(), DMSetPeriodicity()

External Links

source
PETSc.LibPETSc.DMGetStratumIS — Method
points::IS = DMGetStratumIS(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, value::PetscInt)

Get the points in a label stratum

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name
  • value - The stratum value

Output Parameter:

  • points - The stratum points, or NULL if the label does not exist or does not have that value

Level: beginner

See also: DM, DMLabelGetStratumIS(), DMGetStratumSize()

External Links

source
PETSc.LibPETSc.DMGetStratumSize — Method
size::PetscInt = DMGetStratumSize(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, value::PetscInt)

Get the number of points in a label stratum

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name of the stratum
  • value - The stratum value

Output Parameter:

  • size - The number of points, also called the stratum size

Level: beginner

See also: DM, DMLabelGetStratumSize(), DMGetLabelSize(), DMGetLabelIds()

External Links

source
PETSc.LibPETSc.DMGetType — Method
type::String = DMGetType(petsclib::PetscLibType, dm::AbstractPetscDM)

Gets the DM type name (as a string) from the DM.

Not Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • type - The DMType name

Level: intermediate

See also: DM, DMType, DMDA, DMPLEX, DMSetType(), DMCreate(), PetscObjectTypeCompare(), PetscObjectTypeCompareAny()

External Links

source
PETSc.LibPETSc.DMGetUseNatural — Method
useNatural::PetscBool = DMGetUseNatural(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the flag for creating a mapping to the natural order when a DM is (re)distributed in parallel

Not Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • useNatural - PETSC_TRUE to build the mapping to a natural order during distribution

Level: beginner

See also: DM, DMSetUseNatural(), DMCreate()

External Links

source
PETSc.LibPETSc.DMGetVecType — Method
ctype::String = DMGetVecType(petsclib::PetscLibType, da::AbstractPetscDM)

Gets the type of vector created with DMCreateLocalVector() and DMCreateGlobalVector()

Logically Collective

Input Parameter:

  • da - initial distributed array

Output Parameter:

  • ctype - the vector type

Level: intermediate

See also: DM, DMCreate(), DMDestroy(), DMDAInterpolationType, VecType, DMSetMatType(), DMGetMatType(), DMSetVecType()

External Links

source
PETSc.LibPETSc.DMGlobalToLocal — Method
DMGlobalToLocal(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, l::AbstractPetscVec)

update local vectors from global vector

Neighbor-wise Collective

Input Parameters:

  • dm - the DM object
  • g - the global vector
  • mode - INSERT_VALUES or ADD_VALUES
  • l - the local vector

Level: beginner

See also: DM, DMGlobalToLocalHookAdd(), DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMLocalToGlobalBegin(), DMLocalToGlobal(), DMLocalToGlobalEnd(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd()

External Links

source
PETSc.LibPETSc.DMGlobalToLocalBegin — Method
DMGlobalToLocalBegin(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, l::AbstractPetscVec)

Begins updating local vectors from global vector

Neighbor-wise Collective

Input Parameters:

  • dm - the DM object
  • g - the global vector
  • mode - INSERT_VALUES or ADD_VALUES
  • l - the local vector

Level: intermediate

See also: DM, DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocal(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMLocalToGlobal(), DMLocalToGlobalEnd()

External Links

source
PETSc.LibPETSc.DMGlobalToLocalBeginDefaultShell — Method
DMGlobalToLocalBeginDefaultShell(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, l::AbstractPetscVec)

Uses the GlobalToLocal VecScatter context set by the user to begin a global to local scatter

Collective

Input Parameters:

  • dm - DMSHELL
  • g - global vector
  • mode - InsertMode
  • l - local vector

Level: advanced

See also: DM, DMSHELL, DMGlobalToLocalEndDefaultShell()

External Links

source
PETSc.LibPETSc.DMGlobalToLocalEnd — Method
DMGlobalToLocalEnd(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, l::AbstractPetscVec)

Ends updating local vectors from global vector

Neighbor-wise Collective

Input Parameters:

  • dm - the DM object
  • g - the global vector
  • mode - INSERT_VALUES or ADD_VALUES
  • l - the local vector

Level: intermediate

See also: DM, DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocal(), DMLocalToGlobalBegin(), DMLocalToGlobal(), DMLocalToGlobalEnd()

External Links

source
PETSc.LibPETSc.DMGlobalToLocalEndDefaultShell — Method
DMGlobalToLocalEndDefaultShell(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, l::AbstractPetscVec)

Uses the GlobalToLocal VecScatter context set by the user to end a global to local scatter Collective

Input Parameters:

  • dm - DMSHELL
  • g - global vector
  • mode - InsertMode
  • l - local vector

Level: advanced

See also: DM, DMSHELL, DMGlobalToLocalBeginDefaultShell()

External Links

source
PETSc.LibPETSc.DMGlobalToLocalHookAdd — Method
DMGlobalToLocalHookAdd(petsclib::PetscLibType, dm::AbstractPetscDM, beginhook::external, endhook::external, ctx::Ptr{Cvoid})

adds a callback to be run when DMGlobalToLocal() is called

Logically Collective

Input Parameters:

  • dm - the DM
  • beginhook - function to run at the beginning of DMGlobalToLocalBegin()
  • endhook - function to run after DMGlobalToLocalEnd() has completed
  • ctx - [optional] context for provide data for the hooks (may be NULL)

Calling sequence of beginhook:

  • dm - global DM
  • g - global vector
  • mode - mode
  • l - local vector
  • ctx - optional function context

Calling sequence of endhook:

  • dm - global DM
  • g - global vector
  • mode - mode
  • l - local vector
  • ctx - optional function context

Level: advanced

See also: DM, DMGlobalToLocal(), DMRefineHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMGlobalToLocalSolve — Method
DMGlobalToLocalSolve(petsclib::PetscLibType, dm::AbstractPetscDM, x::AbstractPetscVec, y::AbstractPetscVec)

Solve for the global vector that is mapped to a given local vector by DMGlobalToLocalBegin()/DMGlobalToLocalEnd() with mode INSERT_VALUES.

Collective

Input Parameters:

  • dm - The DM object
  • x - The local vector
  • y - The global vector: the input value of this variable is used as an initial guess

Output Parameter:

  • y - The least-squares solution

Level: advanced

See also: DM, DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMLocalToGlobalEnd(), DMPlexGetAnchors(), DMPlexSetAnchors()

External Links

source
PETSc.LibPETSc.DMHasBasisTransform — Method
flg::PetscBool = DMHasBasisTransform(petsclib::PetscLibType, dm::AbstractPetscDM)

Whether the DM employs a basis transformation from functions in global vectors to functions in local vectors

Input Parameter:

  • dm - The DM

Output Parameter:

  • flg - PETSC_TRUE if a basis transformation should be done

Level: developer

See also: DM, DMPlexGlobalToLocalBasis(), DMPlexLocalToGlobalBasis(), DMPlexCreateBasisRotation()

External Links

source
PETSc.LibPETSc.DMHasBound — Method
hasBound::PetscBool = DMHasBound(petsclib::PetscLibType, dm::AbstractPetscDM)

Determine whether a bound condition was specified

Logically collective

Input Parameter:

  • dm - The DM, with a PetscDS that matches the problem being constrained

Output Parameter:

  • hasBound - Flag indicating if a bound condition was specified

Level: intermediate

See also: DM, DSAddBoundary(), PetscDSAddBoundary()

External Links

source
PETSc.LibPETSc.DMHasColoring — Method
flg::PetscBool = DMHasColoring(petsclib::PetscLibType, dm::AbstractPetscDM)

does the DM object have a method of providing a coloring?

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • flg - PETSC_TRUE if the DM has facilities for DMCreateColoring().

Level: developer

See also: DM, DMCreateColoring()

External Links

source
PETSc.LibPETSc.DMHasCreateInjection — Method
flg::PetscBool = DMHasCreateInjection(petsclib::PetscLibType, dm::AbstractPetscDM)

does the DM object have a method of providing an injection?

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • flg - PETSC_TRUE if the DM has facilities for DMCreateInjection().

Level: developer

See also: DM, DMCreateInjection(), DMHasCreateRestriction(), DMHasCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMHasCreateRestriction — Method
flg::PetscBool = DMHasCreateRestriction(petsclib::PetscLibType, dm::AbstractPetscDM)

does the DM object have a method of providing a restriction?

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • flg - PETSC_TRUE if the DM has facilities for DMCreateRestriction().

Level: developer

See also: DM, DMCreateRestriction(), DMHasCreateInterpolation(), DMHasCreateInjection()

External Links

source
PETSc.LibPETSc.DMHasLabel — Method
hasLabel::PetscBool = DMHasLabel(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

Determine whether the DM has a label of a given name

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name

Output Parameter:

  • hasLabel - PETSC_TRUE if the label is present

Level: intermediate

See also: DM, DMLabel, DMGetLabel(), DMGetLabelByNum(), DMCreateLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMHasNamedGlobalVector — Method
exists::PetscBool = DMHasNamedGlobalVector(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

check for a named, persistent global vector created with DMGetNamedGlobalVector()

Not Collective

Input Parameters:

  • dm - DM to hold named vectors
  • name - unique name for Vec

Output Parameter:

  • exists - true if the vector was previously created

Level: developer

See also: DM, DMGetNamedGlobalVector(), DMRestoreNamedLocalVector(), DMClearNamedGlobalVectors()

External Links

source
PETSc.LibPETSc.DMHasNamedLocalVector — Method
exists::PetscBool = DMHasNamedLocalVector(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

check for a named, persistent local vector created with DMGetNamedLocalVector()

Not Collective

Input Parameters:

  • dm - DM to hold named vectors
  • name - unique name for Vec

Output Parameter:

  • exists - true if the vector was previously created

Level: developer

See also: DM, DMGetNamedGlobalVector(), DMRestoreNamedLocalVector(), DMClearNamedLocalVectors()

External Links

source
PETSc.LibPETSc.DMHasVariableBounds — Method
flg::PetscBool = DMHasVariableBounds(petsclib::PetscLibType, dm::AbstractPetscDM)

does the DM object have a variable bounds function?

Not Collective

Input Parameter:

  • dm - the DM object to destroy

Output Parameter:

  • flg - PETSC_TRUE if the variable bounds function exists

Level: developer

See also: DM, DMComputeVariableBounds(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMGetApplicationContext()

External Links

source
PETSc.LibPETSc.DMInitializePackage — Method
DMInitializePackage(petsclib::PetscLibType)

This function initializes everything in the DM package. It is called from PetscDLLibraryRegister_petscdm() when using dynamic libraries, and on the first call to DMCreate() or similar routines when using shared or static libraries.

Level: developer

See also: PetscInitialize()

External Links

source
PETSc.LibPETSc.DMInterpolate — Method
DMInterpolate(petsclib::PetscLibType, coarse::AbstractPetscDM, interp::AbstractPetscMat, fine::AbstractPetscDM)

interpolates user-defined problem data attached to a DM to a finer DM by running hooks registered by DMRefineHookAdd()

Collective if any hooks are

Input Parameters:

  • coarse - coarser DM to use as a base
  • interp - interpolation matrix, apply using MatInterpolate()
  • fine - finer DM to update

Level: developer

See also: DM, DMRefineHookAdd(), MatInterpolate()

External Links

source
PETSc.LibPETSc.DMInterpolateSolution — Method
DMInterpolateSolution(petsclib::PetscLibType, coarse::AbstractPetscDM, fine::AbstractPetscDM, interp::AbstractPetscMat, coarseSol::AbstractPetscVec, fineSol::AbstractPetscVec)

Interpolates a solution from a coarse mesh to a fine mesh.

Collective

Input Parameters:

  • coarse - coarse DM
  • fine - fine DM
  • interp - (optional) the matrix computed by DMCreateInterpolation(). Implementations may not need this, but if it

is available it can avoid some recomputation. If it is provided, MatInterpolate() will be used if the coarse DM does not have a specialized implementation.

  • coarseSol - solution on the coarse mesh

Output Parameter:

  • fineSol - the interpolation of coarseSol to the fine mesh

Level: developer

See also: DM, DMInterpolate(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMInterpolationAddPoints — Method
DMInterpolationAddPoints(petsclib::PetscLibType, ctx::DMInterpolationInfo, n::PetscInt, points::Vector{PetscReal})

Add points at which we will interpolate the fields

Not Collective

Input Parameters:

  • ctx - the context
  • n - the number of points
  • points - the coordinates for each point, an array of size n * dim

Level: intermediate

See also: DM, DMInterpolationInfo, DMInterpolationSetDim(), DMInterpolationEvaluate(), DMInterpolationCreate()

External Links

source
PETSc.LibPETSc.DMInterpolationCreate — Method
ctx::DMInterpolationInfo = DMInterpolationCreate(petsclib::PetscLibType, comm::MPI_Comm)

Creates a DMInterpolationInfo context

Collective

Input Parameter:

  • comm - the communicator

Output Parameter:

  • ctx - the context

Level: beginner

See also: DM, DMInterpolationInfo, DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationDestroy()

External Links

source
PETSc.LibPETSc.DMInterpolationDestroy — Method
DMInterpolationDestroy(petsclib::PetscLibType, ctx::Union{DMInterpolationInfo, Ref{DMInterpolationInfo}})

Destroys a DMInterpolationInfo context

Collective

Input Parameter:

  • ctx - the context

Level: beginner

See also: DM, DMInterpolationInfo, DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationCreate()

External Links

source
PETSc.LibPETSc.DMInterpolationEvaluate — Method
DMInterpolationEvaluate(petsclib::PetscLibType, ctx::DMInterpolationInfo, dm::AbstractPetscDM, x::AbstractPetscVec, v::AbstractPetscVec)

Using the input from dm and x, calculates interpolated field values at the interpolation points.

Input Parameters:

  • ctx - The DMInterpolationInfo context obtained with DMInterpolationCreate()
  • dm - The DM
  • x - The local vector containing the field to be interpolated, can be created with DMCreateGlobalVector()

Output Parameter:

  • v - The vector containing the interpolated values, obtained with DMInterpolationGetVector()

Level: beginner

See also: DM, DMInterpolationInfo, DMInterpolationGetVector(), DMInterpolationAddPoints(), DMInterpolationCreate(), DMInterpolationGetCoordinates()

External Links

source
PETSc.LibPETSc.DMInterpolationGetCoordinates — Method
coordinates::PetscVec = DMInterpolationGetCoordinates(petsclib::PetscLibType, ctx::DMInterpolationInfo)

Gets a Vec with the coordinates of each interpolation point

Collective

Input Parameter:

  • ctx - the context

Output Parameter:

  • coordinates - the coordinates of interpolation points

Level: intermediate

See also: DM, DMInterpolationInfo, DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationCreate()

External Links

source
PETSc.LibPETSc.DMInterpolationGetDim — Method
dim::PetscInt = DMInterpolationGetDim(petsclib::PetscLibType, ctx::DMInterpolationInfo)

Gets the spatial dimension for the interpolation context

Not Collective

Input Parameter:

  • ctx - the context

Output Parameter:

  • dim - the spatial dimension

Level: intermediate

See also: DM, DMInterpolationInfo, DMInterpolationSetDim(), DMInterpolationEvaluate(), DMInterpolationAddPoints()

External Links

source
PETSc.LibPETSc.DMInterpolationGetDof — Method
dof::PetscInt = DMInterpolationGetDof(petsclib::PetscLibType, ctx::DMInterpolationInfo)

Gets the number of fields interpolated at a point for the interpolation context

Not Collective

Input Parameter:

  • ctx - the context

Output Parameter:

  • dof - the number of fields

Level: intermediate

See also: DM, DMInterpolationInfo, DMInterpolationSetDof(), DMInterpolationEvaluate(), DMInterpolationAddPoints()

External Links

source
PETSc.LibPETSc.DMInterpolationGetVector — Method
v::PetscVec = DMInterpolationGetVector(petsclib::PetscLibType, ctx::DMInterpolationInfo)

Gets a Vec which can hold all the interpolated field values

Collective

Input Parameter:

  • ctx - the context

Output Parameter:

  • v - a vector capable of holding the interpolated field values

Level: intermediate

See also: DM, DMInterpolationInfo, DMInterpolationRestoreVector(), DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationCreate()

External Links

source
PETSc.LibPETSc.DMInterpolationRestoreVector — Method
DMInterpolationRestoreVector(petsclib::PetscLibType, ctx::DMInterpolationInfo, v::AbstractPetscVec)

Returns a Vec which can hold all the interpolated field values

Collective

Input Parameters:

  • ctx - the context
  • v - a vector capable of holding the interpolated field values

Level: intermediate

See also: DM, DMInterpolationInfo, DMInterpolationGetVector(), DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationCreate()

External Links

source
PETSc.LibPETSc.DMInterpolationSetDim — Method
DMInterpolationSetDim(petsclib::PetscLibType, ctx::DMInterpolationInfo, dim::PetscInt)

Sets the spatial dimension for the interpolation context

Not Collective

Input Parameters:

  • ctx - the context
  • dim - the spatial dimension

Level: intermediate

See also: DM, DMInterpolationInfo, DMInterpolationGetDim(), DMInterpolationEvaluate(), DMInterpolationAddPoints()

External Links

source
PETSc.LibPETSc.DMInterpolationSetDof — Method
DMInterpolationSetDof(petsclib::PetscLibType, ctx::DMInterpolationInfo, dof::PetscInt)

Sets the number of fields interpolated at a point for the interpolation context

Not Collective

Input Parameters:

  • ctx - the context
  • dof - the number of fields

Level: intermediate

See also: DM, DMInterpolationInfo, DMInterpolationGetDof(), DMInterpolationEvaluate(), DMInterpolationAddPoints()

External Links

source
PETSc.LibPETSc.DMInterpolationSetUp — Method
DMInterpolationSetUp(petsclib::PetscLibType, ctx::DMInterpolationInfo, dm::AbstractPetscDM, redundantPoints::PetscBool, ignoreOutsideDomain::PetscBool)

Compute spatial indices for point location during interpolation

Collective

Input Parameters:

  • ctx - the context
  • dm - the DM for the function space used for interpolation
  • redundantPoints - If PETSC_TRUE, all processes are passing in the same array of points. Otherwise, points need to be communicated among processes.
  • ignoreOutsideDomain - If PETSC_TRUE, ignore points outside the domain, otherwise return an error

Level: intermediate

See also: DM, DMInterpolationInfo, DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationCreate()

External Links

source
PETSc.LibPETSc.DMIsBoundaryPoint — Method
isBd::PetscBool = DMIsBoundaryPoint(petsclib::PetscLibType, dm::AbstractPetscDM, point::PetscInt)

Determine whether a mesh point lies on a DM boundary

Not Collective

Input Parameters:

  • dm - the DM object
  • point - the mesh point number

Output Parameter:

  • isBd - PETSC_TRUE if point belongs to any boundary label registered on the DM

Level: developer

See also: DM, DMLabel, DMAddBoundary(), PetscDSGetBoundary()

External Links

source
PETSc.LibPETSc.DMIsForest — Method
isForest::PetscBool = DMIsForest(petsclib::PetscLibType, dm::AbstractPetscDM)

Check whether a DM uses the DMFOREST interface for hierarchically-refined meshes

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • isForest - whether dm is a subtype of DMFOREST

Level: intermediate

See also: DMFOREST, DMForestRegisterType()

External Links

source
PETSc.LibPETSc.DMKSPGetComputeInitialGuess — Method
func::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMKSPGetComputeInitialGuess(petsclib::PetscLibType, dm::AbstractPetscDM)

get KSP initial guess evaluation function

Not Collective

Input Parameter:

  • dm - DM used with a KSP

Output Parameters:

  • func - initial guess evaluation function, for calling sequence see KSPComputeInitialGuessFn
  • ctx - context for right-hand side evaluation

Level: advanced

See also: DMKSP, DM, KSP, DMKSPSetContext(), KSPSetComputeRHS(), DMKSPSetComputeRHS(), KSPComputeInitialGuessFn

External Links

source
PETSc.LibPETSc.DMKSPGetComputeOperators — Method
func::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMKSPGetComputeOperators(petsclib::PetscLibType, dm::AbstractPetscDM)

get KSP matrix evaluation function

Not Collective

Input Parameter:

  • dm - DM used with a KSP

Output Parameters:

  • func - matrix evaluation function, for calling sequence see KSPComputeOperatorsFn
  • ctx - context for matrix evaluation

Level: developer

See also: DMKSP, DM, KSP, DMKSPSetContext(), KSPSetComputeOperators(), DMKSPSetComputeOperators(), KSPComputeOperatorsFn

External Links

source
PETSc.LibPETSc.DMKSPGetComputeRHS — Method
func::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMKSPGetComputeRHS(petsclib::PetscLibType, dm::AbstractPetscDM)

get KSP right-hand side evaluation function

Not Collective

Input Parameter:

  • dm - DM to be used with KSP

Output Parameters:

  • func - right-hand side evaluation function, for calling sequence see KSPComputeRHSFn
  • ctx - context for right-hand side evaluation

Level: advanced

See also: DMKSP, DM, KSP, DMKSPSetContext(), KSPSetComputeRHS(), DMKSPSetComputeRHS(), KSPComputeRHSFn

External Links

source
PETSc.LibPETSc.DMKSPSetComputeInitialGuess — Method
DMKSPSetComputeInitialGuess(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set KSP initial guess evaluation function

Not Collective

Input Parameters:

  • dm - DM to be used with KSP
  • func - initial guess evaluation function, for calling sequence see KSPComputeInitialGuessFn
  • ctx - context for initial guess evaluation

Level: developer

See also: DMKSP, DM, KSP, DMKSPSetContext(), DMKSPGetComputeRHS(), KSPComputeInitialGuessFn

External Links

source
PETSc.LibPETSc.DMKSPSetComputeOperators — Method
DMKSPSetComputeOperators(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set KSP matrix evaluation function

Not Collective

Input Parameters:

  • dm - DM to be used with KSP
  • func - matrix evaluation function, for calling sequence see KSPComputeOperatorsFn
  • ctx - context for matrix evaluation

Level: developer

See also: DMKSP, DM, KSP, DMKSPSetContext(), DMKSPGetComputeOperators(), KSPSetOperators(), KSPComputeOperatorsFn

External Links

source
PETSc.LibPETSc.DMKSPSetComputeRHS — Method
DMKSPSetComputeRHS(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set KSP right-hand side evaluation function

Not Collective

Input Parameters:

  • dm - DM used with a KSP
  • func - right-hand side evaluation function, for calling sequence see KSPComputeRHSFn
  • ctx - context for right-hand side evaluation

Level: developer

See also: DMKSP, DM, KSP, DMKSPSetContext(), DMKSPGetComputeRHS()

External Links

source
PETSc.LibPETSc.DMLoad — Method
DMLoad(petsclib::PetscLibType, newdm::AbstractPetscDM, viewer::PetscViewer)

Loads a DM that has been stored in binary with DMView().

Collective

Input Parameters:

  • newdm - the newly loaded DM, this needs to have been created with DMCreate() or

some related function before a call to DMLoad().

  • viewer - binary file viewer, obtained from PetscViewerBinaryOpen() or

PETSCVIEWERHDF5 file viewer, obtained from PetscViewerHDF5Open()

Level: intermediate

See also: DM, PetscViewerBinaryOpen(), DMView(), MatLoad(), VecLoad()

External Links

source
PETSc.LibPETSc.DMLocalToGlobal — Method
DMLocalToGlobal(petsclib::PetscLibType, dm::AbstractPetscDM, l::AbstractPetscVec, mode::InsertMode, g::AbstractPetscVec)

updates global vectors from local vectors

Neighbor-wise Collective

Input Parameters:

  • dm - the DM object
  • l - the local vector
  • mode - if INSERT_VALUES then no parallel communication is used, if ADD_VALUES then all ghost points from the same base point accumulate into that base point.
  • g - the global vector

Level: beginner

See also: DM, DMLocalToGlobalBegin(), DMLocalToGlobalEnd(), DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocal(), DMGlobalToLocalEnd(), DMGlobalToLocalBegin(), DMLocalToGlobalHookAdd(), DMGlobaToLocallHookAdd()

External Links

source
PETSc.LibPETSc.DMLocalToGlobalBegin — Method
DMLocalToGlobalBegin(petsclib::PetscLibType, dm::AbstractPetscDM, l::AbstractPetscVec, mode::InsertMode, g::AbstractPetscVec)

begins updating global vectors from local vectors

Neighbor-wise Collective

Input Parameters:

  • dm - the DM object
  • l - the local vector
  • mode - if INSERT_VALUES then no parallel communication is used, if ADD_VALUES then all ghost points from the same base point accumulate into that base point.
  • g - the global vector

Level: intermediate

See also: DM, DMLocalToGlobal(), DMLocalToGlobalEnd(), DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocal(), DMGlobalToLocalEnd(), DMGlobalToLocalBegin()

External Links

source
PETSc.LibPETSc.DMLocalToGlobalBeginDefaultShell — Method
DMLocalToGlobalBeginDefaultShell(petsclib::PetscLibType, dm::AbstractPetscDM, l::AbstractPetscVec, mode::InsertMode, g::AbstractPetscVec)

Uses the LocalToGlobal VecScatter context set by the user to begin a local to global scatter Collective

Input Parameters:

  • dm - DMSHELL
  • l - local vector
  • mode - InsertMode
  • g - global vector

Level: advanced

See also: DM, DMSHELL, DMLocalToGlobalEndDefaultShell()

External Links

source
PETSc.LibPETSc.DMLocalToGlobalEnd — Method
DMLocalToGlobalEnd(petsclib::PetscLibType, dm::AbstractPetscDM, l::AbstractPetscVec, mode::InsertMode, g::AbstractPetscVec)

updates global vectors from local vectors

Neighbor-wise Collective

Input Parameters:

  • dm - the DM object
  • l - the local vector
  • mode - INSERT_VALUES or ADD_VALUES
  • g - the global vector

Level: intermediate

See also: DM, DMLocalToGlobalBegin(), DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocalEnd()

External Links

source
PETSc.LibPETSc.DMLocalToGlobalEndDefaultShell — Method
DMLocalToGlobalEndDefaultShell(petsclib::PetscLibType, dm::AbstractPetscDM, l::AbstractPetscVec, mode::InsertMode, g::AbstractPetscVec)

Uses the LocalToGlobal VecScatter context set by the user to end a local to global scatter Collective

Input Parameters:

  • dm - DMSHELL
  • l - local vector
  • mode - InsertMode
  • g - global vector

Level: advanced

See also: DM, DMSHELL, DMLocalToGlobalBeginDefaultShell()

External Links

source
PETSc.LibPETSc.DMLocalToGlobalHookAdd — Method
DMLocalToGlobalHookAdd(petsclib::PetscLibType, dm::AbstractPetscDM, beginhook::external, endhook::external, ctx::Ptr{Cvoid})

adds a callback to be run when a local to global is called

Logically Collective

Input Parameters:

  • dm - the DM
  • beginhook - function to run at the beginning of DMLocalToGlobalBegin()
  • endhook - function to run after DMLocalToGlobalEnd() has completed
  • ctx - [optional] context for provide data for the hooks (may be NULL)

Calling sequence of beginhook:

  • global - global DM
  • l - local vector
  • mode - mode
  • g - global vector
  • ctx - optional function context

Calling sequence of endhook:

  • global - global DM
  • l - local vector
  • mode - mode
  • g - global vector
  • ctx - optional function context

Level: advanced

See also: DM, DMLocalToGlobal(), DMRefineHookAdd(), DMGlobalToLocalHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMLocalToLocalBegin — Method
DMLocalToLocalBegin(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, l::AbstractPetscVec)

Begins the process of mapping values from a local vector (that include ghost points that contain irrelevant values) to another local vector where the ghost points in the second are set correctly from values on other MPI ranks.

Neighbor-wise Collective

Input Parameters:

  • dm - the DM object
  • g - the original local vector
  • mode - one of INSERT_VALUES or ADD_VALUES

Output Parameter:

  • l - the local vector with correct ghost values

Level: intermediate

See also: DM, DMLocalToLocalEnd(), DMCoarsen(), DMDestroy(), DMView(), DMCreateLocalVector(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin()

External Links

source
PETSc.LibPETSc.DMLocalToLocalBeginDefaultShell — Method
DMLocalToLocalBeginDefaultShell(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, l::AbstractPetscVec)

Uses the LocalToLocal VecScatter context set by the user to begin a local to local scatter Collective

Input Parameters:

  • dm - DMSHELL
  • g - the original local vector
  • mode - InsertMode

Output Parameter:

  • l - the local vector with correct ghost values

Level: advanced

See also: DM, DMSHELL, DMLocalToLocalEndDefaultShell()

External Links

source
PETSc.LibPETSc.DMLocalToLocalEnd — Method
DMLocalToLocalEnd(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, l::AbstractPetscVec)

Maps from a local vector to another local vector where the ghost points in the second are set correctly. Must be preceded by DMLocalToLocalBegin().

Neighbor-wise Collective

Input Parameters:

  • dm - the DM object
  • g - the original local vector
  • mode - one of INSERT_VALUES or ADD_VALUES

Output Parameter:

  • l - the local vector with correct ghost values

Level: intermediate

See also: DM, DMLocalToLocalBegin(), DMCoarsen(), DMDestroy(), DMView(), DMCreateLocalVector(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin()

External Links

source
PETSc.LibPETSc.DMLocalToLocalEndDefaultShell — Method
DMLocalToLocalEndDefaultShell(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec, mode::InsertMode, l::AbstractPetscVec)

Uses the LocalToLocal VecScatter context set by the user to end a local to local scatter Collective

Input Parameters:

  • dm - DMSHELL
  • g - the original local vector
  • mode - InsertMode

Output Parameter:

  • l - the local vector with correct ghost values

Level: advanced

See also: DM, DMSHELL, DMLocalToLocalBeginDefaultShell()

External Links

source
PETSc.LibPETSc.DMLocalizeCoordinate — Method
DMLocalizeCoordinate(petsclib::PetscLibType, dm::AbstractPetscDM, in::Vector{PetscScalar}, endpoint::PetscBool, out::Vector{PetscScalar})

If a mesh is periodic (a torus with lengths Li, some of which can be infinite), project the coordinate onto [0, Li) in each dimension.

Input Parameters:

  • dm - The DM
  • in - The input coordinate point (dim numbers)
  • endpoint - Include the endpoint L_i

Output Parameter:

  • out - The localized coordinate point (dim numbers)

Level: developer

See also: DM, DMLocalizeCoordinates(), DMLocalizeAddCoordinate()

External Links

source
PETSc.LibPETSc.DMLocalizeCoordinates — Method
DMLocalizeCoordinates(petsclib::PetscLibType, dm::AbstractPetscDM)

If a mesh is periodic, create local coordinates for cells having periodic faces

Collective

Input Parameter:

  • dm - The DM

Level: developer

See also: DM, DMSetPeriodicity(), DMLocalizeCoordinate(), DMLocalizeAddCoordinate()

External Links

source
PETSc.LibPETSc.DMLocatePoints — Method
DMLocatePoints(petsclib::PetscLibType, dm::AbstractPetscDM, v::AbstractPetscVec, ltype::DMPoCintLocationType, cellSF::PetscSF)

Locate the points in v in the mesh and return a PetscSF of the containing cells

Collective

Input Parameters:

  • dm - The DM
  • ltype - The type of point location, e.g. DM_POINTLOCATION_NONE or DM_POINTLOCATION_NEAREST

Input/Output Parameters:

  • v - The Vec of points, on output contains the nearest mesh points to the given points if DM_POINTLOCATION_NEAREST is used
  • cellSF - Points to either NULL, or a PetscSF with guesses for which cells contain each point;

on output, the PetscSF containing the MPI ranks and local indices of the containing points

Level: developer

See also: DM, DMSetCoordinates(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMPointLocationType

External Links

source
PETSc.LibPETSc.DMMoabFEMComputeBasis — Method
coordinates::PetscReal,phypts::PetscReal,jacobian_quadrature_weight_product::PetscReal,fe_basis::PetscReal = DMMoabFEMComputeBasis(petsclib::PetscLibType, dim::PetscInt, nverts::PetscInt, quadrature::PetscQuadrature, fe_basis_derivatives::PetscReal)

External Links

source
PETSc.LibPETSc.DMMonitor — Method
DMMonitor(petsclib::PetscLibType, dm::AbstractPetscDM)

runs the user provided monitor routines, if they exist

Collective

Input Parameter:

  • dm - The DM

Level: developer

See also: DM, DMMonitorSet(), DMMonitorSetFromOptions()

External Links

source
PETSc.LibPETSc.DMMonitorCancel — Method
DMMonitorCancel(petsclib::PetscLibType, dm::AbstractPetscDM)

Clears all the monitor functions for a DM object.

Logically Collective

Input Parameter:

  • dm - the DM

Options Database Key:

  • -dm_monitor_cancel - cancels all monitors that have been hardwired

into a code by calls to DMonitorSet(), but does not cancel those set via the options database

Level: intermediate

See also: DM, DMMonitorSet(), DMMonitorSetFromOptions(), DMMonitor()

External Links

source
PETSc.LibPETSc.DMMonitorSet — Method
DMMonitorSet(petsclib::PetscLibType, dm::AbstractPetscDM, f::external, mctx::Ptr{Cvoid}, monitordestroy::Ptr{Cvoid})

Sets an additional monitor function that is to be used after a solve to monitor discretization performance.

Logically Collective

Input Parameters:

  • dm - the DM
  • f - the monitor function
  • mctx - [optional] context for private data for the monitor routine (use NULL if no context is desired)
  • monitordestroy - [optional] routine that frees monitor context (may be NULL), see PetscCtxDestroyFn for the calling sequence

Options Database Key:

  • -dm_monitor_cancel - cancels all monitors that have been hardwired into a code by calls to DMMonitorSet(), but

does not cancel those set via the options database.

Level: intermediate

See also: DM, DMMonitorCancel(), DMMonitorSetFromOptions(), DMMonitor(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.DMMonitorSetFromOptions — Method
flg::PetscBool = DMMonitorSetFromOptions(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, help::String, manual::String, monitor::external, monitorsetup::external)

Sets a monitor function and viewer appropriate for the type indicated by the user

Collective

Input Parameters:

  • dm - DM object you wish to monitor
  • name - the monitor type one is seeking
  • help - message indicating what monitoring is done
  • manual - manual page for the monitor
  • monitor - the monitor function, this must use a PetscViewerFormat as its context
  • monitorsetup - a function that is called once ONLY if the user selected this monitor that may set additional features of the DM or PetscViewer objects

Output Parameter:

  • flg - Flag set if the monitor was created

Calling sequence of monitor:

  • dm - the DM to be monitored
  • ctx - monitor context

Calling sequence of monitorsetup:

  • dm - the DM to be monitored
  • vf - the PetscViewer and format to be used by the monitor

Level: developer

See also: DM, PetscOptionsCreateViewer(), PetscOptionsGetReal(), PetscOptionsHasName(), PetscOptionsGetString(), PetscOptionsGetIntArray(), PetscOptionsGetRealArray(), PetscOptionsBool(), PetscOptionsInt(), PetscOptionsString(), PetscOptionsReal(), PetscOptionsName(), PetscOptionsBegin(), PetscOptionsEnd(), PetscOptionsHeadBegin(), PetscOptionsStringArray(), PetscOptionsRealArray(), PetscOptionsScalar(), PetscOptionsBoolGroupBegin(), PetscOptionsBoolGroup(), PetscOptionsBoolGroupEnd(), PetscOptionsFList(), PetscOptionsEList(), DMMonitor(), DMMonitorSet()

External Links

source
PETSc.LibPETSc.DMOutputSequenceLoad — Method
val::PetscReal = DMOutputSequenceLoad(petsclib::PetscLibType, dm::AbstractPetscDM, viewer::PetscViewer, name::String, num::PetscInt)

Retrieve the sequence value from a PetscViewer

Input Parameters:

  • dm - The original DM
  • viewer - The PetscViewer to get it from
  • name - The sequence name
  • num - The output sequence number

Output Parameter:

  • val - The output sequence value

Level: intermediate

See also: DM, DMGetOutputSequenceNumber(), DMSetOutputSequenceNumber(), VecView()

External Links

source
PETSc.LibPETSc.DMPatchCreate — Method
mesh::PetscDM = DMPatchCreate(petsclib::PetscLibType, comm::MPI_Comm)

Creates a DMPatch object, which is a collections of DMs called patches.

Collective

Input Parameter:

  • comm - The communicator for the DMPatch object

Output Parameter:

  • mesh - The DMPatch object

See also: DMPatchZoom()

External Links

source
PETSc.LibPETSc.DMPatchCreateGrid — Method
dm::PetscDM = DMPatchCreateGrid(petsclib::PetscLibType, comm::MPI_Comm, dim::PetscInt, patchSize::MatStencil, commSize::MatStencil, gridSize::MatStencil)

Create a DMPATCH whose coarse DM is a structured DMDA of the requested global size, with the given patch and process-grid sizes

Collective

Input Parameters:

  • comm - the MPI communicator
  • dim - the spatial dimension (1, 2, or 3); unused dimensions of gridSize and patchSize are forced to 1
  • patchSize - MatStencil giving the size of each patch in cells
  • commSize - MatStencil giving the process grid used per patch (see DMPatchSetCommSize())
  • gridSize - MatStencil giving the global cell count of the underlying DMDA in each dimension

Output Parameter:

  • dm - the newly created DMPATCH

Level: developer

See also: DMPATCH, DMPatchCreate(), DMPatchSetPatchSize(), DMPatchSetCommSize(), DMDA, MatStencil

External Links

source
PETSc.LibPETSc.DMPatchGetCoarse — Method
dmCoarse::PetscDM = DMPatchGetCoarse(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the coarse DM associated with a DMPATCH

Not Collective

Input Parameter:

  • dm - the DMPATCH

Output Parameter:

  • dmCoarse - the coarse DM

Level: intermediate

See also: DMPATCH, DMPatchCreate(), DMPatchZoom()

External Links

source
PETSc.LibPETSc.DMPatchGetCommSize — Method
commSize::MatStencil = DMPatchGetCommSize(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the process grid used for each patch of a DMPATCH

Not Collective

Input Parameter:

  • dm - the DMPATCH

Output Parameter:

  • commSize - a MatStencil whose i, j, k fields hold the number of processes used per patch in each dimension

Level: intermediate

See also: DMPATCH, DMPatchSetCommSize(), DMPatchGetPatchSize(), MatStencil

External Links

source
PETSc.LibPETSc.DMPatchGetPatchSize — Method
patchSize::MatStencil = DMPatchGetPatchSize(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the size of a single patch of a DMPATCH, in grid cells

Not Collective

Input Parameter:

  • dm - the DMPATCH

Output Parameter:

  • patchSize - a MatStencil whose i, j, k, c fields hold the patch extent in each dimension

Level: intermediate

See also: DMPATCH, DMPatchSetPatchSize(), DMPatchGetCommSize(), MatStencil

External Links

source
PETSc.LibPETSc.DMPatchSetCommSize — Method
DMPatchSetCommSize(petsclib::PetscLibType, dm::AbstractPetscDM, commSize::MatStencil)

Set the process grid used for each patch of a DMPATCH

Logically Collective

Input Parameters:

  • dm - the DMPATCH
  • commSize - a MatStencil whose i, j, k fields hold the number of processes to use per patch in each dimension

Level: intermediate

See also: DMPATCH, DMPatchGetCommSize(), DMPatchSetPatchSize(), MatStencil

External Links

source
PETSc.LibPETSc.DMPatchSetPatchSize — Method
DMPatchSetPatchSize(petsclib::PetscLibType, dm::AbstractPetscDM, patchSize::MatStencil)

Set the size of a single patch of a DMPATCH, in grid cells

Logically Collective

Input Parameters:

  • dm - the DMPATCH
  • patchSize - a MatStencil whose i, j, k, c fields hold the patch extent in each dimension

Level: intermediate

See also: DMPATCH, DMPatchGetPatchSize(), DMPatchSetCommSize(), MatStencil

External Links

source
PETSc.LibPETSc.DMPatchSolve — Method
DMPatchSolve(petsclib::PetscLibType, dm::AbstractPetscDM)

Iterate over all patches of a DMPATCH, zooming the coarse DM onto each patch and scattering data between the coarse and zoomed representations

Collective

Input Parameter:

  • dm - the DMPATCH

Level: developer

See also: DMPATCH, DMPatchZoom(), DMPatchGetCoarse(), DMPatchGetPatchSize(), DMPatchGetCommSize()

External Links

source
PETSc.LibPETSc.DMPatchZoom — Method
dmz::PetscDM,sfz::PetscSF,sfzr::PetscSF = DMPatchZoom(petsclib::PetscLibType, dm::AbstractPetscDM, lower::MatStencil, upper::MatStencil, commz::MPI_Comm)

Create patches of a DMDA on subsets of processes, indicated by commz

Collective

Input Parameters:

  • dm - the DM
  • lower - the lower left corner of the requested patch
  • upper - the upper right corner of the requested patch
  • commz - the new communicator for the patch, MPI_COMM_NULL indicates that the given rank will not own a patch

Output Parameters:

  • dmz - the patch DM
  • sfz - the PetscSF mapping the patch+halo to the zoomed version (optional)
  • sfzr - the PetscSF mapping the patch to the restricted zoomed version

Level: intermediate

See also: DMPatchSolve(), DMDACreatePatchIS()

External Links

source
PETSc.LibPETSc.DMPolytopeGetOrientation — Method
ornt::PetscInt = DMPolytopeGetOrientation(petsclib::PetscLibType, ct::DMPolytopeType, sourceCone::Vector{PetscInt}, targetCone::Vector{PetscInt})

Determine an orientation (transformation) that takes the source face arrangement to the target face arrangement

Not Collective

Input Parameters:

  • ct - The DMPolytopeType
  • sourceCone - The source arrangement of faces
  • targetCone - The target arrangement of faces

Output Parameter:

  • ornt - The orientation (transformation) which will take the source arrangement to the target arrangement

Level: advanced

See also: DM, DMPolytopeType, DMPolytopeMatchOrientation(), DMPolytopeGetVertexOrientation(), DMPolytopeMatchVertexOrientation()

External Links

source
PETSc.LibPETSc.DMPolytopeGetVertexOrientation — Method
ornt::PetscInt = DMPolytopeGetVertexOrientation(petsclib::PetscLibType, ct::DMPolytopeType, sourceCone::Vector{PetscInt}, targetCone::Vector{PetscInt})

Determine an orientation (transformation) that takes the source vertex arrangement to the target vertex arrangement

Not Collective

Input Parameters:

  • ct - The DMPolytopeType
  • sourceCone - The source arrangement of vertices
  • targetCone - The target arrangement of vertices

Output Parameter:

  • ornt - The orientation (transformation) which will take the source arrangement to the target arrangement

Level: advanced

See also: DM, DMPolytopeType, DMPolytopeMatchVertexOrientation(), DMPolytopeGetOrientation()

External Links

source
PETSc.LibPETSc.DMPolytopeInCellTest — Method
inside::PetscBool = DMPolytopeInCellTest(petsclib::PetscLibType, ct::DMPolytopeType, point::Vector{PetscReal})

Check whether a point lies inside the reference cell of given type

Not Collective

Input Parameters:

  • ct - The DMPolytopeType
  • point - Coordinates of the point

Output Parameter:

  • inside - Flag indicating whether the point is inside the reference cell of given type

Level: advanced

See also: DM, DMPolytopeType, DMLocatePoints()

External Links

source
PETSc.LibPETSc.DMPolytopeMatchOrientation — Method
ornt::PetscInt,found::PetscBool = DMPolytopeMatchOrientation(petsclib::PetscLibType, ct::DMPolytopeType, sourceCone::Vector{PetscInt}, targetCone::Vector{PetscInt})

Determine an orientation (transformation) that takes the source face arrangement to the target face arrangement

Not Collective

Input Parameters:

  • ct - The DMPolytopeType
  • sourceCone - The source arrangement of faces
  • targetCone - The target arrangement of faces

Output Parameters:

  • ornt - The orientation (transformation) which will take the source arrangement to the target arrangement
  • found - Flag indicating that a suitable orientation was found

Level: advanced

See also: DM, DMPolytopeGetOrientation(), DMPolytopeMatchVertexOrientation(), DMPolytopeGetVertexOrientation()

External Links

source
PETSc.LibPETSc.DMPolytopeMatchVertexOrientation — Method
ornt::PetscInt,found::PetscBool = DMPolytopeMatchVertexOrientation(petsclib::PetscLibType, ct::DMPolytopeType, sourceVert::Vector{PetscInt}, targetVert::Vector{PetscInt})

Determine an orientation (transformation) that takes the source vertex arrangement to the target vertex arrangement

Not Collective

Input Parameters:

  • ct - The DMPolytopeType
  • sourceVert - The source arrangement of vertices
  • targetVert - The target arrangement of vertices

Output Parameters:

  • ornt - The orientation (transformation) which will take the source arrangement to the target arrangement
  • found - Flag indicating that a suitable orientation was found

Level: advanced

See also: DM, DMPolytopeType, DMPolytopeGetOrientation(), DMPolytopeMatchOrientation(), DMPolytopeTypeGetNumVertices(), DMPolytopeTypeGetVertexArrangement()

External Links

source
PETSc.LibPETSc.DMPrintCellIndices — Method
DMPrintCellIndices(petsclib::PetscLibType, c::PetscInt, name::String, len::PetscInt, x::Vector{PetscInt})

Print an integer array of per-cell indices to PETSC_COMM_SELF

Not Collective

Input Parameters:

  • c - the cell number
  • name - the label to print with the cell (typically the element or field name)
  • len - the length of x
  • x - the array of integer indices

Level: developer

See also: DM, DMPrintCellVector(), DMPrintCellVectorReal(), DMPrintCellMatrix(), DMPrintLocalVec()

External Links

source
PETSc.LibPETSc.DMPrintCellMatrix — Method
DMPrintCellMatrix(petsclib::PetscLibType, c::PetscInt, name::String, rows::PetscInt, cols::PetscInt, A::Vector{PetscScalar})

Print a scalar array representing a per-cell matrix to PETSC_COMM_SELF

Not Collective

Input Parameters:

  • c - the cell number
  • name - the label to print with the cell (typically the element or field name)
  • rows - number of rows in the matrix
  • cols - number of columns in the matrix
  • A - the row-major array of PetscScalar matrix entries

Level: developer

See also: DM, DMPrintCellIndices(), DMPrintCellVector(), DMPrintCellVectorReal(), DMPrintLocalVec()

External Links

source
PETSc.LibPETSc.DMPrintCellVector — Method
DMPrintCellVector(petsclib::PetscLibType, c::PetscInt, name::String, len::PetscInt, x::Vector{PetscScalar})

Print a scalar array representing a per-cell vector to PETSC_COMM_SELF

Not Collective

Input Parameters:

  • c - the cell number
  • name - the label to print with the cell (typically the element or field name)
  • len - the length of x
  • x - the array of PetscScalar values

Level: developer

See also: DM, DMPrintCellIndices(), DMPrintCellVectorReal(), DMPrintCellMatrix(), DMPrintLocalVec()

External Links

source
PETSc.LibPETSc.DMPrintCellVectorReal — Method
DMPrintCellVectorReal(petsclib::PetscLibType, c::PetscInt, name::String, len::PetscInt, x::Vector{PetscReal})

Print a real array representing a per-cell vector to PETSC_COMM_SELF

Not Collective

Input Parameters:

  • c - the cell number
  • name - the label to print with the cell (typically the element or field name)
  • len - the length of x
  • x - the array of PetscReal values

Level: developer

See also: DM, DMPrintCellIndices(), DMPrintCellVector(), DMPrintCellMatrix(), DMPrintLocalVec()

External Links

source
PETSc.LibPETSc.DMPrintLocalVec — Method
DMPrintLocalVec(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, tol::PetscReal, X::AbstractPetscVec)

Print a Vec associated with a DM, filtering out very small entries

Collective

Input Parameters:

  • dm - the DM providing the communicator
  • name - a label printed before the vector values
  • tol - tolerance below which entries are filtered to zero using VecFilter()
  • X - the Vec to print

Level: developer

See also: DM, DMPrintCellIndices(), DMPrintCellVector(), DMPrintCellVectorReal(), DMPrintCellMatrix(), VecFilter()

External Links

source
PETSc.LibPETSc.DMProjectBdFieldLabelLocal — Method
DMProjectBdFieldLabelLocal(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, label::DMLabel, numIds::PetscInt, ids::Vector{PetscInt}, Nc::PetscInt, comps::Vector{PetscInt}, localU::AbstractPetscVec, noname::Ptr{Cvoid})

This projects the given function of the input fields into the function space provided, putting the coefficients in a local vector, calculating only over the portion of the domain boundary specified by the label.

Not Collective

Input Parameters:

  • dm - The DM
  • time - The time
  • label - The DMLabel marking the portion of the domain boundary to output
  • numIds - The number of label ids to use
  • ids - The label ids to use for marking
  • Nc - The number of components to set in the output, or PETSC_DETERMINE for all components
  • comps - The components to set in the output, or NULL for all components
  • localU - The input field vector
  • funcs - The functions to evaluate, one per field
  • mode - The insertion mode for values

Output Parameter:

  • localX - The output vector

Calling sequence of funcs:

  • dim - The spatial dimension
  • Nf - The number of input fields
  • NfAux - The number of input auxiliary fields
  • uOff - The offset of each field in u[]
  • uOff_x - The offset of each field in u_x[]
  • u - The field values at this point in space
  • u_t - The field time derivative at this point in space (or NULL)
  • u_x - The field derivatives at this point in space
  • aOff - The offset of each auxiliary field in u[]
  • aOff_x - The offset of each auxiliary field in u_x[]
  • a - The auxiliary field values at this point in space
  • a_t - The auxiliary field time derivative at this point in space (or NULL)
  • a_x - The auxiliary field derivatives at this point in space
  • t - The current time
  • x - The coordinates of this point
  • n - The face normal
  • numConstants - The number of constants
  • constants - The value of each constant
  • f - The value of the function at this point in space

Level: intermediate

See also: DM, DMProjectField(), DMProjectFieldLabelLocal(), DMProjectFunction(), DMComputeL2Diff()

External Links

source
PETSc.LibPETSc.DMProjectField — Method
DMProjectField(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, U::AbstractPetscVec, funcs::Ptr{Ptr{Cvoid}}, mode::InsertMode, X::AbstractPetscVec)

This projects a given function of the input fields into the function space provided by a DM, putting the coefficients in a global vector.

Collective

Input Parameters:

  • dm - The DM
  • time - The time
  • U - The input field vector
  • funcs - The functions to evaluate, one per field, see PetscPointFn
  • mode - The insertion mode for values

Output Parameter:

  • X - The output vector

Level: advanced

See also: DM, PetscPointFn, DMProjectFieldLocal(), DMProjectFieldLabelLocal(), DMProjectFunction(), DMComputeL2Diff()

External Links

source
PETSc.LibPETSc.DMProjectFieldLabel — Method
DMProjectFieldLabel(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, label::DMLabel, numIds::PetscInt, ids::Vector{PetscInt}, Nc::PetscInt, comps::Vector{PetscInt}, U::AbstractPetscVec, noname::Ptr{Cvoid})

This projects the given function of the input fields into the function space provided, putting the coefficients in a global vector, calculating only over the portion of the domain specified by the label.

Not Collective

Input Parameters:

  • dm - The DM
  • time - The time
  • label - The DMLabel marking the portion of the domain to output
  • numIds - The number of label ids to use
  • ids - The label ids to use for marking
  • Nc - The number of components to set in the output, or PETSC_DETERMINE for all components
  • comps - The components to set in the output, or NULL for all components
  • U - The input field vector
  • funcs - The functions to evaluate, one per field
  • mode - The insertion mode for values

Output Parameter:

  • X - The output vector

Calling sequence of funcs:

  • dim - The spatial dimension
  • Nf - The number of input fields
  • NfAux - The number of input auxiliary fields
  • uOff - The offset of each field in u[]
  • uOff_x - The offset of each field in u_x[]
  • u - The field values at this point in space
  • u_t - The field time derivative at this point in space (or NULL)
  • u_x - The field derivatives at this point in space
  • aOff - The offset of each auxiliary field in u[]
  • aOff_x - The offset of each auxiliary field in u_x[]
  • a - The auxiliary field values at this point in space
  • a_t - The auxiliary field time derivative at this point in space (or NULL)
  • a_x - The auxiliary field derivatives at this point in space
  • t - The current time
  • x - The coordinates of this point
  • numConstants - The number of constants
  • constants - The value of each constant
  • f - The value of the function at this point in space

Level: intermediate

See also: DM, DMProjectField(), DMProjectFieldLabelLocal(), DMProjectFunction(), DMComputeL2Diff()

External Links

source
PETSc.LibPETSc.DMProjectFieldLabelLocal — Method
DMProjectFieldLabelLocal(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, label::DMLabel, numIds::PetscInt, ids::Vector{PetscInt}, Nc::PetscInt, comps::Vector{PetscInt}, localU::AbstractPetscVec, noname::Ptr{Cvoid})

This projects the given function of the input fields into the function space provided, putting the coefficients in a local vector, calculating only over the portion of the domain specified by the label.

Not Collective

Input Parameters:

  • dm - The DM
  • time - The time
  • label - The DMLabel marking the portion of the domain to output
  • numIds - The number of label ids to use
  • ids - The label ids to use for marking
  • Nc - The number of components to set in the output, or PETSC_DETERMINE for all components
  • comps - The components to set in the output, or NULL for all components
  • localU - The input field vector
  • funcs - The functions to evaluate, one per field
  • mode - The insertion mode for values

Output Parameter:

  • localX - The output vector

Calling sequence of funcs:

  • dim - The spatial dimension
  • Nf - The number of input fields
  • NfAux - The number of input auxiliary fields
  • uOff - The offset of each field in u[]
  • uOff_x - The offset of each field in u_x[]
  • u - The field values at this point in space
  • u_t - The field time derivative at this point in space (or NULL)
  • u_x - The field derivatives at this point in space
  • aOff - The offset of each auxiliary field in u[]
  • aOff_x - The offset of each auxiliary field in u_x[]
  • a - The auxiliary field values at this point in space
  • a_t - The auxiliary field time derivative at this point in space (or NULL)
  • a_x - The auxiliary field derivatives at this point in space
  • t - The current time
  • x - The coordinates of this point
  • numConstants - The number of constants
  • constants - The value of each constant
  • f - The value of the function at this point in space

Level: intermediate

See also: DM, DMProjectField(), DMProjectFieldLabel(), DMProjectFunction(), DMComputeL2Diff()

External Links

source
PETSc.LibPETSc.DMProjectFieldLocal — Method
DMProjectFieldLocal(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, localU::AbstractPetscVec, noname::Ptr{Cvoid})

This projects the given function of the input fields into the function space provided by the DM, putting the coefficients in a local vector.

Not Collective

Input Parameters:

  • dm - The DM
  • time - The time
  • localU - The input field vector; may be NULL if projection is defined purely by coordinates
  • funcs - The functions to evaluate, one per field
  • mode - The insertion mode for values

Output Parameter:

  • localX - The output vector

Calling sequence of funcs:

  • dim - The spatial dimension
  • Nf - The number of input fields
  • NfAux - The number of input auxiliary fields
  • uOff - The offset of each field in u[]
  • uOff_x - The offset of each field in u_x[]
  • u - The field values at this point in space
  • u_t - The field time derivative at this point in space (or NULL)
  • u_x - The field derivatives at this point in space
  • aOff - The offset of each auxiliary field in u[]
  • aOff_x - The offset of each auxiliary field in u_x[]
  • a - The auxiliary field values at this point in space
  • a_t - The auxiliary field time derivative at this point in space (or NULL)
  • a_x - The auxiliary field derivatives at this point in space
  • t - The current time
  • x - The coordinates of this point
  • numConstants - The number of constants
  • constants - The value of each constant
  • f - The value of the function at this point in space

Level: intermediate

See also: DM, DMProjectField(), DMProjectFieldLabelLocal(), DMProjectFunction(), DMComputeL2Diff()

External Links

source
PETSc.LibPETSc.DMProjectFunction — Method
DMProjectFunction(petsclib, dm, time, funcs, ctxs, mode, X)

Project the pointwise functions funcs (one Ptr{Cvoid} per field, matching PetscSimplePointFn signature) into the global vector X. ctxs is a matching Vector{Ptr{Cvoid}} of context pointers (use C_NULL entries for no context).

source
PETSc.LibPETSc.DMProjectFunctionLabel — Method
DMProjectFunctionLabel(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, label::DMLabel, numIds::PetscInt, ids::Vector{PetscInt}, Nc::PetscInt, comps::Vector{PetscInt}, noname::Ptr{Cvoid})

This projects the given function into the function space provided by the DM, putting the coefficients in a global vector, setting values only for points in the given label.

Collective

Input Parameters:

  • dm - The DM
  • time - The time
  • numIds - The number of ids
  • ids - The ids
  • Nc - The number of components
  • comps - The components
  • label - The DMLabel selecting the portion of the mesh for projection
  • funcs - The coordinate functions to evaluate, one per field
  • ctxs - Optional array of contexts to pass to each coordinate function. ctxs may be null.
  • mode - The insertion mode for values

Output Parameter:

  • X - vector

Calling sequence of funcs:

  • dim - The spatial dimension
  • time - The current timestep
  • x - The coordinates
  • Nc - The number of components
  • u - The output field values
  • ctx - optional function context

Level: developer

See also: DM, DMProjectFunction(), DMProjectFunctionLocal(), DMProjectFunctionLabelLocal(), DMComputeL2Diff()

External Links

source
PETSc.LibPETSc.DMProjectFunctionLabelLocal — Method
DMProjectFunctionLabelLocal(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, label::DMLabel, numIds::PetscInt, ids::Vector{PetscInt}, Nc::PetscInt, comps::Vector{PetscInt}, noname::Ptr{Cvoid})

This projects the given function into the function space provided by the DM, putting the coefficients in a local vector, setting values only for points in the given label.

Not Collective

Input Parameters:

  • dm - The DM
  • time - The time
  • label - The DMLabel selecting the portion of the mesh for projection
  • numIds - The number of ids
  • ids - The ids
  • Nc - The number of components
  • comps - The components
  • funcs - The coordinate functions to evaluate, one per field
  • ctxs - Optional array of contexts to pass to each coordinate function. ctxs itself may be null.
  • mode - The insertion mode for values

Output Parameter:

  • localX - vector

Calling sequence of funcs:

  • dim - The spatial dimension
  • time - The current time
  • x - The coordinates
  • Nc - The number of components
  • u - The output field values
  • ctx - optional function context

Level: developer

See also: DM, DMProjectFunction(), DMProjectFunctionLocal(), DMProjectFunctionLabel(), DMComputeL2Diff()

External Links

source
PETSc.LibPETSc.DMProjectFunctionLocal — Method
DMProjectFunctionLocal(petsclib::PetscLibType, dm::AbstractPetscDM, time::PetscReal, noname::Ptr{Cvoid})

This projects the given function into the function space provided by a DM, putting the coefficients in a local vector.

Not Collective

Input Parameters:

  • dm - The DM
  • time - The time
  • funcs - The coordinate functions to evaluate, one per field
  • ctxs - Optional array of contexts to pass to each coordinate function. ctxs itself may be null.
  • mode - The insertion mode for values

Output Parameter:

  • localX - vector

Calling sequence of funcs:

  • dim - The spatial dimension
  • time - The current timestep
  • x - The coordinates
  • Nc - The number of components
  • u - The output field values
  • ctx - optional function context

Level: developer

See also: DM, DMProjectFunction(), DMProjectFunctionLabel(), DMComputeL2Diff()

External Links

source
PETSc.LibPETSc.DMRefine — Method
dmf::PetscDM = DMRefine(petsclib::PetscLibType, dm::AbstractPetscDM, comm::MPI_Comm)

Refines a DM object using a standard nonadaptive refinement of the underlying mesh

Collective

Input Parameters:

  • dm - the DM object
  • comm - the communicator to contain the new DM object (or MPI_COMM_NULL)

Output Parameter:

  • dmf - the refined DM, or NULL

Options Database Key:

  • -dm_plex_cell_refiner strategy - chooses the refinement strategy, e.g. regular, tohex

Level: developer

See also: DM, DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateDomainDecomposition(), DMRefineHookAdd(), DMRefineHookRemove()

External Links

source
PETSc.LibPETSc.DMRefineHierarchy — Method
DMRefineHierarchy(petsclib::PetscLibType, dm::AbstractPetscDM, nlevels::PetscInt, dmf::Vector{<:AbstractPetscDM})

Refines a DM object, all levels at once

Collective

Input Parameters:

  • dm - the DM object
  • nlevels - the number of levels of refinement

Output Parameter:

  • dmf - the refined DM hierarchy

Level: developer

See also: DM, DMCoarsen(), DMCoarsenHierarchy(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMRefineHookAdd — Method
DMRefineHookAdd(petsclib::PetscLibType, coarse::AbstractPetscDM, refinehook::external, interphook::external, ctx::Ptr{Cvoid})

adds a callback to be run when interpolating a nonlinear problem to a finer grid

Logically Collective; No Fortran Support

Input Parameters:

  • coarse - DM on which to run a hook when interpolating to a finer level
  • refinehook - function to run when setting up the finer level
  • interphook - function to run to update data on finer levels (once per SNESSolve())
  • ctx - [optional] context for provide data for the hooks (may be NULL)

Calling sequence of refinehook:

  • coarse - coarse level DM
  • fine - fine level DM to interpolate problem to
  • ctx - optional function context

Calling sequence of interphook:

  • coarse - coarse level DM
  • interp - matrix interpolating a coarse-level solution to the finer grid
  • fine - fine level DM to update
  • ctx - optional function context

Level: advanced

See also: DM, DMCoarsenHookAdd(), DMInterpolate(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMRefineHookRemove — Method
DMRefineHookRemove(petsclib::PetscLibType, coarse::AbstractPetscDM, refinehook::external, interphook::external, ctx::Ptr{Cvoid})

remove a callback from the list of hooks, that have been set with DMRefineHookAdd(), to be run when interpolating a nonlinear problem to a finer grid

Logically Collective; No Fortran Support

Input Parameters:

  • coarse - the DM on which to run a hook when restricting to a coarser level
  • refinehook - function to run when setting up a finer level
  • interphook - function to run to update data on finer levels
  • ctx - [optional] application context for provide data for the hooks (may be NULL)

Calling sequence of refinehook:

  • coarse - the coarse DM
  • fine - the fine DM
  • ctx - context for the function

Calling sequence of interphook:

  • coarse - the coarse DM
  • interp - the interpolation Mat from coarse to fine
  • fine - the fine DM
  • ctx - context for the function

Level: advanced

See also: DM, DMRefineHookAdd(), DMCoarsenHookRemove(), DMInterpolate(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMRegister — Method
DMRegister(petsclib::PetscLibType, sname::String, fnc::external)

Adds a new DM type implementation

Not Collective, No Fortran Support

Input Parameters:

  • sname - The name of a new user-defined creation routine
  • function - The creation routine itself

Calling sequence of function:

  • dm - the new DM that is being created

Level: advanced

See also: DM, DMType, DMSetType(), DMRegisterAll(), DMRegisterDestroy()

External Links

source
PETSc.LibPETSc.DMRemoveLabel — Method
label::DMLabel = DMRemoveLabel(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

Remove the label given by name from this DM

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name

Output Parameter:

  • label - The DMLabel, or NULL if the label is absent. Pass in NULL to call DMLabelDestroy() on the label, otherwise the

caller is responsible for calling DMLabelDestroy().

Level: developer

See also: DM, DMLabel, DMCreateLabel(), DMHasLabel(), DMGetLabel(), DMGetLabelValue(), DMSetLabelValue(), DMLabelDestroy(), DMRemoveLabelBySelf()

External Links

source
PETSc.LibPETSc.DMRemoveLabelBySelf — Method
DMRemoveLabelBySelf(petsclib::PetscLibType, dm::AbstractPetscDM, label::DMLabel, failNotFound::PetscBool)

Remove the label from this DM

Not Collective

Input Parameters:

  • dm - The DM object
  • label - The DMLabel to be removed from the DM
  • failNotFound - Should it fail if the label is not found in the DM?

Level: developer

See also: DM, DMLabel, DMCreateLabel(), DMHasLabel(), DMGetLabel(), DMGetLabelValue(), DMSetLabelValue(), DMLabelDestroy(), DMRemoveLabel()

External Links

source
PETSc.LibPETSc.DMReorderSectionGetDefault — Method
reorder::DMReorderDefaultFlag = DMReorderSectionGetDefault(petsclib::PetscLibType, dm::AbstractPetscDM)

Get flag indicating whether the local section should be reordered by default

Not collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • reorder - Flag for reordering

Level: intermediate

See also: DMReorderSetDefault()

External Links

source
PETSc.LibPETSc.DMReorderSectionGetType — Method
reorder::String = DMReorderSectionGetType(petsclib::PetscLibType, dm::AbstractPetscDM)

Get the reordering type for the local section

Not collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • reorder - The reordering method

Level: intermediate

See also: DMReorderSetDefault(), DMReorderSectionGetDefault()

External Links

source
PETSc.LibPETSc.DMReorderSectionSetDefault — Method
DMReorderSectionSetDefault(petsclib::PetscLibType, dm::AbstractPetscDM, reorder::DMReorderDefaultFlag)

Set flag indicating whether the local section should be reordered by default

Logically collective

Input Parameters:

  • dm - The DM
  • reorder - Flag for reordering

Level: intermediate

See also: DMReorderSectionGetDefault()

External Links

source
PETSc.LibPETSc.DMReorderSectionSetType — Method
DMReorderSectionSetType(petsclib::PetscLibType, dm::AbstractPetscDM, reorder::String)

Set the type of local section reordering

Logically collective

Input Parameters:

  • dm - The DM
  • reorder - The reordering method

Level: intermediate

See also: DMReorderSectionGetType(), DMReorderSectionSetDefault()

External Links

source
PETSc.LibPETSc.DMRestoreGlobalVector — Method
DMRestoreGlobalVector(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec)

Returns a PETSc vector that obtained from DMGetGlobalVector(). Do not use with vector obtained via DMCreateGlobalVector().

Not Collective

Input Parameters:

  • dm - the DM
  • g - the global vector

Level: beginner

See also: DM, DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToGlobalBegin(), DMGlobalToGlobalEnd(), DMGlobalToGlobal(), DMCreateLocalVector(), DMGetGlobalVector(), DMClearGlobalVectors()

External Links

source
PETSc.LibPETSc.DMRestoreLocalVector — Method
DMRestoreLocalVector(petsclib::PetscLibType, dm::AbstractPetscDM, g::AbstractPetscVec)

Returns a PETSc vector that was obtained from DMGetLocalVector(). Do not use with vector obtained via DMCreateLocalVector().

Not Collective

Input Parameters:

  • dm - the DM
  • g - the local vector

Level: beginner

See also: DM, DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMCreateLocalVector(), DMGetLocalVector(), DMClearLocalVectors()

External Links

source
PETSc.LibPETSc.DMRestoreNamedGlobalVector — Method
DMRestoreNamedGlobalVector(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, X::AbstractPetscVec)

restore access to a named, persistent global vector

Collective

Input Parameters:

  • dm - DM on which X was gotten
  • name - name under which X was gotten
  • X - Vec to restore

Level: developer

See also: DM, DMGetNamedGlobalVector(), DMClearNamedGlobalVectors()

External Links

source
PETSc.LibPETSc.DMRestoreNamedLocalVector — Method
DMRestoreNamedLocalVector(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, X::AbstractPetscVec)

restore access to a named, persistent local vector obtained with DMGetNamedLocalVector()

Not Collective

Input Parameters:

  • dm - DM on which X was gotten
  • name - name under which X was gotten
  • X - Vec to restore

Level: developer

See also: DM, DMRestoreNamedGlobalVector(), DMGetNamedLocalVector(), DMClearNamedLocalVectors()

External Links

source
PETSc.LibPETSc.DMRestrict — Method
DMRestrict(petsclib::PetscLibType, fine::AbstractPetscDM, restrct::AbstractPetscMat, rscale::AbstractPetscVec, inject::AbstractPetscMat, coarse::AbstractPetscDM)

restricts user-defined problem data to a coarser DM by running hooks registered by DMCoarsenHookAdd()

Collective if any hooks are

Input Parameters:

  • fine - finer DM from which the data is obtained
  • restrct - restriction matrix, apply using MatRestrict(), usually the transpose of the interpolation
  • rscale - scaling vector for restriction
  • inject - injection matrix, also use MatRestrict()
  • coarse - coarser DM to update

Level: developer

See also: DM, DMCoarsenHookAdd(), MatRestrict(), DMInterpolate(), DMRefineHookAdd()

External Links

source
PETSc.LibPETSc.DMSNESCheckDiscretization — Method
DMSNESCheckDiscretization(petsclib::PetscLibType, snes::AbstractSNES, dm::AbstractPetscDM, t::PetscReal, u::AbstractPetscVec, tol::PetscReal, error::Vector{PetscReal})

Check the discretization error of the exact solution

Input Parameters:

  • snes - the SNES object
  • dm - the DM
  • t - the time
  • u - a DM vector
  • tol - A tolerance for the check, or -1 to print the results instead

Output Parameter:

  • error - An array which holds the discretization error in each field, or NULL

Level: developer

See also: PetscDSSetExactSolution(), DNSNESCheckFromOptions(), DMSNESCheckResidual(), DMSNESCheckJacobian()

External Links

source
PETSc.LibPETSc.DMSNESCheckFromOptions — Method
DMSNESCheckFromOptions(petsclib::PetscLibType, snes::AbstractSNES, u::AbstractPetscVec)

Check the residual and Jacobian functions using the exact solution by outputting some diagnostic information

Input Parameters:

  • snes - the SNES object
  • u - representative SNES vector

Level: developer

See also: SNES, DM

External Links

source
PETSc.LibPETSc.DMSNESCheckJacobian — Method
isLinear::PetscBool,convRate::PetscReal = DMSNESCheckJacobian(petsclib::PetscLibType, snes::AbstractSNES, dm::AbstractPetscDM, u::AbstractPetscVec, tol::PetscReal)

Check the Jacobian of the exact solution against the residual using the Taylor Test

Input Parameters:

  • snes - the SNES object
  • dm - the DM
  • u - a DM vector
  • tol - A tolerance for the check, or -1 to print the results instead

Output Parameters:

  • isLinear - Flag indicaing that the function looks linear, or NULL
  • convRate - The rate of convergence of the linear model, or NULL

Level: developer

See also: DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckResidual()

External Links

source
PETSc.LibPETSc.DMSNESCheckResidual — Method
residual::PetscReal = DMSNESCheckResidual(petsclib::PetscLibType, snes::AbstractSNES, dm::AbstractPetscDM, u::AbstractPetscVec, tol::PetscReal)

Check the residual of the exact solution

Input Parameters:

  • snes - the SNES object
  • dm - the DM
  • u - a DM vector
  • tol - A tolerance for the check, or -1 to print the results instead

Output Parameter:

  • residual - The residual norm of the exact solution, or NULL

Level: developer

See also: DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckJacobian()

External Links

source
PETSc.LibPETSc.DMSNESComputeJacobianAction — Method
DMSNESComputeJacobianAction(petsclib::PetscLibType, dm::AbstractPetscDM, X::AbstractPetscVec, Y::AbstractPetscVec, F::AbstractPetscVec, ctx::Ptr{Cvoid})

Compute the action of the Jacobian J(X) on Y

Input Parameters:

  • dm - The DM
  • X - Local solution vector
  • Y - Local input vector
  • ctx - The application context

Output Parameter:

  • F - local output vector

Level: developer

See also: DM, DMSNESCreateJacobianMF(), DMPlexSNESComputeResidualFEM()

External Links

source
PETSc.LibPETSc.DMSNESCreateJacobianMF — Method
J::PetscMat = DMSNESCreateJacobianMF(petsclib::PetscLibType, dm::AbstractPetscDM, X::AbstractPetscVec, ctx::Ptr{Cvoid})

Create a Mat which computes the action of the Jacobian matrix-free

Collective

Input Parameters:

  • dm - The DM
  • X - The evaluation point for the Jacobian
  • ctx - An application context, or NULL

Output Parameter:

  • J - The Mat

Level: advanced

See also: DM, SNES, DMSNESComputeJacobianAction()

External Links

source
PETSc.LibPETSc.DMSNESGetBoundaryLocal — Method
DMSNESGetBoundaryLocal(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})

get the local boundary value function set with DMSNESSetBoundaryLocal().

Not Collective

Input Parameter:

  • dm - DM with the associated callback

Output Parameters:

  • func - local boundary value evaluation
  • ctx - context for local boundary value evaluation

Calling sequence of func:

  • dm - the DM context
  • X - ghosted solution vector, appropriate locations (such as essential boundary condition nodes) should be filled
  • ctx - option context passed in DMSNESSetBoundaryLocal()

Level: intermediate

See also: DMSNESSetFunctionLocal(), DMSNESSetBoundaryLocal(), DMSNESSetJacobianLocal()

External Links

source
PETSc.LibPETSc.DMSNESGetFunction — Method
f::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMSNESGetFunction(petsclib::PetscLibType, dm::AbstractPetscDM)

get SNES residual evaluation function from a DMSNES object

Not Collective

Input Parameter:

  • dm - DM to be used with SNES

Output Parameters:

  • f - residual evaluation function; see SNESFunctionFn for calling sequence
  • ctx - context for residual evaluation

Level: developer

See also: DMSNES, DMSNESSetContext(), DMSNESSetFunction(), SNESSetFunction(), SNESFunctionFn

External Links

source
PETSc.LibPETSc.DMSNESGetFunctionLocal — Method
DMSNESGetFunctionLocal(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})

get the local residual evaluation function information set with DMSNESSetFunctionLocal().

Not Collective

Input Parameter:

  • dm - DM with the associated callback

Output Parameters:

  • func - local residual evaluation
  • ctx - context for local residual evaluation

Calling sequence of func:

  • dm - DM for the function
  • x - vector to state at which to evaluate residual
  • f - vector to hold the function evaluation
  • ctx - optional context passed above

Level: beginner

See also: DMSNESSetFunction(), DMSNESSetFunctionLocal(), DMSNESSetJacobianLocal()

External Links

source
PETSc.LibPETSc.DMSNESGetJacobian — Method
J::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMSNESGetJacobian(petsclib::PetscLibType, dm::AbstractPetscDM)

get SNES Jacobian evaluation function from a DMSNES object

Not Collective

Input Parameter:

  • dm - DM to be used with SNES

Output Parameters:

  • J - Jacobian evaluation function; for all calling sequence see SNESJacobianFn
  • ctx - context for residual evaluation

Level: developer

See also: DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), SNESJacobianFn

External Links

source
PETSc.LibPETSc.DMSNESGetJacobianLocal — Method
DMSNESGetJacobianLocal(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})

the local Jacobian evaluation function set with DMSNESSetJacobianLocal().

Logically Collective

Input Parameter:

  • dm - DM with the associated callback

Output Parameters:

  • func - local Jacobian evaluation
  • ctx - context for local Jacobian evaluation

Calling sequence of func:

  • dm - the DM context
  • X - current solution vector (ghosted or not?)
  • J - the Jacobian
  • Jp - approximate Jacobian used to compute the preconditioner, often J
  • ctx - a user provided context

Level: beginner

See also: DMSNESSetJacobianLocal(), DMSNESSetJacobian()

External Links

source
PETSc.LibPETSc.DMSNESGetNGS — Method
DMSNESGetNGS(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})

get SNES Gauss-Seidel relaxation function from a DMSNES object

Not Collective

Input Parameter:

  • dm - DM to be used with SNES

Output Parameters:

  • f - relaxation function which performs Gauss-Seidel sweeps, see SNESSetNGS()
  • ctx - context for residual evaluation

Level: developer

See also: DMSNES, DMSNESSetContext(), SNESGetNGS(), DMSNESGetJacobian(), DMSNESGetFunction()

External Links

source
PETSc.LibPETSc.DMSNESGetObjective — Method
obj::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMSNESGetObjective(petsclib::PetscLibType, dm::AbstractPetscDM)

Returns the objective function set with DMSNESSetObjective()

Not Collective

Input Parameter:

  • dm - DM to be used with SNES

Output Parameters:

  • obj - objective evaluation routine (or NULL); see SNESObjectiveFn for the calling sequence
  • ctx - the function context (or NULL)

Level: developer

See also: DMSNES, DMSNESSetContext(), DMSNESSetObjective(), SNESSetFunction(), SNESObjectiveFn

External Links

source
PETSc.LibPETSc.DMSNESGetObjectiveLocal — Method
DMSNESGetObjectiveLocal(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})

get the local objective evaluation function information set with DMSNESSetObjectiveLocal().

Not Collective

Input Parameter:

  • dm - DM with the associated callback

Output Parameters:

  • func - local objective evaluation
  • ctx - context for local residual evaluation

Calling sequence of func:

  • dm - the DM
  • x - the location where the objective function is to be evaluated
  • obj - the value of the objective function
  • ctx - optional context for the local objective function evaluation

Level: beginner

See also: DMSNESSetObjective(), DMSNESSetObjectiveLocal(), DMSNESSetFunctionLocal()

External Links

source
PETSc.LibPETSc.DMSNESGetPicard — Method
b::Ptr{Cvoid},J::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMSNESGetPicard(petsclib::PetscLibType, dm::AbstractPetscDM)

get SNES Picard iteration evaluation functions from a DMSNES object

Not Collective

Input Parameter:

  • dm - DM to be used with SNES

Output Parameters:

  • b - RHS evaluation function; see SNESFunctionFn for calling sequence
  • J - Jacobian evaluation function; see SNESJacobianFn for calling sequence
  • ctx - context for residual and matrix evaluation

Level: developer

See also: DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), SNESFunctionFn, SNESJacobianFn

External Links

source
PETSc.LibPETSc.DMSNESSetBoundaryLocal — Method
DMSNESSetBoundaryLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::external, ctx::Ptr{Cvoid})

set a function to insert, for example, essential boundary conditions into a ghosted solution vector

Logically Collective

Input Parameters:

  • dm - DM to associate callback with
  • func - local boundary value evaluation
  • ctx - optional context for local boundary value evaluation

Calling sequence of func:

  • dm - the DM context
  • X - ghosted solution vector, appropriate locations (such as essential boundary condition nodes) should be filled
  • ctx - option context passed in DMSNESSetBoundaryLocal()

Level: advanced

See also: DMSNESSetObjectiveLocal(), DMSNESSetFunctionLocal(), DMSNESSetJacobianLocal()

External Links

source
PETSc.LibPETSc.DMSNESSetFunction — Method
DMSNESSetFunction(petsclib::PetscLibType, dm::AbstractPetscDM, f::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set SNES residual evaluation function

Not Collective

Input Parameters:

  • dm - DM to be used with SNES
  • f - residual evaluation function; see SNESFunctionFn for calling sequence
  • ctx - context for residual evaluation

Level: developer

See also: DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), SNESFunctionFn

External Links

source
PETSc.LibPETSc.DMSNESSetFunctionContextDestroy — Method
DMSNESSetFunctionContextDestroy(petsclib::PetscLibType, dm::AbstractPetscDM, f::Ptr{Cvoid})

set SNES residual evaluation context destroy function

Not Collective

Input Parameters:

  • dm - DM to be used with SNES
  • f - residual evaluation context destroy function, see PetscCtxDestroyFn for its calling sequence

Level: developer

See also: DMSNES, DMSNESSetFunction(), SNESSetFunction(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.DMSNESSetFunctionLocal — Method
DMSNESSetFunctionLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::external, ctx::Ptr{Cvoid})

set a local residual evaluation function. This function is called with local vector containing the local vector information PLUS ghost point information. It should compute a result for all local elements and DMSNES will automatically accumulate the overlapping values.

Logically Collective

Input Parameters:

  • dm - DM to associate callback with
  • func - local residual evaluation
  • ctx - optional context for local residual evaluation

Calling sequence of func:

  • dm - DM for the function
  • x - vector to state at which to evaluate residual
  • f - vector to hold the function evaluation
  • ctx - optional context passed above

Level: advanced

See also: DMSNESSetFunction(), DMSNESSetJacobianLocal()

External Links

source
PETSc.LibPETSc.DMSNESSetJacobian — Method
DMSNESSetJacobian(petsclib::PetscLibType, dm::AbstractPetscDM, J::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set SNES Jacobian evaluation function into a DMSNES object

Not Collective

Input Parameters:

  • dm - DM to be used with SNES
  • J - Jacobian evaluation function, see SNESJacobianFn
  • ctx - context for Jacobian evaluation

Level: developer

See also: DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESGetJacobian(), SNESSetJacobian(), SNESJacobianFn

External Links

source
PETSc.LibPETSc.DMSNESSetJacobianContextDestroy — Method
DMSNESSetJacobianContextDestroy(petsclib::PetscLibType, dm::AbstractPetscDM, f::Ptr{Cvoid})

set SNES Jacobian evaluation context destroy function into a DMSNES object

Not Collective

Input Parameters:

  • dm - DM to be used with SNES
  • f - Jacobian evaluation context destroy function, see PetscCtxDestroyFn for its calling sequence

Level: developer

See also: DMSNES, DMSNESSetJacobian()

External Links

source
PETSc.LibPETSc.DMSNESSetJacobianLocal — Method
DMSNESSetJacobianLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::external, ctx::Ptr{Cvoid})

set a local Jacobian evaluation function

Logically Collective

Input Parameters:

  • dm - DM to associate callback with
  • func - local Jacobian evaluation
  • ctx - optional context for local Jacobian evaluation

Calling sequence of func:

  • dm - the DM context
  • X - current solution vector (ghosted or not?)
  • J - the Jacobian
  • Jp - approximate Jacobian used to compute the preconditioner, often J
  • ctx - a user provided context

Level: advanced

See also: DMSNESSetObjectiveLocal(), DMSNESSetFunctionLocal(), DMSNESSetBoundaryLocal()

External Links

source
PETSc.LibPETSc.DMSNESSetMFFunction — Method
DMSNESSetMFFunction(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set SNES residual evaluation function used in applying the matrix-free Jacobian with -snes_mf_operator

Logically Collective

Input Parameters:

  • dm - DM to be used with SNES
  • func - residual evaluation function; see SNESFunctionFn for calling sequence
  • ctx - optional function context

Level: developer

See also: DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), DMSNESSetFunction(), SNESFunctionFn

External Links

source
PETSc.LibPETSc.DMSNESSetNGS — Method
DMSNESSetNGS(petsclib::PetscLibType, dm::AbstractPetscDM, f::external, ctx::Ptr{Cvoid})

set SNES Gauss-Seidel relaxation function into a DMSNES object

Not Collective

Input Parameters:

  • dm - DM to be used with SNES
  • f - relaxation function, see SNESGSFunction
  • ctx - context for residual evaluation

Level: developer

See also: DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), DMSNESSetFunction(), SNESGSFunction

External Links

source
PETSc.LibPETSc.DMSNESSetObjective — Method
DMSNESSetObjective(petsclib::PetscLibType, dm::AbstractPetscDM, obj::Ptr{Cvoid}, ctx::Ptr{Cvoid})

Sets the objective function minimized by some of the SNES linesearch methods into a DMSNES object, used instead of the 2-norm of the residual

Not Collective

Input Parameters:

  • dm - DM to be used with SNES
  • obj - objective evaluation routine; see SNESObjectiveFn for the calling sequence
  • ctx - [optional] user-defined context for private data for the objective evaluation routine (may be NULL)

Level: developer

See also: DMSNES, DMSNESSetContext(), SNESGetObjective(), DMSNESSetFunction(), SNESObjectiveFn

External Links

source
PETSc.LibPETSc.DMSNESSetObjectiveLocal — Method
DMSNESSetObjectiveLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::external, ctx::Ptr{Cvoid})

set a local objective evaluation function. This function is called with local vector containing the local vector information PLUS ghost point information. It should compute a result for all local elements and DMSNES will automatically accumulate the overlapping values.

Logically Collective

Input Parameters:

  • dm - DM to associate callback with
  • func - local objective evaluation
  • ctx - optional context for local objective function evaluation

Calling sequence of func:

  • dm - the DM
  • x - the location where the objective is to be evaluated
  • obj - the value of the objective function
  • ctx - optional context for the local objective function evaluation

Level: advanced

See also: DMSNESSetFunctionLocal(), DMSNESSetJacobianLocal()

External Links

source
PETSc.LibPETSc.DMSNESSetPicard — Method
DMSNESSetPicard(petsclib::PetscLibType, dm::AbstractPetscDM, b::Ptr{Cvoid}, J::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set SNES Picard iteration matrix and RHS evaluation functions into a DMSNES object

Not Collective

Input Parameters:

  • dm - DM to be used with SNES
  • b - RHS evaluation function; see SNESFunctionFn for calling sequence
  • J - Picard matrix evaluation function; see SNESJacobianFn for calling sequence
  • ctx - context for residual and matrix evaluation

Level: developer

See also: DMSNES, SNESSetPicard(), DMSNESSetFunction(), DMSNESSetJacobian(), SNESFunctionFn, SNESJacobianFn

External Links

source
PETSc.LibPETSc.DMSetAdjacency — Method
DMSetAdjacency(petsclib::PetscLibType, dm::AbstractPetscDM, f::PetscInt, useCone::PetscBool, useClosure::PetscBool)

Set the flags for determining variable influence

Not Collective

Input Parameters:

  • dm - The DM object
  • f - The field number
  • useCone - Flag for variable influence starting with the cone operation
  • useClosure - Flag for variable influence using transitive closure

Level: developer

See also: DM, DMGetAdjacency(), DMGetField(), DMSetField()

External Links

source
PETSc.LibPETSc.DMSetApplicationContext — Method
DMSetApplicationContext(petsclib::PetscLibType, dm::AbstractPetscDM, ctx::Ptr{Cvoid})

Set an application context into a DM object

Not Collective

Input Parameters:

  • dm - the DM object
  • ctx - the application context

Level: intermediate

See also: DM, DMGetApplicationContext(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix()

External Links

source
PETSc.LibPETSc.DMSetApplicationContextDestroy — Method
DMSetApplicationContextDestroy(petsclib::PetscLibType, dm::AbstractPetscDM, destroy::Ptr{Cvoid})

Sets a user function that will be called to destroy the application context when the DM is destroyed

Logically Collective if the function is collective

Input Parameters:

  • dm - the DM object
  • destroy - the destroy function, see PetscCtxDestroyFn for the calling sequence

Level: intermediate

See also: DM, DMSetApplicationContext(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMGetApplicationContext(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.DMSetAuxiliaryVec — Method
DMSetAuxiliaryVec(petsclib::PetscLibType, dm::AbstractPetscDM, label::DMLabel, value::PetscInt, part::PetscInt, aux::AbstractPetscVec)

Set an auxiliary vector for region specified by the given label and value, and equation part

Not Collective because auxiliary vectors are not parallel

Input Parameters:

  • dm - The DM
  • label - The DMLabel
  • value - The label value indicating the region
  • part - The equation part, or 0 if unused
  • aux - The Vec holding auxiliary field data

Level: advanced

See also: DM, DMClearAuxiliaryVec(), DMGetAuxiliaryVec(), DMGetAuxiliaryLabels(), DMCopyAuxiliaryVec()

External Links

source
PETSc.LibPETSc.DMSetBasicAdjacency — Method
DMSetBasicAdjacency(petsclib::PetscLibType, dm::AbstractPetscDM, useCone::PetscBool, useClosure::PetscBool)

Set the flags for determining variable influence, using either the default or field 0 if it is defined

Not Collective

Input Parameters:

  • dm - The DM object
  • useCone - Flag for variable influence starting with the cone operation
  • useClosure - Flag for variable influence using transitive closure

Level: developer

See also: DM, DMGetBasicAdjacency(), DMGetField(), DMSetField()

External Links

source
PETSc.LibPETSc.DMSetBlockingType — Method
DMSetBlockingType(petsclib::PetscLibType, dm::AbstractPetscDM, btype::DMBlockingType)

set the blocking granularity to be used for variable block size DMCreateMatrix() is called

Logically Collective

Input Parameters:

  • dm - the DM
  • btype - block by topological point or field node

Options Database Key:

  • -dm_blocking_type (topological_point|field_node) - use topological point blocking or field node blocking

Level: advanced

See also: DM, DMCreateMatrix(), MatSetVariableBlockSizes()

External Links

source
PETSc.LibPETSc.DMSetCellCoordinateDM — Method
DMSetCellCoordinateDM(petsclib::PetscLibType, dm::AbstractPetscDM, cdm::AbstractPetscDM)

Sets the DM that prescribes cellwise coordinate layout and scatters between global and local cellwise coordinates

Logically Collective

Input Parameters:

  • dm - the DM
  • cdm - cellwise coordinate DM

Level: intermediate

See also: DMGetCellCoordinateDM(), DMSetCellCoordinates(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMGetCellCoordinatesLocal(), DMSetCoordinateDM(), DMGetCoordinateDM()

External Links

source
PETSc.LibPETSc.DMSetCellCoordinateField — Method
DMSetCellCoordinateField(petsclib::PetscLibType, dm::AbstractPetscDM, field::DMField)

Set the DMField representation of the discontinuous per-cell mesh coordinates

Logically Collective

Input Parameters:

  • dm - the DM
  • field - the DMField describing the cell coordinates

Level: advanced

See also: DM, DMField, DMSetCoordinateField(), DMGetCellCoordinateDM(), DMSetCellCoordinates()

External Links

source
PETSc.LibPETSc.DMSetCellCoordinateSection — Method
DMSetCellCoordinateSection(petsclib::PetscLibType, dm::AbstractPetscDM, dim::PetscInt, section::PetscSection)

Set the PetscSection of cellwise coordinate values over the mesh.

Not Collective

Input Parameters:

  • dm - The DM object
  • dim - The embedding dimension, or PETSC_DETERMINE
  • section - The PetscSection object for a cellwise layout

Level: intermediate

See also: DM, DMGetCoordinateDim(), DMSetCoordinateSection(), DMGetCellCoordinateSection(), DMGetCoordinateSection(), DMGetCellCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMSetCellCoordinates — Method
DMSetCellCoordinates(petsclib::PetscLibType, dm::AbstractPetscDM, c::AbstractPetscVec)

Sets into the DM a global vector that holds the cellwise coordinates

Collective

Input Parameters:

  • dm - the DM
  • c - cellwise coordinate vector

Level: intermediate

See also: DM, DMGetCoordinates(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMGetCellCoordinatesLocal(), DMGetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMSetCellCoordinatesLocal — Method
DMSetCellCoordinatesLocal(petsclib::PetscLibType, dm::AbstractPetscDM, c::AbstractPetscVec)

Sets into the DM a local vector including ghost points that holds the cellwise coordinates

Not Collective

Input Parameters:

  • dm - the DM
  • c - cellwise coordinate vector

Level: intermediate

See also: DM, DMGetCellCoordinatesLocal(), DMSetCellCoordinates(), DMGetCellCoordinates(), DMGetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMSetCoarseDM — Method
DMSetCoarseDM(petsclib::PetscLibType, dm::AbstractPetscDM, cdm::AbstractPetscDM)

Set the coarse DM from which this DM was obtained by refinement

Input Parameters:

  • dm - The DM object
  • cdm - The coarse DM

Level: intermediate

See also: DM, DMGetCoarseDM(), DMCoarsen(), DMSetRefine(), DMSetFineDM()

External Links

source
PETSc.LibPETSc.DMSetCoarsenLevel — Method
DMSetCoarsenLevel(petsclib::PetscLibType, dm::AbstractPetscDM, level::PetscInt)

Sets the number of coarsenings that have generated this DM.

Collective

Input Parameters:

  • dm - the DM object
  • level - number of coarsenings

Level: developer

See also: DM, DMCoarsen(), DMGetCoarsenLevel(), DMGetRefineLevel(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMSetCoordinateDM — Method
DMSetCoordinateDM(petsclib::PetscLibType, dm::AbstractPetscDM, cdm::AbstractPetscDM)

Sets the DM that prescribes coordinate layout and scatters between global and local coordinates

Logically Collective

Input Parameters:

  • dm - the DM
  • cdm - coordinate DM

Level: intermediate

See also: DM, DMGetCoordinateDM(), DMSetCoordinates(), DMGetCellCoordinateDM(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMGSetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMSetCoordinateDim — Method
DMSetCoordinateDim(petsclib::PetscLibType, dm::AbstractPetscDM, dim::PetscInt)

Set the dimension of the embedding space for coordinate values.

Not Collective

Input Parameters:

  • dm - The DM object
  • dim - The embedding dimension

Level: intermediate

See also: DM, DMGetCoordinateDim(), DMSetCoordinateSection(), DMGetCoordinateSection(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMSetCoordinateDisc — Method
DMSetCoordinateDisc(petsclib::PetscLibType, dm::AbstractPetscDM, disc::PetscFE, localized::PetscBool, project::PetscBool)

Set a coordinate space

Input Parameters:

  • dm - The DM object
  • disc - The new coordinate discretization or NULL to ensure a coordinate discretization exists
  • localized - Set a localized (DG) coordinate space
  • project - Project coordinates to new discretization

Level: intermediate

See also: DM, PetscFE, DMGetCoordinateField()

External Links

source
PETSc.LibPETSc.DMSetCoordinateField — Method
DMSetCoordinateField(petsclib::PetscLibType, dm::AbstractPetscDM, field::DMField)

Set the DMField representation of the mesh coordinates

Logically Collective

Input Parameters:

  • dm - the DM
  • field - the DMField describing the coordinates

Level: advanced

See also: DM, DMField, DMGetCoordinateField(), DMSetCoordinateDM(), DMSetCoordinates()

External Links

source
PETSc.LibPETSc.DMSetCoordinateSection — Method
DMSetCoordinateSection(petsclib::PetscLibType, dm::AbstractPetscDM, dim::PetscInt, section::PetscSection)

Set the PetscSection of coordinate values over the mesh.

Not Collective

Input Parameters:

  • dm - The DM object
  • dim - The embedding dimension, or PETSC_DETERMINE
  • section - The PetscSection object

Level: intermediate

See also: DM, DMGetCoordinateDim(), DMGetCoordinateSection(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMSetCoordinates — Method
DMSetCoordinates(petsclib::PetscLibType, dm::AbstractPetscDM, c::AbstractPetscVec)

Sets into the DM a global vector that holds the coordinates

Logically Collective

Input Parameters:

  • dm - the DM
  • c - coordinate vector

Level: intermediate

See also: DM, DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMGetCoordinateDM(), DMDASetUniformCoordinates()

External Links

source
PETSc.LibPETSc.DMSetCoordinatesLocal — Method
DMSetCoordinatesLocal(petsclib::PetscLibType, dm::AbstractPetscDM, c::AbstractPetscVec)

Sets into the DM a local vector, including ghost points, that holds the coordinates

Not Collective

Input Parameters:

  • dm - the DM
  • c - coordinate vector

Level: intermediate

See also: DM, DMGetCoordinatesLocal(), DMSetCoordinates(), DMGetCoordinates(), DMGetCoordinateDM()

External Links

source
PETSc.LibPETSc.DMSetDefaultConstraints — Method
DMSetDefaultConstraints(petsclib::PetscLibType, dm::AbstractPetscDM, section::PetscSection, mat::AbstractPetscMat, bias::AbstractPetscVec)

Set the PetscSection and Mat that specify the local constraint interpolation.

Collective

Input Parameters:

  • dm - The DM
  • section - The PetscSection describing the range of the constraint matrix: relates rows of the constraint matrix to dofs of the default section. Must have a local communicator (PETSC_COMM_SELF or derivative).
  • mat - The Mat that interpolates local constraints: its width should be the layout size of the default section: NULL indicates no constraints. Must have a local communicator (PETSC_COMM_SELF or derivative).
  • bias - A bias vector to be added to constrained values in the local vector. NULL indicates no bias. Must have a local communicator (PETSC_COMM_SELF or derivative).

Level: advanced

See also: DM, DMGetDefaultConstraints()

External Links

source
PETSc.LibPETSc.DMSetDimension — Method
DMSetDimension(petsclib::PetscLibType, dm::AbstractPetscDM, dim::PetscInt)

Set the topological dimension of the DM

Collective

Input Parameters:

  • dm - The DM
  • dim - The topological dimension

Level: beginner

See also: DM, DMGetDimension(), DMCreate()

External Links

source
PETSc.LibPETSc.DMSetField — Method
DMSetField(petsclib::PetscLibType, dm::AbstractPetscDM, f::PetscInt, label::DMLabel, disc)

Set the discretization object for a given DM field. Usually one would call DMAddField() which automatically handles the field numbering.

Logically Collective

Input Parameters:

  • dm - The DM
  • f - The field number
  • label - The label indicating the support of the field, or NULL for the entire mesh
  • disc - The discretization object

Level: intermediate

See also: DM, DMAddField(), DMGetField()

External Links

source
PETSc.LibPETSc.DMSetFieldAvoidTensor — Method
DMSetFieldAvoidTensor(petsclib::PetscLibType, dm::AbstractPetscDM, f::PetscInt, avoidTensor::PetscBool)

Set flag to avoid defining the field on tensor cells

Logically Collective

Input Parameters:

  • dm - The DM
  • f - The field index
  • avoidTensor - PETSC_TRUE to skip defining the field on tensor cells

Level: intermediate

See also: DM, DMGetFieldAvoidTensor(), DMSetField(), DMGetField()

External Links

source
PETSc.LibPETSc.DMSetFineDM — Method
DMSetFineDM(petsclib::PetscLibType, dm::AbstractPetscDM, fdm::AbstractPetscDM)

Set the fine mesh from which this was obtained by coarsening

Input Parameters:

  • dm - The DM object
  • fdm - The fine DM

Level: developer

See also: DM, DMGetFineDM(), DMCoarsen(), DMRefine()

External Links

source
PETSc.LibPETSc.DMSetFromOptions — Method
DMSetFromOptions(petsclib::PetscLibType, dm::AbstractPetscDM)

sets parameters in a DM from the options database

Collective

Input Parameter:

  • dm - the DM object to set options for

Options Database Keys:

  • -dm_preallocate_only (true|false) - Only preallocate the matrix for DMCreateMatrix() and DMCreateMassMatrix(), but do not fill it with zeros
  • -dm_vec_type type - type of vector to create inside DM
  • -dm_mat_type type - type of matrix to create inside DM
  • -dm_is_coloring_type (global|local) - see ISColoringType
  • -dm_bind_below n - bind (force execution on CPU) for Vec and Mat objects with local size (number of vector entries or matrix rows) below n; currently only supported for DMDA
  • -dm_plex_option_phases ph0_, ph1_, ... - List of prefixes for option processing phases
  • -dm_plex_filename str - File containing a mesh
  • -dm_plex_boundary_filename str - File containing a mesh boundary
  • -dm_plex_name str - Name of the mesh in the file
  • -dm_plex_shape shape - The domain shape, such as BOX, SPHERE, etc.
  • -dm_plex_cell ct - Cell shape
  • -dm_plex_reference_cell_domain (true|false) - Use a reference cell domain
  • -dm_plex_dim dim - Set the topological dimension
  • -dm_plex_simplex (true|false) - PETSC_TRUE for simplex elements, PETSC_FALSE for tensor elements
  • -dm_plex_interpolate (true|false) - PETSC_TRUE turns on topological interpolation (creating edges and faces)
  • -dm_plex_orient (true|false) - PETSC_TRUE turns on topological orientation (flipping edges and faces)
  • -dm_plex_scale sc - Scale factor for mesh coordinates
  • -dm_coord_remap (true|false) - Map coordinates using a function
  • -dm_plex_coordinate_dim dim - Change the coordinate dimension of a mesh (usually given with cdm_ prefix)
  • -dm_coord_map mapname - Select a builtin coordinate map
  • -dm_coord_map_params p0,p1,p2,... - Set coordinate mapping parameters
  • -dm_plex_box_faces m,n,p - Number of faces along each dimension
  • -dm_plex_box_lower x,y,z - Specify lower-left-bottom coordinates for the box
  • -dm_plex_box_upper x,y,z - Specify upper-right-top coordinates for the box
  • -dm_plex_box_bd bx,by,bz - Specify the DMBoundaryType for each direction
  • -dm_plex_sphere_radius r - The sphere radius
  • -dm_plex_ball_radius r - Radius of the ball
  • -dm_plex_cylinder_bd bz - Boundary type in the z direction
  • -dm_plex_cylinder_num_wedges n - Number of wedges around the cylinder
  • -dm_plex_reorder order - Reorder the mesh using the specified algorithm
  • -dm_refine_pre n - The number of refinements before distribution
  • -dm_refine_uniform_pre (true|false) - Flag for uniform refinement before distribution
  • -dm_refine_volume_limit_pre v - The maximum cell volume after refinement before distribution
  • -dm_refine n - The number of refinements after distribution
  • -dm_extrude l - Activate extrusion and specify the number of layers to extrude
  • -dm_plex_save_transform (true|false) - Save the DMPlexTransform that produced this mesh
  • -dm_plex_transform_extrude_thickness t - The total thickness of extruded layers
  • -dm_plex_transform_extrude_use_tensor (true|false) - Use tensor cells when extruding
  • -dm_plex_transform_extrude_symmetric (true|false) - Extrude layers symmetrically about the surface
  • -dm_plex_transform_extrude_normal n0,...,nd - Specify the extrusion direction
  • -dm_plex_transform_extrude_thicknesses t0,...,tl - Specify thickness of each layer
  • -dm_plex_create_fv_ghost_cells - Flag to create finite volume ghost cells on the boundary
  • -dm_plex_fv_ghost_cells_label name - Label name for ghost cells boundary
  • -dm_distribute (true|false) - Flag to redistribute a mesh among processes
  • -dm_distribute_overlap n - The size of the overlap halo
  • -dm_plex_adj_cone (true|false) - Set adjacency direction
  • -dm_plex_adj_closure (true|false) - Set adjacency size
  • -dm_plex_use_ceed (true|false) - Use LibCEED as the FEM backend
  • -dm_plex_check_symmetry (true|false) - Check that the adjacency information in the mesh is symmetric - DMPlexCheckSymmetry()
  • -dm_plex_check_skeleton (true|false) - Check that each cell has the correct number of vertices (only for homogeneous simplex or tensor meshes) - DMPlexCheckSkeleton()
  • -dm_plex_check_faces (true|false) - Check that the faces of each cell give a vertex order this is consistent with what we expect from the cell type - DMPlexCheckFaces()
  • -dm_plex_check_geometry (true|false) - Check that cells have positive volume - DMPlexCheckGeometry()
  • -dm_plex_check_pointsf (true|false) - Check some necessary conditions for PointSF - DMPlexCheckPointSF()
  • -dm_plex_check_interface_cones (true|false) - Check points on inter-partition interfaces have conforming order of cone points - DMPlexCheckInterfaceCones()
  • -dm_plex_check_all (true|false) - Perform all the checks above

Level: intermediate

See also: DM, DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMPlexCheckSymmetry(), DMPlexCheckSkeleton(), DMPlexCheckFaces(), DMPlexCheckGeometry(), DMPlexCheckPointSF(), DMPlexCheckInterfaceCones(), DMSetOptionsPrefix(), DMType, DMPLEX, DMDA, DMSetUp()

External Links

source
PETSc.LibPETSc.DMSetGlobalSection — Method
DMSetGlobalSection(petsclib::PetscLibType, dm::AbstractPetscDM, section::PetscSection)

Set the PetscSection encoding the global data layout for the DM.

Input Parameters:

  • dm - The DM
  • section - The PetscSection, or NULL

Level: intermediate

See also: DM, DMGetGlobalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMSetISColoringType — Method
DMSetISColoringType(petsclib::PetscLibType, dm::AbstractPetscDM, ctype::ISColoringType)

Sets the type of coloring, IS_COLORING_GLOBAL or IS_COLORING_LOCAL that is created by the DM

Logically Collective

Input Parameters:

  • dm - the DM context
  • ctype - the matrix type

Options Database Key:

  • -dm_is_coloring_type (global|local) - see ISColoringType

Level: intermediate

See also: DM, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateMatrix(), DMCreateMassMatrix(), DMSetMatrixPreallocateOnly(), MatType, DMGetMatType(), DMGetISColoringType(), ISColoringType, IS_COLORING_GLOBAL, IS_COLORING_LOCAL

External Links

source
PETSc.LibPETSc.DMSetLabel — Method
DMSetLabel(petsclib::PetscLibType, dm::AbstractPetscDM, label::DMLabel)

Replaces the label of a given name, or ignores it if the name is not present

Not Collective

Input Parameters:

  • dm - The DM object
  • label - The DMLabel, having the same name, to substitute

Default labels in a DMPLEX:

  • "depth" - Holds the depth (co-dimension) of each mesh point
  • "celltype" - Holds the topological type of each cell
  • "ghost" - If the DM is distributed with overlap, this marks the cells and faces in the overlap
  • "Cell Sets" - Mirrors the cell sets defined by GMsh and ExodusII
  • "Face Sets" - Mirrors the face sets defined by GMsh and ExodusII
  • "Vertex Sets" - Mirrors the vertex sets defined by GMsh

Level: intermediate

See also: DM, DMLabel, DMCreateLabel(), DMHasLabel(), DMPlexGetDepthLabel(), DMPlexGetCellType()

External Links

source
PETSc.LibPETSc.DMSetLabelOutput — Method
DMSetLabelOutput(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, output::PetscBool)

Set if a given label should be saved to a PetscViewer in calls to DMView()

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name
  • output - PETSC_TRUE to save the label to the viewer

Level: developer

See also: DM, DMLabel, DMGetOutputFlag(), DMGetLabelOutput(), DMCreateLabel(), DMHasLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMSetLabelValue — Method
DMSetLabelValue(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, point::PetscInt, value::PetscInt)

Add a point to a DMLabel with given value

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name
  • point - The mesh point
  • value - The label value for this point

Output Parameter:

Level: beginner

See also: DM, DMLabelSetValue(), DMGetStratumIS(), DMClearLabelValue()

External Links

source
PETSc.LibPETSc.DMSetLocalSection — Method
DMSetLocalSection(petsclib::PetscLibType, dm::AbstractPetscDM, section::PetscSection)

Set the PetscSection encoding the local data layout for the DM.

Input Parameters:

  • dm - The DM
  • section - The PetscSection

Level: intermediate

See also: DM, PetscSection, DMGetLocalSection(), DMSetGlobalSection()

External Links

source
PETSc.LibPETSc.DMSetMatType — Method
DMSetMatType(petsclib::PetscLibType, dm::AbstractPetscDM, ctype::String)

Sets the type of matrix created with DMCreateMatrix()

Logically Collective

Input Parameters:

  • dm - the DM context
  • ctype - the matrix type, for example MATMPIAIJ

Options Database Key:

  • -dm_mat_type ctype - the type of the matrix to create, see MatType

Level: intermediate

See also: DM, MatType, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateMatrix(), DMCreateMassMatrix(), DMSetMatrixPreallocateOnly(), DMGetMatType(), DMCreateGlobalVector(), DMCreateLocalVector()

External Links

source
PETSc.LibPETSc.DMSetMatrixPreallocateOnly — Method
DMSetMatrixPreallocateOnly(petsclib::PetscLibType, dm::AbstractPetscDM, only::PetscBool)

When DMCreateMatrix() is called the matrix will be properly preallocated but the nonzero structure and zero values will not be set.

Logically Collective

Input Parameters:

  • dm - the DM
  • only - PETSC_TRUE if only want preallocation

Options Database Key:

  • -dm_preallocate_only - Only preallocate the matrix for DMCreateMatrix(), DMCreateMassMatrix(), but do not fill it with zeros

Level: developer

See also: DM, DMCreateMatrix(), DMCreateMassMatrix(), DMSetMatrixStructureOnly(), DMSetMatrixPreallocateSkip()

External Links

source
PETSc.LibPETSc.DMSetMatrixPreallocateSkip — Method
DMSetMatrixPreallocateSkip(petsclib::PetscLibType, dm::AbstractPetscDM, skip::PetscBool)

When DMCreateMatrix() is called the matrix sizes and ISLocalToGlobalMapping will be properly set, but the data structures to store values in the matrices will not be preallocated.

Logically Collective

Input Parameters:

  • dm - the DM
  • skip - PETSC_TRUE to skip preallocation

Level: developer

See also: DM, DMCreateMatrix(), DMSetMatrixStructureOnly(), DMSetMatrixPreallocateOnly()

External Links

source
PETSc.LibPETSc.DMSetMatrixStructureOnly — Method
DMSetMatrixStructureOnly(petsclib::PetscLibType, dm::AbstractPetscDM, only::PetscBool)

When DMCreateMatrix() is called, the matrix nonzero structure will be created but the array for numerical values will not be allocated.

Logically Collective

Input Parameters:

  • dm - the DM
  • only - PETSC_TRUE if you only want matrix nonzero structure

Level: developer

See also: DM, DMCreateMatrix(), DMSetMatrixPreallocateOnly(), DMSetMatrixPreallocateSkip()

External Links

source
PETSc.LibPETSc.DMSetNaturalSF — Method
DMSetNaturalSF(petsclib::PetscLibType, dm::AbstractPetscDM, sf::PetscSF)

Set the PetscSF encoding the map back to the original mesh ordering

Input Parameters:

  • dm - The DM
  • sf - The PetscSF

Level: intermediate

See also: DM, DMGetNaturalSF(), DMSetUseNatural(), DMGetUseNatural(), DMPlexCreateGlobalToNaturalSF(), DMPlexDistribute()

External Links

source
PETSc.LibPETSc.DMSetNearNullSpaceConstructor — Method
DMSetNearNullSpaceConstructor(petsclib::PetscLibType, dm::AbstractPetscDM, field::PetscInt, nullsp::external)

Provide a callback function which constructs the near-nullspace for a given field, defined with DMAddField()

Logically Collective; No Fortran Support

Input Parameters:

  • dm - The DM
  • field - The field number for the nullspace
  • nullsp - A callback to create the near-nullspace

Calling sequence of nullsp:

  • dm - The present DM
  • origField - The field number given above, in the original DM
  • field - The field number in dm
  • nullSpace - The nullspace for the given field

Level: intermediate

See also: DM, DMAddField(), DMGetNearNullSpaceConstructor(), DMSetNullSpaceConstructor(), DMGetNullSpaceConstructor(), DMCreateSubDM(), DMCreateSuperDM(), MatNullSpace

External Links

source
PETSc.LibPETSc.DMSetNullSpaceConstructor — Method
DMSetNullSpaceConstructor(petsclib::PetscLibType, dm::AbstractPetscDM, field::PetscInt, nullsp::external)

Provide a callback function which constructs the nullspace for a given field, defined with DMAddField(), when function spaces are joined or split, such as in DMCreateSubDM()

Logically Collective; No Fortran Support

Input Parameters:

  • dm - The DM
  • field - The field number for the nullspace
  • nullsp - A callback to create the nullspace

Calling sequence of nullsp:

  • dm - The present DM
  • origField - The field number given above, in the original DM
  • field - The field number in dm
  • nullSpace - The nullspace for the given field

Level: intermediate

See also: DM, DMAddField(), DMGetNullSpaceConstructor(), DMSetNearNullSpaceConstructor(), DMGetNearNullSpaceConstructor(), DMCreateSubDM(), DMCreateSuperDM()

External Links

source
PETSc.LibPETSc.DMSetNumFields — Method
DMSetNumFields(petsclib::PetscLibType, dm::AbstractPetscDM, numFields::PetscInt)

Set the number of fields in the DM

Logically Collective

Input Parameters:

  • dm - The DM
  • numFields - The number of fields

Level: intermediate

See also: DM, DMGetNumFields(), DMSetField()

External Links

source
PETSc.LibPETSc.DMSetOptionsPrefix — Method
DMSetOptionsPrefix(petsclib::PetscLibType, dm::AbstractPetscDM, prefix::String)

Sets the prefix prepended to all option names when searching through the options database

Logically Collective

Input Parameters:

  • dm - the DM context
  • prefix - the prefix to prepend

Level: advanced

See also: DM, PetscObjectSetOptionsPrefix(), DMSetFromOptions()

External Links

source
PETSc.LibPETSc.DMSetOutputSequenceNumber — Method
DMSetOutputSequenceNumber(petsclib::PetscLibType, dm::AbstractPetscDM, num::PetscInt, val::PetscReal)

Set the sequence number/value for output

Input Parameters:

  • dm - The original DM
  • num - The output sequence number
  • val - The output sequence value

Level: intermediate

See also: DM, VecView()

External Links

source
PETSc.LibPETSc.DMSetPeriodicity — Method
DMSetPeriodicity(petsclib::PetscLibType, dm::AbstractPetscDM, maxCell::Vector{PetscReal}, Lstart::Vector{PetscReal}, L::Vector{PetscReal})

Set the description of mesh periodicity

Logically Collective

Input Parameters:

  • dm - The DM object
  • maxCell - Over distances greater than this, we can assume a point has crossed over to another sheet, when trying to localize cell coordinates. Pass NULL to remove such information.
  • Lstart - If we assume the mesh is a torus, this is the start of each coordinate, or NULL for 0.0
  • L - If we assume the mesh is a torus, this is the length of each coordinate, otherwise it is < 0.0

Level: developer

See also: DM, DMGetPeriodicity()

External Links

source
PETSc.LibPETSc.DMSetPointSF — Method
DMSetPointSF(petsclib::PetscLibType, dm::AbstractPetscDM, sf::PetscSF)

Set the PetscSF encoding the parallel section point overlap for the DM.

Collective

Input Parameters:

  • dm - The DM
  • sf - The PetscSF

Level: intermediate

See also: DM, DMGetPointSF(), DMGetSectionSF(), DMSetSectionSF(), DMCreateSectionSF()

External Links

source
PETSc.LibPETSc.DMSetRefineLevel — Method
DMSetRefineLevel(petsclib::PetscLibType, dm::AbstractPetscDM, level::PetscInt)

Sets the number of refinements that have generated this DM.

Not Collective

Input Parameters:

  • dm - the DM object
  • level - number of refinements

Level: advanced

See also: DM, DMGetRefineLevel(), DMCoarsen(), DMGetCoarsenLevel(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMSetRegionDS — Method
DMSetRegionDS(petsclib::PetscLibType, dm::AbstractPetscDM, label::DMLabel, fields::AbstractIS, ds::PetscDS, dsIn::PetscDS)

Set the PetscDS for a given mesh region, defined by a DMLabel

Collective

Input Parameters:

  • dm - The DM
  • label - The DMLabel defining the mesh region, or NULL for the entire mesh
  • fields - The IS containing the DM field numbers for the fields in this PetscDS, or NULL for all fields
  • ds - The PetscDS defined on the given region
  • dsIn - The PetscDS for input on the given cell, or NULL if it is the same PetscDS

Level: advanced

See also: DM, DMGetRegionDS(), DMSetRegionNumDS(), DMGetDS(), DMGetCellDS()

External Links

source
PETSc.LibPETSc.DMSetRegionNumDS — Method
DMSetRegionNumDS(petsclib::PetscLibType, dm::AbstractPetscDM, num::PetscInt, label::DMLabel, fields::AbstractIS, ds::PetscDS, dsIn::PetscDS)

Set the PetscDS for a given mesh region, defined by the region number

Not Collective

Input Parameters:

  • dm - The DM
  • num - The region number, in [0, Nds)
  • label - The region label, or NULL
  • fields - The IS containing the DM field numbers for the fields in this PetscDS, or NULL to prevent setting
  • ds - The PetscDS defined on the given region, or NULL to prevent setting
  • dsIn - The PetscDS for input on the given cell, or NULL if it is the same PetscDS

Level: advanced

See also: DM, DMGetRegionDS(), DMSetRegionDS(), DMGetDS(), DMGetCellDS()

External Links

source
PETSc.LibPETSc.DMSetSectionSF — Method
DMSetSectionSF(petsclib::PetscLibType, dm::AbstractPetscDM, sf::PetscSF)

Set the PetscSF encoding the parallel dof overlap for the DM

Input Parameters:

  • dm - The DM
  • sf - The PetscSF

Level: intermediate

See also: DM, DMGetSectionSF(), DMCreateSectionSF()

External Links

source
PETSc.LibPETSc.DMSetSnapToGeomModel — Method
DMSetSnapToGeomModel(petsclib::PetscLibType, dm::AbstractPetscDM, name::String)

Choose a geometry model for this DM.

Not Collective

Input Parameters:

  • dm - The DM object
  • name - A geometry model name, or NULL for the default

Level: intermediate

See also: DM, DMPLEX, DMRefine(), DMPlexCreate(), DMSnapToGeomModel()

External Links

source
PETSc.LibPETSc.DMSetSparseLocalize — Method
DMSetSparseLocalize(petsclib::PetscLibType, dm::AbstractPetscDM, sparse::PetscBool)

Set the flag indicating that DM coordinates should be localized only for cells near the periodic boundary.

Collective

Input Parameters:

  • dm - The DM
  • sparse - PETSC_TRUE if only cells near the periodic boundary are localized

Level: intermediate

See also: DMGetSparseLocalize(), DMLocalizeCoordinates(), DMSetPeriodicity()

External Links

source
PETSc.LibPETSc.DMSetStratumIS — Method
DMSetStratumIS(petsclib::PetscLibType, dm::AbstractPetscDM, name::String, value::PetscInt, points::AbstractIS)

Set the points in a label stratum

Not Collective

Input Parameters:

  • dm - The DM object
  • name - The label name
  • value - The stratum value
  • points - The stratum points

Level: beginner

See also: DM, DMLabel, DMClearLabelStratum(), DMLabelClearStratum(), DMLabelSetStratumIS(), DMGetStratumSize()

External Links

source
PETSc.LibPETSc.DMSetType — Method
DMSetType(petsclib::PetscLibType, dm::AbstractPetscDM, method::String)

Builds a DM, for a particular DM implementation.

Collective

Input Parameters:

  • dm - The DM object
  • method - The name of the DMType, for example DMDA, DMPLEX

Options Database Key:

  • -dm_type type - Sets the DM type; use -help for a list of available types

Level: intermediate

See also: DM, DMType, DMDA, DMPLEX, DMGetType(), DMCreate(), DMDACreate2d()

External Links

source
PETSc.LibPETSc.DMSetUp — Method
DMSetUp(petsclib::PetscLibType, dm::AbstractPetscDM)

sets up the data structures inside a DM object

Collective

Input Parameter:

  • dm - the DM object to setup

Level: intermediate

See also: DM, DMCreate(), DMSetType(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix()

External Links

source
PETSc.LibPETSc.DMSetUseNatural — Method
DMSetUseNatural(petsclib::PetscLibType, dm::AbstractPetscDM, useNatural::PetscBool)

Set the flag for creating a mapping to the natural order when a DM is (re)distributed in parallel

Collective

Input Parameters:

  • dm - The DM
  • useNatural - PETSC_TRUE to build the mapping to a natural order during distribution

Level: beginner

See also: DM, DMGetUseNatural(), DMCreate(), DMPlexDistribute(), DMCreateSubDM(), DMCreateSuperDM()

External Links

source
PETSc.LibPETSc.DMSetVI — Method
DMSetVI(petsclib::PetscLibType, dm::AbstractPetscDM, inactive::AbstractIS)

Marks a DM as associated with a VI problem. This causes the interpolation/restriction operators to be restricted to only those variables NOT associated with active constraints.

Logically Collective

Input Parameters:

  • dm - the DM object
  • inactive - an IS indicating which points are currently not active

Level: intermediate

See also: SNES, SNESVINEWTONRSLS, SNESVIGetInactiveSet()

External Links

source
PETSc.LibPETSc.DMSetVariableBounds — Method
DMSetVariableBounds(petsclib::PetscLibType, dm::AbstractPetscDM, f::external)

sets a function to compute the lower and upper bound vectors for SNESVI.

Logically Collective

Input Parameters:

  • dm - the DM object
  • f - the function that computes variable bounds used by SNESVI (use NULL to cancel a previous function that was set)

Calling sequence of f:

  • dm - the DM
  • lower - the vector to hold the lower bounds
  • upper - the vector to hold the upper bounds

Level: intermediate

See also: DM, DMComputeVariableBounds(), DMHasVariableBounds(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMGetApplicationContext(), DMSetJacobian()

External Links

source
PETSc.LibPETSc.DMSetVecType — Method
DMSetVecType(petsclib::PetscLibType, dm::AbstractPetscDM, ctype::String)

Sets the type of vector to be created with DMCreateLocalVector() and DMCreateGlobalVector()

Logically Collective

Input Parameters:

  • dm - initial distributed array
  • ctype - the vector type, for example VECSTANDARD, VECCUDA, or VECVIENNACL

Options Database Key:

  • -dm_vec_type ctype - the type of vector to create

Level: intermediate

See also: DM, DMCreate(), DMDestroy(), DMDAInterpolationType, VecType, DMGetVecType(), DMSetMatType(), DMGetMatType(), VECSTANDARD, VECCUDA, VECVIENNACL, DMCreateLocalVector(), DMCreateGlobalVector()

External Links

source
PETSc.LibPETSc.DMSlicedCreate — Method
dm::PetscDM = DMSlicedCreate(petsclib::PetscLibType, comm::MPI_Comm, bs::PetscInt, nlocal::PetscInt, Nghosts::PetscInt, ghosts::Vector{PetscInt}, d_nnz::Vector{PetscInt}, o_nnz::Vector{PetscInt})

Creates a DM object, used to manage data for a unstructured problem

Collective

Input Parameters:

  • comm - the processors that will share the global vector
  • bs - the block size
  • nlocal - number of vector entries on this process
  • Nghosts - number of ghost points needed on this process
  • ghosts - global indices of all ghost points for this process
  • d_nnz - matrix preallocation information representing coupling within this process
  • o_nnz - matrix preallocation information representing coupling between this process and other processes

Output Parameter:

  • dm - the slice object

Level: advanced

See also: DM, DMSLICED, DMDestroy(), DMCreateGlobalVector(), DMSetType(), DMSlicedSetGhosts(), DMSlicedSetPreallocation(), VecGhostUpdateBegin(), VecGhostUpdateEnd(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm()

External Links

source
PETSc.LibPETSc.DMSlicedSetBlockFills — Method
DMSlicedSetBlockFills(petsclib::PetscLibType, dm::AbstractPetscDM, dfill::Vector{PetscInt}, ofill::Vector{PetscInt})

Sets the fill pattern in each block for a multi-component problem of the matrix returned by DMSlicedGetMatrix().

Logically Collective

Input Parameters:

  • dm - the DM object
  • dfill - the fill pattern in the diagonal block (may be NULL, means use dense block)
  • ofill - the fill pattern in the off-diagonal blocks

Level: advanced

See also: DM, DMSLICED, DMSlicedGetMatrix(), DMDASetBlockFills()

External Links

source
PETSc.LibPETSc.DMSlicedSetGhosts — Method
DMSlicedSetGhosts(petsclib::PetscLibType, dm::AbstractPetscDM, bs::PetscInt, nlocal::PetscInt, Nghosts::PetscInt, ghosts::Vector{PetscInt})

Sets the global indices of other processes elements that will be ghosts on this process

Not Collective

Input Parameters:

  • dm - the DMSLICED object
  • bs - block size
  • nlocal - number of local (owned, non-ghost) blocks
  • Nghosts - number of ghost blocks on this process
  • ghosts - global indices of each ghost block

Level: advanced

See also: DM, DMSLICED, DMDestroy(), DMCreateGlobalVector()

External Links

source
PETSc.LibPETSc.DMSlicedSetPreallocation — Method
DMSlicedSetPreallocation(petsclib::PetscLibType, dm::AbstractPetscDM, d_nz::PetscInt, d_nnz::Vector{PetscInt}, o_nz::PetscInt, o_nnz::Vector{PetscInt})

sets the matrix memory preallocation for matrices computed by DMSLICED

Not Collective

Input Parameters:

  • dm - the DM object
  • d_nz - number of block nonzeros per block row in diagonal portion of local

submatrix (same for all local rows)

  • d_nnz - array containing the number of block nonzeros in the various block rows

of the in diagonal portion of the local (possibly different for each block row) or NULL.

  • o_nz - number of block nonzeros per block row in the off-diagonal portion of local

submatrix (same for all local rows).

  • o_nnz - array containing the number of nonzeros in the various block rows of the

off-diagonal portion of the local submatrix (possibly different for each block row) or NULL.

Level: advanced

See also: DM, DMSLICED, DMDestroy(), DMCreateGlobalVector(), MatMPIAIJSetPreallocation(), MatMPIBAIJSetPreallocation(), DMSlicedGetMatrix(), DMSlicedSetBlockFills()

External Links

source
PETSc.LibPETSc.DMSnapToGeomModel — Method
DMSnapToGeomModel(petsclib::PetscLibType, dm::AbstractPetscDM, p::PetscInt, dE::PetscInt, mcoords::Vector{PetscScalar}, gcoords::Vector{PetscScalar})

Given a coordinate point 'mcoords' on the mesh point 'p', return the closest coordinate point 'gcoords' on the geometry model associated with that point.

Not Collective

Input Parameters:

  • dm - The DMPLEX object
  • p - The mesh point
  • dE - The coordinate dimension
  • mcoords - A coordinate point lying on the mesh point

Output Parameter:

  • gcoords - The closest coordinate point on the geometry model associated with 'p' to the given point

Level: intermediate

See also: DM, DMPLEX, DMRefine(), DMPlexCreate(), DMPlexSetRefinementUniform()

External Links

source
PETSc.LibPETSc.DMSubDomainHookAdd — Method
DMSubDomainHookAdd(petsclib::PetscLibType, glob::AbstractPetscDM, ddhook::external, restricthook::external, ctx::Ptr{Cvoid})

adds a callback to be run when restricting a problem to subdomain DMs with DMCreateDomainDecomposition()

Logically Collective; No Fortran Support

Input Parameters:

  • global - global DM
  • ddhook - function to run to pass data to the decomposition DM upon its creation
  • restricthook - function to run to update data on block solve (at the beginning of the block solve)
  • ctx - [optional] application context for provide data for the hooks (may be NULL)

Calling sequence of ddhook:

  • global - global DM
  • block - subdomain DM
  • ctx - optional application function context

Calling sequence of restricthook:

  • global - global DM
  • out - scatter to the outer (with ghost and overlap points) sub vector
  • in - scatter to sub vector values only owned locally
  • block - subdomain DM
  • ctx - optional application function context

Level: advanced

See also: DM, DMSubDomainHookRemove(), DMRefineHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate(), DMCreateDomainDecomposition()

External Links

source
PETSc.LibPETSc.DMSubDomainHookRemove — Method
DMSubDomainHookRemove(petsclib::PetscLibType, glob::AbstractPetscDM, ddhook::external, restricthook::external, ctx::Ptr{Cvoid})

remove a callback from the list to be run when restricting a problem to subdomain DMs with DMCreateDomainDecomposition()

Logically Collective; No Fortran Support

Input Parameters:

  • global - global DM
  • ddhook - function to run to pass data to the decomposition DM upon its creation
  • restricthook - function to run to update data on block solve (at the beginning of the block solve)
  • ctx - [optional] application context for provide data for the hooks (may be NULL)

Calling sequence of ddhook:

  • dm - global DM
  • block - subdomain DM
  • ctx - optional application function context

Calling sequence of restricthook:

  • dm - global DM
  • oscatter - scatter to the outer (with ghost and overlap points) sub vector
  • gscatter - scatter to sub vector values only owned locally
  • block - subdomain DM
  • ctx - optional application function context

Level: advanced

See also: DM, DMSubDomainHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate(), DMCreateDomainDecomposition()

External Links

source
PETSc.LibPETSc.DMSubDomainRestrict — Method
DMSubDomainRestrict(petsclib::PetscLibType, glob::AbstractPetscDM, oscatter::VecScatter, gscatter::VecScatter, subdm::AbstractPetscDM)

restricts user-defined problem data to a subdomain DM by running hooks registered by DMSubDomainHookAdd()

Collective if any hooks are

Input Parameters:

  • global - The global DM to use as a base
  • oscatter - The scatter from domain global vector filling subdomain global vector with overlap
  • gscatter - The scatter from domain global vector filling subdomain local vector with ghosts
  • subdm - The subdomain DM to update

Level: developer

See also: DM, DMCoarsenHookAdd(), MatRestrict(), DMCreateDomainDecomposition()

External Links

source
PETSc.LibPETSc.DMTSCheckFromOptions — Method
DMTSCheckFromOptions(petsclib::PetscLibType, ts::AbstractTS, u::AbstractPetscVec)

Check the residual and Jacobian functions using the exact solution by outputting some diagnostic information based on values in the options database

Input Parameters:

  • ts - the TS object
  • u - representative TS vector

Level: developer

See also: DMTS

External Links

source
PETSc.LibPETSc.DMTSCheckJacobian — Method
isLinear::PetscBool,convRate::PetscReal = DMTSCheckJacobian(petsclib::PetscLibType, ts::AbstractTS, dm::AbstractPetscDM, t::PetscReal, u::AbstractPetscVec, u_t::AbstractPetscVec, tol::PetscReal)

Check the Jacobian of the exact solution against the residual using the Taylor Test

Input Parameters:

  • ts - the TS object
  • dm - the DM
  • t - the time
  • u - a DM vector
  • u_t - a DM vector
  • tol - A tolerance for the check, or -1 to print the results instead

Output Parameters:

  • isLinear - Flag indicating that the function looks linear, or NULL
  • convRate - The rate of convergence of the linear model, or NULL

Level: developer

See also: DNTSCheckFromOptions(), DMTSCheckResidual(), DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckResidual()

External Links

source
PETSc.LibPETSc.DMTSCheckResidual — Method
residual::PetscReal = DMTSCheckResidual(petsclib::PetscLibType, ts::AbstractTS, dm::AbstractPetscDM, t::PetscReal, u::AbstractPetscVec, u_t::AbstractPetscVec, tol::PetscReal)

Check the residual of the exact solution

Input Parameters:

  • ts - the TS object
  • dm - the DM
  • t - the time
  • u - a DM vector
  • u_t - a DM vector
  • tol - A tolerance for the check, or -1 to print the results instead

Output Parameter:

  • residual - The residual norm of the exact solution, or NULL

Level: developer

See also: DM, DMTSCheckFromOptions(), DMTSCheckJacobian(), DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckJacobian()

External Links

source
PETSc.LibPETSc.DMTSCreateRHSMassMatrix — Method
DMTSCreateRHSMassMatrix(petsclib::PetscLibType, dm::AbstractPetscDM)

This creates the mass matrix associated with the given DM, and a solver to invert it, and stores them in the DM context.

Collective

Input Parameter:

  • dm - DM providing the mass matrix

Level: developer

See also: DM, DMTSCreateRHSMassMatrixLumped(), DMTSDestroyRHSMassMatrix(), DMCreateMassMatrix(), DMTS

External Links

source
PETSc.LibPETSc.DMTSCreateRHSMassMatrixLumped — Method
DMTSCreateRHSMassMatrixLumped(petsclib::PetscLibType, dm::AbstractPetscDM)

This creates the lumped mass matrix associated with the given DM, and a solver to invert it, and stores them in the DM context.

Collective

Input Parameter:

  • dm - DM providing the mass matrix

Level: developer

See also: DM, DMTSCreateRHSMassMatrix(), DMTSDestroyRHSMassMatrix(), DMCreateMassMatrix(), DMTS

External Links

source
PETSc.LibPETSc.DMTSDestroyRHSMassMatrix — Method
DMTSDestroyRHSMassMatrix(petsclib::PetscLibType, dm::AbstractPetscDM)

Destroys the mass matrix and solver stored in the DM context, if they exist.

Logically Collective

Input Parameter:

  • dm - DM providing the mass matrix

Level: developer

See also: DM, DMTSCreateRHSMassMatrixLumped(), DMCreateMassMatrix(), DMTS

External Links

source
PETSc.LibPETSc.DMTSGetForcingFunction — Method
f::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMTSGetForcingFunction(petsclib::PetscLibType, dm::AbstractPetscDM)

get TS forcing function evaluation function from a DMTS

Not Collective

Input Parameter:

  • dm - DM to be used with TS

Output Parameters:

  • f - forcing function evaluation function; see TSForcingFn for the calling sequence
  • ctx - context for solution evaluation

Level: developer

See also: DMTS, TS, DM, TSSetForcingFunction(), TSForcingFn

External Links

source
PETSc.LibPETSc.DMTSGetI2Function — Method
fun::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMTSGetI2Function(petsclib::PetscLibType, dm::AbstractPetscDM)

get TS implicit residual evaluation function for 2nd order systems from a DMTS

Not Collective

Input Parameter:

  • dm - DM to be used with TS

Output Parameters:

  • fun - function evaluation function, for calling sequence see TSSetI2Function()
  • ctx - context for residual evaluation

Level: developer

See also: DMTS, DM, TS, DMTSSetI2Function(), TSGetI2Function()

External Links

source
PETSc.LibPETSc.DMTSGetI2Jacobian — Method
jac::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMTSGetI2Jacobian(petsclib::PetscLibType, dm::AbstractPetscDM)

get TS implicit Jacobian evaluation function for 2nd order systems from a DMTS

Not Collective

Input Parameter:

  • dm - DM to be used with TS

Output Parameters:

  • jac - Jacobian evaluation function, for calling sequence see TSI2JacobianFn
  • ctx - context for Jacobian evaluation

Level: developer

See also: DMTS, DM, TS, DMTSSetI2Jacobian(), TSGetI2Jacobian(), TSI2JacobianFn

External Links

source
PETSc.LibPETSc.DMTSGetIFunction — Method
func::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMTSGetIFunction(petsclib::PetscLibType, dm::AbstractPetscDM)

get TS implicit residual evaluation function from a DMTS

Not Collective

Input Parameter:

  • dm - DM to be used with TS

Output Parameters:

  • func - function evaluation function, for calling sequence see TSIFunctionFn
  • ctx - context for residual evaluation

Level: developer

See also: DMTS, TS, DM, DMTSSetIFunction(), TSIFunctionFn

External Links

source
PETSc.LibPETSc.DMTSGetIFunctionLocal — Method
DMTSGetIFunctionLocal(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})

get the local implicit function evaluation function. This function is called with local vector containing the local vector information PLUS ghost point information. It should compute a result for all local elements and DM will automatically accumulate the overlapping values.

Logically Collective

Input Parameter:

  • dm - DM to associate callback with

Output Parameters:

  • func - local function evaluation
  • ctx - context for function evaluation

Calling sequence of func:

  • dm - the DM
  • t - the current time
  • u - the current solution
  • udot - the derivative of u
  • F - output, the computed implicit function
  • ctx - the application context for the function

Level: beginner

See also: DM, DMTSSetIFunctionLocal(), DMTSSetIFunction(), DMTSSetIJacobianLocal()

External Links

source
PETSc.LibPETSc.DMTSGetIJacobian — Method
func::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMTSGetIJacobian(petsclib::PetscLibType, dm::AbstractPetscDM)

get TS Jacobian evaluation function from a DMTS

Not Collective

Input Parameter:

  • dm - DM to be used with TS

Output Parameters:

  • func - Jacobian evaluation function, for calling sequence see TSIJacobianFn
  • ctx - context for residual evaluation

Level: developer

See also: DMTS, DM, TS, DMTSSetIJacobian(), TSIJacobianFn

External Links

source
PETSc.LibPETSc.DMTSGetIJacobianLocal — Method
DMTSGetIJacobianLocal(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})

get a local Jacobian evaluation function

Logically Collective

Input Parameter:

  • dm - DM to associate callback with

Output Parameters:

  • func - local Jacobian evaluation
  • ctx - optional context for local Jacobian evaluation

Calling sequence of func:

  • dm - the DM
  • t - the current time
  • u - the current solution
  • udot - the derivative of u
  • shift - the shift factoring arising from the implicit time-step
  • J - output, the Jacobian
  • Jpre - output, matrix from which to compute the preconditioner for J, often the same as J
  • ctx - the application context for the function

Level: beginner

See also: DM, DMTSSetIJacobianLocal(), DMTSSetIFunctionLocal(), DMTSSetIJacobian(), DMTSSetIFunction()

External Links

source
PETSc.LibPETSc.DMTSGetRHSFunction — Method
func::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMTSGetRHSFunction(petsclib::PetscLibType, dm::AbstractPetscDM)

get TS explicit residual evaluation function from a DMTS

Not Collective

Input Parameter:

  • dm - DM to be used with TS

Output Parameters:

  • func - residual evaluation function, for calling sequence see TSRHSFunctionFn
  • ctx - context for residual evaluation

Level: developer

See also: DMTS, DM, TS, TSRHSFunctionFn, TSGetRHSFunction()

External Links

source
PETSc.LibPETSc.DMTSGetRHSFunctionLocal — Method
DMTSGetRHSFunctionLocal(petsclib::PetscLibType, dm::AbstractPetscDM, noname::Ptr{Cvoid})

get a local rhs function evaluation function. This function is called with local vector containing the local vector information PLUS ghost point information. It should compute a result for all local elements and DM will automatically accumulate the overlapping values.

Logically Collective

Input Parameter:

  • dm - DM to associate callback with

Output Parameters:

  • func - local function evaluation
  • ctx - context for function evaluation

Calling sequence of func:

  • dm - the DM
  • t - the current time
  • u - the current solution
  • udot - output, the evaluated right hand side
  • ctx - the application context for the function

Level: beginner

See also: DM, DMTSSetRHSFunctionLocal(), DMTSSetRHSFunction(), DMTSSetIFunction(), DMTSSetIJacobianLocal()

External Links

source
PETSc.LibPETSc.DMTSGetRHSJacobian — Method
func::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMTSGetRHSJacobian(petsclib::PetscLibType, dm::AbstractPetscDM)

get TS Jacobian evaluation function from a DMTS

Not Collective

Input Parameter:

  • dm - DM to be used with TS

Output Parameters:

  • func - Jacobian evaluation function, for calling sequence see TSRHSJacobianFn
  • ctx - context for residual evaluation

Level: developer

See also: DMTS, DM, TS, DMTSSetRHSJacobian(), TSRHSJacobianFn

External Links

source
PETSc.LibPETSc.DMTSGetSolutionFunction — Method
func::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMTSGetSolutionFunction(petsclib::PetscLibType, dm::AbstractPetscDM)

gets the TS solution evaluation function from a DMTS

Not Collective

Input Parameter:

  • dm - DM to be used with TS

Output Parameters:

  • func - solution function evaluation function, for calling sequence see TSSolutionFn
  • ctx - context for solution evaluation

Level: developer

See also: DMTS, TS, DM, DMTSSetSolutionFunction(), TSSolutionFn

External Links

source
PETSc.LibPETSc.DMTSGetTransientVariable — Method
tvar::Ptr{Cvoid},ctx::Ptr{Cvoid} = DMTSGetTransientVariable(petsclib::PetscLibType, dm::AbstractPetscDM)

gets function to transform from state to transient variables set with DMTSSetTransientVariable() from a TSDM

Logically Collective

Input Parameter:

  • dm - DM to be used with TS

Output Parameters:

  • tvar - a function that transforms to transient variables, see TSTransientVariableFn for the calling sequence
  • ctx - a context for tvar

Level: developer

See also: DMTS, DM, DMTSSetTransientVariable(), DMTSGetIFunction(), DMTSGetIJacobian(), TSTransientVariableFn

External Links

source
PETSc.LibPETSc.DMTSSetBoundaryLocal — Method
DMTSSetBoundaryLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::external, ctx::Ptr{Cvoid})

set the function for essential boundary data for a local implicit function evaluation.

Logically Collective

Input Parameters:

  • dm - DM to associate callback with
  • func - local function evaluation
  • ctx - context for function evaluation

Calling sequence of func:

  • dm - the DM
  • t - the current time
  • u - the current solution
  • f - output, the computed right hand side function
  • ctx - the application context for the function

Level: intermediate

See also: DM, TS, DMTSSetIFunction(), DMTSSetIJacobianLocal()

External Links

source
PETSc.LibPETSc.DMTSSetForcingFunction — Method
DMTSSetForcingFunction(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set TS forcing function evaluation function into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • func - forcing function evaluation routine, for calling sequence see TSForcingFn
  • ctx - context for solution evaluation

Level: developer

See also: DMTS, DM, TS, TSForcingFn, TSSetForcingFunction(), DMTSGetForcingFunction()

External Links

source
PETSc.LibPETSc.DMTSSetI2Function — Method
DMTSSetI2Function(petsclib::PetscLibType, dm::AbstractPetscDM, fun::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set TS implicit function evaluation function for 2nd order systems into a TSDM

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • fun - function evaluation routine
  • ctx - context for residual evaluation

Level: developer

See also: DMTS, DM, TS, TSSetI2Function()

External Links

source
PETSc.LibPETSc.DMTSSetI2FunctionContextDestroy — Method
DMTSSetI2FunctionContextDestroy(petsclib::PetscLibType, dm::AbstractPetscDM, f::Ptr{Cvoid})

set TS implicit evaluation for 2nd order systems context destroy into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • f - implicit evaluation context destroy function, see PetscCtxDestroyFn for its calling sequence

Level: developer

See also: DMTS, TSSetI2FunctionContextDestroy(), DMTSSetI2Function(), TSSetI2Function()

External Links

source
PETSc.LibPETSc.DMTSSetI2Jacobian — Method
DMTSSetI2Jacobian(petsclib::PetscLibType, dm::AbstractPetscDM, jac::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set TS implicit Jacobian evaluation function for 2nd order systems from a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • jac - Jacobian evaluation routine
  • ctx - context for Jacobian evaluation

Level: developer

See also: DMTS, DM, TS, TSI2JacobianFn, TSSetI2Jacobian()

External Links

source
PETSc.LibPETSc.DMTSSetI2JacobianContextDestroy — Method
DMTSSetI2JacobianContextDestroy(petsclib::PetscLibType, dm::AbstractPetscDM, f::Ptr{Cvoid})

set TS implicit Jacobian evaluation for 2nd order systems context destroy function into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • f - implicit Jacobian evaluation context destroy function, see PetscCtxDestroyFn for its calling sequence

Level: developer

See also: DMTS, DM, TS, TSSetI2JacobianContextDestroy(), DMTSSetI2Jacobian(), TSSetI2Jacobian()

External Links

source
PETSc.LibPETSc.DMTSSetIFunction — Method
DMTSSetIFunction(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set TS implicit function evaluation function into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • func - function evaluating f(t,u,u_t)
  • ctx - context for residual evaluation

Level: developer

See also: DMTS, TS, DM, TSIFunctionFn

External Links

source
PETSc.LibPETSc.DMTSSetIFunctionContextDestroy — Method
DMTSSetIFunctionContextDestroy(petsclib::PetscLibType, dm::AbstractPetscDM, f::Ptr{Cvoid})

set TS implicit evaluation context destroy function into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • f - implicit evaluation context destroy function, see PetscCtxDestroyFn for its calling sequence

Level: developer

See also: DMTS, DM, TS, DMTSSetIFunction(), TSSetIFunction(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.DMTSSetIFunctionLocal — Method
DMTSSetIFunctionLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::external, ctx::Ptr{Cvoid})

set a local implicit function evaluation function. This function is called with local vector containing the local vector information PLUS ghost point information. It should compute a result for all local elements and DM will automatically accumulate the overlapping values.

Logically Collective

Input Parameters:

  • dm - DM to associate callback with
  • func - local function evaluation
  • ctx - context for function evaluation

Calling sequence of func:

  • dm - the DM
  • t - the current time
  • u - the current solution
  • udot - the derivative of u
  • F - output, the computed implicit function
  • ctx - the application context for the function

Level: beginner

See also: DM, DMTSGetIFunctionLocal(), DMTSSetIFunction(), DMTSSetIJacobianLocal()

External Links

source
PETSc.LibPETSc.DMTSSetIFunctionSerialize — Method
DMTSSetIFunctionSerialize(petsclib::PetscLibType, dm::AbstractPetscDM, view::external, load::external)

sets functions used to view and load a TSIFunctionFn context

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • view - viewer function
  • load - loading function

Level: developer

See also: DMTS, DM, TS

External Links

source
PETSc.LibPETSc.DMTSSetIJacobian — Method
DMTSSetIJacobian(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set TS Jacobian evaluation function into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • func - Jacobian evaluation routine, see TSIJacobianFn for the calling sequence
  • ctx - context for residual evaluation

Level: developer

See also: DMTS, TS, DM, TSIJacobianFn, DMTSGetIJacobian(), TSSetIJacobian()

External Links

source
PETSc.LibPETSc.DMTSSetIJacobianContextDestroy — Method
DMTSSetIJacobianContextDestroy(petsclib::PetscLibType, dm::AbstractPetscDM, f::Ptr{Cvoid})

set TS Jacobian evaluation context destroy function into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • f - Jacobian evaluation context destroy function, see PetscCtxDestroyFn for its calling sequence

Level: developer

See also: DMTS, TSSetIJacobianContextDestroy(), TSSetI2JacobianContextDestroy(), DMTSSetIJacobian(), TSSetIJacobian()

External Links

source
PETSc.LibPETSc.DMTSSetIJacobianLocal — Method
DMTSSetIJacobianLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::external, ctx::Ptr{Cvoid})

set a local Jacobian evaluation function

Logically Collective

Input Parameters:

  • dm - DM to associate callback with
  • func - local Jacobian evaluation
  • ctx - optional context for local Jacobian evaluation

Calling sequence of func:

  • dm - the DM
  • t - the current time
  • u - the current solution
  • udot - the derivative of u
  • shift - the shift factoring arising from the implicit time-step
  • J - output, the Jacobian
  • Jpre - output, matrix from which to compute the preconditioner for J, often the same as J
  • ctx - the application context for the function

Level: beginner

See also: DM, DMTSGetIJacobianLocal(), DMTSSetIFunctionLocal(), DMTSSetIJacobian(), DMTSSetIFunction()

External Links

source
PETSc.LibPETSc.DMTSSetIJacobianSerialize — Method
DMTSSetIJacobianSerialize(petsclib::PetscLibType, dm::AbstractPetscDM, view::external, load::external)

sets functions used to view and load a TSIJacobianFn context

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • view - viewer function
  • load - loading function

Level: developer

See also: DMTS, DM, TS

External Links

source
PETSc.LibPETSc.DMTSSetRHSFunction — Method
DMTSSetRHSFunction(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set TS explicit residual evaluation function into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • func - RHS function evaluation routine, see TSRHSFunctionFn for the calling sequence
  • ctx - context for residual evaluation

Level: developer

See also: DMTS, DM, TS, TSRHSFunctionFn

External Links

source
PETSc.LibPETSc.DMTSSetRHSFunctionContextDestroy — Method
DMTSSetRHSFunctionContextDestroy(petsclib::PetscLibType, dm::AbstractPetscDM, f::Ptr{Cvoid})

set TS explicit residual evaluation context destroy function into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • f - explicit evaluation context destroy function, see PetscCtxDestroyFn for its calling sequence

Level: developer

See also: DMTS, TSSetRHSFunctionContextDestroy(), DMTSSetRHSFunction(), TSSetRHSFunction()

External Links

source
PETSc.LibPETSc.DMTSSetRHSFunctionLocal — Method
DMTSSetRHSFunctionLocal(petsclib::PetscLibType, dm::AbstractPetscDM, func::external, ctx::Ptr{Cvoid})

set a local rhs function evaluation function. This function is called with local vector containing the local vector information PLUS ghost point information. It should compute a result for all local elements and DM will automatically accumulate the overlapping values.

Logically Collective

Input Parameters:

  • dm - DM to associate callback with
  • func - local function evaluation
  • ctx - context for function evaluation

Calling sequence of func:

  • dm - the DM
  • t - the current time
  • u - the current solution
  • f - output, the evaluated right hand side
  • ctx - the application context for the function

Level: beginner

See also: DM, DMTSGetRHSFunctionLocal(), DMTSSetRHSFunction(), DMTSSetIFunction(), DMTSSetIJacobianLocal()

External Links

source
PETSc.LibPETSc.DMTSSetRHSJacobian — Method
DMTSSetRHSJacobian(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set TS Jacobian evaluation function into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • func - Jacobian evaluation routine, for calling sequence see TSIJacobianFn
  • ctx - context for residual evaluation

Level: developer

See also: DMTS, TSRHSJacobianFn, DMTSGetRHSJacobian(), TSSetRHSJacobian()

External Links

source
PETSc.LibPETSc.DMTSSetRHSJacobianContextDestroy — Method
DMTSSetRHSJacobianContextDestroy(petsclib::PetscLibType, dm::AbstractPetscDM, f::Ptr{Cvoid})

set TS Jacobian evaluation context destroy function from a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • f - Jacobian evaluation context destroy function, see PetscCtxDestroyFn for its calling sequence

Level: developer

See also: DMTS, TS, TSSetRHSJacobianContextDestroy(), DMTSSetRHSJacobian(), TSSetRHSJacobian()

External Links

source
PETSc.LibPETSc.DMTSSetSolutionFunction — Method
DMTSSetSolutionFunction(petsclib::PetscLibType, dm::AbstractPetscDM, func::Ptr{Cvoid}, ctx::Ptr{Cvoid})

set TS solution evaluation function into a DMTS

Not Collective

Input Parameters:

  • dm - DM to be used with TS
  • func - solution function evaluation routine, for calling sequence see TSSolutionFn
  • ctx - context for solution evaluation

Level: developer

See also: DMTS, DM, TS, DMTSGetSolutionFunction(), TSSolutionFn

External Links

source
PETSc.LibPETSc.DMTSSetTransientVariable — Method
DMTSSetTransientVariable(petsclib::PetscLibType, dm::AbstractPetscDM, tvar::Ptr{Cvoid}, ctx::Ptr{Cvoid})

sets function to transform from state to transient variables into a DMTS

Logically Collective

Input Parameters:

  • dm - DM to be used with TS
  • tvar - a function that transforms to transient variables, see TSTransientVariableFn for the calling sequence
  • ctx - a context for tvar

Level: developer

See also: DMTS, TS, TSBDF, TSSetTransientVariable(), DMTSGetTransientVariable(), DMTSSetIFunction(), DMTSSetIJacobian(), TSTransientVariableFn

External Links

source
PETSc.LibPETSc.DMUseTensorOrder — Method
DMUseTensorOrder(petsclib::PetscLibType, dm::AbstractPetscDM, tensor::PetscBool)

Use a tensor product closure ordering for the default section

Input Parameters:

  • dm - The DM
  • tensor - Flag for tensor order

Level: developer

See also: DMPlexSetClosurePermutationTensor(), PetscSectionResetClosurePermutation()

External Links

source
PETSc.LibPETSc.DMView — Method
DMView(petsclib::PetscLibType, dm::AbstractPetscDM, v::PetscViewer)

Views a DM. Depending on the PetscViewer and its PetscViewerFormat it may print some ASCII information about the DM to the screen or a file or save the DM in a binary file to be loaded later or create a visualization of the DM

Collective

Input Parameters:

  • dm - the DM object to view
  • v - the viewer

Options Database Keys:

  • -view_pyvista_warp f - Warps the mesh by the active scalar with factor f
  • -view_pyvista_clip xl,xu,yl,yu,zl,zu - Defines the clipping box
  • -dm_view_draw_line_color color - Specify the X-window color for cell borders
  • -dm_view_draw_cell_color color - Specify the X-window color for cells
  • -dm_view_draw_affine (true|false) - Flag to ignore high-order edges

Level: beginner

See also: DM, PetscViewer, PetscViewerFormat, PetscViewerSetFormat(), DMDestroy(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMLoad(), PetscObjectSetName()

External Links

source
PETSc.LibPETSc.DMViewFromOptions — Method
DMViewFromOptions(petsclib::PetscLibType, dm::AbstractPetscDM, obj, name::String)

View a DM in a particular way based on a request in the options database

Collective

Input Parameters:

  • dm - the DM object
  • obj - optional object that provides the prefix for the options database (if NULL then the prefix in obj is used)
  • name - option string that is used to activate viewing

Options Database Key:

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

Level: intermediate

See also: DM, DMView(), PetscObjectViewFromOptions(), DMCreate()

External Links

source
PETSc.LibPETSc.DMAdaptorAdapt — Method
adm::PetscDM,ax::PetscVec = DMAdaptorAdapt(petsclib::PetscLibType, adaptor::DMAdaptor, x::AbstractPetscVec, strategy::DMAdaptationStrategy)

Creates a new DM that is adapted to the problem

Not Collective

Input Parameters:

  • adaptor - The DMAdaptor object
  • x - The global approximate solution
  • strategy - The adaptation strategy, see DMAdaptationStrategy

Output Parameters:

  • adm - The adapted DM
  • ax - The adapted solution

Options Database Keys:

  • -snes_adapt (initial|sequential|multigrid) - adaption strategy, see DMAdaptationStrategy
  • -adapt_gradient_view - View the Clement interpolant of the solution gradient
  • -adapt_hessian_view - View the Clement interpolant of the solution Hessian
  • -adapt_metric_view - View the metric tensor for adaptive mesh refinement

Level: intermediate

See also: DMAdaptor, DMAdaptationStrategy, DMAdaptorSetSolver(), DMAdaptorCreate()

External Links

source
PETSc.LibPETSc.DMAdaptorCreate — Method
adaptor::DMAdaptor = DMAdaptorCreate(petsclib::PetscLibType, comm::MPI_Comm)

Create a DMAdaptor object. Its purpose is to construct a adaptation DMLabel or metric Vec that can be used to modify the DM.

Collective

Input Parameter:

  • comm - The communicator for the DMAdaptor object

Output Parameter:

  • adaptor - The DMAdaptor object

Level: beginner

See also: DM, DMAdaptor, DMAdaptorDestroy(), DMAdaptorAdapt(), PetscConvEst, PetscConvEstCreate()

External Links

source
PETSc.LibPETSc.DMAdaptorDestroy — Method
DMAdaptorDestroy(petsclib::PetscLibType, adaptor::Union{DMAdaptor, Ref{DMAdaptor}})

Destroys a DMAdaptor object

Collective

Input Parameter:

  • adaptor - The DMAdaptor object

Level: beginner

See also: DM, DMAdaptor, DMAdaptorCreate(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorGetCriterion — Method
criterion::DMAdaptationCriterion = DMAdaptorGetCriterion(petsclib::PetscLibType, adaptor::DMAdaptor)

Get the adaptation criterion

Not Collective

Input Parameter:

  • adaptor - the DMAdaptor

Output Parameter:

  • criterion - the criterion for adaptation

Level: advanced

See also: DMAdaptor, DMAdaptorSetCriterion(), DMAdaptationCriterion

External Links

source
PETSc.LibPETSc.DMAdaptorGetMixedSetupFunction — Method
DMAdaptorGetMixedSetupFunction(petsclib::PetscLibType, adaptor::DMAdaptor, noname::Ptr{Cvoid})

Get the function setting up the mixed problem, if it exists

Not Collective

Input Parameter:

  • adaptor - the DMAdaptor

Output Parameter:

  • setupFunc - the function setting up the mixed problem, or NULL

Level: advanced

See also: DMAdaptor, DMAdaptorSetMixedSetupFunction(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorGetSequenceLength — Method
num::PetscInt = DMAdaptorGetSequenceLength(petsclib::PetscLibType, adaptor::DMAdaptor)

Gets the number of sequential adaptations used by an adapter

Not Collective

Input Parameter:

  • adaptor - The DMAdaptor object

Output Parameter:

  • num - The number of adaptations

Level: intermediate

See also: DMAdaptor, DMAdaptorSetSequenceLength(), DMAdaptorCreate(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorGetSolver — Method
snes::SNES = DMAdaptorGetSolver(petsclib::PetscLibType, adaptor::DMAdaptor)

Gets the solver used to produce discrete solutions

Not Collective

Input Parameter:

  • adaptor - The DMAdaptor object

Output Parameter:

  • snes - The solver

Level: intermediate

See also: DM, DMAdaptor, DMAdaptorSetSolver(), DMAdaptorCreate(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorGetTransferFunction — Method
DMAdaptorGetTransferFunction(petsclib::PetscLibType, adaptor::DMAdaptor, noname::Ptr{Cvoid})

Get the callback used by a DMAdaptor to transfer a solution vector from an old DM to the adapted DM

Not Collective

Input Parameter:

  • adaptor - the DMAdaptor object

Output Parameter:

  • tfunc - pointer to the transfer callback

Calling sequence of tfunc:

  • adaptor - the DMAdaptor object
  • dm - the current DM
  • xin - the current solution
  • newdm - the adapted DM
  • xout - the transferred solution on newdm
  • ctx - application context, set with DMSetApplicationContext()

Level: developer

See also: DMAdaptor, DMAdaptorSetTransferFunction(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorGetType — Method
type::String = DMAdaptorGetType(petsclib::PetscLibType, adaptor::DMAdaptor)

Gets the type name (as a string) from the adaptor.

Not Collective

Input Parameter:

  • adaptor - The DMAdaptor

Output Parameter:

  • type - The DMAdaptorType name

Level: intermediate

See also: DM, DMPLEX, DMAdaptor, DMAdaptorType, DMAdaptorSetType(), DMAdaptorCreate()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitor — Method
DMAdaptorMonitor(petsclib::PetscLibType, adaptor::DMAdaptor, it::PetscInt, odm::AbstractPetscDM, adm::AbstractPetscDM, Nf::PetscInt, enorms::Vector{PetscReal}, error::AbstractPetscVec)

runs the user provided monitor routines, if they exist

Collective

Input Parameters:

  • adaptor - the DMAdaptor
  • it - iteration number
  • odm - the original DM
  • adm - the adapted DM
  • Nf - the number of fields
  • enorms - the 2-norm error values for each field
  • error - Vec of cellwise errors

Level: developer

See also: DMAdaptorMonitorSet()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorCancel — Method
DMAdaptorMonitorCancel(petsclib::PetscLibType, adaptor::DMAdaptor)

Clears all monitors for a DMAdaptor object.

Logically Collective

Input Parameter:

  • adaptor - the DMAdaptor

Options Database Key:

  • -dm_adaptor_monitor_cancel - Cancels all monitors that have been hardwired into a code by calls to DMAdaptorMonitorSet(), but does not cancel those set via the options database.

Level: intermediate

See also: DMAdaptorMonitorError(), DMAdaptorMonitorSet(), DMAdaptor

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorError — Method
DMAdaptorMonitorError(petsclib::PetscLibType, adaptor::DMAdaptor, n::PetscInt, odm::AbstractPetscDM, adm::AbstractPetscDM, Nf::PetscInt, enorms::Vector{PetscReal}, error::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})

Prints the error norm at each iteration of an adaptation loop.

Collective

Input Parameters:

  • adaptor - the DMAdaptor
  • n - iteration number
  • odm - the original DM
  • adm - the adapted DM
  • Nf - number of fields
  • enorms - 2-norm error values for each field (may be estimated).
  • error - Vec of cellwise errors
  • vf - The viewer context

Options Database Key:

  • -adaptor_monitor_error - Activates DMAdaptorMonitorError()

Level: intermediate

See also: DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDraw(), DMAdaptorMonitorErrorDrawLG()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorErrorDraw — Method
DMAdaptorMonitorErrorDraw(petsclib::PetscLibType, adaptor::DMAdaptor, n::PetscInt, odm::AbstractPetscDM, adm::AbstractPetscDM, Nf::PetscInt, enorms::Vector{PetscReal}, error::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})

Plots the error at each iteration of an iterative solver.

Collective

Input Parameters:

  • adaptor - the DMAdaptor
  • n - iteration number
  • odm - the original DM
  • adm - the adapted DM
  • Nf - number of fields
  • enorms - 2-norm error values for each field (may be estimated).
  • error - Vec of cellwise errors
  • vf - The viewer context

Options Database Key:

  • -adaptor_monitor_error draw - Activates DMAdaptorMonitorErrorDraw()

Level: intermediate

See also: PETSCVIEWERDRAW, DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDrawLG()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorErrorDrawLG — Method
DMAdaptorMonitorErrorDrawLG(petsclib::PetscLibType, adaptor::DMAdaptor, n::PetscInt, odm::AbstractPetscDM, adm::AbstractPetscDM, Nf::PetscInt, enorms::Vector{PetscReal}, error::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})

Plots the error norm at each iteration of an adaptive loop.

Collective

Input Parameters:

  • adaptor - the DMAdaptor
  • n - iteration number
  • odm - the original DM
  • adm - the adapted DM
  • Nf - number of fields
  • enorms - 2-norm error values for each field (may be estimated).
  • error - Vec of cellwise errors
  • vf - The viewer context, obtained via DMAdaptorMonitorErrorDrawLGCreate()

Options Database Key:

  • -adaptor_error draw::draw_lg - Activates DMAdaptorMonitorErrorDrawLG()

Level: intermediate

See also: PETSCVIEWERDRAW, DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDraw(), DMAdaptorMonitorError(), DMAdaptorMonitorTrueResidualDrawLGCreate()

External Links

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

Creates the context for the error plotter DMAdaptorMonitorErrorDrawLG()

Collective

Input Parameters:

  • viewer - The PetscViewer
  • format - The viewer format
  • ctx - An optional application context

Output Parameter:

  • vf - The viewer context

Level: intermediate

See also: PETSCVIEWERDRAW, PetscViewerMonitorGLSetUp(), DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDrawLG()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorRegister — Method
DMAdaptorMonitorRegister(petsclib::PetscLibType, name::String, vtype::String, format::PetscViewerFormat, monitor::external, create::external, destroy::external)

Registers a mesh adaptation monitor routine that may be accessed with DMAdaptorMonitorSetFromOptions()

Not Collective

Input Parameters:

  • name - name of a new monitor routine
  • vtype - A PetscViewerType for the output
  • format - A PetscViewerFormat for the output
  • monitor - Monitor routine
  • create - Creation routine, or NULL
  • destroy - Destruction routine, or NULL

Level: advanced

See also: DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorRegisterAll(), DMAdaptorMonitorSetFromOptions()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorSet — Method
DMAdaptorMonitorSet(petsclib::PetscLibType, adaptor::DMAdaptor, monitor::external, ctx::Ptr{Cvoid}, monitordestroy::Ptr{Cvoid})

Sets an ADDITIONAL function to be called at every iteration to monitor the error etc.

Logically Collective

Input Parameters:

  • adaptor - the DMAdaptor
  • monitor - pointer to function (if this is NULL, it turns off monitoring
  • ctx - [optional] context for private data for the monitor routine (use NULL if no context is needed)
  • monitordestroy - [optional] routine that frees monitor context (may be NULL), see PetscCtxDestroyFn for its calling sequence

Calling sequence of monitor:

  • adaptor - the DMAdaptor
  • it - iteration number
  • odm - the original DM
  • adm - the adapted DM
  • Nf - number of fields
  • enorms - (estimated) 2-norm of the error for each field
  • error - Vec of cellwise errors
  • ctx - optional monitoring context, as set by DMAdaptorMonitorSet()

Options Database Keys:

  • -adaptor_monitor_size - sets DMAdaptorMonitorSize()
  • -adaptor_monitor_error - sets DMAdaptorMonitorError()
  • -adaptor_monitor_error draw - sets DMAdaptorMonitorErrorDraw() and plots error
  • -adaptor_monitor_error draw::draw_lg - sets DMAdaptorMonitorErrorDrawLG() and plots error
  • -dm_adaptor_monitor_cancel - Cancels all monitors that have been hardwired into a code by calls to DMAdaptorMonitorSet(), but does not cancel those set via the options database.

Level: beginner

See also: DMAdaptorMonitorError(), DMAdaptor, PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorSetFromOptions — Method
DMAdaptorMonitorSetFromOptions(petsclib::PetscLibType, adaptor::DMAdaptor, opt::String, name::String, ctx::Ptr{Cvoid})

Sets a monitor function and viewer appropriate for the type indicated by the user in the options database

Collective

Input Parameters:

  • adaptor - DMadaptor object you wish to monitor
  • opt - the command line option for this monitor
  • name - the monitor type one is seeking
  • ctx - An optional application context for the monitor, or NULL

Level: developer

See also: DMAdaptorMonitorRegister(), DMAdaptorMonitorSet(), PetscOptionsGetViewer()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorSize — Method
DMAdaptorMonitorSize(petsclib::PetscLibType, adaptor::DMAdaptor, n::PetscInt, odm::AbstractPetscDM, adm::AbstractPetscDM, Nf::PetscInt, enorms::Vector{PetscReal}, error::AbstractPetscVec, vf::Vector{PetscViewerAndFormat})

Prints the mesh sizes at each iteration of an adaptation loop.

Collective

Input Parameters:

  • adaptor - the DMAdaptor
  • n - iteration number
  • odm - the original DM
  • adm - the adapted DM
  • Nf - number of fields
  • enorms - 2-norm error values for each field (may be estimated).
  • error - Vec of cellwise errors
  • vf - The viewer context

Options Database Key:

  • -adaptor_monitor_size - Activates DMAdaptorMonitorSize()

Level: intermediate

See also: DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorError(), DMAdaptorMonitorErrorDraw(), DMAdaptorMonitorErrorDrawLG()

External Links

source
PETSc.LibPETSc.DMAdaptorRegister — Method
DMAdaptorRegister(petsclib::PetscLibType, name::String, noname::Ptr{Cvoid})

Adds a new adaptor component implementation

Not Collective

Input Parameters:

  • name - The name of a new user-defined creation routine
  • create_func - The creation routine

See also: DM, DMPLEX, DMAdaptor, DMAdaptorRegisterAll(), DMAdaptorRegisterDestroy()

External Links

source
PETSc.LibPETSc.DMAdaptorSetCriterion — Method
DMAdaptorSetCriterion(petsclib::PetscLibType, adaptor::DMAdaptor, criterion::DMAdaptationCriterion)

Set the adaptation criterion

Not Collective

Input Parameters:

  • adaptor - the DMAdaptor
  • criterion - the adaptation criterion

Level: advanced

See also: DMAdaptor, DMAdaptorGetCriterion(), DMAdaptationCriterion

External Links

source
PETSc.LibPETSc.DMAdaptorSetFromOptions — Method
DMAdaptorSetFromOptions(petsclib::PetscLibType, adaptor::DMAdaptor)

Sets properties of a DMAdaptor object from values in the options database

Collective

Input Parameter:

  • adaptor - The DMAdaptor object

Options Database Keys:

  • -adaptor_monitor_size - Monitor the mesh size
  • -adaptor_monitor_error - Monitor the solution error
  • -adaptor_sequence_num num - Number of adaptations to generate an optimal grid
  • -adaptor_target_num num - Set the target number of vertices N_adapt, -1 for automatic determination
  • -adaptor_refinement_factor r - Set r such that Nadapt = r^dim Norig
  • -adaptor_mixed_setup_function func - Set the function func that sets up the mixed problem

Level: beginner

See also: DM, DMAdaptor, DMAdaptorCreate(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorSetMixedSetupFunction — Method
DMAdaptorSetMixedSetupFunction(petsclib::PetscLibType, adaptor::DMAdaptor, setupFunc::external)

Set the function setting up the mixed problem

Not Collective

Input Parameters:

  • adaptor - the DMAdaptor
  • setupFunc - the function setting up the mixed problem

Calling sequence of setupFunc:

  • adaptor - the DMAdaptor
  • dm - the DM

Level: advanced

See also: DMAdaptor, DMAdaptorGetMixedSetupFunction(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorSetOptionsPrefix — Method
DMAdaptorSetOptionsPrefix(petsclib::PetscLibType, adaptor::DMAdaptor, prefix::String)

Sets the prefix used for searching for all DMAdaptor options in the database.

Logically Collective

Input Parameters:

  • adaptor - the DMAdaptor
  • prefix - the prefix to prepend to all option names

Level: advanced

See also: DMAdaptor, SNESSetOptionsPrefix(), DMAdaptorSetFromOptions()

External Links

source
PETSc.LibPETSc.DMAdaptorSetSequenceLength — Method
DMAdaptorSetSequenceLength(petsclib::PetscLibType, adaptor::DMAdaptor, num::PetscInt)

Sets the number of sequential adaptations

Not Collective

Input Parameters:

  • adaptor - The DMAdaptor object
  • num - The number of adaptations

Level: intermediate

See also: DMAdaptorGetSequenceLength(), DMAdaptorCreate(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorSetSolver — Method
DMAdaptorSetSolver(petsclib::PetscLibType, adaptor::DMAdaptor, snes::AbstractSNES)

Sets the solver used to produce discrete solutions

Not Collective

Input Parameters:

  • adaptor - The DMAdaptor object
  • snes - The solver, this MUST have an attached DM/PetscDS, so that the exact solution can be computed

Level: intermediate

See also: DMAdaptor, DMAdaptorGetSolver(), DMAdaptorCreate(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorSetTransferFunction — Method
DMAdaptorSetTransferFunction(petsclib::PetscLibType, adaptor::DMAdaptor, tfunc::external)

Set the callback used by a DMAdaptor to transfer a solution vector from an old DM to the adapted DM

Logically Collective

Input Parameters:

  • adaptor - the DMAdaptor object
  • tfunc - the transfer callback

Calling sequence of tfunc:

  • adaptor - the DMAdaptor object
  • dm - the current DM
  • xin - the current solution
  • newdm - the adapted DM
  • xout - the transferred solution on newdm
  • ctx - application context, set with DMSetApplicationContext()

Level: developer

See also: DMAdaptor, DMAdaptorGetTransferFunction(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorSetType — Method
DMAdaptorSetType(petsclib::PetscLibType, adaptor::DMAdaptor, method::String)

Sets the particular implementation for a adaptor.

Collective

Input Parameters:

  • adaptor - The DMAdaptor
  • method - The name of the adaptor type

Options Database Key:

  • -adaptor_type type - Sets the adaptor type; see DMAdaptorType

Level: intermediate

See also: DM, DMPLEX, DMAdaptor, DMAdaptorType, DMAdaptorGetType(), DMAdaptorCreate()

External Links

source
PETSc.LibPETSc.DMAdaptorSetUp — Method
DMAdaptorSetUp(petsclib::PetscLibType, adaptor::DMAdaptor)

After the solver is specified, creates data structures for controlling adaptivity

Collective

Input Parameter:

  • adaptor - The DMAdaptor object

Level: beginner

See also: DMAdaptor, DMAdaptorCreate(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorView — Method
DMAdaptorView(petsclib::PetscLibType, adaptor::DMAdaptor, viewer::PetscViewer)

Views a DMAdaptor object

Collective

Input Parameters:

  • adaptor - The DMAdaptor object
  • viewer - The PetscViewer object

Level: beginner

See also: DM, DMAdaptor, DMAdaptorCreate(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMFieldCreateDA — Method
field::DMField = DMFieldCreateDA(petsclib::PetscLibType, dm::AbstractPetscDM, nc::PetscInt, cornerValues::Vector{PetscScalar})

Create a DMField of type DMFIELDDA that represents a multilinear field on a DMDA given by its values at the corners of the reference element.

Collective

Input Parameters:

  • dm - the DMDA on which the field lives
  • nc - the number of components of the field
  • cornerValues - array of length nc * (1 << dim) holding the field values at each corner of the reference element, ordered by lexicographic corner index

Output Parameter:

  • field - the newly created DMField

Level: intermediate

See also: DMField, DMFIELDDA, DMDA, DMFieldCreate(), DMFieldCreateDS(), DMFieldCreateShell()

External Links

source
PETSc.LibPETSc.DMFieldCreateDS — Method
field::DMField = DMFieldCreateDS(petsclib::PetscLibType, dm::AbstractPetscDM, fieldNum::PetscInt, vec::AbstractPetscVec)

Create a DMField of type DMFIELDDS for a PetscDS field on a DM.

Collective

Input Parameters:

  • dm - the DM carrying the discretization
  • fieldNum - the field number within the DM's PetscDS
  • vec - local vector holding the coefficients

Output Parameter:

  • field - the newly created DMField

Level: intermediate

See also: DMField, DMFIELDDS, DMFieldCreateDSWithDG(), DMFieldCreate(), PetscDS

External Links

source
PETSc.LibPETSc.DMFieldCreateDSWithDG — Method
field::DMField = DMFieldCreateDSWithDG(petsclib::PetscLibType, dm::AbstractPetscDM, dmDG::AbstractPetscDM, fieldNum::PetscInt, vec::AbstractPetscVec, vecDG::AbstractPetscVec)

Create a DMField of type DMFIELDDS for a PetscDS field, optionally paired with a matching discontinuous-Galerkin representation on a companion DM.

Collective

Input Parameters:

  • dm - the DM carrying the primary (continuous) discretization
  • dmDG - optional DM carrying a matching discontinuous-Galerkin discretization, or NULL
  • fieldNum - the field number within the DM's PetscDS
  • vec - local vector holding the coefficients on dm
  • vecDG - local vector holding the coefficients on dmDG, or NULL if dmDG is NULL

Output Parameter:

  • field - the newly created DMField

Level: intermediate

See also: DMField, DMFIELDDS, DMFieldCreateDS(), DMFieldCreate(), PetscDS, PetscFE

External Links

source
PETSc.LibPETSc.DMFieldCreateDefaultFaceQuadrature — Method
quad::PetscQuadrature = DMFieldCreateDefaultFaceQuadrature(petsclib::PetscLibType, field::DMField, pointIS::AbstractIS)

Creates a quadrature sufficient to integrate the field on all faces of the selected cells via pullback onto the reference element

Not Collective

Input Parameters:

  • field - the DMField object
  • pointIS - the index set of points over which we wish to integrate the field over faces

Output Parameter:

  • quad - a PetscQuadrature object

Level: developer

See also: DMFieldCreateDefaultQuadrature(), DMField, PetscQuadrature, IS, DMFieldEvaluteFE(), DMFieldGetDegree()

External Links

source
PETSc.LibPETSc.DMFieldCreateDefaultQuadrature — Method
quad::PetscQuadrature = DMFieldCreateDefaultQuadrature(petsclib::PetscLibType, field::DMField, pointIS::AbstractIS)

Creates a quadrature sufficient to integrate the field on the selected points via pullback onto the reference element

Not Collective

Input Parameters:

  • field - the DMField object
  • pointIS - the index set of points over which we wish to integrate the field

Output Parameter:

  • quad - a PetscQuadrature object

Level: developer

See also: DMFieldCreateDefaultFaceQuadrature(), DMField, PetscQuadrature, IS, DMFieldEvaluteFE(), DMFieldGetDegree()

External Links

source
PETSc.LibPETSc.DMFieldCreateFEGeom — Method
geom::Ptr{PetscFEGeom} = DMFieldCreateFEGeom(petsclib::PetscLibType, field::DMField, pointIS::AbstractIS, quad::PetscQuadrature, mode::PetscFEGeomMode)

Compute and create the geometric factors of a coordinate field

Not Collective

Input Parameters:

  • field - the DMField object
  • pointIS - the index set of points over which we wish to integrate the field
  • quad - the quadrature points at which to evaluate the geometric factors
  • mode - Type of geometry data to store

Output Parameter:

  • geom - the geometric factors

Level: developer

See also: DMField, PetscQuadrature, IS, PetscFEGeom, DMFieldEvaluateFE(), DMFieldCreateDefaulteQuadrature(), DMFieldGetDegree()

External Links

source
PETSc.LibPETSc.DMFieldCreateShell — Method
field::DMField = DMFieldCreateShell(petsclib::PetscLibType, dm::AbstractPetscDM, numComponents::PetscInt, continuity::DMFieldContinuity, ctx::Ptr{Cvoid})

Create a DMFIELDSHELL, a DMField whose evaluation is implemented entirely by user-supplied callbacks.

Collective

Input Parameters:

  • dm - the DM on which the field lives
  • numComponents - the number of components of the field
  • continuity - the continuity of the field (e.g. DMFIELD_VERTEX)
  • ctx - optional application context returned by DMFieldShellGetContext()

Output Parameter:

  • field - the newly created DMField of type DMFIELDSHELL

Level: intermediate

See also: DMField, DMFIELDSHELL, DMFieldShellGetContext(), DMFieldShellSetEvaluate(), DMFieldShellSetEvaluateFE(), DMFieldShellSetEvaluateFV(), DMFieldShellSetDestroy()

External Links

source
PETSc.LibPETSc.DMFieldDestroy — Method
DMFieldDestroy(petsclib::PetscLibType, field::Union{DMField, Ref{DMField}})

destroy a DMField

Collective

Input Parameter:

  • field - address of DMField

Level: advanced

See also: DMField, DMFieldCreate()

External Links

source
PETSc.LibPETSc.DMFieldEvaluate — Method
B::Ptr{Cvoid},D::Ptr{Cvoid},H::Ptr{Cvoid} = DMFieldEvaluate(petsclib::PetscLibType, field::DMField, points::AbstractPetscVec, datatype::PetscDataType)

Evaluate the field and its derivatives on a set of points

Collective

Input Parameters:

  • field - The DMField object
  • points - The points at which to evaluate the field. Should have size d x n,

where d is the coordinate dimension of the manifold and n is the number of points

  • datatype - The PetscDataType of the output arrays: either PETSC_REAL or PETSC_SCALAR.

If the field is complex and datatype is PETSC_REAL, the real part of the field is returned.

Output Parameters:

  • B - pointer to data of size c * n * sizeof(datatype), where c is the number of components in the field.

If B is not NULL, the values of the field are written in this array, varying first by component, then by point.

  • D - pointer to data of size d * c * n * sizeof(datatype).

If D is not NULL, the values of the field's spatial derivatives are written in this array, varying first by the partial derivative component, then by field component, then by point.

  • H - pointer to data of size d * d * c * n * sizeof(datatype).

If H is not NULL, the values of the field's second spatial derivatives are written in this array, varying first by the second partial derivative component, then by field component, then by point.

Level: intermediate

See also: DMField, DMFieldGetDM(), DMFieldGetNumComponents(), DMFieldEvaluateFE(), DMFieldEvaluateFV(), PetscDataType

External Links

source
PETSc.LibPETSc.DMFieldEvaluateFE — Method
B::Ptr{Cvoid},D::Ptr{Cvoid},H::Ptr{Cvoid} = DMFieldEvaluateFE(petsclib::PetscLibType, field::DMField, cellIS::AbstractIS, points::PetscQuadrature, datatype::PetscDataType)

Evaluate the field and its derivatives on a set of points mapped from quadrature points on a reference point. The derivatives are taken with respect to the reference coordinates.

Not Collective

Input Parameters:

  • field - The DMField object
  • cellIS - Index set for cells on which to evaluate the field
  • points - The quadature containing the points in the reference cell at which to evaluate the field.
  • datatype - The PetscDataType of the output arrays: either PETSC_REAL or PETSC_SCALAR.

If the field is complex and datatype is PETSC_REAL, the real part of the field is returned.

Output Parameters:

  • B - pointer to data of size c * n * sizeof(datatype), where c is the number of components in the field.

If B is not NULL, the values of the field are written in this array, varying first by component, then by point.

  • D - pointer to data of size d * c * n * sizeof(datatype).

If D is not NULL, the values of the field's spatial derivatives are written in this array, varying first by the partial derivative component, then by field component, then by point.

  • H - pointer to data of size d * d * c * n * sizeof(datatype).

If H is not NULL, the values of the field's second spatial derivatives are written in this array, varying first by the second partial derivative component, then by field component, then by point.

Level: intermediate

See also: DMField, DM, DMFieldGetNumComponents(), DMFieldEvaluate(), DMFieldEvaluateFV()

External Links

source
PETSc.LibPETSc.DMFieldEvaluateFV — Method
B::Ptr{Cvoid},D::Ptr{Cvoid},H::Ptr{Cvoid} = DMFieldEvaluateFV(petsclib::PetscLibType, field::DMField, cellIS::AbstractIS, datatype::PetscDataType)

Evaluate the mean of a field and its finite volume derivatives on a set of points.

Not Collective

Input Parameters:

  • field - The DMField object
  • cellIS - Index set for cells on which to evaluate the field
  • datatype - The PetscDataType of the output arrays: either PETSC_REAL or PETSC_SCALAR.

If the field is complex and datatype is PETSC_REAL, the real part of the field is returned.

Output Parameters:

  • B - pointer to data of size c * n * sizeof(datatype), where c is the number of components in the field.

If B is not NULL, the values of the field are written in this array, varying first by component, then by point.

  • D - pointer to data of size d * c * n * sizeof(datatype).

If D is not NULL, the values of the field's spatial derivatives are written in this array, varying first by the partial derivative component, then by field component, then by point.

  • H - pointer to data of size d * d * c * n * sizeof(datatype).

If H is not NULL, the values of the field's second spatial derivatives are written in this array, varying first by the second partial derivative component, then by field component, then by point.

Level: intermediate

See also: DMField, IS, DMFieldGetNumComponents(), DMFieldEvaluate(), DMFieldEvaluateFE(), PetscDataType

External Links

source
PETSc.LibPETSc.DMFieldGetDM — Method
dm::PetscDM = DMFieldGetDM(petsclib::PetscLibType, field::DMField)

Returns the DM for the manifold over which the field is defined.

Not Collective

Input Parameter:

  • field - The DMField object

Output Parameter:

  • dm - The DM object

Level: intermediate

See also: DMField, DM, DMFieldEvaluate()

External Links

source
PETSc.LibPETSc.DMFieldGetDegree — Method
minDegree::PetscInt,maxDegree::PetscInt = DMFieldGetDegree(petsclib::PetscLibType, field::DMField, cellIS::AbstractIS)

Get the polynomial degree of a field when pulled back onto the reference element

Not Collective

Input Parameters:

  • field - the DMField object
  • cellIS - the index set of points over which we want know the invariance

Output Parameters:

  • minDegree - the degree of the largest polynomial space contained in the field on each element
  • maxDegree - the largest degree of the smallest polynomial space containing the field on any element

Level: intermediate

See also: DMField, IS, DMFieldEvaluateFE()

External Links

source
PETSc.LibPETSc.DMFieldGetNumComponents — Method
nc::PetscInt = DMFieldGetNumComponents(petsclib::PetscLibType, field::DMField)

Returns the number of components in the field

Not Collective

Input Parameter:

  • field - The DMField object

Output Parameter:

  • nc - The number of field components

Level: intermediate

See also: DMField, DMFieldEvaluate()

External Links

source
PETSc.LibPETSc.DMFieldGetType — Method
type::String = DMFieldGetType(petsclib::PetscLibType, field::DMField)

Gets the DMFieldType name (as a string) from the DMField.

Not Collective

Input Parameter:

  • field - The DMField context

Output Parameter:

  • type - The DMFieldType name

Level: advanced

See also: DMField, DMFieldSetType(), DMFieldType, PetscObjectTypeCompare(), PetscObjectTypeCompareAny()

External Links

source
PETSc.LibPETSc.DMFieldRegister — Method
DMFieldRegister(petsclib::PetscLibType, sname::String, fnc::external)

Adds an implementation of the DMField object.

Not collective, No Fortran Support

Input Parameters:

  • sname - name of a new user-defined implementation
  • function - routine to create method context

See also: DMField, DMFieldRegisterAll(), DMFieldRegisterDestroy()

External Links

source
PETSc.LibPETSc.DMFieldSetType — Method
DMFieldSetType(petsclib::PetscLibType, field::DMField, type::String)

set the DMField implementation

Collective

Input Parameters:

  • field - the DMField context
  • type - a known method, see DMFieldType

Level: advanced

See also: DMField, DMFieldGetType(), DMFieldType

External Links

source
PETSc.LibPETSc.DMFieldShellEvaluateFEDefault — Method
B::Ptr{Cvoid},D::Ptr{Cvoid},H::Ptr{Cvoid} = DMFieldShellEvaluateFEDefault(petsclib::PetscLibType, field::DMField, pointIS::AbstractIS, quad::PetscQuadrature, type::PetscDataType)

Default finite-element evaluation for a DMFIELDSHELL that maps the quadrature points to real space using the coordinate DMField and then calls DMFieldEvaluate().

Not Collective

Input Parameters:

  • field - the DMField of type DMFIELDSHELL
  • pointIS - the IS of mesh points at which to evaluate
  • quad - the reference-element quadrature
  • type - PETSC_SCALAR or PETSC_REAL

Output Parameters:

  • B - values at quadrature points, or NULL
  • D - derivatives at quadrature points, or NULL
  • H - Hessians at quadrature points, or NULL

Level: developer

See also: DMField, DMFIELDSHELL, DMFieldShellSetEvaluateFE(), DMFieldShellEvaluateFVDefault(), DMFieldEvaluate()

External Links

source
PETSc.LibPETSc.DMFieldShellEvaluateFVDefault — Method
B::Ptr{Cvoid},D::Ptr{Cvoid},H::Ptr{Cvoid} = DMFieldShellEvaluateFVDefault(petsclib::PetscLibType, field::DMField, pointIS::AbstractIS, type::PetscDataType)

Default finite-volume evaluation for a DMFIELDSHELL that samples at cell centroids using the coordinate DMField's default quadrature and calls DMFieldEvaluate().

Not Collective

Input Parameters:

  • field - the DMField of type DMFIELDSHELL
  • pointIS - the IS of mesh cells at which to evaluate
  • type - PETSC_SCALAR or PETSC_REAL

Output Parameters:

  • B - cell-averaged values, or NULL
  • D - cell-averaged derivatives, or NULL
  • H - cell-averaged Hessians, or NULL

Level: developer

See also: DMField, DMFIELDSHELL, DMFieldShellSetEvaluateFV(), DMFieldShellEvaluateFEDefault(), DMFieldEvaluate()

External Links

source
PETSc.LibPETSc.DMFieldShellGetContext — Method
ctx::Ptr{Cvoid} = DMFieldShellGetContext(petsclib::PetscLibType, field::DMField)

Retrieve the user-supplied context associated with a DMFIELDSHELL.

Not Collective

Input Parameter:

  • field - the DMField of type DMFIELDSHELL

Output Parameter:

  • ctx - the context pointer that was passed to DMFieldCreateShell()

Level: intermediate

See also: DMField, DMFIELDSHELL, DMFieldCreateShell()

External Links

source
PETSc.LibPETSc.DMFieldShellSetCreateDefaultQuadrature — Method
DMFieldShellSetCreateDefaultQuadrature(petsclib::PetscLibType, field::DMField, create::external)

Register the routine that supplies a default PetscQuadrature sufficient to integrate a DMFIELDSHELL exactly over a set of mesh points.

Logically Collective

Input Parameters:

  • field - the DMField of type DMFIELDSHELL
  • create - callback that returns a newly created PetscQuadrature for the given point IS

Calling sequence of create:

  • f - the DMField of type DMFIELDSHELL
  • is - the IS of mesh points over which the field will be integrated
  • quad - the newly created PetscQuadrature

Level: intermediate

See also: DMField, DMFIELDSHELL, DMFieldCreateShell(), DMFieldCreateDefaultQuadrature()

External Links

source
PETSc.LibPETSc.DMFieldShellSetDestroy — Method
DMFieldShellSetDestroy(petsclib::PetscLibType, field::DMField, destroy::external)

Register a destroy callback that will be invoked when a DMFIELDSHELL is destroyed.

Logically Collective

Input Parameters:

  • field - the DMField of type DMFIELDSHELL
  • destroy - the destroy routine, called before the shell's own data is freed

Calling sequence of destroy:

  • field - the DMField of type DMFIELDSHELL being destroyed

Level: intermediate

See also: DMField, DMFIELDSHELL, DMFieldCreateShell(), DMFieldDestroy()

External Links

source
PETSc.LibPETSc.DMFieldShellSetEvaluate — Method
DMFieldShellSetEvaluate(petsclib::PetscLibType, field::DMField, evaluate::external)

Register the routine that evaluates a DMFIELDSHELL at an arbitrary set of real-space points supplied as a Vec of coordinates.

Logically Collective

Input Parameters:

  • field - the DMField of type DMFIELDSHELL
  • evaluate - the evaluation callback

Calling sequence of evaluate:

  • field - the DMField of type DMFIELDSHELL
  • u - the points at which to evaluate the field, as a Vec of coordinates of size d x n
  • dtype - PETSC_SCALAR or PETSC_REAL
  • B - array of field values at each point, or NULL
  • D - array of field spatial derivatives at each point, or NULL
  • H - array of field spatial Hessians at each point, or NULL

Level: intermediate

See also: DMField, DMFIELDSHELL, DMFieldCreateShell(), DMFieldEvaluate(), DMFieldShellSetEvaluateFE(), DMFieldShellSetEvaluateFV()

External Links

source
PETSc.LibPETSc.DMFieldShellSetEvaluateFE — Method
DMFieldShellSetEvaluateFE(petsclib::PetscLibType, field::DMField, evaluateFE::external)

Register the routine that evaluates a DMFIELDSHELL at finite-element quadrature points over a set of mesh points.

Logically Collective

Input Parameters:

  • field - the DMField of type DMFIELDSHELL
  • evaluateFE - the FE evaluation callback

Calling sequence of evaluateFE:

  • field - the DMField of type DMFIELDSHELL
  • is - the IS of mesh cells on which to evaluate the field
  • quad - the reference-cell PetscQuadrature supplying the evaluation points
  • dtype - PETSC_SCALAR or PETSC_REAL
  • B - array of field values at each quadrature point, or NULL
  • D - array of field reference derivatives at each quadrature point, or NULL
  • H - array of field reference Hessians at each quadrature point, or NULL

Level: intermediate

See also: DMField, DMFIELDSHELL, DMFieldCreateShell(), DMFieldEvaluateFE(), DMFieldShellEvaluateFEDefault(), DMFieldShellSetEvaluateFV()

External Links

source
PETSc.LibPETSc.DMFieldShellSetEvaluateFV — Method
DMFieldShellSetEvaluateFV(petsclib::PetscLibType, field::DMField, evaluateFV::external)

Register the routine that evaluates a DMFIELDSHELL as cell averages over a set of mesh cells.

Logically Collective

Input Parameters:

  • field - the DMField of type DMFIELDSHELL
  • evaluateFV - the FV evaluation callback

Calling sequence of evaluateFV:

  • field - the DMField of type DMFIELDSHELL
  • is - the IS of mesh cells on which to evaluate the field
  • dtype - PETSC_SCALAR or PETSC_REAL
  • B - array of cell-averaged field values, or NULL
  • D - array of cell-averaged field derivatives, or NULL
  • H - array of cell-averaged field Hessians, or NULL

Level: intermediate

See also: DMField, DMFIELDSHELL, DMFieldCreateShell(), DMFieldEvaluateFV(), DMFieldShellEvaluateFVDefault(), DMFieldShellSetEvaluateFE()

External Links

source
PETSc.LibPETSc.DMFieldShellSetGetDegree — Method
DMFieldShellSetGetDegree(petsclib::PetscLibType, field::DMField, getDegree::external)

Register the routine that reports the polynomial degree bounds of a DMFIELDSHELL over a set of mesh points.

Logically Collective

Input Parameters:

  • field - the DMField of type DMFIELDSHELL
  • getDegree - callback that returns the minimum and maximum polynomial degrees of the field over the given point IS

Calling sequence of getDegree:

  • field - the DMField of type DMFIELDSHELL
  • is - the IS of mesh points over which the degree bounds are requested
  • minDegree - the degree of the largest polynomial space contained in the field on each element
  • maxDegree - the largest degree of the smallest polynomial space containing the field on any element

Level: intermediate

See also: DMField, DMFIELDSHELL, DMFieldCreateShell(), DMFieldGetDegree()

External Links

source
PETSc.LibPETSc.DMFieldView — Method
DMFieldView(petsclib::PetscLibType, field::DMField, viewer::PetscViewer)

view a DMField

Collective

Input Parameters:

  • field - DMField
  • viewer - viewer to display field, for example PETSC_VIEWER_STDOUT_WORLD

Level: advanced

See also: DMField, DMFieldCreate()

External Links

source
PETSc.LibPETSc.DMLabelAddStrata — Method
DMLabelAddStrata(petsclib::PetscLibType, label::DMLabel, numStrata::PetscInt, stratumValues::Vector{PetscInt})

Adds new stratum values in a DMLabel

Not Collective

Input Parameters:

  • label - The DMLabel
  • numStrata - The number of stratum values
  • stratumValues - The stratum values

Level: beginner

See also: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelAddStrataIS — Method
DMLabelAddStrataIS(petsclib::PetscLibType, label::DMLabel, valueIS::AbstractIS)

Adds new stratum values in a DMLabel

Not Collective

Input Parameters:

  • label - The DMLabel
  • valueIS - Index set with stratum values

Level: beginner

See also: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelAddStratum — Method
DMLabelAddStratum(petsclib::PetscLibType, label::DMLabel, value::PetscInt)

Adds a new stratum value in a DMLabel

Input Parameters:

  • label - The DMLabel
  • value - The stratum value

Level: beginner

See also: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelClearStratum — Method
DMLabelClearStratum(petsclib::PetscLibType, label::DMLabel, value::PetscInt)

Remove a stratum

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the stratum value

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelClearValue — Method
DMLabelClearValue(petsclib::PetscLibType, label::DMLabel, point::PetscInt, value::PetscInt)

Clear the value a label assigns to a point

Not Collective

Input Parameters:

  • label - the DMLabel
  • point - the point
  • value - The point value

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelCompare — Method
equal::PetscBool,message::String = DMLabelCompare(petsclib::PetscLibType, comm::MPI_Comm, l0::DMLabel, l1::DMLabel)

Compare two DMLabel objects

Collective; No Fortran Support

Input Parameters:

  • comm - Comm over which to compare labels
  • l0 - First DMLabel
  • l1 - Second DMLabel

Output Parameters:

  • equal - (Optional) Flag whether the two labels are equal
  • message - (Optional) Message describing the difference

Level: intermediate

See also: DMLabel, DM, DMCompareLabels(), DMLabelGetNumValues(), DMLabelGetDefaultValue(), DMLabelGetNonEmptyStratumValuesIS(), DMLabelGetStratumIS()

External Links

source
PETSc.LibPETSc.DMLabelComputeIndex — Method
DMLabelComputeIndex(petsclib::PetscLibType, label::DMLabel)

Create an index structure for membership determination, automatically determining the bounds

Not Collective

Input Parameter:

  • label - The DMLabel

Level: intermediate

See also: DMLabel, DM, DMLabelHasPoint(), DMLabelCreateIndex(), DMLabelDestroyIndex(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelConvertToSection — Method
section::PetscSection,is::IS = DMLabelConvertToSection(petsclib::PetscLibType, label::DMLabel)

Make a PetscSection/IS pair that encodes the label

Not Collective

Input Parameter:

  • label - the DMLabel

Output Parameters:

  • section - the section giving offsets for each stratum
  • is - An IS containing all the label points

Level: developer

See also: DMLabel, DM, DMLabelDistribute()

External Links

source
PETSc.LibPETSc.DMLabelCreate — Method
label::DMLabel = DMLabelCreate(petsclib::PetscLibType, comm::MPI_Comm, name::String)

Create a DMLabel object, which is a multimap

Collective

Input Parameters:

  • comm - The communicator, usually PETSC_COMM_SELF
  • name - The label name

Output Parameter:

  • label - The DMLabel

Level: beginner

See also: DMLabel, DM, DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelCreateIndex — Method
DMLabelCreateIndex(petsclib::PetscLibType, label::DMLabel, pStart::PetscInt, pEnd::PetscInt)

Create an index structure for membership determination

Not Collective

Input Parameters:

  • label - The DMLabel
  • pStart - The smallest point
  • pEnd - The largest point + 1

Level: intermediate

See also: DMLabel, DM, DMLabelHasPoint(), DMLabelComputeIndex(), DMLabelDestroyIndex(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelDestroy — Method
DMLabelDestroy(petsclib::PetscLibType, label::Union{DMLabel, Ref{DMLabel}})

Destroys a DMLabel

Collective

Input Parameter:

  • label - The DMLabel

Level: beginner

See also: DMLabel, DM, DMLabelReset(), DMLabelCreate()

External Links

source
PETSc.LibPETSc.DMLabelDestroyIndex — Method
DMLabelDestroyIndex(petsclib::PetscLibType, label::DMLabel)

Destroy the index structure

Not Collective

Input Parameter:

  • label - the DMLabel

Level: intermediate

See also: DMLabel, DM, DMLabelHasPoint(), DMLabelCreateIndex(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelDistribute — Method
labelNew::DMLabel = DMLabelDistribute(petsclib::PetscLibType, label::DMLabel, sf::PetscSF)

Create a new label pushed forward over the PetscSF

Collective

Input Parameters:

  • label - the DMLabel
  • sf - the map from old to new distribution

Output Parameter:

  • labelNew - the new redistributed label

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelDuplicate — Method
labelnew::DMLabel = DMLabelDuplicate(petsclib::PetscLibType, label::DMLabel)

Duplicates a DMLabel

Collective

Input Parameter:

  • label - The DMLabel

Output Parameter:

  • labelnew - new label

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelEphemeralGetLabel — Method
olabel::DMLabel = DMLabelEphemeralGetLabel(petsclib::PetscLibType, label::DMLabel)

Get the base label for this ephemeral label

Not Collective

Input Parameter:

  • label - the DMLabel

Output Parameter:

  • olabel - the base label for this ephemeral label

Level: intermediate

See also: DMLabelEphemeralSetLabel(), DMLabelEphemeralGetTransform(), DMLabelSetType()

External Links

source
PETSc.LibPETSc.DMLabelEphemeralGetTransform — Method
tr::DMPlexTransform = DMLabelEphemeralGetTransform(petsclib::PetscLibType, label::DMLabel)

Get the transform for this ephemeral label

Not Collective

Input Parameter:

  • label - the DMLabel

Output Parameter:

  • tr - the transform for this ephemeral label

Level: intermediate

See also: DMLabelEphemeralSetTransform(), DMLabelEphemeralGetLabel(), DMLabelSetType()

External Links

source
PETSc.LibPETSc.DMLabelEphemeralSetLabel — Method
DMLabelEphemeralSetLabel(petsclib::PetscLibType, label::DMLabel, olabel::DMLabel)

Set the base label for this ephemeral label

Not Collective

Input Parameters:

  • label - the DMLabel
  • olabel - the base label for this ephemeral label

Level: intermediate

See also: DMLabelEphemeralGetLabel(), DMLabelEphemeralSetTransform(), DMLabelSetType()

External Links

source
PETSc.LibPETSc.DMLabelEphemeralSetTransform — Method
DMLabelEphemeralSetTransform(petsclib::PetscLibType, label::DMLabel, tr::DMPlexTransform)

Set the transform for this ephemeral label

Not Collective

Input Parameters:

  • label - the DMLabel
  • tr - the transform for this ephemeral label

Level: intermediate

See also: DMLabelEphemeralGetTransform(), DMLabelEphemeralSetLabel(), DMLabelSetType()

External Links

source
PETSc.LibPETSc.DMLabelFilter — Method
DMLabelFilter(petsclib::PetscLibType, label::DMLabel, start::PetscInt, end_::PetscInt)

Remove all points outside of [start, end)

Not Collective

Input Parameters:

  • label - the DMLabel
  • start - the first point kept
  • end - one more than the last point kept

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGather — Method
labelNew::DMLabel = DMLabelGather(petsclib::PetscLibType, label::DMLabel, sf::PetscSF)

Gather all label values from leafs into roots

Collective

Input Parameters:

  • label - the DMLabel
  • sf - the PetscSF communication map

Output Parameter:

  • labelNew - the new DMLabel with localised leaf values

Level: developer

See also: DMLabel, DM, DMLabelDistribute()

External Links

source
PETSc.LibPETSc.DMLabelGetBounds — Method
pStart::PetscInt,pEnd::PetscInt = DMLabelGetBounds(petsclib::PetscLibType, label::DMLabel)

Return the smallest and largest point in the label

Not Collective

Input Parameter:

  • label - the DMLabel

Output Parameters:

  • pStart - The smallest point
  • pEnd - The largest point + 1

Level: intermediate

See also: DMLabel, DM, DMLabelHasPoint(), DMLabelCreateIndex(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelGetDefaultValue — Method
defaultValue::PetscInt = DMLabelGetDefaultValue(petsclib::PetscLibType, label::DMLabel)

Get the default value returned by DMLabelGetValue() if a point has not been explicitly given a value. When a label is created, it is initialized to -1.

Not Collective

Input Parameter:

  • label - a DMLabel object

Output Parameter:

  • defaultValue - the default value

Level: beginner

See also: DMLabel, DM, DMLabelSetDefaultValue(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelGetNonEmptyStratumValuesIS — Method
values::IS = DMLabelGetNonEmptyStratumValuesIS(petsclib::PetscLibType, label::DMLabel)

Get an IS of all values that the DMlabel takes

Not Collective

Input Parameter:

  • label - the DMLabel

Output Parameter:

  • values - the value IS

Level: intermediate

See also: DMLabel, DM, DMLabelGetValueIS(), DMLabelGetValueISGlobal(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetNumValues — Method
numValues::PetscInt = DMLabelGetNumValues(petsclib::PetscLibType, label::DMLabel)

Get the number of values that the DMLabel takes

Not Collective

Input Parameter:

  • label - the DMLabel

Output Parameter:

  • numValues - the number of values

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetStratumBounds — Method
start::PetscInt,end_::PetscInt = DMLabelGetStratumBounds(petsclib::PetscLibType, label::DMLabel, value::PetscInt)

Get the largest and smallest point of a stratum

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the stratum value

Output Parameters:

  • start - the smallest point in the stratum
  • end - the largest point in the stratum

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetStratumIS — Method
points::IS = DMLabelGetStratumIS(petsclib::PetscLibType, label::DMLabel, value::PetscInt)

Get an IS with the stratum points

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the stratum value

Output Parameter:

  • points - The stratum points

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetStratumPointIndex — Method
index::PetscInt = DMLabelGetStratumPointIndex(petsclib::PetscLibType, label::DMLabel, value::PetscInt, p::PetscInt)

Get the index of a point in a given stratum

Not Collective

Input Parameters:

  • label - The DMLabel
  • value - The label value
  • p - A point with this value

Output Parameter:

  • index - The index of this point in the stratum, or -1 if the point is not in the stratum or the stratum does not exist

Level: intermediate

See also: DMLabel, DM, DMLabelGetValueIndex(), DMLabelGetStratumIS(), DMLabelCreate()

External Links

source
PETSc.LibPETSc.DMLabelGetStratumSize — Method
size::PetscInt = DMLabelGetStratumSize(petsclib::PetscLibType, label::DMLabel, value::PetscInt)

Get the size of a stratum

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the stratum value

Output Parameter:

  • size - The number of points in the stratum

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetType — Method
type::String = DMLabelGetType(petsclib::PetscLibType, label::DMLabel)

Gets the type name (as a string) from the label.

Not Collective

Input Parameter:

  • label - The DMLabel

Output Parameter:

  • type - The DMLabel type name

Level: intermediate

See also: DMLabel, DM, DMLabelSetType(), DMLabelCreate()

External Links

source
PETSc.LibPETSc.DMLabelGetValue — Method
value::PetscInt = DMLabelGetValue(petsclib::PetscLibType, label::DMLabel, point::PetscInt)

Return the value a label assigns to a point, or the label's default value (which is initially -1, and can be changed with DMLabelSetDefaultValue())

Not Collective

Input Parameters:

  • label - the DMLabel
  • point - the point

Output Parameter:

  • value - The point value, or the default value (-1 by default)

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelSetValue(), DMLabelClearValue(), DMLabelGetDefaultValue(), DMLabelSetDefaultValue()

External Links

source
PETSc.LibPETSc.DMLabelGetValueBounds — Method
minValue::PetscInt,maxValue::PetscInt = DMLabelGetValueBounds(petsclib::PetscLibType, label::DMLabel)

Return the smallest and largest value in the label

Not Collective

Input Parameter:

  • label - the DMLabel

Output Parameters:

  • minValue - The smallest value
  • maxValue - The largest value

Level: intermediate

See also: DMLabel, DM, DMLabelGetBounds(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelGetValueIS — Method
values::IS = DMLabelGetValueIS(petsclib::PetscLibType, label::DMLabel)

Get an IS of all values that the DMlabel takes

Not Collective

Input Parameter:

  • label - the DMLabel

Output Parameter:

  • values - the value IS

Level: intermediate

See also: DMLabel, DM, DMLabelGetNonEmptyStratumValuesIS(), DMLabelGetValueISGlobal(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetValueISGlobal — Method
values::IS = DMLabelGetValueISGlobal(petsclib::PetscLibType, comm::MPI_Comm, label::DMLabel, get_nonempty::PetscBool)

Get an IS of all values that the DMlabel takes across all ranks

Collective

Input Parameter:

  • comm - MPI communicator to collect values
  • label - the DMLabel, may be NULL for ranks in comm which do not have the corresponding DMLabel
  • get_nonempty - whether to get nonempty stratum values (akin to DMLabelGetNonEmptyStratumValuesIS())

Output Parameter:

  • values - the value IS

Level: intermediate

See also: DMLabel, DM, DMLabelGetValueIS(), DMLabelGetNonEmptyStratumValuesIS(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetValueIndex — Method
index::PetscInt = DMLabelGetValueIndex(petsclib::PetscLibType, label::DMLabel, value::PetscInt)

Get the index of a given value in the list of values for the DMlabel, or -1 if it is not present

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the value

Output Parameter:

  • index - the index of value in the list of values

Level: intermediate

See also: DMLabel, DM, DMLabelGetValueIS(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelHasPoint — Method
contains::PetscBool = DMLabelHasPoint(petsclib::PetscLibType, label::DMLabel, point::PetscInt)

Determine whether a label assigns a value to a point

Not Collective

Input Parameters:

  • label - the DMLabel
  • point - the point

Output Parameter:

  • contains - Flag indicating whether the label maps this point to a value

Level: developer

See also: DMLabel, DM, DMLabelCreateIndex(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelHasStratum — Method
exists::PetscBool = DMLabelHasStratum(petsclib::PetscLibType, label::DMLabel, value::PetscInt)

Determine whether points exist with the given value

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the stratum value

Output Parameter:

  • exists - Flag saying whether points exist

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelHasValue — Method
contains::PetscBool = DMLabelHasValue(petsclib::PetscLibType, label::DMLabel, value::PetscInt)

Determine whether a label assigns the value to any point

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the value

Output Parameter:

  • contains - Flag indicating whether the label maps this value to any point

Level: developer

See also: DMLabel, DM, DMLabelHasPoint(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelInsertIS — Method
DMLabelInsertIS(petsclib::PetscLibType, label::DMLabel, is::AbstractIS, value::PetscInt)

Set all points in the IS to a value

Not Collective

Input Parameters:

  • label - the DMLabel
  • is - the point IS
  • value - The point value

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelPermute — Method
labelNew::DMLabel = DMLabelPermute(petsclib::PetscLibType, label::DMLabel, permutation::AbstractIS)

Create a new label with permuted points

Not Collective

Input Parameters:

  • label - the DMLabel
  • permutation - the point permutation

Output Parameter:

  • labelNew - the new label containing the permuted points

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelPermuteValues — Method
DMLabelPermuteValues(petsclib::PetscLibType, label::DMLabel, permutation::AbstractIS)

Permute the values in a label

Not collective

Input Parameters:

  • label - the DMLabel
  • permutation - the value permutation, permutation[old value] = new value

Output Parameter:

  • label - the DMLabel now with permuted values

See also: DMLabelRewriteValues(), DMLabel, DM, DMLabelPermute(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelPropagateBegin — Method
DMLabelPropagateBegin(petsclib::PetscLibType, label::DMLabel, sf::PetscSF)

Setup a cycle of label propagation

Collective

Input Parameters:

  • label - The DMLabel to propagate across processes
  • sf - The PetscSF describing parallel layout of the label points

Level: intermediate

See also: DMLabel, DM, DMLabelPropagateEnd(), DMLabelPropagatePush()

External Links

source
PETSc.LibPETSc.DMLabelPropagateEnd — Method
DMLabelPropagateEnd(petsclib::PetscLibType, label::DMLabel, pointSF::PetscSF)

Tear down a cycle of label propagation

Collective

Input Parameters:

  • label - The DMLabel to propagate across processes
  • pointSF - The PetscSF describing parallel layout of the label points

Level: intermediate

See also: DMLabel, DM, DMLabelPropagateBegin(), DMLabelPropagatePush()

External Links

source
PETSc.LibPETSc.DMLabelPropagatePush — Method
DMLabelPropagatePush(petsclib::PetscLibType, label::DMLabel, pointSF::PetscSF, markPoint::external, ctx::Ptr{Cvoid})

Tear down a cycle of label propagation

Collective

Input Parameters:

  • label - The DMLabel to propagate across processes
  • pointSF - The PetscSF describing parallel layout of the label points
  • markPoint - An optional callback that is called when a point is marked, or NULL
  • ctx - An optional application context for the callback, or NULL

Calling sequence of markPoint:

  • label - The DMLabel
  • p - The point being marked
  • val - The label value for p
  • ctx - An optional application context

Level: intermediate

See also: DMLabel, DM, DMLabelPropagateBegin(), DMLabelPropagateEnd()

External Links

source
PETSc.LibPETSc.DMLabelRegister — Method
DMLabelRegister(petsclib::PetscLibType, name::String, noname::Ptr{Cvoid})

Adds a new label component implementation

Not Collective

Input Parameters:

  • name - The name of a new user-defined creation routine
  • create_func - The creation routine itself

See also: DMLabel, DM, DMLabelType, DMLabelRegisterAll(), DMLabelRegisterDestroy()

External Links

source
PETSc.LibPETSc.DMLabelReset — Method
DMLabelReset(petsclib::PetscLibType, label::DMLabel)

Destroys internal data structures in a DMLabel

Not Collective

Input Parameter:

  • label - The DMLabel

Level: beginner

See also: DMLabel, DM, DMLabelDestroy(), DMLabelCreate()

External Links

source
PETSc.LibPETSc.DMLabelRewriteValues — Method
DMLabelRewriteValues(petsclib::PetscLibType, label::DMLabel, permutation::AbstractIS)

Permute the values in a label, but some may be omitted

Not collective

Input Parameters:

  • label - the DMLabel
  • permutation - the value permutation, permutation[old value] = new value, but some maybe omitted

Output Parameter:

  • label - the DMLabel now with permuted values

See also: DMLabelPermuteValues(), DMLabel, DM, DMLabelPermute(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelSetDefaultValue — Method
DMLabelSetDefaultValue(petsclib::PetscLibType, label::DMLabel, defaultValue::PetscInt)

Set the default value returned by DMLabelGetValue() if a point has not been explicitly given a value. When a label is created, it is initialized to -1.

Not Collective

Input Parameter:

  • label - a DMLabel object

Output Parameter:

  • defaultValue - the default value

Level: beginner

See also: DMLabel, DM, DMLabelGetDefaultValue(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelSetStratumBounds — Method
DMLabelSetStratumBounds(petsclib::PetscLibType, label::DMLabel, value::PetscInt, pStart::PetscInt, pEnd::PetscInt)

Efficiently give a contiguous set of points a given label value

Not Collective

Input Parameters:

  • label - The DMLabel
  • value - The label value for all points
  • pStart - The first point
  • pEnd - A point beyond all marked points

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelSetStratumIS(), DMLabelGetStratumIS()

External Links

source
PETSc.LibPETSc.DMLabelSetStratumIS — Method
DMLabelSetStratumIS(petsclib::PetscLibType, label::DMLabel, value::PetscInt, is::AbstractIS)

Set the stratum points using an IS

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the stratum value
  • is - The stratum points

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelSetType — Method
DMLabelSetType(petsclib::PetscLibType, label::DMLabel, method::String)

Sets the particular implementation for a label.

Collective

Input Parameters:

  • label - The label
  • method - The name of the label type

Options Database Key:

  • -dm_label_type type - Sets the label type; see DMLabelType

Level: intermediate

See also: DMLabel, DM, DMLabelGetType(), DMLabelCreate(), DMLabelType

External Links

source
PETSc.LibPETSc.DMLabelSetUp — Method
DMLabelSetUp(petsclib::PetscLibType, label::DMLabel)

SetUp a DMLabel object

Collective

Input Parameters:

  • label - The DMLabel

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelSetValue — Method
DMLabelSetValue(petsclib::PetscLibType, label::DMLabel, point::PetscInt, value::PetscInt)

Set the value a label assigns to a point. If the value is the same as the label's default value (which is initially -1, and can be changed with DMLabelSetDefaultValue() to something different), then this function will do nothing.

Not Collective

Input Parameters:

  • label - the DMLabel
  • point - the point
  • value - The point value

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelClearValue(), DMLabelGetDefaultValue(), DMLabelSetDefaultValue()

External Links

source
PETSc.LibPETSc.DMLabelStratumHasPoint — Method
contains::PetscBool = DMLabelStratumHasPoint(petsclib::PetscLibType, label::DMLabel, value::PetscInt, point::PetscInt)

Return true if the stratum contains a point

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the stratum value
  • point - the point

Output Parameter:

  • contains - true if the stratum contains the point

Level: intermediate

See also: DMLabel, DM, DMLabelCreate(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelView — Method
DMLabelView(petsclib::PetscLibType, label::DMLabel, viewer::PetscViewer)

View the label

Collective

Input Parameters:

  • label - The DMLabel
  • viewer - The PetscViewer

Level: intermediate

See also: DMLabel, PetscViewer, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelViewFromOptions — Method
DMLabelViewFromOptions(petsclib::PetscLibType, label::DMLabel, obj, name::String)

View a DMLabel in a particular way based on a request in the options database

Collective

Input Parameters:

  • label - the DMLabel object
  • obj - optional object that provides the prefix for the options database (if NULL then the prefix in obj is used)
  • name - option string that is used to activate viewing

Options Database Key:

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

Level: intermediate

See also: DMLabel, DMLabelView(), PetscObjectViewFromOptions(), DMLabelCreate()

External Links

source