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.DMAdaptLabelMethod
DMAdaptLabel(petsclib::PetscLibType,dm::PetscDM, label::DMLabel, dmAdapt::PetscDM)

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

-seealso: DM, DMAdaptMetric(), DMCoarsen(), DMRefine()

External Links

source
PETSc.LibPETSc.DMAdaptMetricMethod
DMAdaptMetric(petsclib::PetscLibType,dm::PetscDM, metric::PetscVec, bdLabel::DMLabel, rgLabel::DMLabel, dmAdapt::PetscDM)

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

-seealso: DMAdaptLabel(), DMCoarsen(), DMRefine()

External Links

source
PETSc.LibPETSc.DMAddBoundaryMethod
bd::PetscInt = DMAddBoundary(petsclib::PetscLibType,dm::PetscDM, type::DMBoundaryConditionType, name::String, label::DMLabel, Nv::PetscInt, values::Vector{PetscInt}, field::PetscInt, Nc::PetscInt, comps::Vector{PetscInt}, bcFunc::PetscVoidFn, bcFunc_t::PetscVoidFn, ctx::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 user context for bcFunc

Output Parameter:

  • bd - (Optional) Boundary number

Options Database Keys:

  • -bc_<boundary name> <num> - Overrides the boundary ids
  • -bc_<boundary name>_comp <num> - Overrides the boundary components

Level: intermediate

Notes: If the DM is of type DMPLEX and the field is of type PetscFE, then this function completes the label using DMPlexLabelComplete().

Both bcFunc and bcFunct will depend on the boundary condition type. If the type if `DMBC_ESSENTIAL`, then the calling sequence is: -vb void bcFunc(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nc, PetscScalar bcval[]) -ve

If the type is DM_BC_ESSENTIAL_FIELD or other _FIELD value, then the calling sequence is:

-vb void bcFunc(PetscInt dim, PetscInt Nf, PetscInt NfAux, const PetscInt uOff[], const PetscInt uOffx[], const PetscScalar u[], const PetscScalar ut[], const PetscScalar ux[], const PetscInt aOff[], const PetscInt aOffx[], const PetscScalar a[], const PetscScalar at[], const PetscScalar ax[], PetscReal time, const PetscReal x[], PetscScalar bcval[]) -ve

  • dim - the spatial dimension
  • Nf - the number of fields
  • uOff - the offset into u[] and u_t[] for each field
  • uOff_x - the offset into u_x[] for each field
  • u - each field evaluated at the current point
  • u_t - the time derivative of each field evaluated at the current point
  • u_x - the gradient of each field evaluated at the current point
  • aOff - the offset into a[] and a_t[] for each auxiliary field
  • aOff_x - the offset into a_x[] for each auxiliary field
  • a - each auxiliary field evaluated at the current point
  • a_t - the time derivative of each auxiliary field evaluated at the current point
  • a_x - the gradient of auxiliary each field evaluated at the current point
  • t - current time
  • x - coordinates of the current point
  • numConstants - number of constant parameters
  • constants - constant parameters
  • bcval - output values at the current point

See also:

DM, DSGetBoundary(), PetscDSAddBoundary()

External Links

source
PETSc.LibPETSc.DMAddFieldMethod
DMAddField(petsclib::PetscLibType,dm::PetscDM, label::DMLabel, disc::PetscObject)

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

Notes: The label already exists or will be added to the DM with DMSetLabel().

For example, a piecewise continuous pressure field can be defined by coefficients at the cell centers of a mesh and piecewise constant functions within each cell. Thus a specific function in the space is defined by the combination of a Vec containing the coefficients, a DM defining the geometry entities, a DMLabel indicating a subset of those geometric entities, and a discretization object, such as a PetscFE.

Fortran Note: Use the argument PetscObjectCast(disc) as the second argument

See also:

DM, DMSetLabel(), DMSetField(), DMGetField(), PetscFE

External Links

source
PETSc.LibPETSc.DMAddLabelMethod
DMAddLabel(petsclib::PetscLibType,dm::PetscDM, 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.DMAppendOptionsPrefixMethod
DMAppendOptionsPrefix(petsclib::PetscLibType,dm::PetscDM, 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

Note: If the DM does not currently have an options prefix then this value is used alone as the prefix as if DMSetOptionsPrefix() had been called. A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.

See also:

DM, DMSetOptionsPrefix(), DMGetOptionsPrefix(), PetscObjectAppendOptionsPrefix(), DMSetFromOptions()

External Links

source
PETSc.LibPETSc.DMClearAuxiliaryVecMethod
DMClearAuxiliaryVec(petsclib::PetscLibType,dm::PetscDM)

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.DMClearDSMethod
DMClearDS(petsclib::PetscLibType,dm::PetscDM)

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.DMClearFieldsMethod
DMClearFields(petsclib::PetscLibType,dm::PetscDM)

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.DMClearGlobalVectorsMethod
DMClearGlobalVectors(petsclib::PetscLibType,dm::PetscDM)

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

Collective

Input Parameter:

  • dm - the DM

Level: developer

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

External Links

source
PETSc.LibPETSc.DMClearLabelStratumMethod
DMClearLabelStratum(petsclib::PetscLibType,dm::PetscDM, 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.DMClearLabelValueMethod
DMClearLabelValue(petsclib::PetscLibType,dm::PetscDM, 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.DMClearLocalVectorsMethod
DMClearLocalVectors(petsclib::PetscLibType,dm::PetscDM)

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

Collective

Input Parameter:

  • dm - the DM

Level: developer

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

External Links

source
PETSc.LibPETSc.DMClearNamedGlobalVectorsMethod
DMClearNamedGlobalVectors(petsclib::PetscLibType,dm::PetscDM)

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

Collective

Input Parameter:

  • dm - the DM

Level: developer

-seealso: DM, DMGetNamedGlobalVector(), DMGetNamedLocalVector(), DMClearNamedLocalVectors()

External Links

source
PETSc.LibPETSc.DMClearNamedLocalVectorsMethod
DMClearNamedLocalVectors(petsclib::PetscLibType,dm::PetscDM)

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

Collective

Input Parameter:

  • dm - the DM

Level: developer

-seealso: DM, DMGetNamedGlobalVector(), DMGetNamedLocalVector(), DMClearNamedGlobalVectors()

External Links

source
PETSc.LibPETSc.DMCloneMethod
DMClone(petsclib::PetscLibType,dm::PetscDM, newdm::PetscDM)

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

Notes: For some DM implementations this is a shallow clone, the result of which may share (reference counted) information with its parent. For example, DMClone() applied to a DMPLEX object will result in a new DMPLEX that shares the topology with the original DMPLEX. It does not share the PetscSection of the original DM.

The clone is considered set up if the original has been set up.

Use DMConvert() for a general way to create new DM from a given DM

See also:

DM, DMDestroy(), DMCreate(), DMSetType(), DMSetLocalSection(), DMSetGlobalSection(), DMPLEX, DMConvert()

External Links

source
PETSc.LibPETSc.DMCoarsenMethod
DMCoarsen(petsclib::PetscLibType,dm::PetscDM, comm::MPI_Comm, dmc::PetscDM)

Coarsens a DM object using a standard, non

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.DMCoarsenHierarchyMethod
DMCoarsenHierarchy(petsclib::PetscLibType,dm::PetscDM, nlevels::PetscInt, dmc::Vector{PetscDM})

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.DMCoarsenHookAddMethod
DMCoarsenHookAdd(petsclib::PetscLibType,fine::PetscDM, coarsenhook::external, restricthook::external, ctx::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] user-defined 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 user-defined 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 user-defined function context

Level: advanced

Notes: This function is only needed if auxiliary data, attached to the DM with PetscObjectCompose(), needs to be set up or passed from the fine DM to the coarse DM.

If this function is called multiple times, the hooks will be run in the order they are added.

In order to compose with nonlinear preconditioning without duplicating storage, the hook should be implemented to extract the finest level information from its context (instead of from the SNES).

The hooks are automatically called by DMRestrict()

See also:

DM, DMCoarsenHookRemove(), DMRefineHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMCoarsenHookRemoveMethod
DMCoarsenHookRemove(petsclib::PetscLibType,fine::PetscDM, coarsenhook::external, restricthook::external, ctx::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] user-defined context for provide data for the hooks (may be NULL)

Level: advanced

Notes: This function does nothing if the coarsenhook is not in the list.

See DMCoarsenHookAdd() for the calling sequence of coarsenhook and restricthook

See also:

DM, DMCoarsenHookAdd(), DMRefineHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMCompareLabelsMethod
equal::PetscBool = DMCompareLabels(petsclib::PetscLibType,dm0::PetscDM, dm1::PetscDM, message::String)

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

Notes: The output flag equal will be the same on all processes.

If equal is passed as NULL and difference is found, an error is thrown on all processes.

Make sure to pass equal is NULL on all processes or none of them.

The output message is set independently on each rank.

message must be freed with PetscFree()

If message is passed as NULL and a difference is found, the difference description is printed to stderr in synchronized manner.

Make sure to pass message as NULL on all processes or no processes.

Labels are matched by name. If the number of labels and their names are equal, DMLabelCompare() is used to compare each pair of labels with the same name.

Developer Note: Cannot automatically generate the Fortran stub because message must be freed with PetscFree()

See also:

DM, DMLabel, DMAddLabel(), DMCopyLabelsMode, DMLabelCompare()

External Links

source
PETSc.LibPETSc.DMComputeErrorMethod
DMComputeError(petsclib::PetscLibType,dm::PetscDM, sol::PetscVec, errors::Vector{PetscReal}, errorVec::PetscVec)

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

Note: The exact solutions come from the PetscDS object, and the time comes from DMGetOutputSequenceNumber().

See also:

DM, DMMonitorSet(), DMGetRegionNumDS(), PetscDSGetExactSolution(), DMGetOutputSequenceNumber()

External Links

source
PETSc.LibPETSc.DMComputeExactSolutionMethod
DMComputeExactSolution(petsclib::PetscLibType,dm::PetscDM, time::PetscReal, u::PetscVec, u_t::PetscVec)

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

Note: The user must call PetscDSSetExactSolution() before using this routine

See also:

DM, PetscDSSetExactSolution()

External Links

source
PETSc.LibPETSc.DMComputeVariableBoundsMethod
DMComputeVariableBounds(petsclib::PetscLibType,dm::PetscDM, xl::PetscVec, xu::PetscVec)

compute variable bounds used by SNESVI.

Logically Collective

Input Parameter:

  • dm - the DM object

Output Parameters:

  • xl - lower bound
  • xu - upper bound

Level: advanced

Note: This is generally not called by users. It calls the function provided by the user with DMSetVariableBounds()

See also:

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

External Links

source
PETSc.LibPETSc.DMConvertMethod
DMConvert(petsclib::PetscLibType,dm::PetscDM, newtype::DMType, M::PetscDM)

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

Note: Cannot be used to convert a sequential DM to a parallel or a parallel to sequential, the MPI communicator of the generated DM is always the same as the communicator of the input DM.

See also:

DM, DMSetType(), DMCreate(), DMClone()

External Links

source
PETSc.LibPETSc.DMCopyAuxiliaryVecMethod
DMCopyAuxiliaryVec(petsclib::PetscLibType,dm::PetscDM, dmNew::PetscDM)

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

Note: This is a shallow copy of the auxiliary vectors

See also:

DM, DMClearAuxiliaryVec(), DMGetNumAuxiliaryVec(), DMGetAuxiliaryVec(), DMSetAuxiliaryVec()

External Links

source
PETSc.LibPETSc.DMCopyDMKSPMethod
DMCopyDMKSP(petsclib::PetscLibType,dmsrc::PetscDM, dmdest::PetscDM)

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

-seealso: , DMKSP, DM, KSP, DMGetDMKSP(), KSPSetDM()

External Links

source
PETSc.LibPETSc.DMCopyDMSNESMethod
DMCopyDMSNES(petsclib::PetscLibType,dmsrc::PetscDM, dmdest::PetscDM)

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

-seealso: , DMSNES, DMGetDMSNES(), SNESSetDM()

External Links

source
PETSc.LibPETSc.DMCopyDSMethod
DMCopyDS(petsclib::PetscLibType,dm::PetscDM, minDegree::PetscInt, maxDegree::PetscInt, newdm::PetscDM)

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.DMCopyDiscMethod
DMCopyDisc(petsclib::PetscLibType,dm::PetscDM, newdm::PetscDM)

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

Developer Note: Really ugly name, nothing in PETSc is called a Disc plus it is an ugly abbreviation

See also:

DM, DMCopyFields(), DMCopyDS()

External Links

source
PETSc.LibPETSc.DMCopyFieldsMethod
DMCopyFields(petsclib::PetscLibType,dm::PetscDM, minDegree::PetscInt, maxDegree::PetscInt, newdm::PetscDM)

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.DMCopyLabelsMethod
DMCopyLabels(petsclib::PetscLibType,dmA::PetscDM, dmB::PetscDM, 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

Note: This is typically used when interpolating or otherwise adding to a mesh, or testing.

See also:

DM, DMLabel, DMAddLabel(), DMCopyLabelsMode

External Links

source
PETSc.LibPETSc.DMCreateMethod
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

Notes: See DMType for a brief summary of available DM.

The type must then be set with DMSetType(). If you never call DMSetType() it will generate an error when you try to use the dm.

DM is an orphan initialism or orphan acronym, the letters have no meaning and never did.

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateColoringMethod
coloring::ISColoring = DMCreateColoring(petsclib::PetscLibType,dm::PetscDM, 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

Notes: Coloring of matrices can also be computed directly from the sparse matrix nonzero structure via the MatColoring object or from the mesh from which the matrix comes from (what this function provides). In general using the mesh produces a more optimal coloring (fewer colors).

This produces a coloring with the distance of 2, see MatSetColoringDistance() which can be used for efficiently computing Jacobians with MatFDColoringCreate() For DMDA in three dimensions with periodic boundary conditions the number of grid points in each dimension must be divisible by 2*stencil_width + 1, otherwise an error will be generated.

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateDSMethod
DMCreateDS(petsclib::PetscLibType,dm::PetscDM)

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

Developer Note: The name of this function is wrong. Create functions always return the created object as one of the arguments.

See also:

DM, DMSetField, DMAddField(), DMGetDS(), DMGetCellDS(), DMGetRegionDS(), DMSetRegionDS()

External Links

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

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

Notes: Each IS contains the global indices of the dofs of the corresponding subdomains with in the dofs of the original DM. The inner subdomains conceptually define a nonoverlapping covering, while outer subdomains can overlap.

The optional list of DMs define a DM for each subproblem.

The user is responsible for freeing all requested arrays. In particular, every entry of namelist should be freed with PetscFree(), every entry of innerislist and outerislist should be destroyed with ISDestroy(), every entry of dmlist should be destroyed with DMDestroy(), and all of the arrays should be freed with PetscFree().

Developer Notes: The dmlist is for the inner subdomains or the outer subdomains or all subdomains?

The names are inconsistent, the hooks use DMSubDomainHook which is nothing like DMCreateDomainDecomposition() while DMRefineHook is used for DMRefine().

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateDomainDecompositionScattersMethod
iscat::Vector{VecScatter},oscat::Vector{VecScatter},gscat::Vector{VecScatter} = DMCreateDomainDecompositionScatters(petsclib::PetscLibType,dm::PetscDM, n::PetscInt, subdms::PetscDM)

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

Note: This is an alternative to the iis and ois arguments in DMCreateDomainDecomposition() that allow for the solution of general nonlinear problems with overlapping subdomain methods. While merely having index sets that enable subsets of the residual equations to be created is fine for linear problems, nonlinear problems require local assembly of solution and residual data.

Developer Note: Can the subdms input be anything or are they exactly the DM obtained from DMCreateDomainDecomposition()?

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateFEDefaultMethod
fem::PetscFE = DMCreateFEDefault(petsclib::PetscLibType,dm::PetscDM, 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

Note: This is a convenience method that just calls PetscFECreateByCell() underneath.

See also:

DM, PetscFECreateByCell(), DMAddField(), DMCreateDS(), DMGetCellDS(), DMGetRegionDS()

External Links

source
PETSc.LibPETSc.DMCreateFieldDecompositionMethod
len::PetscInt,namelist::Cchar,islist::Vector{IS},dmlist::Vector{PetscDM} = DMCreateFieldDecomposition(petsclib::PetscLibType,dm::PetscDM)

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

Notes: Each IS contains the global indices of the dofs of the corresponding field, defined by DMAddField(). The optional list of DMs define the DM for each subproblem.

The same as DMCreateFieldIS() but also returns a DM for each field.

The user is responsible for freeing all requested arrays. In particular, every entry of namelist should be freed with PetscFree(), every entry of islist should be destroyed with ISDestroy(), every entry of dmlist should be destroyed with DMDestroy(), and all of the arrays should be freed with PetscFree().

Fortran Notes: Use the declarations -vb character(80), pointer :: namelist(:) IS, pointer :: islist(:) DM, pointer :: dmlist(:) -ve

namelist must be provided, islist may be PETSC_NULL_IS_POINTER and dmlist may be PETSC_NULL_DM_POINTER

Use DMDestroyFieldDecomposition() to free the returned objects

Developer Notes: It is not clear why this function and DMCreateFieldIS() exist. Having two seems redundant and confusing.

Unlike DMRefine(), DMCoarsen(), and DMCreateDomainDecomposition() this provides no mechanism to provide hooks that are called after the decomposition is computed.

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateFieldISMethod
numFields::PetscInt,fieldNames::Cchar,fields::Vector{IS} = DMCreateFieldIS(petsclib::PetscLibType,dm::PetscDM)

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 user is responsible for freeing all requested arrays. In particular, every entry of fieldNames should be freed with PetscFree(), every entry of fields should be destroyed with ISDestroy(), and both arrays should be freed with PetscFree().

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.DMCreateGlobalVectorMethod
vec::PetscVec = DMCreateGlobalVector(petsclib::PetscLibType,dm::PetscDM)

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.DMCreateGradientMatrixMethod
mat::PetscMat = DMCreateGradientMatrix(petsclib::PetscLibType,dmc::PetscDM, dmf::PetscDM)

Gets the gradient matrix between two DM objects Collective

Input Parameters:

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

Output Parameter:

  • mat - the gradient matrix

Level: developer

Notes: For DMPLEX the finite element model for the DM must have been already provided.

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateInjectionMethod
mat::PetscMat = DMCreateInjection(petsclib::PetscLibType,dac::PetscDM, daf::PetscDM)

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

Notes: This is an operator that applied to a vector obtained with DMCreateGlobalVector() on the fine grid maps the values to a vector on the vector on the coarse DM by simply selecting the values on the coarse grid points. This compares to the operator obtained by DMCreateRestriction() or the transpose of the operator obtained by DMCreateInterpolation() that uses a "local weighted average" of the values around the coarse grid point as the coarse grid value.

For DMDA objects this only works for "uniform refinement", that is the refined mesh was obtained DMRefine() or the coarse mesh was obtained by DMCoarsen(). The coordinates set into the DMDA are completely ignored in computing the injection.

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateInterpolationMethod
mat::PetscMat,vec::PetscVec = DMCreateInterpolation(petsclib::PetscLibType,dmc::PetscDM, dmf::PetscDM)

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

Notes: For DMDA objects this only works for "uniform refinement", that is the refined mesh was obtained DMRefine() or the coarse mesh was obtained by DMCoarsen(). The coordinates set into the DMDA are completely ignored in computing the interpolation.

For DMDA objects you can use this interpolation (more precisely the interpolation from the DMGetCoordinateDM()) to interpolate the mesh coordinate vectors EXCEPT in the periodic case where it does not make sense since the coordinate vectors are not periodic.

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateInterpolationScaleMethod
scale::PetscVec = DMCreateInterpolationScale(petsclib::PetscLibType,dac::PetscDM, daf::PetscDM, mat::PetscMat)

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

Note: xcoarse = diag(L)Rxfine preserves scale and is thus suitable for state (versus residual) restriction. In other words xcoarse is the coarse representation of xfine.

Developer Note: If the fine-scale DMDA has the -dmbindbelow option set to true, then DMCreateInterpolationScale() calls MatSetBindingPropagates() on the restriction/interpolation operator to set the bindingpropagates flag to true.

See also:

DM, MatRestrict(), MatInterpolate(), DMCreateInterpolation(), DMCreateRestriction(), DMCreateGlobalVector()

External Links

source
PETSc.LibPETSc.DMCreateLabelMethod
DMCreateLabel(petsclib::PetscLibType,dm::PetscDM, 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.DMCreateLabelAtIndexMethod
DMCreateLabelAtIndex(petsclib::PetscLibType,dm::PetscDM, 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.DMCreateLocalVectorMethod
vec::PetscVec = DMCreateLocalVector(petsclib::PetscLibType,dm::PetscDM)

Creates a local vector from a DM object.

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • vec - the local vector

Level: beginner

Note: A local vector usually has ghost locations that contain values that are owned by different MPI ranks. A global vector has no ghost locations.

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateMassMatrixMethod
mat::PetscMat = DMCreateMassMatrix(petsclib::PetscLibType,dmc::PetscDM, dmf::PetscDM)

Gets the mass matrix between two DM objects 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.DMCreateMassMatrixLumpedMethod
llm::PetscVec,lm::PetscVec = DMCreateMassMatrixLumped(petsclib::PetscLibType,dm::PetscDM)

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

Note: See DMCreateMassMatrix() for how to create the non-lumped version of the mass matrix.

See also:

DM, DMCreateMassMatrix(), DMCreateMatrix(), DMRefine(), DMCoarsen(), DMCreateRestriction(), DMCreateInterpolation(), DMCreateInjection()

External Links

source
PETSc.LibPETSc.DMCreateMatrixMethod
mat::PetscMat = DMCreateMatrix(petsclib::PetscLibType,dm::PetscDM)

Gets an empty matrix for a DM that is most commonly used to store the Jacobian of a discrete PDE operator.

Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • mat - the empty Jacobian

Options Database Key:

  • -dm_preallocate_only - Only preallocate the matrix for DMCreateMatrix() and DMCreateMassMatrix(), but do not fill it with zeros

Level: beginner

Notes: This properly preallocates the number of nonzeros in the sparse matrix so you do not need to do it yourself.

By default it also sets the nonzero structure and puts in the zero entries. To prevent setting the nonzero pattern call DMSetMatrixPreallocateOnly()

For DMDA, when you call MatView() on this matrix it is displayed using the global natural ordering, NOT in the ordering used internally by PETSc.

For DMDA, in general it is easiest to use MatSetValuesStencil() or MatSetValuesLocal() to put values into the matrix because MatSetValues() requires the indices for the global numbering for the DMDA which is complic`ated to compute

See also:

DM, DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMSetMatType(), DMCreateMassMatrix()

External Links

source
PETSc.LibPETSc.DMCreateRestrictionMethod
mat::PetscMat = DMCreateRestriction(petsclib::PetscLibType,dmc::PetscDM, dmf::PetscDM)

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

Note: This only works for DMSTAG. For many situations either the transpose of the operator obtained with DMCreateInterpolation() or that matrix multiplied by the vector obtained with DMCreateInterpolationScale() provides the desired object.

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateSectionPermutationMethod
perm::IS,blockStarts::PetscBT = DMCreateSectionPermutation(petsclib::PetscLibType,dm::PetscDM)

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.DMCreateSectionSFMethod
DMCreateSectionSF(petsclib::PetscLibType,dm::PetscDM, locSection::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

Note: One usually uses DMGetSectionSF() to obtain the PetscSF

Developer Note: Since this routine has for arguments the two sections from the DM and puts the resulting PetscSF directly into the DM, perhaps this function should not take the local and global sections as input and should just obtain them from the DM? Plus PETSc creation functions return the thing they create, this returns nothing

See also:

DM, DMGetSectionSF(), DMSetSectionSF(), DMGetLocalSection(), DMGetGlobalSection()

External Links

source
PETSc.LibPETSc.DMCreateSectionSubDMMethod
is::IS,subdm::PetscDM = DMCreateSectionSubDM(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: DMCreateSubDM(), DMGetLocalSection(), DMPlexSetMigrationSF(), DMView()

External Links

source
PETSc.LibPETSc.DMCreateSectionSuperDMMethod
is::Vector{IS},superdm::PetscDM = DMCreateSectionSuperDM(petsclib::PetscLibType,dms::Vector{PetscDM}, 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

-seealso: DMCreateSuperDM(), DMGetLocalSection(), DMPlexSetMigrationSF(), DMView()

External Links

source
PETSc.LibPETSc.DMCreateSubDMMethod
is::IS,subdm::PetscDM = DMCreateSubDM(petsclib::PetscLibType,dm::PetscDM, 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

Note: You need to call DMPlexSetMigrationSF() on the original DM if you want the Global-To-Natural map to be automatically constructed

See also:

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

External Links

source
PETSc.LibPETSc.DMCreateSuperDMMethod
is::Vector{IS},superdm::PetscDM = DMCreateSuperDM(petsclib::PetscLibType,dms::Vector{PetscDM}, 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

Note: You need to call DMPlexSetMigrationSF() on the original DM if you want the Global-To-Natural map to be automatically constructed

See also:

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

External Links

source
PETSc.LibPETSc.DMDestroyMethod
DMDestroy(petsclib::PetscLibType,dm::PetscDM)

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.DMExtrudeMethod
DMExtrude(petsclib::PetscLibType,dm::PetscDM, layers::PetscInt, dme::PetscDM)

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

Note: If no extrusion was done, the return value is NULL

See also:

DM, DMRefine(), DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector()

External Links

source
PETSc.LibPETSc.DMFindRegionNumMethod
num::PetscInt = DMFindRegionNum(petsclib::PetscLibType,dm::PetscDM, ds::PetscDS)

Find the region number for a given PetscDS, or

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.DMGenerateRegisterMethod
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

-seealso: DM, DMGenerateRegisterAll(), DMPlexGenerate(), DMGenerateRegisterDestroy()

External Links

source
PETSc.LibPETSc.DMGeomModelRegisterMethod
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

-seealso: DM, DMGeomModelRegisterAll(), DMPlexGeomModel(), DMGeomModelRegisterDestroy()

External Links

source
PETSc.LibPETSc.DMGetAdjacencyMethod
useCone::PetscBool,useClosure::PetscBool = DMGetAdjacency(petsclib::PetscLibType,dm::PetscDM, 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

Notes: -v FEM: Two points p and q are adjacent if q in closure(star(p)), useCone = PETSCFALSE, useClosure = PETSCTRUE FVM: Two points p and q are adjacent if q in support(p+cone(p)), useCone = PETSCTRUE, useClosure = PETSCFALSE FVM++: Two points p and q are adjacent if q in star(closure(p)), useCone = PETSCTRUE, useClosure = PETSCTRUE -ve Further explanation can be found in the User's Manual Section on the Influence of Variables on One Another.

See also:

DM, DMSetAdjacency(), DMGetField(), DMSetField()

External Links

source
PETSc.LibPETSc.DMGetApplicationContextMethod
DMGetApplicationContext(petsclib::PetscLibType,dm::PetscDM, ctx::PeCtx)

Gets a user context from a DM object provided with DMSetApplicationContext()

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • ctx - a pointer to the user context

Level: intermediate

Note: A user context is a way to pass problem specific information that is accessible whenever the DM is available

Fortran Notes: This only works when the context is a Fortran derived type (it cannot be a PetscObject) and you must write a Fortran interface definition for this function that tells the Fortran compiler the derived data type that is returned as the ctx argument. For example, -vb Interface DMGetApplicationContext Subroutine DMGetApplicationContext(dm,ctx,ierr) #include <petsc/finclude/petscdm.h> use petscdm DM dm type(tUsertype), pointer :: ctx PetscErrorCode ierr End Subroutine End Interface DMGetApplicationContext -ve

The prototype for ctx must be -vb type(tUsertype), pointer :: ctx -ve

See also:

DM, DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix()

External Links

source
PETSc.LibPETSc.DMGetAuxiliaryLabelsMethod
values::Vector{PetscInt},parts::Vector{PetscInt} = DMGetAuxiliaryLabels(petsclib::PetscLibType,dm::PetscDM, labels::Vector{DMLabel})

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

Note: The arrays passed in must be at least as large as DMGetNumAuxiliaryVec().

See also:

DM, DMClearAuxiliaryVec(), DMGetNumAuxiliaryVec(), DMGetAuxiliaryVec(), DMSetAuxiliaryVec(), DMCopyAuxiliaryVec()

External Links

source
PETSc.LibPETSc.DMGetAuxiliaryVecMethod
DMGetAuxiliaryVec(petsclib::PetscLibType,dm::PetscDM, label::DMLabel, value::PetscInt, part::PetscInt, aux::PetscVec)

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

Note: If no auxiliary vector is found for this (label, value), (NULL, 0, 0) is checked as well.

See also:

DM, DMClearAuxiliaryVec(), DMSetAuxiliaryVec(), DMGetNumAuxiliaryVec(), DMGetAuxiliaryLabels()

External Links

source
PETSc.LibPETSc.DMGetBasicAdjacencyMethod
useCone::PetscBool,useClosure::PetscBool = DMGetBasicAdjacency(petsclib::PetscLibType,dm::PetscDM)

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

Notes: -vb FEM: Two points p and q are adjacent if q in closure(star(p)), useCone = PETSCFALSE, useClosure = PETSCTRUE FVM: Two points p and q are adjacent if q in support(p+cone(p)), useCone = PETSCTRUE, useClosure = PETSCFALSE FVM++: Two points p and q are adjacent if q in star(closure(p)), useCone = PETSCTRUE, useClosure = PETSCTRUE -ve

See also:

DM, DMSetBasicAdjacency(), DMGetField(), DMSetField()

External Links

source
PETSc.LibPETSc.DMGetBlockSizeMethod
bs::PetscInt = DMGetBlockSize(petsclib::PetscLibType,dm::PetscDM)

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

Notes: This might be the number of degrees of freedom at each grid point for a structured grid.

Complex DM that represent multiphysics or staggered grids or mixed-methods do not generally have a single inherent block size, but rather different locations in the vectors may have a different block size.

See also:

DM, ISCreateBlock(), VecSetBlockSize(), MatSetBlockSize(), DMGetLocalToGlobalMapping()

External Links

source
PETSc.LibPETSc.DMGetBlockingTypeMethod
btype::DMBlockingType = DMGetBlockingType(petsclib::PetscLibType,dm::PetscDM)

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.DMGetBoundingBoxMethod
gmin::Vector{PetscReal},gmax::Vector{PetscReal} = DMGetBoundingBox(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: DM, DMGetLocalBoundingBox(), DMGetCoordinates(), DMGetCoordinatesLocal()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinateDMMethod
DMGetCellCoordinateDM(petsclib::PetscLibType,dm::PetscDM, cdm::PetscDM)

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

-seealso: DM, DMSetCellCoordinateDM(), DMSetCellCoordinates(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMGetCellCoordinatesLocal(), DMLocalizeCoordinates(), DMSetCoordinateDM(), DMGetCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinateSectionMethod
DMGetCellCoordinateSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)

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

-seealso: DM, DMGetCoordinateSection(), DMSetCellCoordinateSection(), DMGetCellCoordinateDM(), DMGetCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinatesMethod
DMGetCellCoordinates(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)

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

-seealso: DM, DMGetCoordinates(), DMSetCellCoordinates(), DMGetCellCoordinatesLocal(), DMGetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinatesLocalMethod
DMGetCellCoordinatesLocal(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)

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

-seealso: DM, DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMSetCellCoordinates(), DMGetCellCoordinateDM(), DMGetCellCoordinatesLocalNoncollective()

External Links

source
PETSc.LibPETSc.DMGetCellCoordinatesLocalNoncollectiveMethod
DMGetCellCoordinatesLocalNoncollective(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)

Non

Not Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • c - cellwise coordinate vector

Level: advanced

-seealso: DM, DMGetCellCoordinatesLocalSetUp(), DMGetCellCoordinatesLocal(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMSetCellCoordinates(), DMGetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCellDSMethod
DMGetCellDS(petsclib::PetscLibType,dm::PetscDM, point::PetscInt, ds::PetscDS, dsIn::PetscDS)

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.DMGetCoarseDMMethod
DMGetCoarseDM(petsclib::PetscLibType,dm::PetscDM, cdm::PetscDM)

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.DMGetCoarsenLevelMethod
level::PetscInt = DMGetCoarsenLevel(petsclib::PetscLibType,dm::PetscDM)

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.DMGetCompatibilityMethod
compatible::PetscBool,set::PetscBool = DMGetCompatibility(petsclib::PetscLibType,dm1::PetscDM, dm2::PetscDM)

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

Notes: Two DMs are deemed compatible if they represent the same parallel decomposition of the same topology. This implies that the section (field data) on one "makes sense" with respect to the topology and parallel decomposition of the other. Loosely speaking, compatible DMs represent the same domain and parallel decomposition, but hold different data.

Typically, one would confirm compatibility if intending to simultaneously iterate over a pair of vectors obtained from different DMs.

For example, two DMDA objects are compatible if they have the same local and global sizes and the same stencil width. They can have different numbers of degrees of freedom per node. Thus, one could use the node numbering from either DM in bounds for a loop over vectors derived from either DM.

Consider the operation of summing data living on a 2-dof DMDA to data living on a 1-dof DMDA, which should be compatible, as in the following snippet. -vb -.. PetscCall(DMGetCompatibility(da1,da2,&compatible,&set)); if (set && compatible) { PetscCall(DMDAVecGetArrayDOF(da1,vec1,&arr1)); PetscCall(DMDAVecGetArrayDOF(da2,vec2,&arr2)); PetscCall(DMDAGetCorners(da1,&x,&y,NULL,&m,&n,NULL)); for (j=y; j<y+n; ++j) { for (i=x; i<x+m, ++i) { arr1[j][i][0] = arr2[j][i][0] + arr2[j][i][1]; } } PetscCall(DMDAVecRestoreArrayDOF(da1,vec1,&arr1)); PetscCall(DMDAVecRestoreArrayDOF(da2,vec2,&arr2)); } else { SETERRQ(PetscObjectComm((PetscObject)da1,PETSCERRARG_INCOMP,"DMDA objects incompatible"); } -.. -ve

Checking compatibility might be expensive for a given implementation of DM, or might be impossible to unambiguously confirm or deny. For this reason, this function may decline to determine compatibility, and hence users should always check the "set" output parameter.

A DM is always compatible with itself.

In the current implementation, DMs which live on "unequal" communicators (MPIUNEQUAL in the terminology of MPIComm_compare()) are always deemed incompatible.

This function is labeled "Collective," as information about all subdomains is required on each rank. However, in DM implementations which store all this information locally, this function may be merely "Logically Collective".

Developer Note: Compatibility is assumed to be a symmetric concept; DM A is compatible with DM B iff B is compatible with A. Thus, this function checks the implementations of both dm and dmc (if they are of different types), attempting to determine compatibility. It is left to DM implementers to ensure that symmetry is preserved. The simplest way to do this is, when implementing type-specific logic for this function, is to check for existing logic in the implementation of other DM types and let *set = PETSC_FALSE if found.

See also:

DM, DMDACreateCompatibleDMDA(), DMStagCreateCompatibleDMStag()

External Links

source
PETSc.LibPETSc.DMGetCoordinateDMMethod
cdm::PetscDM = DMGetCoordinateDM(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: DM, DMSetCoordinateDM(), DMSetCoordinates(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMGSetCellCoordinateDM(),

External Links

source
PETSc.LibPETSc.DMGetCoordinateDimMethod
dim::PetscInt = DMGetCoordinateDim(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: DM, DMSetCoordinateDim(), DMGetCoordinateSection(), DMGetCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMGetCoordinateSectionMethod
DMGetCoordinateSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)

Retrieve the PetscSection of coordinate values over the mesh.

Collective

Input Parameter:

  • dm - The DM object

Output Parameter:

  • section - The PetscSection object

Level: intermediate

-seealso: DM, DMGetCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesMethod
DMGetCoordinates(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)

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

-seealso: DM, DMDA, DMSetCoordinates(), DMGetCoordinatesLocal(), DMGetCoordinateDM(), DMDASetUniformCoordinates()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalMethod
DMGetCoordinatesLocal(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)

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

-seealso: DM, DMSetCoordinatesLocal(), DMGetCoordinates(), DMSetCoordinates(), DMGetCoordinateDM(), DMGetCoordinatesLocalNoncollective()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalNoncollectiveMethod
DMGetCoordinatesLocalNoncollective(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)

Non

Not Collective

Input Parameter:

  • dm - the DM

Output Parameter:

  • c - coordinate vector

Level: advanced

-seealso: DM, DMGetCoordinatesLocalSetUp(), DMGetCoordinatesLocal(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMSetCoordinates(), DMGetCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalSetUpMethod
DMGetCoordinatesLocalSetUp(petsclib::PetscLibType,dm::PetscDM)

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

Collective

Input Parameter:

  • dm - the DM

Level: advanced

-seealso: DM, DMSetCoordinates(), DMGetCoordinatesLocalNoncollective()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalTupleMethod
DMGetCoordinatesLocalTuple(petsclib::PetscLibType,dm::PetscDM, p::IS, pCoordSection::PetscSection, pCoord::PetscVec)

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

-seealso: DM, DMDA, DMSetCoordinatesLocal(), DMGetCoordinatesLocal(), DMGetCoordinatesLocalNoncollective(), DMGetCoordinatesLocalSetUp(), DMGetCoordinates(), DMSetCoordinates(), DMGetCoordinateDM()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalizedMethod
areLocalized::PetscBool = DMGetCoordinatesLocalized(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: DM, DMLocalizeCoordinates(), DMSetPeriodicity(), DMGetCoordinatesLocalizedLocal()

External Links

source
PETSc.LibPETSc.DMGetCoordinatesLocalizedLocalMethod
areLocalized::PetscBool = DMGetCoordinatesLocalizedLocal(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: DM, DMLocalizeCoordinates(), DMGetCoordinatesLocalized(), DMSetPeriodicity()

External Links

source
PETSc.LibPETSc.DMGetDSMethod
DMGetDS(petsclib::PetscLibType,dm::PetscDM, ds::PetscDS)

Get the default PetscDS

Not Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • ds - The default PetscDS

Level: intermediate

Note: The ds is owned by the dm and should not be destroyed directly.

See also:

DM, DMGetCellDS(), DMGetRegionDS()

External Links

source
PETSc.LibPETSc.DMGetDefaultConstraintsMethod
DMGetDefaultConstraints(petsclib::PetscLibType,dm::PetscDM, section::PetscSection, mat::PetscMat, bias::PetscVec)

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

Note: This gets borrowed references, so the user should not destroy the PetscSection, Mat, or Vec.

See also:

DM, DMSetDefaultConstraints()

External Links

source
PETSc.LibPETSc.DMGetDimPointsMethod
pStart::PetscInt,pEnd::PetscInt = DMGetDimPoints(petsclib::PetscLibType,dm::PetscDM, dim::PetscInt)

Get the half

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

Note: The points are vertices in the Hasse diagram encoding the topology. This is explained in https://arxiv.org/abs/0908.4427. If no points exist of this dimension in the storage scheme, then the interval is empty.

See also:

DM, DMPLEX, DMPlexGetDepthStratum(), DMPlexGetHeightStratum()

External Links

source
PETSc.LibPETSc.DMGetDimensionMethod
dim::PetscInt = DMGetDimension(petsclib::PetscLibType,dm::PetscDM)

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.DMGetEnclosurePointMethod
pA::PetscInt = DMGetEnclosurePoint(petsclib::PetscLibType,dmA::PetscDM, dmB::PetscDM, 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

-seealso: , DM, DMPLEX, DMGetEnclosureRelation()

External Links

source
PETSc.LibPETSc.DMGetEnclosureRelationMethod
DMGetEnclosureRelation(petsclib::PetscLibType,dmA::PetscDM, dmB::PetscDM, rel::DMEnclosureType)

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

-seealso: , DM, DMPLEX, DMGetEnclosurePoint()

External Links

source
PETSc.LibPETSc.DMGetFieldMethod
DMGetField(petsclib::PetscLibType,dm::PetscDM, f::PetscInt, label::DMLabel, disc::PetscObject)

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.DMGetFieldAvoidTensorMethod
avoidTensor::PetscBool = DMGetFieldAvoidTensor(petsclib::PetscLibType,dm::PetscDM, 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.DMGetFineDMMethod
DMGetFineDM(petsclib::PetscLibType,dm::PetscDM, fdm::PetscDM)

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.DMGetFirstLabeledPointMethod
point::PetscInt = DMGetFirstLabeledPoint(petsclib::PetscLibType,dm::PetscDM, odm::PetscDM, label::DMLabel, numIds::PetscInt, ids::Vector{PetscInt}, height::PetscInt, ds::PetscDS)

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

-seealso: , DM, DMPLEX, DMPlexSetActivePoint(), DMLabel, PetscDS

External Links

source
PETSc.LibPETSc.DMGetGlobalSectionMethod
DMGetGlobalSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)

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

Collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • section - The PetscSection

Level: intermediate

Note: This gets a borrowed reference, so the user should not destroy this PetscSection.

See also:

DM, DMSetLocalSection(), DMGetLocalSection()

External Links

source
PETSc.LibPETSc.DMGetGlobalVectorMethod
DMGetGlobalVector(petsclib::PetscLibType,dm::PetscDM, g::PetscVec)

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

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

External Links

source
PETSc.LibPETSc.DMGetISColoringTypeMethod
ctype::ISColoringType = DMGetISColoringType(petsclib::PetscLibType,dm::PetscDM)

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

Options Database Key:

  • -dm_is_coloring_type - global or local

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.DMGetLabelMethod
DMGetLabel(petsclib::PetscLibType,dm::PetscDM, name::String, label::DMLabel)

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.DMGetLabelByNumMethod
DMGetLabelByNum(petsclib::PetscLibType,dm::PetscDM, n::PetscInt, label::DMLabel)

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.DMGetLabelIdISMethod
DMGetLabelIdIS(petsclib::PetscLibType,dm::PetscDM, name::String, ids::IS)

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.DMGetLabelNameMethod
DMGetLabelName(petsclib::PetscLibType,dm::PetscDM, n::PetscInt, name::String)

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

Developer Note: Some of the functions that appropriate on labels using their number have the suffix ByNum, others do not.

See also:

DM, DMLabel, DMGetLabelByNum(), DMGetLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()

External Links

source
PETSc.LibPETSc.DMGetLabelOutputMethod
output::PetscBool = DMGetLabelOutput(petsclib::PetscLibType,dm::PetscDM, 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.DMGetLabelSizeMethod
size::PetscInt = DMGetLabelSize(petsclib::PetscLibType,dm::PetscDM, 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

Developer Note: This should be renamed to something like DMGetLabelNumValues() or removed.

See also:

DM, DMLabelGetNumValues(), DMSetLabelValue(), DMGetLabel()

External Links

source
PETSc.LibPETSc.DMGetLabelValueMethod
value::PetscInt = DMGetLabelValue(petsclib::PetscLibType,dm::PetscDM, name::String, point::PetscInt)

Get the value in a DMLabel for the given point, with

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.DMGetLocalBoundingBoxMethod
lmin::Vector{PetscReal},lmax::Vector{PetscReal} = DMGetLocalBoundingBox(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: DM, DMGetCoordinates(), DMGetCoordinatesLocal(), DMGetBoundingBox()

External Links

source
PETSc.LibPETSc.DMGetLocalSectionMethod
DMGetLocalSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)

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

Note: This gets a borrowed reference, so the user should not destroy this PetscSection.

See also:

DM, DMSetLocalSection(), DMGetGlobalSection()

External Links

source
PETSc.LibPETSc.DMGetLocalToGlobalMappingMethod
DMGetLocalToGlobalMapping(petsclib::PetscLibType,dm::PetscDM, ltog::ISLocalToGlobalMapping)

Accesses the local

Collective

Input Parameter:

  • dm - the DM that provides the mapping

Output Parameter:

  • ltog - the mapping

Level: advanced

Notes: The global to local mapping allows one to set values into the global vector or matrix using VecSetValuesLocal() and MatSetValuesLocal()

Vectors obtained with DMCreateGlobalVector() and matrices obtained with DMCreateMatrix() already contain the global mapping so you do need to use this function with those objects.

This mapping can then be used by VecSetLocalToGlobalMapping() or MatSetLocalToGlobalMapping().

See also:

DM, DMCreateLocalVector(), DMCreateGlobalVector(), VecSetLocalToGlobalMapping(), MatSetLocalToGlobalMapping(), DMCreateMatrix()

External Links

source
PETSc.LibPETSc.DMGetLocalVectorMethod
 g::PetscVec = DMGetLocalVector(petsclib::PetscLibType,dm::PetscDM)

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

Note: The vector values are NOT initialized and may have garbage in them, so you may need to zero them.

The output parameter, g, is a regular PETSc vector that should be returned with DMRestoreLocalVector() DO NOT call VecDestroy() on it.

This is intended to be used for vectors you need for a short time, like within a single function call. For vectors that you intend to keep around (for example in a C struct) or pass around large parts of your code you should use DMCreateLocalVector().

VecStride*() operations can be useful when using DM with dof > 1

Level: beginner

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

External Links

source
PETSc.LibPETSc.DMGetMatTypeMethod
ctype::MatType = DMGetMatType(petsclib::PetscLibType,dm::PetscDM)

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.DMGetNamedGlobalVectorMethod
DMGetNamedGlobalVector(petsclib::PetscLibType,dm::PetscDM, name::String, X::PetscVec)

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

-seealso: DM, DMRestoreNamedGlobalVector(), DMHasNamedGlobalVector(), DMClearNamedGlobalVectors(), DMGetGlobalVector(), DMGetLocalVector()

External Links

source
PETSc.LibPETSc.DMGetNamedLocalVectorMethod
DMGetNamedLocalVector(petsclib::PetscLibType,dm::PetscDM, name::String, X::PetscVec)

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

-seealso: DM, DMGetNamedGlobalVector(), DMRestoreNamedLocalVector(), DMHasNamedLocalVector(), DMClearNamedLocalVectors(), DMGetGlobalVector(), DMGetLocalVector()

External Links

source
PETSc.LibPETSc.DMGetNaturalSFMethod
DMGetNaturalSF(petsclib::PetscLibType,dm::PetscDM, sf::PetscSF)

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

Input Parameter:

  • dm - The DM

Output Parameter:

  • sf - The PetscSF

Level: intermediate

Note: This gets a borrowed reference, so the user should not destroy this PetscSF.

See also:

DM, DMSetNaturalSF(), DMSetUseNatural(), DMGetUseNatural(), DMPlexCreateGlobalToNaturalSF(), DMPlexDistribute()

External Links

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

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

Note: Do not free the array, it is freed when the DM is destroyed.

See also:

DM, DMDAGetNeighbors(), PetscSFGetRootRanks()

External Links

source
PETSc.LibPETSc.DMGetNumAuxiliaryVecMethod
numAux::PetscInt = DMGetNumAuxiliaryVec(petsclib::PetscLibType,dm::PetscDM)

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.DMGetNumDSMethod
Nds::PetscInt = DMGetNumDS(petsclib::PetscLibType,dm::PetscDM)

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.DMGetNumFieldsMethod
numFields::PetscInt = DMGetNumFields(petsclib::PetscLibType,dm::PetscDM)

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.DMGetNumLabelsMethod
numLabels::PetscInt = DMGetNumLabels(petsclib::PetscLibType,dm::PetscDM)

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.DMGetOptionsPrefixMethod
DMGetOptionsPrefix(petsclib::PetscLibType,dm::PetscDM, prefix::String)

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.DMGetOutputDMMethod
DMGetOutputDM(petsclib::PetscLibType,dm::PetscDM, odm::PetscDM)

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

Note: In some situations the vector obtained with DMCreateGlobalVector() excludes points for degrees of freedom that are associated with fixed (Dirichelet) boundary conditions since the algebraic solver does not solve for those variables. The output DM includes these excluded points and its global vector contains the locations for those dof so that they can be output to a file or other viewer along with the unconstrained dof.

See also:

DM, VecView(), DMGetGlobalSection(), DMCreateGlobalVector(), PetscSectionHasConstraints(), DMSetGlobalSection()

External Links

source
PETSc.LibPETSc.DMGetOutputSequenceLengthMethod
len::PetscInt = DMGetOutputSequenceLength(petsclib::PetscLibType,dm::PetscDM, 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

Note: This is intended for output that should appear in sequence, for instance a set of timesteps in an PETSCVIEWERHDF5 file, or a set of realizations of a stochastic system.

Developer Note: It is unclear at the user API level why a DM is needed as input

See also:

DM, DMGetOutputSequenceNumber(), DMSetOutputSequenceNumber(), VecView()

External Links

source
PETSc.LibPETSc.DMGetOutputSequenceNumberMethod
num::PetscInt,val::PetscReal = DMGetOutputSequenceNumber(petsclib::PetscLibType,dm::PetscDM)

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

Note: This is intended for output that should appear in sequence, for instance a set of timesteps in an PETSCVIEWERHDF5 file, or a set of realizations of a stochastic system.

Developer Note: The DM serves as a convenient place to store the current iteration value. The iteration is not not directly related to the DM.

See also:

DM, VecView()

External Links

source
PETSc.LibPETSc.DMGetPeriodicityMethod
maxCell::Vector{PetscReal},Lstart::Vector{PetscReal},L::Vector{PetscReal} = DMGetPeriodicity(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: DM

External Links

source
PETSc.LibPETSc.DMGetPointSFMethod
DMGetPointSF(petsclib::PetscLibType,dm::PetscDM, sf::PetscSF)

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

Note: This gets a borrowed reference, so the user should not destroy this PetscSF.

See also:

DM, DMSetPointSF(), DMGetSectionSF(), DMSetSectionSF(), DMCreateSectionSF()

External Links

source
PETSc.LibPETSc.DMGetRefineLevelMethod
level::PetscInt = DMGetRefineLevel(petsclib::PetscLibType,dm::PetscDM)

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

Note: This can be used, by example, to set the number of coarser levels associated with this DM for a multigrid solver.

See also:

DM, DMRefine(), DMCoarsen(), DMGetCoarsenLevel(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMGetRegionDSMethod
DMGetRegionDS(petsclib::PetscLibType,dm::PetscDM, label::DMLabel, fields::IS, ds::PetscDS, dsIn::PetscDS)

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

Note: If a non-NULL label is given, but there is no PetscDS on that specific label, the PetscDS for the full domain (if present) is returned. Returns with fields = NULL and ds = NULL if there is no PetscDS for the full domain.

See also:

DM, DMGetRegionNumDS(), DMSetRegionDS(), DMGetDS(), DMGetCellDS()

External Links

source
PETSc.LibPETSc.DMGetRegionNumDSMethod
DMGetRegionNumDS(petsclib::PetscLibType,dm::PetscDM, num::PetscInt, label::DMLabel, fields::IS, ds::PetscDS, dsIn::PetscDS)

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.DMGetSectionSFMethod
DMGetSectionSF(petsclib::PetscLibType,dm::PetscDM, sf::PetscSF)

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

Note: This gets a borrowed reference, so the user should not destroy this PetscSF.

See also:

DM, DMSetSectionSF(), DMCreateSectionSF()

External Links

source
PETSc.LibPETSc.DMGetSparseLocalizeMethod
sparse::PetscBool = DMGetSparseLocalize(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: DMSetSparseLocalize(), DMLocalizeCoordinates(), DMSetPeriodicity()

External Links

source
PETSc.LibPETSc.DMGetStratumISMethod
DMGetStratumIS(petsclib::PetscLibType,dm::PetscDM, name::String, value::PetscInt, points::IS)

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.DMGetStratumSizeMethod
size::PetscInt = DMGetStratumSize(petsclib::PetscLibType,dm::PetscDM, 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.DMGetTypeMethod
type::DMType = DMGetType(petsclib::PetscLibType,dm::PetscDM)

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()

External Links

source
PETSc.LibPETSc.DMGetUseNaturalMethod
useNatural::PetscBool = DMGetUseNatural(petsclib::PetscLibType,dm::PetscDM)

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.DMGetVecTypeMethod
ctype::VecType = DMGetVecType(petsclib::PetscLibType,da::PetscDM)

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.DMGlobalToLocalMethod
DMGlobalToLocal(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)

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

Notes: The communication involved in this update can be overlapped with computation by instead using DMGlobalToLocalBegin() and DMGlobalToLocalEnd().

DMGlobalToLocalHookAdd() may be used to provide additional operations that are performed during the update process.

See also:

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

External Links

source
PETSc.LibPETSc.DMGlobalToLocalBeginMethod
DMGlobalToLocalBegin(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)

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

Notes: The operation is completed with DMGlobalToLocalEnd()

One can perform local computations between the DMGlobalToLocalBegin() and DMGlobalToLocalEnd() to overlap communication and computation

DMGlobalToLocal() is a short form of DMGlobalToLocalBegin() and DMGlobalToLocalEnd()

DMGlobalToLocalHookAdd() may be used to provide additional operations that are performed during the update process.

See also:

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

External Links

source
PETSc.LibPETSc.DMGlobalToLocalBeginDefaultShellMethod
DMGlobalToLocalBeginDefaultShell(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)

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

-seealso: DM, DMSHELL, DMGlobalToLocalEndDefaultShell()

External Links

source
PETSc.LibPETSc.DMGlobalToLocalEndMethod
DMGlobalToLocalEnd(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)

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

Note: See DMGlobalToLocalBegin() for details.

See also:

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

External Links

source
PETSc.LibPETSc.DMGlobalToLocalEndDefaultShellMethod
DMGlobalToLocalEndDefaultShell(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)

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

-seealso: DM, DMSHELL, DMGlobalToLocalBeginDefaultShell()

External Links

source
PETSc.LibPETSc.DMGlobalToLocalHookAddMethod
DMGlobalToLocalHookAdd(petsclib::PetscLibType,dm::PetscDM, beginhook::external, endhook::external, ctx::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] user-defined 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 user-defined function context

Calling sequence of endhook:

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

Level: advanced

Note: The hook may be used to provide, for example, values that represent boundary conditions in the local vectors that do not exist on the global vector.

See also:

DM, DMGlobalToLocal(), DMRefineHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMGlobalToLocalSolveMethod
DMGlobalToLocalSolve(petsclib::PetscLibType,dm::PetscDM, x::PetscVec, y::PetscVec)

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

Note: It is assumed that the sum of all the local vector sizes is greater than or equal to the global vector size, so the solution is a least-squares solution. It is also assumed that DMLocalToGlobalBegin()/DMLocalToGlobalEnd() with mode ADD_VALUES is the adjoint of the global-to-local map, so that the least-squares solution may be found by the normal equations.

If the DM is of type DMPLEX, then y is the solution of L^T * D * L * y = L^T * D * x , where D is a diagonal mask that is 1 for every point in the union of the closures of the local cells and 0 otherwise. This difference is only relevant if there are anchor points that are not in the closure of any local cell (see DMPlexGetAnchors()/DMPlexSetAnchors()).

What is L?

If this solves for a global vector from a local vector why is not called DMLocalToGlobalSolve()?

See also:

DM, DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMLocalToGlobalEnd(), DMPlexGetAnchors(), DMPlexSetAnchors()

External Links

source
PETSc.LibPETSc.DMHasBasisTransformMethod
flg::PetscBool = DMHasBasisTransform(petsclib::PetscLibType,dm::PetscDM)

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.DMHasBoundMethod
hasBound::PetscBool = DMHasBound(petsclib::PetscLibType,dm::PetscDM)

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.DMHasColoringMethod
flg::PetscBool = DMHasColoring(petsclib::PetscLibType,dm::PetscDM)

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.DMHasCreateInjectionMethod
flg::PetscBool = DMHasCreateInjection(petsclib::PetscLibType,dm::PetscDM)

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.DMHasCreateRestrictionMethod
flg::PetscBool = DMHasCreateRestriction(petsclib::PetscLibType,dm::PetscDM)

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.DMHasLabelMethod
hasLabel::PetscBool = DMHasLabel(petsclib::PetscLibType,dm::PetscDM, 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.DMHasNamedGlobalVectorMethod
exists::PetscBool = DMHasNamedGlobalVector(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: DM, DMGetNamedGlobalVector(), DMRestoreNamedLocalVector(), DMClearNamedGlobalVectors()

External Links

source
PETSc.LibPETSc.DMHasNamedLocalVectorMethod
exists::PetscBool = DMHasNamedLocalVector(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: DM, DMGetNamedGlobalVector(), DMRestoreNamedLocalVector(), DMClearNamedLocalVectors()

External Links

source
PETSc.LibPETSc.DMHasVariableBoundsMethod
flg::PetscBool = DMHasVariableBounds(petsclib::PetscLibType,dm::PetscDM)

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.DMInitializePackageMethod
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

-seealso: PetscInitialize()

External Links

source
PETSc.LibPETSc.DMInterpolateMethod
DMInterpolate(petsclib::PetscLibType,coarse::PetscDM, interp::PetscMat, fine::PetscDM)

interpolates user

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

Developer Note: This routine is called DMInterpolate() while the hook is called DMRefineHookAdd(). It would be better to have an an API with consistent terminology.

See also:

DM, DMRefineHookAdd(), MatInterpolate()

External Links

source
PETSc.LibPETSc.DMInterpolateSolutionMethod
DMInterpolateSolution(petsclib::PetscLibType,coarse::PetscDM, fine::PetscDM, interp::PetscMat, coarseSol::PetscVec, fineSol::PetscVec)

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

Note: This function exists because the interpolation of a solution vector between meshes is not always a linear map. For example, if a boundary value problem has an inhomogeneous Dirichlet boundary condition that is compressed out of the solution vector. Or if interpolation is inherently a nonlinear operation, such as a method using slope-limiting reconstruction.

Developer Note: This doesn't just interpolate "solutions" so its API name is questionable.

See also:

DM, DMInterpolate(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMInterpolationAddPointsMethod
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

Note: The input coordinate information is copied into the object.

See also:

DM, DMInterpolationInfo, DMInterpolationSetDim(), DMInterpolationEvaluate(), DMInterpolationCreate()

External Links

source
PETSc.LibPETSc.DMInterpolationCreateMethod
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

Developer Note: The naming is incorrect, either the object should be named DMInterpolation or all the routines should begin with DMInterpolationInfo

See also:

DM, DMInterpolationInfo, DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationDestroy()

External Links

source
PETSc.LibPETSc.DMInterpolationDestroyMethod
DMInterpolationDestroy(petsclib::PetscLibType,ctx::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.DMInterpolationEvaluateMethod
DMInterpolationEvaluate(petsclib::PetscLibType,ctx::DMInterpolationInfo, dm::PetscDM, x::PetscVec, v::PetscVec)

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.DMInterpolationGetCoordinatesMethod
DMInterpolationGetCoordinates(petsclib::PetscLibType,ctx::DMInterpolationInfo, coordinates::PetscVec)

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

Note: The local vector entries correspond to interpolation points lying on this process, according to the associated DM. This is a borrowed vector that the user should not destroy.

See also:

DM, DMInterpolationInfo, DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationCreate()

External Links

source
PETSc.LibPETSc.DMInterpolationGetDimMethod
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.DMInterpolationGetDofMethod
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.DMInterpolationGetVectorMethod
DMInterpolationGetVector(petsclib::PetscLibType,ctx::DMInterpolationInfo, v::PetscVec)

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

Note: This vector should be returned using DMInterpolationRestoreVector().

See also:

DM, DMInterpolationInfo, DMInterpolationRestoreVector(), DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationCreate()

External Links

source
PETSc.LibPETSc.DMInterpolationRestoreVectorMethod
DMInterpolationRestoreVector(petsclib::PetscLibType,ctx::DMInterpolationInfo, v::PetscVec)

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.DMInterpolationSetDimMethod
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.DMInterpolationSetDofMethod
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.DMInterpolationSetUpMethod
DMInterpolationSetUp(petsclib::PetscLibType,ctx::DMInterpolationInfo, dm::PetscDM, 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.DMIsForestMethod
isForest::PetscBool = DMIsForest(petsclib::PetscLibType,dm::PetscDM)

Check whether a DM uses the DMFOREST interface for hierarchically

Not Collective

Input Parameter:

  • dm - the DM object

Output Parameter:

  • isForest - whether dm is a subtype of DMFOREST

Level: intermediate

-seealso: DMFOREST, DMForestRegisterType()

External Links

source
PETSc.LibPETSc.DMKSPGetComputeInitialGuessMethod
DMKSPGetComputeInitialGuess(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeInitialGuessFn, ctx::Cvoid)

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

-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), KSPSetComputeRHS(), DMKSPSetComputeRHS(), KSPComputeInitialGuessFn

External Links

source
PETSc.LibPETSc.DMKSPGetComputeOperatorsMethod
DMKSPGetComputeOperators(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeOperatorsFn, ctx::Cvoid)

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

-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), KSPSetComputeOperators(), DMKSPSetComputeOperators(), KSPComputeOperatorsFn

External Links

source
PETSc.LibPETSc.DMKSPGetComputeRHSMethod
DMKSPGetComputeRHS(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeRHSFn, ctx::Cvoid)

get KSP right

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

-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), KSPSetComputeRHS(), DMKSPSetComputeRHS(), KSPComputeRHSFn

External Links

source
PETSc.LibPETSc.DMKSPSetComputeInitialGuessMethod
DMKSPSetComputeInitialGuess(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeInitialGuessFn, ctx::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

-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), DMKSPGetComputeRHS(), KSPComputeInitialGuessFn

External Links

source
PETSc.LibPETSc.DMKSPSetComputeOperatorsMethod
DMKSPSetComputeOperators(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeOperatorsFn, ctx::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

-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), DMKSPGetComputeOperators(), KSPSetOperators(), KSPComputeOperatorsFn

External Links

source
PETSc.LibPETSc.DMKSPSetComputeRHSMethod
DMKSPSetComputeRHS(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeRHSFn, ctx::Cvoid)

set KSP right

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

-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), DMKSPGetComputeRHS()

External Links

source
PETSc.LibPETSc.DMLoadMethod
DMLoad(petsclib::PetscLibType,newdm::PetscDM, 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

Notes: The type is determined by the data in the file, any type set into the DM before this call is ignored.

Using PETSCVIEWERHDF5 type with PETSC_VIEWER_HDF5_PETSC format, one can save multiple DMPLEX meshes in a single HDF5 file. This in turn requires one to name the DMPLEX object with PetscObjectSetName() before saving it with DMView() and before loading it with DMLoad() for identification of the mesh object.

See also:

DM, PetscViewerBinaryOpen(), DMView(), MatLoad(), VecLoad()

External Links

source
PETSc.LibPETSc.DMLocalToGlobalMethod
DMLocalToGlobal(petsclib::PetscLibType,dm::PetscDM, l::PetscVec, mode::InsertMode, g::PetscVec)

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

Notes: The communication involved in this update can be overlapped with computation by using DMLocalToGlobalBegin() and DMLocalToGlobalEnd().

In the ADD_VALUES case you normally would zero the receiving vector before beginning this operation.

INSERT_VALUES is not supported for DMDA; in that case simply compute the values directly into a global vector instead of a local one.

Use DMLocalToGlobalHookAdd() to add additional operations that are performed on the data during the update process

See also:

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

External Links

source
PETSc.LibPETSc.DMLocalToGlobalBeginMethod
DMLocalToGlobalBegin(petsclib::PetscLibType,dm::PetscDM, l::PetscVec, mode::InsertMode, g::PetscVec)

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

Notes: In the ADD_VALUES case you normally would zero the receiving vector before beginning this operation.

INSERT_VALUES is not supported for DMDA, in that case simply compute the values directly into a global vector instead of a local one.

Use DMLocalToGlobalEnd() to complete the communication process.

DMLocalToGlobal() is a short form of DMLocalToGlobalBegin() and DMLocalToGlobalEnd()

DMLocalToGlobalHookAdd() may be used to provide additional operations that are performed during the update process.

See also:

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

External Links

source
PETSc.LibPETSc.DMLocalToGlobalBeginDefaultShellMethod
DMLocalToGlobalBeginDefaultShell(petsclib::PetscLibType,dm::PetscDM, l::PetscVec, mode::InsertMode, g::PetscVec)

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

-seealso: DM, DMSHELL, DMLocalToGlobalEndDefaultShell()

External Links

source
PETSc.LibPETSc.DMLocalToGlobalEndMethod
DMLocalToGlobalEnd(petsclib::PetscLibType,dm::PetscDM, l::PetscVec, mode::InsertMode, g::PetscVec)

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

Note: See DMLocalToGlobalBegin() for full details

See also:

DM, DMLocalToGlobalBegin(), DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocalEnd()

External Links

source
PETSc.LibPETSc.DMLocalToGlobalEndDefaultShellMethod
DMLocalToGlobalEndDefaultShell(petsclib::PetscLibType,dm::PetscDM, l::PetscVec, mode::InsertMode, g::PetscVec)

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

-seealso: DM, DMSHELL, DMLocalToGlobalBeginDefaultShell()

External Links

source
PETSc.LibPETSc.DMLocalToGlobalHookAddMethod
DMLocalToGlobalHookAdd(petsclib::PetscLibType,dm::PetscDM, beginhook::external, endhook::external, ctx::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] user-defined 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 user-defined function context

Calling sequence of endhook:

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

Level: advanced

See also:

DM, DMLocalToGlobal(), DMRefineHookAdd(), DMGlobalToLocalHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMLocalToLocalBeginMethod
DMLocalToLocalBegin(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)

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

Note: Must be followed by DMLocalToLocalEnd().

See also:

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

External Links

source
PETSc.LibPETSc.DMLocalToLocalBeginDefaultShellMethod
DMLocalToLocalBeginDefaultShell(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)

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

-seealso: DM, DMSHELL, DMLocalToLocalEndDefaultShell()

External Links

source
PETSc.LibPETSc.DMLocalToLocalEndMethod
DMLocalToLocalEnd(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)

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.DMLocalToLocalEndDefaultShellMethod
DMLocalToLocalEndDefaultShell(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)

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

-seealso: DM, DMSHELL, DMLocalToLocalBeginDefaultShell()

External Links

source
PETSc.LibPETSc.DMLocalizeCoordinateMethod
out::Vector{PetscScalar} = DMLocalizeCoordinate(petsclib::PetscLibType,dm::PetscDM, in::Vector{PetscScalar}, endpoint::PetscBool)

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

-seealso: DM, DMLocalizeCoordinates(), DMLocalizeAddCoordinate()

External Links

source
PETSc.LibPETSc.DMLocalizeCoordinatesMethod
DMLocalizeCoordinates(petsclib::PetscLibType,dm::PetscDM)

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

Collective

Input Parameter:

  • dm - The DM

Level: developer

-seealso: DM, DMSetPeriodicity(), DMLocalizeCoordinate(), DMLocalizeAddCoordinate()

External Links

source
PETSc.LibPETSc.DMLocatePointsMethod
DMLocatePoints(petsclib::PetscLibType,dm::PetscDM, v::PetscVec, 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

-seealso: DM, DMSetCoordinates(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMPointLocationType

External Links

source
PETSc.LibPETSc.DMMoabFEMComputeBasisMethod
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.DMMonitorMethod
DMMonitor(petsclib::PetscLibType,dm::PetscDM)

runs the user provided monitor routines, if they exist

Collective

Input Parameter:

  • dm - The DM

Level: developer

Developer Note: Note should indicate when during the life of the DM the monitor is run. It appears to be related to the discretization process seems rather specialized since some DM have no concept of discretization.

See also:

DM, DMMonitorSet(), DMMonitorSetFromOptions()

External Links

source
PETSc.LibPETSc.DMMonitorCancelMethod
DMMonitorCancel(petsclib::PetscLibType,dm::PetscDM)

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

Note: There is no way to clear one specific monitor from a DM object.

See also:

DM, DMMonitorSet(), DMMonitorSetFromOptions(), DMMonitor()

External Links

source
PETSc.LibPETSc.DMMonitorSetMethod
DMMonitorSet(petsclib::PetscLibType,dm::PetscDM, f::external, mctx::Cvoid, monitordestroy::PetscCtxDestroyFn)

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] user-defined 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

Note: Several different monitoring routines may be set by calling DMMonitorSet() multiple times or with DMMonitorSetFromOptions(); all will be called in the order in which they were set.

Fortran Note: Only a single monitor function can be set for each DM object

Developer Note: This API has a generic name but seems specific to a very particular aspect of the use of DM

See also:

DM, DMMonitorCancel(), DMMonitorSetFromOptions(), DMMonitor(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.DMMonitorSetFromOptionsMethod
flg::PetscBool = DMMonitorSetFromOptions(petsclib::PetscLibType,dm::PetscDM, 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

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.DMOutputSequenceLoadMethod
val::PetscReal = DMOutputSequenceLoad(petsclib::PetscLibType,dm::PetscDM, 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

Note: This is intended for output that should appear in sequence, for instance a set of timesteps in an PETSCVIEWERHDF5 file, or a set of realizations of a stochastic system.

Developer Note: It is unclear at the user API level why a DM is needed as input

See also:

DM, DMGetOutputSequenceNumber(), DMSetOutputSequenceNumber(), VecView()

External Links

source
PETSc.LibPETSc.DMPatchCreateMethod
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

-seealso: DMPatchZoom()

External Links

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

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

-seealso: DMPatchSolve(), DMDACreatePatchIS()

External Links

source
PETSc.LibPETSc.DMPolytopeGetOrientationMethod
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

Note: This function is the same as DMPolytopeMatchOrientation() except it will generate an error if no suitable orientation can be found.

Developer Note: It is unclear why this function needs to exist since one can simply call DMPolytopeMatchOrientation() and error if none is found

See also:

DM, DMPolytopeType, DMPolytopeMatchOrientation(), DMPolytopeGetVertexOrientation(), DMPolytopeMatchVertexOrientation()

External Links

source
PETSc.LibPETSc.DMPolytopeGetVertexOrientationMethod
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

Note: This function is the same as DMPolytopeMatchVertexOrientation() except it errors if not orientation is possible.

Developer Note: It is unclear why this function needs to exist since one can simply call DMPolytopeMatchVertexOrientation() and error if none is found

See also:

DM, DMPolytopeType, DMPolytopeMatchVertexOrientation(), DMPolytopeGetOrientation()

External Links

source
PETSc.LibPETSc.DMPolytopeInCellTestMethod
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.DMPolytopeMatchOrientationMethod
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

Note: An arrangement is a face order combined with an orientation for each face

Each orientation (transformation) is labeled with an integer from negative DMPolytopeTypeGetNumArrangements(ct)/2 to DMPolytopeTypeGetNumArrangements(ct)/2 that labels each arrangement (face ordering plus orientation for each face).

See DMPolytopeMatchVertexOrientation() to find a new vertex orientation that takes the source vertex arrangement to the target vertex arrangement

See also:

DM, DMPolytopeGetOrientation(), DMPolytopeMatchVertexOrientation(), DMPolytopeGetVertexOrientation()

External Links

source
PETSc.LibPETSc.DMPolytopeMatchVertexOrientationMethod
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

Notes: An arrangement is a vertex order

Each orientation (transformation) is labeled with an integer from negative DMPolytopeTypeGetNumArrangements(ct)/2 to DMPolytopeTypeGetNumArrangements(ct)/2 that labels each arrangement (vertex ordering).

See DMPolytopeMatchOrientation() to find a new face orientation that takes the source face arrangement to the target face arrangement

See also:

DM, DMPolytopeType, DMPolytopeGetOrientation(), DMPolytopeMatchOrientation(), DMPolytopeTypeGetNumVertices(), DMPolytopeTypeGetVertexArrangement()

External Links

source
PETSc.LibPETSc.DMProjectFieldMethod
DMProjectField(petsclib::PetscLibType,dm::PetscDM, time::PetscReal, U::PetscVec, funcs::PetscPoCintFn, mode::InsertMode, X::PetscVec)

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

Note: There are three different DMs that potentially interact in this function. The output dm, specifies the layout of the values calculates by the function. The input DM, attached to U, may be different. For example, you can input the solution over the full domain, but output over a piece of the boundary, or a subdomain. You can also output a different number of fields than the input, with different discretizations. Last the auxiliary DM, attached to the auxiliary field vector, which is attached to dm, can also be different. It can have a different topology, number of fields, and discretizations.

See also:

DM, PetscPointFn, DMProjectFieldLocal(), DMProjectFieldLabelLocal(), DMProjectFunction(), DMComputeL2Diff()

External Links

source
PETSc.LibPETSc.DMRefineMethod
DMRefine(petsclib::PetscLibType,dm::PetscDM, comm::MPI_Comm, dmf::PetscDM)

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

Note: If no refinement was done, the return value is NULL

See also:

DM, DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateDomainDecomposition(), DMRefineHookAdd(), DMRefineHookRemove()

External Links

source
PETSc.LibPETSc.DMRefineHierarchyMethod
DMRefineHierarchy(petsclib::PetscLibType,dm::PetscDM, nlevels::PetscInt, dmf::Vector{PetscDM})

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.DMRefineHookAddMethod
DMRefineHookAdd(petsclib::PetscLibType,coarse::PetscDM, refinehook::external, interphook::external, ctx::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] user-defined 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 user-defined 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 user-defined function context

Level: advanced

Notes: This function is only needed if auxiliary data that is attached to the DMs via, for example, PetscObjectCompose(), needs to be passed to fine grids while grid sequencing.

The actual interpolation is done when DMInterpolate() is called.

If this function is called multiple times, the hooks will be run in the order they are added.

See also:

DM, DMCoarsenHookAdd(), DMInterpolate(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMRefineHookRemoveMethod
DMRefineHookRemove(petsclib::PetscLibType,coarse::PetscDM, refinehook::external, interphook::external, ctx::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] user-defined context for provide data for the hooks (may be NULL)

Level: advanced

Note: This function does nothing if the hook is not in the list.

See also:

DM, DMRefineHookAdd(), DMCoarsenHookRemove(), DMInterpolate(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()

External Links

source
PETSc.LibPETSc.DMRegisterMethod
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

Level: advanced

Note: DMRegister() may be called multiple times to add several user-defined DMs

Example Usage: -vb DMRegister("my_da", MyDMCreate); -ve

Then, your DM type can be chosen with the procedural interface via -vb DMCreate(MPIComm, DM *); DMSetType(DM,"myda"); -ve or at runtime via the option -vb -datype myda -ve

See also:

DM, DMType, DMSetType(), DMRegisterAll(), DMRegisterDestroy()

External Links

source
PETSc.LibPETSc.DMRemoveLabelMethod
DMRemoveLabel(petsclib::PetscLibType,dm::PetscDM, name::String, label::DMLabel)

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.DMRemoveLabelBySelfMethod
DMRemoveLabelBySelf(petsclib::PetscLibType,dm::PetscDM, 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

Note: Only exactly the same instance is removed if found, name match is ignored. If the DM has an exclusive reference to the label, the label gets destroyed and *label nullified.

See also:

DM, DMLabel, DMCreateLabel(), DMHasLabel(), DMGetLabel() DMGetLabelValue(), DMSetLabelValue(), DMLabelDestroy(), DMRemoveLabel()

External Links

source
PETSc.LibPETSc.DMReorderSectionGetDefaultMethod
DMReorderSectionGetDefault(petsclib::PetscLibType,dm::PetscDM, reorder::DMReorderDefaultFlag)

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

-seealso: DMReorderSetDefault()

External Links

source
PETSc.LibPETSc.DMReorderSectionGetTypeMethod
reorder::MatOrderingType = DMReorderSectionGetType(petsclib::PetscLibType,dm::PetscDM)

Get the reordering type for the local section

Not collective

Input Parameter:

  • dm - The DM

Output Parameter:

  • reorder - The reordering method

Level: intermediate

-seealso: DMReorderSetDefault(), DMReorderSectionGetDefault()

External Links

source
PETSc.LibPETSc.DMReorderSectionSetDefaultMethod
DMReorderSectionSetDefault(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: DMReorderSectionGetDefault()

External Links

source
PETSc.LibPETSc.DMReorderSectionSetTypeMethod
DMReorderSectionSetType(petsclib::PetscLibType,dm::PetscDM, reorder::MatOrderingType)

Set the type of local section reordering

Logically collective

Input Parameters:

  • dm - The DM
  • reorder - The reordering method

Level: intermediate

-seealso: DMReorderSectionGetType(), DMReorderSectionSetDefault()

External Links

source
PETSc.LibPETSc.DMRestoreGlobalVectorMethod
DMRestoreGlobalVector(petsclib::PetscLibType,dm::PetscDM, g::PetscVec)

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

-seealso: DM, DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToGlobalBegin(), DMGlobalToGlobalEnd(), DMGlobalToGlobal(), DMCreateLocalVector(), DMGetGlobalVector(), DMClearGlobalVectors()

External Links

source
PETSc.LibPETSc.DMRestoreLocalVectorMethod
DMRestoreLocalVector(petsclib::PetscLibType,dm::PetscDM, g::PetscVec)

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

-seealso: DM, DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMCreateLocalVector(), DMGetLocalVector(), DMClearLocalVectors()

External Links

source
PETSc.LibPETSc.DMRestoreNamedGlobalVectorMethod
DMRestoreNamedGlobalVector(petsclib::PetscLibType,dm::PetscDM, name::String, X::PetscVec)

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

-seealso: DM, DMGetNamedGlobalVector(), DMClearNamedGlobalVectors()

External Links

source
PETSc.LibPETSc.DMRestoreNamedLocalVectorMethod
DMRestoreNamedLocalVector(petsclib::PetscLibType,dm::PetscDM, name::String, X::PetscVec)

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

-seealso: DM, DMRestoreNamedGlobalVector(), DMGetNamedLocalVector(), DMClearNamedLocalVectors()

External Links

source
PETSc.LibPETSc.DMRestrictMethod
DMRestrict(petsclib::PetscLibType,fine::PetscDM, restrct::PetscMat, rscale::PetscVec, inject::PetscMat, coarse::PetscDM)

restricts user

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

Developer Note: Though this routine is called DMRestrict() the hooks are added with DMCoarsenHookAdd(), a consistent terminology would be better

See also:

DM, DMCoarsenHookAdd(), MatRestrict(), DMInterpolate(), DMRefineHookAdd()

External Links

source
PETSc.LibPETSc.DMSNESCheckDiscretizationMethod
error::Vector{PetscReal} = DMSNESCheckDiscretization(petsclib::PetscLibType,snes::PetscSNES, dm::PetscDM, t::PetscReal, u::PetscVec, tol::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

-seealso: , PetscDSSetExactSolution(), DNSNESCheckFromOptions(), DMSNESCheckResidual(), DMSNESCheckJacobian()

External Links

source
PETSc.LibPETSc.DMSNESCheckFromOptionsMethod
DMSNESCheckFromOptions(petsclib::PetscLibType,snes::PetscSNES, u::PetscVec)

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

-seealso: , SNES, DM

External Links

source
PETSc.LibPETSc.DMSNESCheckJacobianMethod
isLinear::PetscBool,convRate::PetscReal = DMSNESCheckJacobian(petsclib::PetscLibType,snes::PetscSNES, dm::PetscDM, u::PetscVec, 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

-seealso: , DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckResidual()

External Links

source
PETSc.LibPETSc.DMSNESCheckResidualMethod
residual::PetscReal = DMSNESCheckResidual(petsclib::PetscLibType,snes::PetscSNES, dm::PetscDM, u::PetscVec, 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

-seealso: , DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckJacobian()

External Links

source
PETSc.LibPETSc.DMSNESComputeJacobianActionMethod
DMSNESComputeJacobianAction(petsclib::PetscLibType,dm::PetscDM, X::PetscVec, Y::PetscVec, F::PetscVec, user::Cvoid)

Compute the action of the Jacobian J(X) on Y

Input Parameters:

  • dm - The DM
  • X - Local solution vector
  • Y - Local input vector
  • user - The user context

Output Parameter:

  • F - local output vector

Level: developer

-seealso: , DM, DMSNESCreateJacobianMF(), DMPlexSNESComputeResidualFEM()

External Links

source
PETSc.LibPETSc.DMSNESCreateJacobianMFMethod
J::PetscMat = DMSNESCreateJacobianMF(petsclib::PetscLibType,dm::PetscDM, X::PetscVec, user::Cvoid)

Create a Mat which computes the action of the Jacobian matrix

Collective

Input Parameters:

  • dm - The DM
  • X - The evaluation point for the Jacobian
  • user - A user context, or NULL

Output Parameter:

  • J - The Mat

Level: advanced

-seealso: , DM, SNES, DMSNESComputeJacobianAction()

External Links

source
PETSc.LibPETSc.DMSNESGetFunctionMethod
DMSNESGetFunction(petsclib::PetscLibType,dm::PetscDM, f::SNESFunctionFn, ctx::Cvoid)

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

-seealso: , DMSNES, DMSNESSetContext(), DMSNESSetFunction(), SNESSetFunction(), SNESFunctionFn

External Links

source
PETSc.LibPETSc.DMSNESGetJacobianMethod
DMSNESGetJacobian(petsclib::PetscLibType,dm::PetscDM, J::SNESJacobianFn, ctx::Cvoid)

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

-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), SNESJacobianFn

External Links

source
PETSc.LibPETSc.DMSNESGetObjectiveMethod
DMSNESGetObjective(petsclib::PetscLibType,dm::PetscDM, obj::SNESObjectiveFn, ctx::Cvoid)

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

-seealso: , DMSNES, DMSNESSetContext(), DMSNESSetObjective(), SNESSetFunction(), SNESObjectiveFn

External Links

source
PETSc.LibPETSc.DMSNESGetPicardMethod
DMSNESGetPicard(petsclib::PetscLibType,dm::PetscDM, b::SNESFunctionFn, J::SNESJacobianFn, ctx::Cvoid)

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

-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), SNESFunctionFn, SNESJacobianFn

External Links

source
PETSc.LibPETSc.DMSNESSetBoundaryLocalMethod
DMSNESSetBoundaryLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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

-seealso: , DMSNESSetObjectiveLocal(), DMSNESSetFunctionLocal(), DMSNESSetJacobianLocal()

External Links

source
PETSc.LibPETSc.DMSNESSetFunctionMethod
DMSNESSetFunction(petsclib::PetscLibType,dm::PetscDM, f::SNESFunctionFn, ctx::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

-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), SNESFunctionFn

External Links

source
PETSc.LibPETSc.DMSNESSetFunctionContextDestroyMethod
DMSNESSetFunctionContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)

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

-seealso: , DMSNES, DMSNESSetFunction(), SNESSetFunction(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.DMSNESSetFunctionLocalMethod
DMSNESSetFunctionLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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

-seealso: , DMSNESSetFunction(), DMSNESSetJacobianLocal()

External Links

source
PETSc.LibPETSc.DMSNESSetJacobianMethod
DMSNESSetJacobian(petsclib::PetscLibType,dm::PetscDM, J::SNESJacobianFn, ctx::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

-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESGetJacobian(), SNESSetJacobian(), SNESJacobianFn

External Links

source
PETSc.LibPETSc.DMSNESSetJacobianContextDestroyMethod
DMSNESSetJacobianContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)

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

-seealso: , DMSNES, DMSNESSetJacobian()

External Links

source
PETSc.LibPETSc.DMSNESSetJacobianLocalMethod
DMSNESSetJacobianLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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

-seealso: , DMSNESSetObjectiveLocal(), DMSNESSetFunctionLocal(), DMSNESSetBoundaryLocal()

External Links

source
PETSc.LibPETSc.DMSNESSetMFFunctionMethod
DMSNESSetMFFunction(petsclib::PetscLibType,dm::PetscDM, func::SNESFunctionFn, ctx::Cvoid)

set SNES residual evaluation function used in applying the matrix

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

-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), DMSNESSetFunction(), SNESFunctionFn

External Links

source
PETSc.LibPETSc.DMSNESSetNGSMethod
DMSNESSetNGS(petsclib::PetscLibType,dm::PetscDM, f::external, ctx::Cvoid)

set SNES Gauss

Not Collective

Input Parameters:

  • dm - DM to be used with SNES
  • f - relaxation function, see SNESGSFunction
  • ctx - context for residual evaluation

Level: developer

-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), DMSNESSetFunction(), SNESGSFunction

External Links

source
PETSc.LibPETSc.DMSNESSetObjectiveMethod
DMSNESSetObjective(petsclib::PetscLibType,dm::PetscDM, obj::SNESObjectiveFn, ctx::Cvoid)

Sets the objective function minimized by some of the SNES linesearch methods into a DMSNES object, used instead of the 2

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

-seealso: , DMSNES, DMSNESSetContext(), SNESGetObjective(), DMSNESSetFunction(), SNESObjectiveFn

External Links

source
PETSc.LibPETSc.DMSNESSetObjectiveLocalMethod
DMSNESSetObjectiveLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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 residual evaluation

Level: advanced

-seealso: DMSNESSetFunctionLocal(), DMSNESSetJacobianLocal()

External Links

source
PETSc.LibPETSc.DMSNESSetPicardMethod
DMSNESSetPicard(petsclib::PetscLibType,dm::PetscDM, b::SNESFunctionFn, J::SNESJacobianFn, ctx::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

-seealso: , DMSNES, SNESSetPicard(), DMSNESSetFunction(), DMSNESSetJacobian(), SNESFunctionFn, SNESJacobianFn

External Links

source
PETSc.LibPETSc.DMSetAdjacencyMethod
DMSetAdjacency(petsclib::PetscLibType,dm::PetscDM, 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.DMSetApplicationContextMethod
DMSetApplicationContext(petsclib::PetscLibType,dm::PetscDM, ctx::Cvoid)

Set a user context into a DM object

Not Collective

Input Parameters:

  • dm - the DM object
  • ctx - the user context

Level: intermediate

Note: A user context is a way to pass problem specific information that is accessible whenever the DM is available In a multilevel solver, the user context is shared by all the DM in the hierarchy; it is thus not advisable to store objects that represent discretized quantities inside the context.

Fortran Note: This only works when ctx is a Fortran derived type (it cannot be a PetscObject), we recommend writing a Fortran interface definition for this function that tells the Fortran compiler the derived data type that is passed in as the ctx argument. See DMGetApplicationContext() for an example.

See also:

DM, DMGetApplicationContext(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix()

External Links

source
PETSc.LibPETSc.DMSetApplicationContextDestroyMethod
DMSetApplicationContextDestroy(petsclib::PetscLibType,dm::PetscDM, destroy::PetscCtxDestroyFn)

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.DMSetAuxiliaryVecMethod
DMSetAuxiliaryVec(petsclib::PetscLibType,dm::PetscDM, label::DMLabel, value::PetscInt, part::PetscInt, aux::PetscVec)

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.DMSetBasicAdjacencyMethod
DMSetBasicAdjacency(petsclib::PetscLibType,dm::PetscDM, 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

Notes: -vb FEM: Two points p and q are adjacent if q in closure(star(p)), useCone = PETSCFALSE, useClosure = PETSCTRUE FVM: Two points p and q are adjacent if q in support(p+cone(p)), useCone = PETSCTRUE, useClosure = PETSCFALSE FVM++: Two points p and q are adjacent if q in star(closure(p)), useCone = PETSCTRUE, useClosure = PETSCTRUE -ve

See also:

DM, DMGetBasicAdjacency(), DMGetField(), DMSetField()

External Links

source
PETSc.LibPETSc.DMSetBlockingTypeMethod
DMSetBlockingType(petsclib::PetscLibType,dm::PetscDM, 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.DMSetCellCoordinateDMMethod
DMSetCellCoordinateDM(petsclib::PetscLibType,dm::PetscDM, cdm::PetscDM)

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

-seealso: DMGetCellCoordinateDM(), DMSetCellCoordinates(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMGetCellCoordinatesLocal(), DMSetCoordinateDM(), DMGetCoordinateDM()

External Links

source
PETSc.LibPETSc.DMSetCellCoordinateSectionMethod
DMSetCellCoordinateSection(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: DM, DMGetCoordinateDim(), DMSetCoordinateSection(), DMGetCellCoordinateSection(), DMGetCoordinateSection(), DMGetCellCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMSetCellCoordinatesMethod
DMSetCellCoordinates(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)

Sets into the DM a global vector that holds the cellwise coordinates

Collective

Input Parameters:

  • dm - the DM
  • c - cellwise coordinate vector

Level: intermediate

-seealso: DM, DMGetCoordinates(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMGetCellCoordinatesLocal(), DMGetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMSetCellCoordinatesLocalMethod
DMSetCellCoordinatesLocal(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)

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

-seealso: DM, DMGetCellCoordinatesLocal(), DMSetCellCoordinates(), DMGetCellCoordinates(), DMGetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMSetCoarseDMMethod
DMSetCoarseDM(petsclib::PetscLibType,dm::PetscDM, cdm::PetscDM)

Set the coarse DM from which this DM was obtained by refinement

Input Parameters:

  • dm - The DM object
  • cdm - The coarse DM

Level: intermediate

Note: Normally this is set automatically by DMRefine()

See also:

DM, DMGetCoarseDM(), DMCoarsen(), DMSetRefine(), DMSetFineDM()

External Links

source
PETSc.LibPETSc.DMSetCoarsenLevelMethod
DMSetCoarsenLevel(petsclib::PetscLibType,dm::PetscDM, 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

Note: This is rarely used directly, the information is automatically set when a DM is created with DMCoarsen()

See also:

DM, DMCoarsen(), DMGetCoarsenLevel(), DMGetRefineLevel(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMSetCoordinateDMMethod
DMSetCoordinateDM(petsclib::PetscLibType,dm::PetscDM, cdm::PetscDM)

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

-seealso: DM, DMGetCoordinateDM(), DMSetCoordinates(), DMGetCellCoordinateDM(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMGSetCellCoordinateDM()

External Links

source
PETSc.LibPETSc.DMSetCoordinateDimMethod
DMSetCoordinateDim(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: DM, DMGetCoordinateDim(), DMSetCoordinateSection(), DMGetCoordinateSection(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMSetCoordinateDiscMethod
DMSetCoordinateDisc(petsclib::PetscLibType,dm::PetscDM, disc::PetscFE, locized::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

-seealso: DM, PetscFE, DMGetCoordinateField()

External Links

source
PETSc.LibPETSc.DMSetCoordinateSectionMethod
DMSetCoordinateSection(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: DM, DMGetCoordinateDim(), DMGetCoordinateSection(), DMGetLocalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMSetCoordinatesMethod
DMSetCoordinates(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)

Sets into the DM a global vector that holds the coordinates

Logically Collective

Input Parameters:

  • dm - the DM
  • c - coordinate vector

Level: intermediate

-seealso: DM, DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMGetCoordinateDM(), DMDASetUniformCoordinates()

External Links

source
PETSc.LibPETSc.DMSetCoordinatesLocalMethod
DMSetCoordinatesLocal(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)

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

-seealso: DM, DMGetCoordinatesLocal(), DMSetCoordinates(), DMGetCoordinates(), DMGetCoordinateDM()

External Links

source
PETSc.LibPETSc.DMSetDefaultConstraintsMethod
DMSetDefaultConstraints(petsclib::PetscLibType,dm::PetscDM, section::PetscSection, mat::PetscMat, bias::PetscVec)

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

Notes: If a constraint matrix is specified, then it is applied during DMGlobalToLocalEnd() when mode is INSERT_VALUES, INSERT_BC_VALUES, or INSERT_ALL_VALUES. Without a constraint matrix, the local vector l returned by DMGlobalToLocalEnd() contains values that have been scattered from a global vector without modification; with a constraint matrix A, l is modified by computing c = A * l + bias, l[s[i]] = c[i], where the scatter s is defined by the PetscSection returned by DMGetDefaultConstraints().

If a constraint matrix is specified, then its adjoint is applied during DMLocalToGlobalBegin() when mode is ADD_VALUES, ADD_BC_VALUES, or ADD_ALL_VALUES. Without a constraint matrix, the local vector l is accumulated into a global vector without modification; with a constraint matrix A, l is first modified by computing c[i] = l[s[i]], l[s[i]] = 0, l = l + A'*c, which is the adjoint of the operation described above. Any bias, if specified, is ignored when accumulating.

This increments the references of the PetscSection, Mat, and Vec, so they user can destroy them.

See also:

DM, DMGetDefaultConstraints()

External Links

source
PETSc.LibPETSc.DMSetDimensionMethod
DMSetDimension(petsclib::PetscLibType,dm::PetscDM, 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.DMSetFieldMethod
DMSetField(petsclib::PetscLibType,dm::PetscDM, f::PetscInt, label::DMLabel, disc::PetscObject)

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.DMSetFieldAvoidTensorMethod
DMSetFieldAvoidTensor(petsclib::PetscLibType,dm::PetscDM, 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.DMSetFineDMMethod
DMSetFineDM(petsclib::PetscLibType,dm::PetscDM, fdm::PetscDM)

Set the fine mesh from which this was obtained by coarsening

Input Parameters:

  • dm - The DM object
  • fdm - The fine DM

Level: developer

Note: Normally this is set automatically by DMCoarsen()

See also:

DM, DMGetFineDM(), DMCoarsen(), DMRefine()

External Links

source
PETSc.LibPETSc.DMSetFromOptionsMethod
DMSetFromOptions(petsclib::PetscLibType,dm::PetscDM)

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 - 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 or local>
  • -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 <bool> - Use a reference cell domain
  • -dm_plex_dim <dim> - Set the topological dimension
  • -dm_plex_simplex <bool> - PETSC_TRUE for simplex elements, PETSC_FALSE for tensor elements
  • -dm_plex_interpolate <bool> - PETSC_TRUE turns on topological interpolation (creating edges and faces)
  • -dm_plex_orient <bool> - PETSC_TRUE turns on topological orientation (flipping edges and faces)
  • -dm_plex_scale <sc> - Scale factor for mesh coordinates
  • -dm_coord_remap <bool> - 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 <bool> - 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 <bool> - 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 <bool> - Use tensor cells when extruding
  • -dm_plex_transform_extrude_symmetric <bool> - 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 <bool> - Flag to redistribute a mesh among processes
  • -dm_distribute_overlap <n> - The size of the overlap halo
  • -dm_plex_adj_cone <bool> - Set adjacency direction
  • -dm_plex_adj_closure <bool> - Set adjacency size
  • -dm_plex_use_ceed <bool> - Use LibCEED as the FEM backend
  • -dm_plex_check_symmetry - Check that the adjacency information in the mesh is symmetric - DMPlexCheckSymmetry()
  • -dm_plex_check_skeleton - Check that each cell has the correct number of vertices (only for homogeneous simplex or tensor meshes) - DMPlexCheckSkeleton()
  • -dm_plex_check_faces - 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 - Check that cells have positive volume - DMPlexCheckGeometry()
  • -dm_plex_check_pointsf - Check some necessary conditions for PointSF - DMPlexCheckPointSF()
  • -dm_plex_check_interface_cones - Check points on inter-partition interfaces have conforming order of cone points - DMPlexCheckInterfaceCones()
  • -dm_plex_check_all - Perform all the checks above

Level: intermediate

Note: For some DMType such as DMDA this cannot be called after DMSetUp() has been called.

See also:

DM, DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMPlexCheckSymmetry(), DMPlexCheckSkeleton(), DMPlexCheckFaces(), DMPlexCheckGeometry(), DMPlexCheckPointSF(), DMPlexCheckInterfaceCones(), DMSetOptionsPrefix(), DMType, DMPLEX, DMDA, DMSetUp()

External Links

source
PETSc.LibPETSc.DMSetGlobalSectionMethod
DMSetGlobalSection(petsclib::PetscLibType,dm::PetscDM, 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

Note: Any existing PetscSection will be destroyed

See also:

DM, DMGetGlobalSection(), DMSetLocalSection()

External Links

source
PETSc.LibPETSc.DMSetISColoringTypeMethod
DMSetISColoringType(petsclib::PetscLibType,dm::PetscDM, 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 or local

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.DMSetLabelMethod
DMSetLabel(petsclib::PetscLibType,dm::PetscDM, 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.DMSetLabelOutputMethod
DMSetLabelOutput(petsclib::PetscLibType,dm::PetscDM, 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.DMSetLabelValueMethod
DMSetLabelValue(petsclib::PetscLibType,dm::PetscDM, 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.DMSetLocalSectionMethod
DMSetLocalSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)

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

Input Parameters:

  • dm - The DM
  • section - The PetscSection

Level: intermediate

Note: Any existing Section will be destroyed

See also:

DM, PetscSection, DMGetLocalSection(), DMSetGlobalSection()

External Links

source
PETSc.LibPETSc.DMSetMatTypeMethod
DMSetMatType(petsclib::PetscLibType,dm::PetscDM, ctype::MatType)

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, for example mpiaij

Level: intermediate

See also:

DM, MatType, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateMatrix(), DMCreateMassMatrix(), DMSetMatrixPreallocateOnly(), DMGetMatType(), DMCreateGlobalVector(), DMCreateLocalVector()

External Links

source
PETSc.LibPETSc.DMSetMatrixPreallocateOnlyMethod
DMSetMatrixPreallocateOnly(petsclib::PetscLibType,dm::PetscDM, 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.DMSetMatrixPreallocateSkipMethod
DMSetMatrixPreallocateSkip(petsclib::PetscLibType,dm::PetscDM, 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

Note: This is most useful to reduce initialization costs when MatSetPreallocationCOO() and MatSetValuesCOO() will be used.

See also:

DM, DMCreateMatrix(), DMSetMatrixStructureOnly(), DMSetMatrixPreallocateOnly()

External Links

source
PETSc.LibPETSc.DMSetMatrixStructureOnlyMethod
DMSetMatrixStructureOnly(petsclib::PetscLibType,dm::PetscDM, 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.DMSetNaturalSFMethod
DMSetNaturalSF(petsclib::PetscLibType,dm::PetscDM, 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.DMSetNearNullSpaceConstructorMethod
DMSetNearNullSpaceConstructor(petsclib::PetscLibType,dm::PetscDM, field::PetscInt, nullsp::external)

Provide a callback function which constructs the near

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.DMSetNullSpaceConstructorMethod
DMSetNullSpaceConstructor(petsclib::PetscLibType,dm::PetscDM, 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.DMSetNumFieldsMethod
DMSetNumFields(petsclib::PetscLibType,dm::PetscDM, 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.DMSetOptionsPrefixMethod
DMSetOptionsPrefix(petsclib::PetscLibType,dm::PetscDM, 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

Note: A hyphen (-) must NOT be given at the beginning of the prefix name. The first character of all runtime options is AUTOMATICALLY the hyphen.

See also:

DM, PetscObjectSetOptionsPrefix(), DMSetFromOptions()

External Links

source
PETSc.LibPETSc.DMSetOutputSequenceNumberMethod
DMSetOutputSequenceNumber(petsclib::PetscLibType,dm::PetscDM, 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

Note: This is intended for output that should appear in sequence, for instance a set of timesteps in an PETSCVIEWERHDF5 file, or a set of realizations of a stochastic system.

See also:

DM, VecView()

External Links

source
PETSc.LibPETSc.DMSetPeriodicityMethod
DMSetPeriodicity(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: DM, DMGetPeriodicity()

External Links

source
PETSc.LibPETSc.DMSetPointSFMethod
DMSetPointSF(petsclib::PetscLibType,dm::PetscDM, 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.DMSetRefineLevelMethod
DMSetRefineLevel(petsclib::PetscLibType,dm::PetscDM, 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

Notes: This value is used by PCMG to determine how many multigrid levels to use

The values are usually set automatically by the process that is causing the refinements of an initial DM by calling this routine.

See also:

DM, DMGetRefineLevel(), DMCoarsen(), DMGetCoarsenLevel(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()

External Links

source
PETSc.LibPETSc.DMSetRegionDSMethod
DMSetRegionDS(petsclib::PetscLibType,dm::PetscDM, label::DMLabel, fields::IS, 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

Note: If the label has a PetscDS defined, it will be replaced. Otherwise, it will be added to the DM. If the PetscDS is replaced, the fields argument is ignored.

See also:

DM, DMGetRegionDS(), DMSetRegionNumDS(), DMGetDS(), DMGetCellDS()

External Links

source
PETSc.LibPETSc.DMSetRegionNumDSMethod
DMSetRegionNumDS(petsclib::PetscLibType,dm::PetscDM, num::PetscInt, label::DMLabel, fields::IS, 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.DMSetSectionSFMethod
DMSetSectionSF(petsclib::PetscLibType,dm::PetscDM, sf::PetscSF)

Set the PetscSF encoding the parallel dof overlap for the DM

Input Parameters:

  • dm - The DM
  • sf - The PetscSF

Level: intermediate

Note: Any previous PetscSF is destroyed

See also:

DM, DMGetSectionSF(), DMCreateSectionSF()

External Links

source
PETSc.LibPETSc.DMSetSnapToGeomModelMethod
DMSetSnapToGeomModel(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: , DM, DMPLEX, DMRefine(), DMPlexCreate(), DMSnapToGeomModel()

External Links

source
PETSc.LibPETSc.DMSetSparseLocalizeMethod
DMSetSparseLocalize(petsclib::PetscLibType,dm::PetscDM, sparse::PetscBool)

Set the flag indicating that DM coordinates should be localized only for cells near the periodic boundary.

Logically collective

Input Parameters:

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

Level: intermediate

-seealso: DMGetSparseLocalize(), DMLocalizeCoordinates(), DMSetPeriodicity()

External Links

source
PETSc.LibPETSc.DMSetStratumISMethod
DMSetStratumIS(petsclib::PetscLibType,dm::PetscDM, name::String, value::PetscInt, points::IS)

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.DMSetTypeMethod
DMSetType(petsclib::PetscLibType,dm::PetscDM, method::DMType)

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

Note: Of the DM is constructed by directly calling a function to construct a particular DM, for example, DMDACreate2d() or DMPlexCreateBoxMesh()

See also:

DM, DMType, DMDA, DMPLEX, DMGetType(), DMCreate(), DMDACreate2d()

External Links

source
PETSc.LibPETSc.DMSetUpMethod
DMSetUp(petsclib::PetscLibType,dm::PetscDM)

sets up the data structures inside a DM object

Collective

Input Parameter:

  • dm - the DM object to setup

Level: intermediate

Note: This is usually called after various parameter setting operations and DMSetFromOptions() are called on the DM

See also:

DM, DMCreate(), DMSetType(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix()

External Links

source
PETSc.LibPETSc.DMSetUseNaturalMethod
DMSetUseNatural(petsclib::PetscLibType,dm::PetscDM, 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

Note: This also causes the map to be build after DMCreateSubDM() and DMCreateSuperDM()

See also:

DM, DMGetUseNatural(), DMCreate(), DMPlexDistribute(), DMCreateSubDM(), DMCreateSuperDM()

External Links

source
PETSc.LibPETSc.DMSetVIMethod
DMSetVI(petsclib::PetscLibType,dm::PetscDM, inactive::IS)

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

-seealso: , SNES, SNESVINEWTONRSLS, SNESVIGetInactiveSet()

External Links

source
PETSc.LibPETSc.DMSetVariableBoundsMethod
DMSetVariableBounds(petsclib::PetscLibType,dm::PetscDM, 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)

Level: intermediate

Developer Note: Should be called DMSetComputeVIBounds() or something similar

See also:

DM, DMComputeVariableBounds(), DMHasVariableBounds(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMGetApplicationContext(), DMSetJacobian()

External Links

source
PETSc.LibPETSc.DMSetVecTypeMethod
DMSetVecType(petsclib::PetscLibType,dm::PetscDM, ctype::VecType)

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.DMSlicedCreateMethod
dm::PetscDM = DMSlicedCreate(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, nloc::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

-seealso: DM, DMSLICED, DMDestroy(), DMCreateGlobalVector(), DMSetType(), DMSlicedSetGhosts(), DMSlicedSetPreallocation(), VecGhostUpdateBegin(), VecGhostUpdateEnd(), VecGhostGetLocalForm(), VecGhostRestoreLocalForm()

External Links

source
PETSc.LibPETSc.DMSlicedSetBlockFillsMethod
DMSlicedSetBlockFills(petsclib::PetscLibType,dm::PetscDM, dfill::Vector{PetscInt}, ofill::Vector{PetscInt})

Sets the fill pattern in each block for a multi 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

-seealso: DM, DMSLICED, DMSlicedGetMatrix(), DMDASetBlockFills()

External Links

source
PETSc.LibPETSc.DMSlicedSetGhostsMethod
DMSlicedSetGhosts(petsclib::PetscLibType,dm::PetscDM, bs::PetscInt, nloc::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

-seealso: DM, DMSLICED, DMDestroy(), DMCreateGlobalVector()

External Links

source
PETSc.LibPETSc.DMSlicedSetPreallocationMethod
DMSlicedSetPreallocation(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: DM, DMSLICED, DMDestroy(), DMCreateGlobalVector(), MatMPIAIJSetPreallocation(), MatMPIBAIJSetPreallocation(), DMSlicedGetMatrix(), DMSlicedSetBlockFills()

External Links

source
PETSc.LibPETSc.DMSnapToGeomModelMethod
gcoords::Vector{PetscScalar} = DMSnapToGeomModel(petsclib::PetscLibType,dm::PetscDM, p::PetscInt, dE::PetscInt, mcoords::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

-seealso: , DM, DMPLEX, DMRefine(), DMPlexCreate(), DMPlexSetRefinementUniform()

External Links

source
PETSc.LibPETSc.DMSubDomainHookAddMethod
DMSubDomainHookAdd(petsclib::PetscLibType,global_::PetscDM, ddhook::external, restricthook::external, ctx::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] user-defined context for provide data for the hooks (may be NULL)

Calling sequence of ddhook:

  • global - global DM
  • block - subdomain DM
  • ctx - optional user-defined 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 user-defined function context

Level: advanced

Notes: This function can be used if auxiliary data needs to be set up on subdomain DMs.

If this function is called multiple times, the hooks will be run in the order they are added.

In order to compose with nonlinear preconditioning without duplicating storage, the hook should be implemented to extract the global information from its context (instead of from the SNES).

Developer Note: It is unclear what "block solve" means within the definition of restricthook

See also:

DM, DMSubDomainHookRemove(), DMRefineHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate(), DMCreateDomainDecomposition()

External Links

source
PETSc.LibPETSc.DMSubDomainHookRemoveMethod
DMSubDomainHookRemove(petsclib::PetscLibType,global_::PetscDM, ddhook::external, restricthook::external, ctx::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] user-defined context for provide data for the hooks (may be NULL)

Level: advanced

Note: See DMSubDomainHookAdd() for the calling sequences of ddhook and restricthook

See also:

DM, DMSubDomainHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate(), DMCreateDomainDecomposition()

External Links

source
PETSc.LibPETSc.DMSubDomainRestrictMethod
DMSubDomainRestrict(petsclib::PetscLibType,global_::PetscDM, oscatter::VecScatter, gscatter::VecScatter, subdm::PetscDM)

restricts user

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.DMTSCheckFromOptionsMethod
DMTSCheckFromOptions(petsclib::PetscLibType,ts::TS, u::PetscVec)

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

-seealso: DMTS

External Links

source
PETSc.LibPETSc.DMTSCheckJacobianMethod
isLinear::PetscBool,convRate::PetscReal = DMTSCheckJacobian(petsclib::PetscLibType,ts::TS, dm::PetscDM, t::PetscReal, u::PetscVec, u_t::PetscVec, 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

-seealso: , DNTSCheckFromOptions(), DMTSCheckResidual(), DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckResidual()

External Links

source
PETSc.LibPETSc.DMTSCheckResidualMethod
residual::PetscReal = DMTSCheckResidual(petsclib::PetscLibType,ts::TS, dm::PetscDM, t::PetscReal, u::PetscVec, u_t::PetscVec, 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

-seealso: , DM, DMTSCheckFromOptions(), DMTSCheckJacobian(), DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckJacobian()

External Links

source
PETSc.LibPETSc.DMTSCreateRHSMassMatrixMethod
DMTSCreateRHSMassMatrix(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: , DM, DMTSCreateRHSMassMatrixLumped(), DMTSDestroyRHSMassMatrix(), DMCreateMassMatrix(), DMTS

External Links

source
PETSc.LibPETSc.DMTSCreateRHSMassMatrixLumpedMethod
DMTSCreateRHSMassMatrixLumped(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: , DM, DMTSCreateRHSMassMatrix(), DMTSDestroyRHSMassMatrix(), DMCreateMassMatrix(), DMTS

External Links

source
PETSc.LibPETSc.DMTSDestroyRHSMassMatrixMethod
DMTSDestroyRHSMassMatrix(petsclib::PetscLibType,dm::PetscDM)

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

-seealso: , DM, DMTSCreateRHSMassMatrixLumped(), DMCreateMassMatrix(), DMTS

External Links

source
PETSc.LibPETSc.DMTSGetForcingFunctionMethod
DMTSGetForcingFunction(petsclib::PetscLibType,dm::PetscDM, f::TSForcingFn, ctx::Cvoid)

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

-seealso: , DMTS, TS, DM, TSSetForcingFunction(), TSForcingFn

External Links

source
PETSc.LibPETSc.DMTSGetI2FunctionMethod
DMTSGetI2Function(petsclib::PetscLibType,dm::PetscDM, fun::TSI2FunctionFn, ctx::Cvoid)

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

-seealso: , DMTS, DM, TS, DMTSSetI2Function(), TSGetI2Function()

External Links

source
PETSc.LibPETSc.DMTSGetI2JacobianMethod
DMTSGetI2Jacobian(petsclib::PetscLibType,dm::PetscDM, jac::TSI2JacobianFn, ctx::Cvoid)

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

-seealso: , DMTS, DM, TS, DMTSSetI2Jacobian(), TSGetI2Jacobian(), TSI2JacobianFn

External Links

source
PETSc.LibPETSc.DMTSGetIFunctionMethod
DMTSGetIFunction(petsclib::PetscLibType,dm::PetscDM, func::TSIFunctionFn, ctx::Cvoid)

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

-seealso: , DMTS, TS, DM, DMTSSetIFunction(), TSIFunctionFn

External Links

source
PETSc.LibPETSc.DMTSGetIJacobianMethod
DMTSGetIJacobian(petsclib::PetscLibType,dm::PetscDM, func::TSIJacobianFn, ctx::Cvoid)

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

-seealso: , DMTS, DM, TS, DMTSSetIJacobian(), TSIJacobianFn

External Links

source
PETSc.LibPETSc.DMTSGetRHSFunctionMethod
DMTSGetRHSFunction(petsclib::PetscLibType,dm::PetscDM, func::TSRHSFunctionFn, ctx::Cvoid)

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

-seealso: , DMTS, DM, TS, TSRHSFunctionFn, TSGetRHSFunction()

External Links

source
PETSc.LibPETSc.DMTSGetRHSJacobianMethod
DMTSGetRHSJacobian(petsclib::PetscLibType,dm::PetscDM, func::TSRHSJacobianFn, ctx::Cvoid)

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

-seealso: , DMTS, DM, TS, DMTSSetRHSJacobian(), TSRHSJacobianFn

External Links

source
PETSc.LibPETSc.DMTSGetSolutionFunctionMethod
DMTSGetSolutionFunction(petsclib::PetscLibType,dm::PetscDM, func::TSSolutionFn, ctx::Cvoid)

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

-seealso: , DMTS, TS, DM, DMTSSetSolutionFunction(), TSSolutionFn

External Links

source
PETSc.LibPETSc.DMTSGetTransientVariableMethod
DMTSGetTransientVariable(petsclib::PetscLibType,dm::PetscDM, tvar::TSTransientVariableFn, ctx::Cvoid)

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

-seealso: , DMTS, DM, DMTSSetTransientVariable(), DMTSGetIFunction(), DMTSGetIJacobian(), TSTransientVariableFn

External Links

source
PETSc.LibPETSc.DMTSSetBoundaryLocalMethod
DMTSSetBoundaryLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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

Level: intermediate

-seealso: , DM, TS, DMTSSetIFunction(), DMTSSetIJacobianLocal()

External Links

source
PETSc.LibPETSc.DMTSSetForcingFunctionMethod
DMTSSetForcingFunction(petsclib::PetscLibType,dm::PetscDM, func::TSForcingFn, ctx::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

-seealso: , DMTS, DM, TS, TSForcingFn, TSSetForcingFunction(), DMTSGetForcingFunction()

External Links

source
PETSc.LibPETSc.DMTSSetI2FunctionMethod
DMTSSetI2Function(petsclib::PetscLibType,dm::PetscDM, fun::TSI2FunctionFn, ctx::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

-seealso: , DMTS, DM, TS, TSSetI2Function()

External Links

source
PETSc.LibPETSc.DMTSSetI2FunctionContextDestroyMethod
DMTSSetI2FunctionContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)

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

-seealso: , DMTS, TSSetI2FunctionContextDestroy(), DMTSSetI2Function(), TSSetI2Function()

External Links

source
PETSc.LibPETSc.DMTSSetI2JacobianMethod
DMTSSetI2Jacobian(petsclib::PetscLibType,dm::PetscDM, jac::TSI2JacobianFn, ctx::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

-seealso: , DMTS, DM, TS, TSI2JacobianFn, TSSetI2Jacobian()

External Links

source
PETSc.LibPETSc.DMTSSetI2JacobianContextDestroyMethod
DMTSSetI2JacobianContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)

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

-seealso: , DMTS, DM, TS, TSSetI2JacobianContextDestroy(), DMTSSetI2Jacobian(), TSSetI2Jacobian()

External Links

source
PETSc.LibPETSc.DMTSSetIFunctionMethod
DMTSSetIFunction(petsclib::PetscLibType,dm::PetscDM, func::TSIFunctionFn, ctx::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

-seealso: , DMTS, TS, DM, TSIFunctionFn

External Links

source
PETSc.LibPETSc.DMTSSetIFunctionContextDestroyMethod
DMTSSetIFunctionContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)

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

-seealso: , DMTS, DM, TS, DMTSSetIFunction(), TSSetIFunction(), PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.DMTSSetIFunctionLocalMethod
DMTSSetIFunctionLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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

Level: beginner

-seealso: , DM, DMTSGetIFunctionLocal(), DMTSSetIFunction(), DMTSSetIJacobianLocal()

External Links

source
PETSc.LibPETSc.DMTSSetIFunctionSerializeMethod
DMTSSetIFunctionSerialize(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: , DMTS, DM, TS

External Links

source
PETSc.LibPETSc.DMTSSetIJacobianMethod
DMTSSetIJacobian(petsclib::PetscLibType,dm::PetscDM, func::TSIJacobianFn, ctx::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

-seealso: , DMTS, TS, DM, TSIJacobianFn, DMTSGetIJacobian(), TSSetIJacobian()

External Links

source
PETSc.LibPETSc.DMTSSetIJacobianContextDestroyMethod
DMTSSetIJacobianContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)

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

-seealso: , DMTS, TSSetIJacobianContextDestroy(), TSSetI2JacobianContextDestroy(), DMTSSetIJacobian(), TSSetIJacobian()

External Links

source
PETSc.LibPETSc.DMTSSetIJacobianLocalMethod
DMTSSetIJacobianLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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

Level: beginner

-seealso: , DM, DMTSGetIJacobianLocal(), DMTSSetIFunctionLocal(), DMTSSetIJacobian(), DMTSSetIFunction()

External Links

source
PETSc.LibPETSc.DMTSSetIJacobianSerializeMethod
DMTSSetIJacobianSerialize(petsclib::PetscLibType,dm::PetscDM, 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

-seealso: , DMTS, DM, TS

External Links

source
PETSc.LibPETSc.DMTSSetRHSFunctionMethod
DMTSSetRHSFunction(petsclib::PetscLibType,dm::PetscDM, func::TSRHSFunctionFn, ctx::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

-seealso: , DMTS, DM, TS, TSRHSFunctionFn

External Links

source
PETSc.LibPETSc.DMTSSetRHSFunctionContextDestroyMethod
DMTSSetRHSFunctionContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)

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

-seealso: , DMTS, TSSetRHSFunctionContextDestroy(), DMTSSetRHSFunction(), TSSetRHSFunction()

External Links

source
PETSc.LibPETSc.DMTSSetRHSFunctionLocalMethod
DMTSSetRHSFunctionLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::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

Level: beginner

-seealso: , DM, DMTSGetRHSFunctionLocal(), DMTSSetRHSFunction(), DMTSSetIFunction(), DMTSSetIJacobianLocal()

External Links

source
PETSc.LibPETSc.DMTSSetRHSJacobianMethod
DMTSSetRHSJacobian(petsclib::PetscLibType,dm::PetscDM, func::TSRHSJacobianFn, ctx::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

-seealso: , DMTS, TSRHSJacobianFn, DMTSGetRHSJacobian(), TSSetRHSJacobian()

External Links

source
PETSc.LibPETSc.DMTSSetRHSJacobianContextDestroyMethod
DMTSSetRHSJacobianContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)

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

-seealso: , DMTS, TS, TSSetRHSJacobianContextDestroy(), DMTSSetRHSJacobian(), TSSetRHSJacobian()

External Links

source
PETSc.LibPETSc.DMTSSetSolutionFunctionMethod
DMTSSetSolutionFunction(petsclib::PetscLibType,dm::PetscDM, func::TSSolutionFn, ctx::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

-seealso: , DMTS, DM, TS, DMTSGetSolutionFunction(), TSSolutionFn

External Links

source
PETSc.LibPETSc.DMTSSetTransientVariableMethod
DMTSSetTransientVariable(petsclib::PetscLibType,dm::PetscDM, tvar::TSTransientVariableFn, ctx::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

-seealso: , DMTS, TS, TSBDF, TSSetTransientVariable(), DMTSGetTransientVariable(), DMTSSetIFunction(), DMTSSetIJacobian(), TSTransientVariableFn

External Links

source
PETSc.LibPETSc.DMUseTensorOrderMethod
DMUseTensorOrder(petsclib::PetscLibType,dm::PetscDM, tensor::PetscBool)

Use a tensor product closure ordering for the default section

Input Parameters:

  • dm - The DM
  • tensor - Flag for tensor order

Level: developer

-seealso: DMPlexSetClosurePermutationTensor(), PetscSectionResetClosurePermutation()

External Links

source
PETSc.LibPETSc.DMViewMethod
DMView(petsclib::PetscLibType,dm::PetscDM, 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 <int> - Specify the X-window color for cell borders
  • -dm_view_draw_cell_color <int> - Specify the X-window color for cells
  • -dm_view_draw_affine <bool> - Flag to ignore high-order edges

Level: beginner

Notes:

PetscViewer = PETSCVIEWERHDF5 i.e. HDF5 format can be used with PETSC_VIEWER_HDF5_PETSC as the PetscViewerFormat to save multiple DMPLEX meshes in a single HDF5 file. This in turn requires one to name the DMPLEX object with PetscObjectSetName() before saving it with DMView() and before loading it with DMLoad() for identification of the mesh object.

PetscViewer = PETSCVIEWEREXODUSII i.e. ExodusII format assumes that element blocks (mapped to "Cell sets" labels) consists of sequentially numbered cells.

If dm has been distributed, only the part of the DM on MPI rank 0 (including "ghost" cells and vertices) will be written.

Only TRI, TET, QUAD, and HEX cells are supported in ExodusII.

DMPLEX only represents geometry while most post-processing software expect that a mesh also provides information on the discretization space. This function assumes that the file represents Lagrange finite elements of order 1 or 2. The order of the mesh shall be set using PetscViewerExodusIISetOrder()

Variable names can be set and queried using PetscViewerExodusII[Set/Get][Nodal/Zonal]VariableNames[s].

See also:

DM, PetscViewer, PetscViewerFormat, PetscViewerSetFormat(), DMDestroy(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMLoad(), PetscObjectSetName()

External Links

source
PETSc.LibPETSc.DMViewFromOptionsMethod
DMViewFromOptions(petsclib::PetscLibType,dm::PetscDM, obj::PetscObject, 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

Level: intermediate

Note: See PetscObjectViewFromOptions() for a list of values that can be provided in the options database to determine how the DM is viewed

See also:

DM, DMView(), PetscObjectViewFromOptions(), DMCreate()

External Links

source
PETSc.LibPETSc.DMAdaptorAdaptMethod
DMAdaptorAdapt(petsclib::PetscLibType,adaptor::DMAdaptor, x::PetscVec, strategy::DMAdaptationStrategy, adm::PetscDM, ax::PetscVec)

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 <strategy> - initial, sequential, multigrid
  • -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.DMAdaptorCreateMethod
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.DMAdaptorDestroyMethod
DMAdaptorDestroy(petsclib::PetscLibType,adaptor::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.DMAdaptorGetCriterionMethod
DMAdaptorGetCriterion(petsclib::PetscLibType,adaptor::DMAdaptor, criterion::DMAdaptationCriterion)

Get the adaptation criterion

Not Collective

Input Parameter:

  • adaptor - the DMAdaptor

Output Parameter:

  • criterion - the criterion for adaptation

Level: advanced

-seealso: DMAdaptor, DMAdaptorSetCriterion(), DMAdaptationCriterion

External Links

source
PETSc.LibPETSc.DMAdaptorGetSequenceLengthMethod
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.DMAdaptorGetSolverMethod
DMAdaptorGetSolver(petsclib::PetscLibType,adaptor::DMAdaptor, snes::PetscSNES)

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.DMAdaptorGetTypeMethod
type::DMAdaptorType = 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

-seealso: , DM, DMPLEX, DMAdaptor, DMAdaptorType, DMAdaptorSetType(), DMAdaptorCreate()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorMethod
DMAdaptorMonitor(petsclib::PetscLibType,adaptor::DMAdaptor, it::PetscInt, odm::PetscDM, adm::PetscDM, Nf::PetscInt, enorms::Vector{PetscReal}, error::PetscVec)

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

-seealso: , DMAdaptorMonitorSet()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorCancelMethod
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

-seealso: , DMAdaptorMonitorError(), DMAdaptorMonitorSet(), DMAdaptor

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorErrorMethod
DMAdaptorMonitorError(petsclib::PetscLibType,adaptor::DMAdaptor, n::PetscInt, odm::PetscDM, adm::PetscDM, Nf::PetscInt, enorms::Vector{PetscReal}, error::PetscVec, vf::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

-seealso: , DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDraw(), DMAdaptorMonitorErrorDrawLG()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorErrorDrawMethod
DMAdaptorMonitorErrorDraw(petsclib::PetscLibType,adaptor::DMAdaptor, n::PetscInt, odm::PetscDM, adm::PetscDM, Nf::PetscInt, enorms::Vector{PetscReal}, error::PetscVec, vf::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

-seealso: , PETSCVIEWERDRAW, DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDrawLG()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorErrorDrawLGMethod
DMAdaptorMonitorErrorDrawLG(petsclib::PetscLibType,adaptor::DMAdaptor, n::PetscInt, odm::PetscDM, adm::PetscDM, Nf::PetscInt, enorms::Vector{PetscReal}, error::PetscVec, vf::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

-seealso: , PETSCVIEWERDRAW, DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDraw(), DMAdaptorMonitorError(), DMAdaptorMonitorTrueResidualDrawLGCreate()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorErrorDrawLGCreateMethod
vf::PetscViewerAndFormat = DMAdaptorMonitorErrorDrawLGCreate(petsclib::PetscLibType,viewer::PetscViewer, format::PetscViewerFormat, ctx::Cvoid)

Creates the context for the error plotter DMAdaptorMonitorErrorDrawLG()

Collective

Input Parameters:

  • viewer - The PetscViewer
  • format - The viewer format
  • ctx - An optional user context

Output Parameter:

  • vf - The viewer context

Level: intermediate

-seealso: , PETSCVIEWERDRAW, PetscViewerMonitorGLSetUp(), DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDrawLG()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorRegisterMethod
DMAdaptorMonitorRegister(petsclib::PetscLibType,name::String, vtype::PetscViewerType, 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

-seealso: , DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorRegisterAll(), DMAdaptorMonitorSetFromOptions()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorSetMethod
DMAdaptorMonitorSet(petsclib::PetscLibType,adaptor::DMAdaptor, monitor::external, ctx::Cvoid, monitordestroy::PetscCtxDestroyFn)

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

-seealso: , DMAdaptorMonitorError(), DMAdaptor, PetscCtxDestroyFn

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorSetFromOptionsMethod
DMAdaptorMonitorSetFromOptions(petsclib::PetscLibType,adaptor::DMAdaptor, opt::String, name::String, ctx::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 user context for the monitor, or NULL

Level: developer

-seealso: , DMAdaptorMonitorRegister(), DMAdaptorMonitorSet(), PetscOptionsGetViewer()

External Links

source
PETSc.LibPETSc.DMAdaptorMonitorSizeMethod
DMAdaptorMonitorSize(petsclib::PetscLibType,adaptor::DMAdaptor, n::PetscInt, odm::PetscDM, adm::PetscDM, Nf::PetscInt, enorms::Vector{PetscReal}, error::PetscVec, vf::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

-seealso: , DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorError(), DMAdaptorMonitorErrorDraw(), DMAdaptorMonitorErrorDrawLG()

External Links

source
PETSc.LibPETSc.DMAdaptorSetCriterionMethod
DMAdaptorSetCriterion(petsclib::PetscLibType,adaptor::DMAdaptor, criterion::DMAdaptationCriterion)

Set the adaptation criterion

Not Collective

Input Parameters:

  • adaptor - the DMAdaptor
  • criterion - the adaptation criterion

Level: advanced

-seealso: DMAdaptor, DMAdaptorGetCriterion(), DMAdaptationCriterion

External Links

source
PETSc.LibPETSc.DMAdaptorSetFromOptionsMethod
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.DMAdaptorSetMixedSetupFunctionMethod
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

Level: advanced

-seealso: DMAdaptor, DMAdaptorGetMixedSetupFunction(), DMAdaptorAdapt()

External Links

source
PETSc.LibPETSc.DMAdaptorSetOptionsPrefixMethod
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

-seealso: , DMAdaptor, SNESSetOptionsPrefix(), DMAdaptorSetFromOptions()

External Links

source
PETSc.LibPETSc.DMAdaptorSetSequenceLengthMethod
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.DMAdaptorSetSolverMethod
DMAdaptorSetSolver(petsclib::PetscLibType,adaptor::DMAdaptor, snes::PetscSNES)

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.DMAdaptorSetTypeMethod
DMAdaptorSetType(petsclib::PetscLibType,adaptor::DMAdaptor, method::DMAdaptorType)

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

-seealso: , DM, DMPLEX, DMAdaptor, DMAdaptorType, DMAdaptorGetType(), DMAdaptorCreate()

External Links

source
PETSc.LibPETSc.DMAdaptorSetUpMethod
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.DMAdaptorViewMethod
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.DMFieldCreateDefaultFaceQuadratureMethod
quad::PetscQuadrature = DMFieldCreateDefaultFaceQuadrature(petsclib::PetscLibType,field::DMField, pointIS::IS)

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

-seealso: DMFieldCreateDefaultQuadrature(), DMField, PetscQuadrature, IS, DMFieldEvaluteFE(), DMFieldGetDegree()

External Links

source
PETSc.LibPETSc.DMFieldCreateDefaultQuadratureMethod
quad::PetscQuadrature = DMFieldCreateDefaultQuadrature(petsclib::PetscLibType,field::DMField, pointIS::IS)

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

-seealso: DMFieldCreateDefaultFaceQuadrature(), DMField, PetscQuadrature, IS, DMFieldEvaluteFE(), DMFieldGetDegree()

External Links

source
PETSc.LibPETSc.DMFieldCreateFEGeomMethod
geom::PetscFEGeom = DMFieldCreateFEGeom(petsclib::PetscLibType,field::DMField, pointIS::IS, 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

-seealso: DMField, PetscQuadrature, IS, PetscFEGeom, DMFieldEvaluateFE(), DMFieldCreateDefaulteQuadrature(), DMFieldGetDegree()

External Links

source
PETSc.LibPETSc.DMFieldDestroyMethod
DMFieldDestroy(petsclib::PetscLibType,field::DMField)

destroy a DMField

Collective

Input Parameter:

  • field - address of DMField

Level: advanced

-seealso: DMField, DMFieldCreate()

External Links

source
PETSc.LibPETSc.DMFieldEvaluateMethod
DMFieldEvaluate(petsclib::PetscLibType,field::DMField, points::PetscVec, datatype::PetscDataType, B::Cvoid, D::Cvoid, H::Cvoid)

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

-seealso: DMField, DMFieldGetDM(), DMFieldGetNumComponents(), DMFieldEvaluateFE(), DMFieldEvaluateFV(), PetscDataType

External Links

source
PETSc.LibPETSc.DMFieldEvaluateFEMethod
DMFieldEvaluateFE(petsclib::PetscLibType,field::DMField, cellIS::IS, points::PetscQuadrature, datatype::PetscDataType, B::Cvoid, D::Cvoid, H::Cvoid)

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

-seealso: DMField, DM, DMFieldGetNumComponents(), DMFieldEvaluate(), DMFieldEvaluateFV()

External Links

source
PETSc.LibPETSc.DMFieldEvaluateFVMethod
DMFieldEvaluateFV(petsclib::PetscLibType,field::DMField, cellIS::IS, datatype::PetscDataType, B::Cvoid, D::Cvoid, H::Cvoid)

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

-seealso: DMField, IS, DMFieldGetNumComponents(), DMFieldEvaluate(), DMFieldEvaluateFE(), PetscDataType

External Links

source
PETSc.LibPETSc.DMFieldGetDMMethod
DMFieldGetDM(petsclib::PetscLibType,field::DMField, dm::PetscDM)

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

-seealso: DMField, DM, DMFieldEvaluate()

External Links

source
PETSc.LibPETSc.DMFieldGetDegreeMethod
minDegree::PetscInt,maxDegree::PetscInt = DMFieldGetDegree(petsclib::PetscLibType,field::DMField, cellIS::IS)

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

-seealso: DMField, IS, DMFieldEvaluateFE()

External Links

source
PETSc.LibPETSc.DMFieldGetNumComponentsMethod
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

-seealso: DMField, DMFieldEvaluate()

External Links

source
PETSc.LibPETSc.DMFieldGetTypeMethod
type::DMFieldType = 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

-seealso: DMField, DMFieldSetType(), DMFieldType

External Links

source
PETSc.LibPETSc.DMFieldRegisterMethod
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

-seealso: DMField, DMFieldRegisterAll(), DMFieldRegisterDestroy()

External Links

source
PETSc.LibPETSc.DMFieldSetTypeMethod
DMFieldSetType(petsclib::PetscLibType,field::DMField, type::DMFieldType)

set the DMField implementation

Collective

Input Parameters:

  • field - the DMField context
  • type - a known method

Level: advanced

-seealso: DMField, DMFieldGetType(), DMFieldType,

External Links

source
PETSc.LibPETSc.DMFieldViewMethod
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

-seealso: DMField, DMFieldCreate()

External Links

source
PETSc.LibPETSc.DMLabelAddStrataMethod
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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelAddStrataISMethod
DMLabelAddStrataIS(petsclib::PetscLibType,label::DMLabel, valueIS::IS)

Adds new stratum values in a DMLabel

Not Collective

Input Parameters:

  • label - The DMLabel
  • valueIS - Index set with stratum values

Level: beginner

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelAddStratumMethod
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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelClearStratumMethod
DMLabelClearStratum(petsclib::PetscLibType,label::DMLabel, value::PetscInt)

Remove a stratum

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the stratum value

Level: intermediate

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelClearValueMethod
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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelCompareMethod
equal::PetscBool = DMLabelCompare(petsclib::PetscLibType,comm::MPI_Comm, l0::DMLabel, l1::DMLabel, message::Cchar)

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

-seealso: DMLabel, DM, DMCompareLabels(), DMLabelGetNumValues(), DMLabelGetDefaultValue(), DMLabelGetNonEmptyStratumValuesIS(), DMLabelGetStratumIS()

External Links

source
PETSc.LibPETSc.DMLabelComputeIndexMethod
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

-seealso: DMLabel, DM, DMLabelHasPoint(), DMLabelCreateIndex(), DMLabelDestroyIndex(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelConvertToSectionMethod
DMLabelConvertToSection(petsclib::PetscLibType,label::DMLabel, section::PetscSection, is::IS)

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

-seealso: DMLabel, DM, DMLabelDistribute()

External Links

source
PETSc.LibPETSc.DMLabelCreateMethod
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

-seealso: DMLabel, DM, DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelCreateIndexMethod
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

-seealso: DMLabel, DM, DMLabelHasPoint(), DMLabelComputeIndex(), DMLabelDestroyIndex(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelDestroyMethod
DMLabelDestroy(petsclib::PetscLibType,label::DMLabel)

Destroys a DMLabel

Collective

Input Parameter:

  • label - The DMLabel

Level: beginner

-seealso: DMLabel, DM, DMLabelReset(), DMLabelCreate()

External Links

source
PETSc.LibPETSc.DMLabelDestroyIndexMethod
DMLabelDestroyIndex(petsclib::PetscLibType,label::DMLabel)

Destroy the index structure

Not Collective

Input Parameter:

  • label - the DMLabel

Level: intermediate

-seealso: DMLabel, DM, DMLabelHasPoint(), DMLabelCreateIndex(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelDistributeMethod
DMLabelDistribute(petsclib::PetscLibType,label::DMLabel, sf::PetscSF, labelNew::DMLabel)

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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelDuplicateMethod
labelnew::DMLabel = DMLabelDuplicate(petsclib::PetscLibType,label::DMLabel)

Duplicates a DMLabel

Collective

Input Parameter:

  • label - The DMLabel

Output Parameter:

  • labelnew - new label

Level: intermediate

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelEphemeralGetLabelMethod
DMLabelEphemeralGetLabel(petsclib::PetscLibType,label::DMLabel, olabel::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

-seealso: DMLabelEphemeralSetLabel(), DMLabelEphemeralGetTransform(), DMLabelSetType()

External Links

source
PETSc.LibPETSc.DMLabelEphemeralGetTransformMethod
DMLabelEphemeralGetTransform(petsclib::PetscLibType,label::DMLabel, tr::DMPlexTransform)

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

-seealso: DMLabelEphemeralSetTransform(), DMLabelEphemeralGetLabel(), DMLabelSetType()

External Links

source
PETSc.LibPETSc.DMLabelEphemeralSetLabelMethod
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

-seealso: DMLabelEphemeralGetLabel(), DMLabelEphemeralSetTransform(), DMLabelSetType()

External Links

source
PETSc.LibPETSc.DMLabelEphemeralSetTransformMethod
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

-seealso: DMLabelEphemeralGetTransform(), DMLabelEphemeralSetLabel(), DMLabelSetType()

External Links

source
PETSc.LibPETSc.DMLabelFilterMethod
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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGatherMethod
DMLabelGather(petsclib::PetscLibType,label::DMLabel, sf::PetscSF, labelNew::DMLabel)

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

-seealso: DMLabel, DM, DMLabelDistribute()

External Links

source
PETSc.LibPETSc.DMLabelGetBoundsMethod
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

-seealso: DMLabel, DM, DMLabelHasPoint(), DMLabelCreateIndex(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelGetDefaultValueMethod
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

-seealso: DMLabel, DM, DMLabelSetDefaultValue(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelGetNonEmptyStratumValuesISMethod
DMLabelGetNonEmptyStratumValuesIS(petsclib::PetscLibType,label::DMLabel, values::IS)

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

-seealso: DMLabel, DM, DMLabelGetValueIS(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetNumValuesMethod
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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetStratumBoundsMethod
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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetStratumISMethod
DMLabelGetStratumIS(petsclib::PetscLibType,label::DMLabel, value::PetscInt, points::IS)

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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetStratumPointIndexMethod
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

-seealso: DMLabel, DM, DMLabelGetValueIndex(), DMLabelGetStratumIS(), DMLabelCreate()

External Links

source
PETSc.LibPETSc.DMLabelGetStratumSizeMethod
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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetTypeMethod
type::DMLabelType = 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

-seealso: DMLabel, DM, DMLabelSetType(), DMLabelCreate()

External Links

source
PETSc.LibPETSc.DMLabelGetValueMethod
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 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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelSetValue(), DMLabelClearValue(), DMLabelGetDefaultValue(), DMLabelSetDefaultValue()

External Links

source
PETSc.LibPETSc.DMLabelGetValueBoundsMethod
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

-seealso: DMLabel, DM, DMLabelGetBounds(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelGetValueISMethod
DMLabelGetValueIS(petsclib::PetscLibType,label::DMLabel, values::IS)

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

-seealso: DMLabel, DM, DMLabelGetNonEmptyStratumValuesIS(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelGetValueIndexMethod
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

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the value

Output Parameter:

  • index - the index of value in the list of values

Level: intermediate

-seealso: DMLabel, DM, DMLabelGetValueIS(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelHasPointMethod
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

-seealso: DMLabel, DM, DMLabelCreateIndex(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelHasStratumMethod
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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelHasValueMethod
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

-seealso: DMLabel, DM, DMLabelHasPoint(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelInsertISMethod
DMLabelInsertIS(petsclib::PetscLibType,label::DMLabel, is::IS, 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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelPermuteMethod
DMLabelPermute(petsclib::PetscLibType,label::DMLabel, permutation::IS, labelNew::DMLabel)

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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelPermuteValuesMethod
DMLabelPermuteValues(petsclib::PetscLibType,label::DMLabel, permutation::IS)

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

-seealso: DMLabelRewriteValues(), DMLabel, DM, DMLabelPermute(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelPropagateBeginMethod
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

-seealso: DMLabel, DM, DMLabelPropagateEnd(), DMLabelPropagatePush()

External Links

source
PETSc.LibPETSc.DMLabelPropagateEndMethod
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

-seealso: DMLabel, DM, DMLabelPropagateBegin(), DMLabelPropagatePush()

External Links

source
PETSc.LibPETSc.DMLabelPropagatePushMethod
DMLabelPropagatePush(petsclib::PetscLibType,label::DMLabel, pointSF::PetscSF, markPoint::external, ctx::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 user 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 user context

Level: intermediate

-seealso: DMLabel, DM, DMLabelPropagateBegin(), DMLabelPropagateEnd()

External Links

source
PETSc.LibPETSc.DMLabelResetMethod
DMLabelReset(petsclib::PetscLibType,label::DMLabel)

Destroys internal data structures in a DMLabel

Not Collective

Input Parameter:

  • label - The DMLabel

Level: beginner

-seealso: DMLabel, DM, DMLabelDestroy(), DMLabelCreate()

External Links

source
PETSc.LibPETSc.DMLabelRewriteValuesMethod
DMLabelRewriteValues(petsclib::PetscLibType,label::DMLabel, permutation::IS)

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

-seealso: DMLabelPermuteValues(), DMLabel, DM, DMLabelPermute(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelSetDefaultValueMethod
defaultValue::PetscInt = DMLabelSetDefaultValue(petsclib::PetscLibType,label::DMLabel)

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

-seealso: DMLabel, DM, DMLabelGetDefaultValue(), DMLabelGetValue(), DMLabelSetValue()

External Links

source
PETSc.LibPETSc.DMLabelSetStratumBoundsMethod
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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelSetStratumIS(), DMLabelGetStratumIS()

External Links

source
PETSc.LibPETSc.DMLabelSetStratumISMethod
DMLabelSetStratumIS(petsclib::PetscLibType,label::DMLabel, value::PetscInt, is::IS)

Set the stratum points using an IS

Not Collective

Input Parameters:

  • label - the DMLabel
  • value - the stratum value
  • is - The stratum points

Level: intermediate

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelSetTypeMethod
DMLabelSetType(petsclib::PetscLibType,label::DMLabel, method::DMLabelType)

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; use -help for a list of available types or see DMLabelType

Level: intermediate

-seealso: DMLabel, DM, DMLabelGetType(), DMLabelCreate()

External Links

source
PETSc.LibPETSc.DMLabelSetUpMethod
DMLabelSetUp(petsclib::PetscLibType,label::DMLabel)

SetUp a DMLabel object

Collective

Input Parameters:

  • label - The DMLabel

Level: intermediate

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source
PETSc.LibPETSc.DMLabelSetValueMethod
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 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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelClearValue(), DMLabelGetDefaultValue(), DMLabelSetDefaultValue()

External Links

source
PETSc.LibPETSc.DMLabelStratumHasPointMethod
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

-seealso: DMLabel, DM, DMLabelCreate(), DMLabelSetValue(), DMLabelClearValue()

External Links

source
PETSc.LibPETSc.DMLabelViewMethod
DMLabelView(petsclib::PetscLibType,label::DMLabel, viewer::PetscViewer)

View the label

Collective

Input Parameters:

  • label - The DMLabel
  • viewer - The PetscViewer

Level: intermediate

-seealso: DMLabel, PetscViewer, DM, DMLabelCreate(), DMLabelDestroy()

External Links

source