DM (Domain Management)
The DM (Domain Management) object encapsulates the relationship between a mesh data structure and the algebraic objects (vectors, matrices). It provides a common interface for structured and unstructured meshes, particles, networks, and other geometric/topological structures.
Overview
The DM abstraction in PETSc manages:
- Topology and geometry of computational domains
- Mapping between geometric entities and degrees of freedom
- Distribution of data across MPI processes
- Multi-level representations for multigrid
- Field definitions and discretizations
Basic Usage Pattern
using PETSc, MPI
# Initialize
petsclib = PETSc.petsclibs[1]
PETSc.initialize(petsclib)
# Create a DM (specific type created via DMDACreate, DMPlexCreate, etc.)
# See subtype-specific pages for creation functions
# Setup the DM
LibPETSc.DMSetFromOptions(petsclib, dm)
LibPETSc.DMSetUp(petsclib, dm)
# Create global vectors
x = LibPETSc.DMCreateGlobalVector(petsclib, dm)
# Create matrices
A = LibPETSc.DMCreateMatrix(petsclib, dm)
# Use the DM...
# Cleanup
LibPETSc.VecDestroy(petsclib, x)
LibPETSc.MatDestroy(petsclib, A)
LibPETSc.DMDestroy(petsclib, dm)
PETSc.finalize(petsclib)DM Subtypes
PETSc provides several DM implementations for different problem types:
- DMDA: Structured grids (1D, 2D, 3D) with regular topology
- DMPlex: Unstructured meshes using Sieve/DMPlex topology
- DMStag: Staggered grids for staggered finite differences
- DMSwarm: Particle methods and particle-in-cell
- DMForest: Adaptive mesh refinement with forest-of-octrees
- DMNetwork: Network/graph-based problems
- DMShell and others: User-defined and composite DM types
General DM Functions
The following functions work across all DM types:
PETSc.LibPETSc.DMAdaptInterpolator — Method
DMAdaptInterpolator(petsclib::PetscLibType,dmc::PetscDM, dmf::PetscDM, In::PetscMat, smoother::PetscKSP, MF::PetscMat, MC::PetscMat, InAdapt::PetscMat, user::Cvoid)External Links
- PETSc Manual:
DM/DMAdaptInterpolator
PETSc.LibPETSc.DMAdaptLabel — Method
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-adaptationDMobjectlabel- label with the flags
Output Parameters:
dmAdapt- the adaptedDMobject: may beNULLif an adaptedDMcould not be produced.
Level: intermediate
-seealso: DM, DMAdaptMetric(), DMCoarsen(), DMRefine()
External Links
- PETSc Manual:
DM/DMAdaptLabel
PETSc.LibPETSc.DMAdaptMetric — Method
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 objectmetric- The metric to which the mesh is adapted, defined vertex-wise.bdLabel- Label for boundary tags, which will be preserved in the output mesh.bdLabelshould beNULLif there is no such label, and should be different from "boundary".rgLabel- Label for cell tags, which will be preserved in the output mesh.rgLabelshould beNULLif there is no such label, and should be different from "regions".
Output Parameter:
dmAdapt- Pointer to theDMobject containing the adapted mesh
-seealso: DMAdaptLabel(), DMCoarsen(), DMRefine()
External Links
- PETSc Manual:
DM/DMAdaptMetric
PETSc.LibPETSc.DMAddBoundary — Method
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- TheDM, with aPetscDSthat matches the problem being constrainedtype- The type of condition, e.g.DM_BC_ESSENTIAL_ANALYTIC,DM_BC_ESSENTIAL_FIELD(Dirichlet), orDM_BC_NATURAL(Neumann)name- The BC namelabel- The label defining constrained pointsNv- The number ofDMLabelvalues for constrained pointsvalues- An array of values for constrained pointsfield- The field to constrainNc- The number of constrained field components (0 will constrain all components)comps- An array of constrained component numbersbcFunc- A pointwise function giving boundary valuesbcFunc_t- A pointwise function giving the time derivative of the boundary values, orNULLctx- 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 dimensionNf- the number of fieldsuOff- the offset into u[] and u_t[] for each fielduOff_x- the offset into u_x[] for each fieldu- each field evaluated at the current pointu_t- the time derivative of each field evaluated at the current pointu_x- the gradient of each field evaluated at the current pointaOff- the offset into a[] and a_t[] for each auxiliary fieldaOff_x- the offset into a_x[] for each auxiliary fielda- each auxiliary field evaluated at the current pointa_t- the time derivative of each auxiliary field evaluated at the current pointa_x- the gradient of auxiliary each field evaluated at the current pointt- current timex- coordinates of the current pointnumConstants- number of constant parametersconstants- constant parametersbcval- output values at the current point
See also:
DM, DSGetBoundary(), PetscDSAddBoundary()
External Links
- PETSc Manual:
DM/DMAddBoundary
PETSc.LibPETSc.DMAddField — Method
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- TheDMlabel- The label indicating the support of the field, orNULLfor the entire meshdisc- 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
- PETSc Manual:
DM/DMAddField
PETSc.LibPETSc.DMAddLabel — Method
DMAddLabel(petsclib::PetscLibType,dm::PetscDM, label::DMLabel)Add the label to this DM
Not Collective
Input Parameters:
dm- TheDMobjectlabel- TheDMLabel
Level: developer
See also:
DM, DMLabel, DMCreateLabel(), DMHasLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()
External Links
- PETSc Manual:
DM/DMAddLabel
PETSc.LibPETSc.DMAppendOptionsPrefix — Method
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- theDMcontextprefix- 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
- PETSc Manual:
DM/DMAppendOptionsPrefix
PETSc.LibPETSc.DMCheckInterpolator — Method
DMCheckInterpolator(petsclib::PetscLibType,dmf::PetscDM, In::PetscMat, MC::PetscMat, MF::PetscMat, tol::PetscReal)External Links
- PETSc Manual:
DM/DMCheckInterpolator
PETSc.LibPETSc.DMClearAuxiliaryVec — Method
DMClearAuxiliaryVec(petsclib::PetscLibType,dm::PetscDM)Destroys the auxiliary vector information and creates a new empty one
Not Collective
Input Parameter:
dm- TheDM
Level: advanced
See also:
DM, DMCopyAuxiliaryVec(), DMGetNumAuxiliaryVec(), DMGetAuxiliaryVec(), DMSetAuxiliaryVec()
External Links
- PETSc Manual:
DM/DMClearAuxiliaryVec
PETSc.LibPETSc.DMClearDS — Method
DMClearDS(petsclib::PetscLibType,dm::PetscDM)Remove all discrete systems from the DM
Logically Collective
Input Parameter:
dm- TheDM
Level: intermediate
See also:
DM, DMGetNumDS(), DMGetDS(), DMSetField()
External Links
- PETSc Manual:
DM/DMClearDS
PETSc.LibPETSc.DMClearFields — Method
DMClearFields(petsclib::PetscLibType,dm::PetscDM)Remove all fields from the DM
Logically Collective
Input Parameter:
dm- TheDM
Level: intermediate
See also:
DM, DMGetNumFields(), DMSetNumFields(), DMSetField()
External Links
- PETSc Manual:
DM/DMClearFields
PETSc.LibPETSc.DMClearGlobalVectors — Method
DMClearGlobalVectors(petsclib::PetscLibType,dm::PetscDM)Destroys all the global vectors that have been created for DMGetGlobalVector() calls in this DM
Collective
Input Parameter:
dm- theDM
Level: developer
-seealso: DM, DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMCreateLocalVector(), DMRestoreLocalVector() VecStrideMax(), VecStrideMin(), VecStrideNorm(), DMClearLocalVectors()
External Links
- PETSc Manual:
DM/DMClearGlobalVectors
PETSc.LibPETSc.DMClearLabelStratum — Method
DMClearLabelStratum(petsclib::PetscLibType,dm::PetscDM, name::String, value::PetscInt)Remove all points from a stratum from a DMLabel
Not Collective
Input Parameters:
dm- TheDMobjectname- The label namevalue- The label value for this point
Output Parameter:
Level: beginner
See also:
DM, DMLabel, DMLabelClearStratum(), DMSetLabelValue(), DMGetStratumIS(), DMClearLabelValue()
External Links
- PETSc Manual:
DM/DMClearLabelStratum
PETSc.LibPETSc.DMClearLabelValue — Method
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- TheDMobjectname- The label namepoint- The mesh pointvalue- The label value for this point
Level: beginner
See also:
DM, DMLabelClearValue(), DMSetLabelValue(), DMGetStratumIS()
External Links
- PETSc Manual:
DM/DMClearLabelValue
PETSc.LibPETSc.DMClearLocalVectors — Method
DMClearLocalVectors(petsclib::PetscLibType,dm::PetscDM)Destroys all the local vectors that have been created for DMGetLocalVector() calls in this DM
Collective
Input Parameter:
dm- theDM
Level: developer
-seealso: DM, DMCreateLocalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMLocalToLocalBegin(), DMLocalToLocalEnd(), DMRestoreLocalVector() VecStrideMax(), VecStrideMin(), VecStrideNorm(), DMClearGlobalVectors()
External Links
- PETSc Manual:
DM/DMClearLocalVectors
PETSc.LibPETSc.DMClearNamedGlobalVectors — Method
DMClearNamedGlobalVectors(petsclib::PetscLibType,dm::PetscDM)Destroys all the named global vectors that have been created with DMGetNamedGlobalVector() in this DM
Collective
Input Parameter:
dm- theDM
Level: developer
-seealso: DM, DMGetNamedGlobalVector(), DMGetNamedLocalVector(), DMClearNamedLocalVectors()
External Links
- PETSc Manual:
DM/DMClearNamedGlobalVectors
PETSc.LibPETSc.DMClearNamedLocalVectors — Method
DMClearNamedLocalVectors(petsclib::PetscLibType,dm::PetscDM)Destroys all the named local vectors that have been created with DMGetNamedLocalVector() in this DM
Collective
Input Parameter:
dm- theDM
Level: developer
-seealso: DM, DMGetNamedGlobalVector(), DMGetNamedLocalVector(), DMClearNamedGlobalVectors()
External Links
- PETSc Manual:
DM/DMClearNamedLocalVectors
PETSc.LibPETSc.DMClone — Method
DMClone(petsclib::PetscLibType,dm::PetscDM, newdm::PetscDM)Creates a DM object with the same topology as the original.
Collective
Input Parameter:
dm- The originalDMobject
Output Parameter:
newdm- The newDMobject
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
- PETSc Manual:
DM/DMClone
PETSc.LibPETSc.DMCoarsen — Method
DMCoarsen(petsclib::PetscLibType,dm::PetscDM, comm::MPI_Comm, dmc::PetscDM)Coarsens a DM object using a standard, non
Collective
Input Parameters:
dm- theDMobjectcomm- the communicator to contain the newDMobject (orMPI_COMM_NULL)
Output Parameter:
dmc- the coarsenedDM
Level: developer
See also:
DM, DMRefine(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateDomainDecomposition(), DMCoarsenHookAdd(), DMCoarsenHookRemove()
External Links
- PETSc Manual:
DM/DMCoarsen
PETSc.LibPETSc.DMCoarsenHierarchy — Method
DMCoarsenHierarchy(petsclib::PetscLibType,dm::PetscDM, nlevels::PetscInt, dmc::Vector{PetscDM})Coarsens a DM object, all levels at once
Collective
Input Parameters:
dm- theDMobjectnlevels- the number of levels of coarsening
Output Parameter:
dmc- the coarsenedDMhierarchy
Level: developer
See also:
DM, DMCoarsen(), DMRefineHierarchy(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()
External Links
- PETSc Manual:
DM/DMCoarsenHierarchy
PETSc.LibPETSc.DMCoarsenHookAdd — Method
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-DMon which to run a hook when restricting to a coarser levelcoarsenhook- function to run when setting up a coarser levelrestricthook- function to run to update data on coarser levels (called once perSNESSolve())ctx- [optional] user-defined context for provide data for the hooks (may beNULL)
Calling sequence of coarsenhook:
fine- fine levelDMcoarse- coarse levelDMto restrict problem toctx- optional user-defined function context
Calling sequence of restricthook:
fine- fine levelDMmrestrict- matrix restricting a fine-level solution to the coarse grid, usually the transpose of the interpolationrscale- scaling vector for restrictioninject- matrix restricting by injectioncoarse- coarse level DM to updatectx- 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
- PETSc Manual:
DM/DMCoarsenHookAdd
PETSc.LibPETSc.DMCoarsenHookRemove — Method
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-DMon which to run a hook when restricting to a coarser levelcoarsenhook- function to run when setting up a coarser levelrestricthook- function to run to update data on coarser levelsctx- [optional] user-defined context for provide data for the hooks (may beNULL)
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
- PETSc Manual:
DM/DMCoarsenHookRemove
PETSc.LibPETSc.DMCompareLabels — Method
equal::PetscBool = DMCompareLabels(petsclib::PetscLibType,dm0::PetscDM, dm1::PetscDM, message::String)Compare labels between two DM objects
Collective; No Fortran Support
Input Parameters:
dm0- FirstDMobjectdm1- SecondDMobject
Output Parameters:
equal- (Optional) Flag whether labels ofdm0anddm1are the samemessage- (Optional) Message describing the difference, orNULLif 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
- PETSc Manual:
DM/DMCompareLabels
PETSc.LibPETSc.DMComputeError — Method
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- TheDMsol- The solution vector
Input/Output Parameter:
errors- An array of length Nf, the number of fields, orNULLfor no output; on output
contains the error in each field
Output Parameter:
errorVec- A vector to hold the cellwise error (may beNULL)
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
- PETSc Manual:
DM/DMComputeError
PETSc.LibPETSc.DMComputeExactSolution — Method
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- TheDMtime- The time
Output Parameters:
u- The vector will be filled with exact solution values, orNULLu_t- The vector will be filled with the time derivative of exact solution values, orNULL
Level: developer
Note: The user must call PetscDSSetExactSolution() before using this routine
See also:
DM, PetscDSSetExactSolution()
External Links
- PETSc Manual:
DM/DMComputeExactSolution
PETSc.LibPETSc.DMComputeVariableBounds — Method
DMComputeVariableBounds(petsclib::PetscLibType,dm::PetscDM, xl::PetscVec, xu::PetscVec)compute variable bounds used by SNESVI.
Logically Collective
Input Parameter:
dm- theDMobject
Output Parameters:
xl- lower boundxu- 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
- PETSc Manual:
DM/DMComputeVariableBounds
PETSc.LibPETSc.DMConvert — Method
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- theDMnewtype- newDMtype (use "same" for the same type)
Output Parameter:
M- pointer to newDM
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
- PETSc Manual:
DM/DMConvert
PETSc.LibPETSc.DMCopyAuxiliaryVec — Method
DMCopyAuxiliaryVec(petsclib::PetscLibType,dm::PetscDM, dmNew::PetscDM)Copy the auxiliary vector data on a DM to a new DM
Not Collective
Input Parameter:
dm- TheDM
Output Parameter:
dmNew- The newDM, 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
- PETSc Manual:
DM/DMCopyAuxiliaryVec
PETSc.LibPETSc.DMCopyDMKSP — Method
DMCopyDMKSP(petsclib::PetscLibType,dmsrc::PetscDM, dmdest::PetscDM)copies a DM DMKSP context to a new DM
Logically Collective
Input Parameters:
dmsrc-DMto obtain context fromdmdest-DMto add context to
Level: developer
-seealso: , DMKSP, DM, KSP, DMGetDMKSP(), KSPSetDM()
External Links
- PETSc Manual:
Ksp/DMCopyDMKSP
PETSc.LibPETSc.DMCopyDMSNES — Method
DMCopyDMSNES(petsclib::PetscLibType,dmsrc::PetscDM, dmdest::PetscDM)copies a DMSNES context to a new DM
Logically Collective
Input Parameters:
dmsrc-DMto obtain context fromdmdest-DMto add context to
Level: developer
-seealso: , DMSNES, DMGetDMSNES(), SNESSetDM()
External Links
- PETSc Manual:
Snes/DMCopyDMSNES
PETSc.LibPETSc.DMCopyDS — Method
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- TheDMminDegree- Minimum degree for a discretization, orPETSC_DETERMINEfor no limitmaxDegree- Maximum degree for a discretization, orPETSC_DETERMINEfor no limit
Output Parameter:
newdm- TheDM
Level: advanced
See also:
DM, DMCopyFields(), DMAddField(), DMGetDS(), DMGetCellDS(), DMGetRegionDS(), DMSetRegionDS()
External Links
- PETSc Manual:
DM/DMCopyDS
PETSc.LibPETSc.DMCopyDisc — Method
DMCopyDisc(petsclib::PetscLibType,dm::PetscDM, newdm::PetscDM)Copy the fields and discrete systems for the DM into another DM
Collective
Input Parameter:
dm- TheDM
Output Parameter:
newdm- TheDM
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
- PETSc Manual:
DM/DMCopyDisc
PETSc.LibPETSc.DMCopyFields — Method
DMCopyFields(petsclib::PetscLibType,dm::PetscDM, minDegree::PetscInt, maxDegree::PetscInt, newdm::PetscDM)Copy the discretizations for the DM into another DM
Collective
Input Parameters:
dm- TheDMminDegree- Minimum degree for a discretization, orPETSC_DETERMINEfor no limitmaxDegree- Maximum degree for a discretization, orPETSC_DETERMINEfor no limit
Output Parameter:
newdm- TheDM
Level: advanced
See also:
DM, DMGetField(), DMSetField(), DMAddField(), DMCopyDS(), DMGetDS(), DMGetCellDS()
External Links
- PETSc Manual:
DM/DMCopyFields
PETSc.LibPETSc.DMCopyLabels — Method
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- TheDMobject with initial labelsdmB- TheDMobject to which labels are copiedmode- 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 aDMLabelin the source and destinationDMs with the same name is encountered (seeDMCopyLabelsMode)
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
- PETSc Manual:
DM/DMCopyLabels
PETSc.LibPETSc.DMCopyTransform — Method
DMCopyTransform(petsclib::PetscLibType,dm::PetscDM, newdm::PetscDM)External Links
- PETSc Manual:
DM/DMCopyTransform
PETSc.LibPETSc.DMCreate — Method
dm::PetscDM = DMCreate(petsclib::PetscLibType,comm::MPI_Comm)Creates an empty DM object. DMs are the abstract objects in PETSc that mediate between meshes and discretizations and the algebraic solvers, time integrators, and optimization algorithms in PETSc.
Collective
Input Parameter:
comm- The communicator for theDMobject
Output Parameter:
dm- TheDMobject
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
- PETSc Manual:
DM/DMCreate
PETSc.LibPETSc.DMCreateColoring — Method
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- theDMobjectctype-IS_COLORING_LOCALorIS_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
- PETSc Manual:
DM/DMCreateColoring
PETSc.LibPETSc.DMCreateDS — Method
DMCreateDS(petsclib::PetscLibType,dm::PetscDM)Create the discrete systems for the DM based upon the fields added to the DM
Collective
Input Parameter:
dm- TheDM
Options Database Key:
-dm_petscds_view- View all thePetscDSobjects in thisDM
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
- PETSc Manual:
DM/DMCreateDS
PETSc.LibPETSc.DMCreateDomainDecomposition — Method
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- theDMobject
Output Parameters:
n- The number of subproblems in the domain decomposition (orNULLif not requested), also the length of the four arrays belownamelist- The name for each subdomain (orNULLif not requested)innerislist- The global indices for each inner subdomain (orNULL, if not requested)outerislist- The global indices for each outer subdomain (orNULL, if not requested)dmlist- TheDMs for each subdomain subproblem (orNULL, if not requested; ifNULLis returned, noDMs 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
- PETSc Manual:
DM/DMCreateDomainDecomposition
PETSc.LibPETSc.DMCreateDomainDecompositionScatters — Method
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- theDMobjectn- the number of subdomainssubdms- the local subdomains
Output Parameters:
iscat- scatter from global vector to nonoverlapping global vector entries on subdomainoscat- scatter from global vector to overlapping global vector entries on subdomaingscat- 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
- PETSc Manual:
DM/DMCreateDomainDecompositionScatters
PETSc.LibPETSc.DMCreateFEDefault — Method
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- TheDMNc- The number of components for the fieldprefix- The options prefix for the outputPetscFE, orNULLqorder- The quadrature order orPETSC_DETERMINEto usePetscSpacepolynomial degree
Output Parameter:
fem- ThePetscFE
Level: intermediate
Note: This is a convenience method that just calls PetscFECreateByCell() underneath.
See also:
DM, PetscFECreateByCell(), DMAddField(), DMCreateDS(), DMGetCellDS(), DMGetRegionDS()
External Links
- PETSc Manual:
DM/DMCreateFEDefault
PETSc.LibPETSc.DMCreateFieldDecomposition — Method
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- theDMobject
Output Parameters:
len- The number of fields (orNULLif not requested)namelist- The name for each field (orNULLif not requested)islist- The global indices for each field (orNULLif not requested)dmlist- TheDMs for each field subproblem (orNULL, if not requested; ifNULLis returned, noDMs 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
- PETSc Manual:
DM/DMCreateFieldDecomposition
PETSc.LibPETSc.DMCreateFieldIS — Method
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- theDMobject
Output Parameters:
numFields- The number of fields (orNULLif not requested)fieldNames- The name of each field (orNULLif not requested)fields- The global indices for each field (orNULLif 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
- PETSc Manual:
DM/DMCreateFieldIS
PETSc.LibPETSc.DMCreateGlobalVector — Method
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- theDMobject
Output Parameter:
vec- the global vector
Level: beginner
See also:
DM, Vec, DMCreateLocalVector(), DMGetGlobalVector(), DMDestroy(), DMView(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd()
External Links
- PETSc Manual:
DM/DMCreateGlobalVector
PETSc.LibPETSc.DMCreateGradientMatrix — Method
mat::PetscMat = DMCreateGradientMatrix(petsclib::PetscLibType,dmc::PetscDM, dmf::PetscDM)Gets the gradient matrix between two DM objects Collective
Input Parameters:
dmc- the targetDMobjectdmf- the sourceDMobject, can beNULL
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
- PETSc Manual:
DM/DMCreateGradientMatrix
PETSc.LibPETSc.DMCreateInjection — Method
mat::PetscMat = DMCreateInjection(petsclib::PetscLibType,dac::PetscDM, daf::PetscDM)Gets injection matrix between two DM objects.
Collective
Input Parameters:
dac- theDMobjectdaf- the second, finerDMobject
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
- PETSc Manual:
DM/DMCreateInjection
PETSc.LibPETSc.DMCreateInterpolation — Method
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- theDMobjectdmf- the second, finerDMobject
Output Parameters:
mat- the interpolationvec- the scaling (optional, passNULLif not needed), seeDMCreateInterpolationScale()
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
- PETSc Manual:
DM/DMCreateInterpolation
PETSc.LibPETSc.DMCreateInterpolationScale — Method
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-DMthat defines a coarse meshdaf-DMthat defines a fine meshmat- 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
- PETSc Manual:
DM/DMCreateInterpolationScale
PETSc.LibPETSc.DMCreateLabel — Method
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- TheDMobjectname- The label name
Level: intermediate
See also:
DM, DMLabelCreate(), DMHasLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()
External Links
- PETSc Manual:
DM/DMCreateLabel
PETSc.LibPETSc.DMCreateLabelAtIndex — Method
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- TheDMobjectl- The index for the labelname- The label name
Level: intermediate
See also:
DM, DMCreateLabel(), DMLabelCreate(), DMHasLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()
External Links
- PETSc Manual:
DM/DMCreateLabelAtIndex
PETSc.LibPETSc.DMCreateLocalVector — Method
vec::PetscVec = DMCreateLocalVector(petsclib::PetscLibType,dm::PetscDM)Creates a local vector from a DM object.
Not Collective
Input Parameter:
dm- theDMobject
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
- PETSc Manual:
DM/DMCreateLocalVector
PETSc.LibPETSc.DMCreateMassMatrix — Method
mat::PetscMat = DMCreateMassMatrix(petsclib::PetscLibType,dmc::PetscDM, dmf::PetscDM)Gets the mass matrix between two DM objects Collective
Input Parameters:
dmc- the targetDMobjectdmf- the sourceDMobject, can beNULL
Output Parameter:
mat- the mass matrix
Level: developer
See also:
DM, DMCreateMassMatrixLumped(), DMCreateMatrix(), DMRefine(), DMCoarsen(), DMCreateRestriction(), DMCreateInterpolation(), DMCreateInjection()
External Links
- PETSc Manual:
DM/DMCreateMassMatrix
PETSc.LibPETSc.DMCreateMassMatrixLumped — Method
llm::PetscVec,lm::PetscVec = DMCreateMassMatrixLumped(petsclib::PetscLibType,dm::PetscDM)Gets the lumped mass matrix for a given DM
Collective
Input Parameter:
dm- theDMobject
Output Parameters:
llm- the local lumped mass matrix, which is a diagonal matrix, represented as a vectorlm- 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
- PETSc Manual:
DM/DMCreateMassMatrixLumped
PETSc.LibPETSc.DMCreateMatrix — Method
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- theDMobject
Output Parameter:
mat- the empty Jacobian
Options Database Key:
-dm_preallocate_only- Only preallocate the matrix forDMCreateMatrix()andDMCreateMassMatrix(), 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
- PETSc Manual:
DM/DMCreateMatrix
PETSc.LibPETSc.DMCreateRestriction — Method
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- theDMobjectdmf- the second, finerDMobject
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
- PETSc Manual:
DM/DMCreateRestriction
PETSc.LibPETSc.DMCreateSectionPermutation — Method
perm::IS,blockStarts::PetscBT = DMCreateSectionPermutation(petsclib::PetscLibType,dm::PetscDM)Create a permutation of the PetscSection chart and optionally a block structure.
Input Parameter:
dm- TheDM
Output Parameters:
perm- A permutation of the mesh points in the chartblockStarts- A high bit is set for the point that begins every block, orNULLfor default blocking
Level: developer
See also:
DM, PetscSection, DMGetLocalSection(), DMGetGlobalSection()
External Links
- PETSc Manual:
DM/DMCreateSectionPermutation
PETSc.LibPETSc.DMCreateSectionSF — Method
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- TheDMlocalSection-PetscSectiondescribing the local data layoutglobalSection-PetscSectiondescribing 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
- PETSc Manual:
DM/DMCreateSectionSF
PETSc.LibPETSc.DMCreateSectionSubDM — Method
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- TheDMobjectnumFields- The number of fields to incorporate intosubdmfields- The field numbers of the selected fieldsnumComps- The number of components from each field to incorporate intosubdm, or PETSC_DECIDE for all componentscomps- The component numbers of the selected fields (omitted for PTESC_DECIDE fields)
Output Parameters:
is- The global indices for the subproblem orNULLsubdm- TheDMfor the subproblem, which must already have be cloned fromdmorNULL
Level: intermediate
-seealso: DMCreateSubDM(), DMGetLocalSection(), DMPlexSetMigrationSF(), DMView()
External Links
- PETSc Manual:
DM/DMCreateSectionSubDM
PETSc.LibPETSc.DMCreateSectionSuperDM — Method
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- TheDMobjects, the must all have the same topology; for example obtained withDMClone()len- The number ofDMindms
Output Parameters:
is- The global indices for the subproblem, orNULLsuperdm- TheDMfor the superproblem, which must already have be cloned and contain the same topology as thedms
Level: intermediate
-seealso: DMCreateSuperDM(), DMGetLocalSection(), DMPlexSetMigrationSF(), DMView()
External Links
- PETSc Manual:
DM/DMCreateSectionSuperDM
PETSc.LibPETSc.DMCreateSubDM — Method
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- TheDMobjectnumFields- The number of fields to selectfields- The field numbers of the selected fields
Output Parameters:
is- The global indices for all the degrees of freedom in the new subDM, useNULLif not neededsubdm- TheDMfor the subproblem, useNULLif 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
- PETSc Manual:
DM/DMCreateSubDM
PETSc.LibPETSc.DMCreateSuperDM — Method
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- TheDMobjectsn- The number ofDMs
Output Parameters:
is- The global indices for each of subproblem within the superDM, orNULL, its length isnsuperdm- TheDMfor 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
- PETSc Manual:
DM/DMCreateSuperDM
PETSc.LibPETSc.DMDestroy — Method
DMDestroy(petsclib::PetscLibType,dm::PetscDM)Destroys a DM.
Collective
Input Parameter:
dm- theDMobject to destroy
Level: developer
See also:
DM, DMCreate(), DMType, DMSetType(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix()
External Links
- PETSc Manual:
DM/DMDestroy
PETSc.LibPETSc.DMDestroyVI — Method
PETSc.LibPETSc.DMExtrude — Method
DMExtrude(petsclib::PetscLibType,dm::PetscDM, layers::PetscInt, dme::PetscDM)Extrude a DM object from a surface
Collective
Input Parameters:
dm- theDMobjectlayers- the number of extruded cell layers
Output Parameter:
dme- the extrudedDM, orNULL
Level: developer
Note: If no extrusion was done, the return value is NULL
See also:
DM, DMRefine(), DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector()
External Links
- PETSc Manual:
DM/DMExtrude
PETSc.LibPETSc.DMFinalizePackage — Method
DMFinalizePackage(petsclib::PetscLibType)This function finalizes everything in the DM package. It is called from PetscFinalize().
Level: developer
-seealso: PetscInitialize()
External Links
- PETSc Manual:
DM/DMFinalizePackage
PETSc.LibPETSc.DMFindRegionNum — Method
num::PetscInt = DMFindRegionNum(petsclib::PetscLibType,dm::PetscDM, ds::PetscDS)Find the region number for a given PetscDS, or
Not Collective
Input Parameters:
dm- TheDMds- ThePetscDSdefined 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
- PETSc Manual:
DM/DMFindRegionNum
PETSc.LibPETSc.DMGenerateRegister — Method
DMGenerateRegister(petsclib::PetscLibType,sname::String, fnc::external, rfnc::external, alfnc::external, dim::PetscInt)Adds a grid generator to DM
Not Collective, No Fortran Support
Input Parameters:
sname- name of a new user-defined grid generatorfnc- generator functionrfnc- refinement functionalfnc- adapt by label functiondim- dimension of boundary of domain
-seealso: DM, DMGenerateRegisterAll(), DMPlexGenerate(), DMGenerateRegisterDestroy()
External Links
- PETSc Manual:
DM/DMGenerateRegister
PETSc.LibPETSc.DMGenerateRegisterAll — Method
DMGenerateRegisterAll(petsclib::PetscLibType)Registers all of the mesh generation methods in the DM package.
Not Collective
Level: advanced
-seealso: DM, DMGenerateRegisterDestroy()
External Links
- PETSc Manual:
DM/DMGenerateRegisterAll
PETSc.LibPETSc.DMGenerateRegisterDestroy — Method
DMGenerateRegisterDestroy(petsclib::PetscLibType)External Links
- PETSc Manual:
DM/DMGenerateRegisterDestroy
PETSc.LibPETSc.DMGeomModelRegister — Method
DMGeomModelRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds a geometry model to DM
Not Collective, No Fortran Support
Input Parameters:
sname- name of a new user-defined geometry modelfnc- geometry model function
-seealso: DM, DMGeomModelRegisterAll(), DMPlexGeomModel(), DMGeomModelRegisterDestroy()
External Links
- PETSc Manual:
DM/DMGeomModelRegister
PETSc.LibPETSc.DMGeomModelRegisterAll — Method
DMGeomModelRegisterAll(petsclib::PetscLibType)Registers all of the geometry model methods in the DM package.
Not Collective
Level: advanced
-seealso: DM, DMGeomModelRegisterDestroy()
External Links
- PETSc Manual:
DM/DMGeomModelRegisterAll
PETSc.LibPETSc.DMGeomModelRegisterDestroy — Method
DMGeomModelRegisterDestroy(petsclib::PetscLibType)External Links
- PETSc Manual:
DM/DMGeomModelRegisterDestroy
PETSc.LibPETSc.DMGetAdjacency — Method
useCone::PetscBool,useClosure::PetscBool = DMGetAdjacency(petsclib::PetscLibType,dm::PetscDM, f::PetscInt)Returns the flags for determining variable influence
Not Collective
Input Parameters:
dm- TheDMobjectf- The field number, orPETSC_DEFAULTfor the default adjacency
Output Parameters:
useCone- Flag for variable influence starting with the cone operationuseClosure- 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
- PETSc Manual:
DM/DMGetAdjacency
PETSc.LibPETSc.DMGetApplicationContext — Method
DMGetApplicationContext(petsclib::PetscLibType,dm::PetscDM, ctx::PeCtx)Gets a user context from a DM object provided with DMSetApplicationContext()
Not Collective
Input Parameter:
dm- theDMobject
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
- PETSc Manual:
DM/DMGetApplicationContext
PETSc.LibPETSc.DMGetAuxiliaryLabels — Method
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- TheDM
Output Parameters:
labels- TheDMLabels for eachVecvalues- The label values for eachVecparts- The equation parts for eachVec
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
- PETSc Manual:
DM/DMGetAuxiliaryLabels
PETSc.LibPETSc.DMGetAuxiliaryVec — Method
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- TheDMlabel- TheDMLabelvalue- The label value indicating the regionpart- The equation part, or 0 if unused
Output Parameter:
aux- TheVecholding 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
- PETSc Manual:
DM/DMGetAuxiliaryVec
PETSc.LibPETSc.DMGetBasicAdjacency — Method
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- TheDMobject
Output Parameters:
useCone- Flag for variable influence starting with the cone operationuseClosure- 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
- PETSc Manual:
DM/DMGetBasicAdjacency
PETSc.LibPETSc.DMGetBlockSize — Method
bs::PetscInt = DMGetBlockSize(petsclib::PetscLibType,dm::PetscDM)Gets the inherent block size associated with a DM
Not Collective
Input Parameter:
dm- theDMwith 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
- PETSc Manual:
DM/DMGetBlockSize
PETSc.LibPETSc.DMGetBlockingType — Method
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- theDM
Output Parameter:
btype- block by topological point or field node
Level: advanced
See also:
DM, DMCreateMatrix(), MatSetVariableBlockSizes()
External Links
- PETSc Manual:
DM/DMGetBlockingType
PETSc.LibPETSc.DMGetBoundingBox — Method
gmin::Vector{PetscReal},gmax::Vector{PetscReal} = DMGetBoundingBox(petsclib::PetscLibType,dm::PetscDM)Returns the global bounding box for the DM.
Collective
Input Parameter:
dm- theDM
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
- PETSc Manual:
DM/DMGetBoundingBox
PETSc.LibPETSc.DMGetCellCoordinateDM — Method
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- theDM
Output Parameter:
cdm- cellwise coordinateDM, orNULLif they are not defined
Level: intermediate
-seealso: DM, DMSetCellCoordinateDM(), DMSetCellCoordinates(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMGetCellCoordinatesLocal(), DMLocalizeCoordinates(), DMSetCoordinateDM(), DMGetCoordinateDM()
External Links
- PETSc Manual:
DM/DMGetCellCoordinateDM
PETSc.LibPETSc.DMGetCellCoordinateSection — Method
DMGetCellCoordinateSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)Retrieve the PetscSection of cellwise coordinate values over the mesh.
Collective
Input Parameter:
dm- TheDMobject
Output Parameter:
section- ThePetscSectionobject, orNULLif no cellwise coordinates are defined
Level: intermediate
-seealso: DM, DMGetCoordinateSection(), DMSetCellCoordinateSection(), DMGetCellCoordinateDM(), DMGetCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()
External Links
- PETSc Manual:
DM/DMGetCellCoordinateSection
PETSc.LibPETSc.DMGetCellCoordinates — Method
DMGetCellCoordinates(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)Gets a global vector with the cellwise coordinates associated with the DM.
Collective
Input Parameter:
dm- theDM
Output Parameter:
c- global coordinate vector
Level: intermediate
-seealso: DM, DMGetCoordinates(), DMSetCellCoordinates(), DMGetCellCoordinatesLocal(), DMGetCellCoordinateDM()
External Links
- PETSc Manual:
DM/DMGetCellCoordinates
PETSc.LibPETSc.DMGetCellCoordinatesLocal — Method
DMGetCellCoordinatesLocal(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)Gets a local vector with the cellwise coordinates associated with the DM.
Collective
Input Parameter:
dm- theDM
Output Parameter:
c- coordinate vector
Level: intermediate
-seealso: DM, DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMSetCellCoordinates(), DMGetCellCoordinateDM(), DMGetCellCoordinatesLocalNoncollective()
External Links
- PETSc Manual:
DM/DMGetCellCoordinatesLocal
PETSc.LibPETSc.DMGetCellCoordinatesLocalNoncollective — Method
DMGetCellCoordinatesLocalNoncollective(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)Non
Not Collective
Input Parameter:
dm- theDM
Output Parameter:
c- cellwise coordinate vector
Level: advanced
-seealso: DM, DMGetCellCoordinatesLocalSetUp(), DMGetCellCoordinatesLocal(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMSetCellCoordinates(), DMGetCellCoordinateDM()
External Links
- PETSc Manual:
DM/DMGetCellCoordinatesLocalNoncollective
PETSc.LibPETSc.DMGetCellCoordinatesLocalSetUp — Method
DMGetCellCoordinatesLocalSetUp(petsclib::PetscLibType,dm::PetscDM)Prepares a local vector of cellwise coordinates, so that DMGetCellCoordinatesLocalNoncollective() can be used as non
Collective
Input Parameter:
dm- theDM
Level: advanced
-seealso: DM, DMGetCellCoordinatesLocalNoncollective()
External Links
- PETSc Manual:
DM/DMGetCellCoordinatesLocalSetUp
PETSc.LibPETSc.DMGetCellDS — Method
DMGetCellDS(petsclib::PetscLibType,dm::PetscDM, point::PetscInt, ds::PetscDS, dsIn::PetscDS)Get the PetscDS defined on a given cell
Not Collective
Input Parameters:
dm- TheDMpoint- Cell for thePetscDS
Output Parameters:
ds- ThePetscDSdefined on the given celldsIn- ThePetscDSfor input on the given cell, orNULLif the same ds
Level: developer
See also:
DM, DMGetDS(), DMSetRegionDS()
External Links
- PETSc Manual:
DM/DMGetCellDS
PETSc.LibPETSc.DMGetCoarseDM — Method
DMGetCoarseDM(petsclib::PetscLibType,dm::PetscDM, cdm::PetscDM)Get the coarse DMfrom which this DM was obtained by refinement
Not Collective
Input Parameter:
dm- TheDMobject
Output Parameter:
cdm- The coarseDM
Level: intermediate
See also:
DM, DMSetCoarseDM(), DMCoarsen()
External Links
- PETSc Manual:
DM/DMGetCoarseDM
PETSc.LibPETSc.DMGetCoarsenLevel — Method
level::PetscInt = DMGetCoarsenLevel(petsclib::PetscLibType,dm::PetscDM)Gets the number of coarsenings that have generated this DM.
Not Collective
Input Parameter:
dm- theDMobject
Output Parameter:
level- number of coarsenings
Level: developer
See also:
DM, DMCoarsen(), DMSetCoarsenLevel(), DMGetRefineLevel(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()
External Links
- PETSc Manual:
DM/DMGetCoarsenLevel
PETSc.LibPETSc.DMGetCompatibility — Method
compatible::PetscBool,set::PetscBool = DMGetCompatibility(petsclib::PetscLibType,dm1::PetscDM, dm2::PetscDM)determine if two DMs are compatible
Collective
Input Parameters:
dm1- the firstDMdm2- the secondDM
Output Parameters:
compatible- whether or not the twoDMs are compatibleset- 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
- PETSc Manual:
DM/DMGetCompatibility
PETSc.LibPETSc.DMGetCoordinateDM — Method
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- theDM
Output Parameter:
cdm- coordinateDM
Level: intermediate
-seealso: DM, DMSetCoordinateDM(), DMSetCoordinates(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMGSetCellCoordinateDM(),
External Links
- PETSc Manual:
DM/DMGetCoordinateDM
PETSc.LibPETSc.DMGetCoordinateDim — Method
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- TheDMobject
Output Parameter:
dim- The embedding dimension
Level: intermediate
-seealso: DM, DMSetCoordinateDim(), DMGetCoordinateSection(), DMGetCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()
External Links
- PETSc Manual:
DM/DMGetCoordinateDim
PETSc.LibPETSc.DMGetCoordinateField — Method
DMGetCoordinateField(petsclib::PetscLibType,dm::PetscDM, field::DMField)External Links
- PETSc Manual:
DM/DMGetCoordinateField
PETSc.LibPETSc.DMGetCoordinateSection — Method
DMGetCoordinateSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)Retrieve the PetscSection of coordinate values over the mesh.
Collective
Input Parameter:
dm- TheDMobject
Output Parameter:
section- ThePetscSectionobject
Level: intermediate
-seealso: DM, DMGetCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()
External Links
- PETSc Manual:
DM/DMGetCoordinateSection
PETSc.LibPETSc.DMGetCoordinates — Method
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- theDM
Output Parameter:
c- global coordinate vector
Level: intermediate
-seealso: DM, DMDA, DMSetCoordinates(), DMGetCoordinatesLocal(), DMGetCoordinateDM(), DMDASetUniformCoordinates()
External Links
- PETSc Manual:
DM/DMGetCoordinates
PETSc.LibPETSc.DMGetCoordinatesLocal — Method
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- theDM
Output Parameter:
c- coordinate vector
Level: intermediate
-seealso: DM, DMSetCoordinatesLocal(), DMGetCoordinates(), DMSetCoordinates(), DMGetCoordinateDM(), DMGetCoordinatesLocalNoncollective()
External Links
- PETSc Manual:
DM/DMGetCoordinatesLocal
PETSc.LibPETSc.DMGetCoordinatesLocalNoncollective — Method
DMGetCoordinatesLocalNoncollective(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)Non
Not Collective
Input Parameter:
dm- theDM
Output Parameter:
c- coordinate vector
Level: advanced
-seealso: DM, DMGetCoordinatesLocalSetUp(), DMGetCoordinatesLocal(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMSetCoordinates(), DMGetCoordinateDM()
External Links
- PETSc Manual:
DM/DMGetCoordinatesLocalNoncollective
PETSc.LibPETSc.DMGetCoordinatesLocalSetUp — Method
DMGetCoordinatesLocalSetUp(petsclib::PetscLibType,dm::PetscDM)Prepares a local vector of coordinates, so that DMGetCoordinatesLocalNoncollective() can be used as non
Collective
Input Parameter:
dm- theDM
Level: advanced
-seealso: DM, DMSetCoordinates(), DMGetCoordinatesLocalNoncollective()
External Links
- PETSc Manual:
DM/DMGetCoordinatesLocalSetUp
PETSc.LibPETSc.DMGetCoordinatesLocalTuple — Method
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- theDMp- theISof points whose coordinates will be returned
Output Parameters:
pCoordSection- thePetscSectiondescribing the layout of pCoord, i.e. each point corresponds to one point inp, and DOFs correspond to coordinatespCoord- theVecwith coordinates of points inp
Level: advanced
-seealso: DM, DMDA, DMSetCoordinatesLocal(), DMGetCoordinatesLocal(), DMGetCoordinatesLocalNoncollective(), DMGetCoordinatesLocalSetUp(), DMGetCoordinates(), DMSetCoordinates(), DMGetCoordinateDM()
External Links
- PETSc Manual:
DM/DMGetCoordinatesLocalTuple
PETSc.LibPETSc.DMGetCoordinatesLocalized — Method
areLocalized::PetscBool = DMGetCoordinatesLocalized(petsclib::PetscLibType,dm::PetscDM)Check if the DM coordinates have been localized for cells
Collective
Input Parameter:
dm- TheDM
Output Parameter:
areLocalized-PETSC_TRUEif localized
Level: developer
-seealso: DM, DMLocalizeCoordinates(), DMSetPeriodicity(), DMGetCoordinatesLocalizedLocal()
External Links
- PETSc Manual:
DM/DMGetCoordinatesLocalized
PETSc.LibPETSc.DMGetCoordinatesLocalizedLocal — Method
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- TheDM
Output Parameter:
areLocalized-PETSC_TRUEif localized
Level: developer
-seealso: DM, DMLocalizeCoordinates(), DMGetCoordinatesLocalized(), DMSetPeriodicity()
External Links
- PETSc Manual:
DM/DMGetCoordinatesLocalizedLocal
PETSc.LibPETSc.DMGetDS — Method
DMGetDS(petsclib::PetscLibType,dm::PetscDM, ds::PetscDS)Get the default PetscDS
Not Collective
Input Parameter:
dm- TheDM
Output Parameter:
ds- The defaultPetscDS
Level: intermediate
Note: The ds is owned by the dm and should not be destroyed directly.
See also:
DM, DMGetCellDS(), DMGetRegionDS()
External Links
- PETSc Manual:
DM/DMGetDS
PETSc.LibPETSc.DMGetDefaultConstraints — Method
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- TheDM
Output Parameters:
section- ThePetscSectiondescribing the range of the constraint matrix: relates rows of the constraint matrix to dofs of the default section. ReturnsNULLif there are no local constraints.mat- TheMatthat interpolates local constraints: its width should be the layout size of the default section. ReturnsNULLif 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
- PETSc Manual:
DM/DMGetDefaultConstraints
PETSc.LibPETSc.DMGetDimPoints — Method
pStart::PetscInt,pEnd::PetscInt = DMGetDimPoints(petsclib::PetscLibType,dm::PetscDM, dim::PetscInt)Get the half
Collective
Input Parameters:
dm- theDMdim- the dimension
Output Parameters:
pStart- The first point of the given dimensionpEnd- 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
- PETSc Manual:
DM/DMGetDimPoints
PETSc.LibPETSc.DMGetDimension — Method
dim::PetscInt = DMGetDimension(petsclib::PetscLibType,dm::PetscDM)Return the topological dimension of the DM
Not Collective
Input Parameter:
dm- TheDM
Output Parameter:
dim- The topological dimension
Level: beginner
See also:
DM, DMSetDimension(), DMCreate()
External Links
- PETSc Manual:
DM/DMGetDimension
PETSc.LibPETSc.DMGetEnclosurePoint — Method
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 firstDMdmB- The secondDMetype- The type of enclosure relation thatdmAhas todmBpB- A point ofdmB
Output Parameter:
pA- The corresponding point ofdmA
Level: intermediate
-seealso: , DM, DMPLEX, DMGetEnclosureRelation()
External Links
- PETSc Manual:
DM/DMGetEnclosurePoint
PETSc.LibPETSc.DMGetEnclosureRelation — Method
DMGetEnclosureRelation(petsclib::PetscLibType,dmA::PetscDM, dmB::PetscDM, rel::DMEnclosureType)Get the relationship between dmA and dmB
Input Parameters:
dmA- The firstDMdmB- The secondDM
Output Parameter:
rel- The relation ofdmAtodmB
Level: intermediate
-seealso: , DM, DMPLEX, DMGetEnclosurePoint()
External Links
- PETSc Manual:
DM/DMGetEnclosureRelation
PETSc.LibPETSc.DMGetField — Method
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- TheDMf- The field number
Output Parameters:
label- The label indicating the support of the field, orNULLfor the entire mesh (pass inNULLif not needed)disc- The discretization object (pass inNULLif not needed)
Level: intermediate
See also:
DM, DMAddField(), DMSetField()
External Links
- PETSc Manual:
DM/DMGetField
PETSc.LibPETSc.DMGetFieldAvoidTensor — Method
avoidTensor::PetscBool = DMGetFieldAvoidTensor(petsclib::PetscLibType,dm::PetscDM, f::PetscInt)Get flag to avoid defining the field on tensor cells
Not Collective
Input Parameters:
dm- TheDMf- 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
- PETSc Manual:
DM/DMGetFieldAvoidTensor
PETSc.LibPETSc.DMGetFineDM — Method
DMGetFineDM(petsclib::PetscLibType,dm::PetscDM, fdm::PetscDM)Get the fine mesh from which this DM was obtained by coarsening
Input Parameter:
dm- TheDMobject
Output Parameter:
fdm- The fineDM
Level: intermediate
See also:
DM, DMSetFineDM(), DMCoarsen(), DMRefine()
External Links
- PETSc Manual:
DM/DMGetFineDM
PETSc.LibPETSc.DMGetFirstLabeledPoint — Method
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- theDModm- the enclosingDMlabel- label forDMdomain, orNULLfor whole domainnumIds- the number ofidsids- An array of the label ids in sequence for the domainheight- Height of target cells inDMPLEXtopology
Output Parameters:
point- the first labeled pointds- thePetscDScorresponding to the first labeled point
Level: developer
-seealso: , DM, DMPLEX, DMPlexSetActivePoint(), DMLabel, PetscDS
External Links
- PETSc Manual:
DM/DMGetFirstLabeledPoint
PETSc.LibPETSc.DMGetGlobalSection — Method
DMGetGlobalSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)Get the PetscSection encoding the global data layout for the DM.
Collective
Input Parameter:
dm- TheDM
Output Parameter:
section- ThePetscSection
Level: intermediate
Note: This gets a borrowed reference, so the user should not destroy this PetscSection.
See also:
DM, DMSetLocalSection(), DMGetLocalSection()
External Links
- PETSc Manual:
DM/DMGetGlobalSection
PETSc.LibPETSc.DMGetGlobalVector — Method
DMGetGlobalVector(petsclib::PetscLibType,dm::PetscDM, g::PetscVec)Gets a PETSc vector that may be used with the DM global routines.
Collective
Input Parameter:
dm- theDM
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
- PETSc Manual:
DM/DMGetGlobalVector
PETSc.LibPETSc.DMGetISColoringType — Method
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- theDMcontext
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
- PETSc Manual:
DM/DMGetISColoringType
PETSc.LibPETSc.DMGetLabel — Method
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- TheDMobjectname- The label name
Output Parameter:
label- TheDMLabel, orNULLif 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
- PETSc Manual:
DM/DMGetLabel
PETSc.LibPETSc.DMGetLabelByNum — Method
DMGetLabelByNum(petsclib::PetscLibType,dm::PetscDM, n::PetscInt, label::DMLabel)Return the nth label on a DM
Not Collective
Input Parameters:
dm- TheDMobjectn- the label number
Output Parameter:
label- the label
Level: intermediate
See also:
DM, DMLabel, DMAddLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()
External Links
- PETSc Manual:
DM/DMGetLabelByNum
PETSc.LibPETSc.DMGetLabelIdIS — Method
DMGetLabelIdIS(petsclib::PetscLibType,dm::PetscDM, name::String, ids::IS)Get the DMLabelGetValueIS() from a DMLabel in the DM
Not Collective
Input Parameters:
dm- TheDMobjectname- The label name
Output Parameter:
ids- The integer ids, orNULLif the label does not exist
Level: beginner
See also:
DM, DMLabelGetValueIS(), DMGetLabelSize()
External Links
- PETSc Manual:
DM/DMGetLabelIdIS
PETSc.LibPETSc.DMGetLabelName — Method
DMGetLabelName(petsclib::PetscLibType,dm::PetscDM, n::PetscInt, name::String)Return the name of nth label
Not Collective
Input Parameters:
dm- TheDMobjectn- 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
- PETSc Manual:
DM/DMGetLabelName
PETSc.LibPETSc.DMGetLabelOutput — Method
output::PetscBool = DMGetLabelOutput(petsclib::PetscLibType,dm::PetscDM, name::String)Get the output flag for a given label
Not Collective
Input Parameters:
dm- TheDMobjectname- The label name
Output Parameter:
output- The flag for output
Level: developer
See also:
DM, DMLabel, DMSetLabelOutput(), DMCreateLabel(), DMHasLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()
External Links
- PETSc Manual:
DM/DMGetLabelOutput
PETSc.LibPETSc.DMGetLabelSize — Method
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- TheDMobjectname- 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
- PETSc Manual:
DM/DMGetLabelSize
PETSc.LibPETSc.DMGetLabelValue — Method
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- TheDMobjectname- The label namepoint- 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
- PETSc Manual:
DM/DMGetLabelValue
PETSc.LibPETSc.DMGetLocalBoundingBox — Method
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- theDM
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
- PETSc Manual:
DM/DMGetLocalBoundingBox
PETSc.LibPETSc.DMGetLocalSection — Method
DMGetLocalSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)Get the PetscSection encoding the local data layout for the DM.
Input Parameter:
dm- TheDM
Output Parameter:
section- ThePetscSection
Options Database Key:
-dm_petscsection_view- View the section created by theDM
Level: intermediate
Note: This gets a borrowed reference, so the user should not destroy this PetscSection.
See also:
DM, DMSetLocalSection(), DMGetGlobalSection()
External Links
- PETSc Manual:
DM/DMGetLocalSection
PETSc.LibPETSc.DMGetLocalToGlobalMapping — Method
DMGetLocalToGlobalMapping(petsclib::PetscLibType,dm::PetscDM, ltog::ISLocalToGlobalMapping)Accesses the local
Collective
Input Parameter:
dm- theDMthat 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
- PETSc Manual:
DM/DMGetLocalToGlobalMapping
PETSc.LibPETSc.DMGetLocalVector — Method
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- theDM
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
- PETSc Manual:
DM/DMGetLocalVector
PETSc.LibPETSc.DMGetMatType — Method
ctype::MatType = DMGetMatType(petsclib::PetscLibType,dm::PetscDM)Gets the type of matrix that would be created with DMCreateMatrix()
Logically Collective
Input Parameter:
dm- theDMcontext
Output Parameter:
ctype- the matrix type
Level: intermediate
See also:
DM, DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMCreateMatrix(), DMCreateMassMatrix(), DMSetMatrixPreallocateOnly(), MatType, DMSetMatType()
External Links
- PETSc Manual:
DM/DMGetMatType
PETSc.LibPETSc.DMGetNamedGlobalVector — Method
DMGetNamedGlobalVector(petsclib::PetscLibType,dm::PetscDM, name::String, X::PetscVec)get access to a named, persistent global vector
Collective
Input Parameters:
dm-DMto hold named vectorsname- unique name forX
Output Parameter:
X- namedVec
Level: developer
-seealso: DM, DMRestoreNamedGlobalVector(), DMHasNamedGlobalVector(), DMClearNamedGlobalVectors(), DMGetGlobalVector(), DMGetLocalVector()
External Links
- PETSc Manual:
DM/DMGetNamedGlobalVector
PETSc.LibPETSc.DMGetNamedLocalVector — Method
DMGetNamedLocalVector(petsclib::PetscLibType,dm::PetscDM, name::String, X::PetscVec)get access to a named, persistent local vector
Not Collective
Input Parameters:
dm-DMto hold named vectorsname- unique name forX
Output Parameter:
X- namedVec
Level: developer
-seealso: DM, DMGetNamedGlobalVector(), DMRestoreNamedLocalVector(), DMHasNamedLocalVector(), DMClearNamedLocalVectors(), DMGetGlobalVector(), DMGetLocalVector()
External Links
- PETSc Manual:
DM/DMGetNamedLocalVector
PETSc.LibPETSc.DMGetNaturalSF — Method
DMGetNaturalSF(petsclib::PetscLibType,dm::PetscDM, sf::PetscSF)Get the PetscSF encoding the map back to the original mesh ordering
Input Parameter:
dm- TheDM
Output Parameter:
sf- ThePetscSF
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
- PETSc Manual:
DM/DMGetNaturalSF
PETSc.LibPETSc.DMGetNeighbors — Method
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- TheDM
Output Parameters:
nranks- the number of neighboursranks- 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
- PETSc Manual:
DM/DMGetNeighbors
PETSc.LibPETSc.DMGetNumAuxiliaryVec — Method
numAux::PetscInt = DMGetNumAuxiliaryVec(petsclib::PetscLibType,dm::PetscDM)Get the number of auxiliary vectors associated with this DM
Not Collective
Input Parameter:
dm- TheDM
Output Parameter:
numAux- The number of auxiliary data vectors
Level: advanced
See also:
DM, DMClearAuxiliaryVec(), DMSetAuxiliaryVec(), DMGetAuxiliaryLabels(), DMGetAuxiliaryVec()
External Links
- PETSc Manual:
DM/DMGetNumAuxiliaryVec
PETSc.LibPETSc.DMGetNumDS — Method
Nds::PetscInt = DMGetNumDS(petsclib::PetscLibType,dm::PetscDM)Get the number of discrete systems in the DM
Not Collective
Input Parameter:
dm- TheDM
Output Parameter:
Nds- The number ofPetscDSobjects
Level: intermediate
See also:
DM, DMGetDS(), DMGetCellDS()
External Links
- PETSc Manual:
DM/DMGetNumDS
PETSc.LibPETSc.DMGetNumFields — Method
numFields::PetscInt = DMGetNumFields(petsclib::PetscLibType,dm::PetscDM)Get the number of fields in the DM
Not Collective
Input Parameter:
dm- TheDM
Output Parameter:
numFields- The number of fields
Level: intermediate
See also:
DM, DMSetNumFields(), DMSetField()
External Links
- PETSc Manual:
DM/DMGetNumFields
PETSc.LibPETSc.DMGetNumLabels — Method
numLabels::PetscInt = DMGetNumLabels(petsclib::PetscLibType,dm::PetscDM)Return the number of labels defined by on the DM
Not Collective
Input Parameter:
dm- TheDMobject
Output Parameter:
numLabels- the number of Labels
Level: intermediate
See also:
DM, DMLabel, DMGetLabelByNum(), DMGetLabelName(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()
External Links
- PETSc Manual:
DM/DMGetNumLabels
PETSc.LibPETSc.DMGetOptionsPrefix — Method
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- theDMcontext
Output Parameter:
prefix- pointer to the prefix string used is returned
Level: advanced
See also:
DM, DMSetOptionsPrefix(), DMAppendOptionsPrefix(), DMSetFromOptions()
External Links
- PETSc Manual:
DM/DMGetOptionsPrefix
PETSc.LibPETSc.DMGetOutputDM — Method
DMGetOutputDM(petsclib::PetscLibType,dm::PetscDM, odm::PetscDM)Retrieve the DM associated with the layout for output
Collective
Input Parameter:
dm- The originalDM
Output Parameter:
odm- TheDMwhich 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
- PETSc Manual:
DM/DMGetOutputDM
PETSc.LibPETSc.DMGetOutputSequenceLength — Method
len::PetscInt = DMGetOutputSequenceLength(petsclib::PetscLibType,dm::PetscDM, viewer::PetscViewer, name::String)Retrieve the number of sequence values from a PetscViewer
Input Parameters:
dm- The originalDMviewer- ThePetscViewerto get it fromname- 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
- PETSc Manual:
DM/DMGetOutputSequenceLength
PETSc.LibPETSc.DMGetOutputSequenceNumber — Method
num::PetscInt,val::PetscReal = DMGetOutputSequenceNumber(petsclib::PetscLibType,dm::PetscDM)Retrieve the sequence number/value for output
Input Parameter:
dm- The originalDM
Output Parameters:
num- The output sequence numberval- 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
- PETSc Manual:
DM/DMGetOutputSequenceNumber
PETSc.LibPETSc.DMGetPeriodicity — Method
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- TheDMobject
Output Parameters:
maxCell- Over distances greater than this, we can assume a point has crossed over to another sheet, when trying to localize cell coordinatesLstart- If we assume the mesh is a torus, this is the start of each coordinate, orNULLfor 0.0L- 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
- PETSc Manual:
DM/DMGetPeriodicity
PETSc.LibPETSc.DMGetPointSF — Method
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- TheDM
Output Parameter:
sf- ThePetscSF
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
- PETSc Manual:
DM/DMGetPointSF
PETSc.LibPETSc.DMGetRefineLevel — Method
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- theDMobject
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
- PETSc Manual:
DM/DMGetRefineLevel
PETSc.LibPETSc.DMGetRegionDS — Method
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- TheDMlabel- TheDMLabeldefining the mesh region, orNULLfor the entire mesh
Output Parameters:
fields- TheIScontaining theDMfield numbers for the fields in thisPetscDS, orNULLds- ThePetscDSdefined on the given region, orNULLdsIn- ThePetscDSfor input in the given region, orNULL
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
- PETSc Manual:
DM/DMGetRegionDS
PETSc.LibPETSc.DMGetRegionNumDS — Method
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- TheDMnum- The region number, in [0, Nds)
Output Parameters:
label- The region label, orNULLfields- TheIScontaining theDMfield numbers for the fields in thisPetscDS, orNULLds- ThePetscDSdefined on the given region, orNULLdsIn- ThePetscDSfor input in the given region, orNULL
Level: advanced
See also:
DM, DMGetRegionDS(), DMSetRegionDS(), DMGetDS(), DMGetCellDS()
External Links
- PETSc Manual:
DM/DMGetRegionNumDS
PETSc.LibPETSc.DMGetSectionSF — Method
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- TheDM
Output Parameter:
sf- ThePetscSF
Level: intermediate
Note: This gets a borrowed reference, so the user should not destroy this PetscSF.
See also:
DM, DMSetSectionSF(), DMCreateSectionSF()
External Links
- PETSc Manual:
DM/DMGetSectionSF
PETSc.LibPETSc.DMGetSparseLocalize — Method
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- TheDM
Output Parameter:
sparse-PETSC_TRUEif only cells near the periodic boundary are localized
Level: intermediate
-seealso: DMSetSparseLocalize(), DMLocalizeCoordinates(), DMSetPeriodicity()
External Links
- PETSc Manual:
DM/DMGetSparseLocalize
PETSc.LibPETSc.DMGetStratumIS — Method
DMGetStratumIS(petsclib::PetscLibType,dm::PetscDM, name::String, value::PetscInt, points::IS)Get the points in a label stratum
Not Collective
Input Parameters:
dm- TheDMobjectname- The label namevalue- The stratum value
Output Parameter:
points- The stratum points, orNULLif the label does not exist or does not have that value
Level: beginner
See also:
DM, DMLabelGetStratumIS(), DMGetStratumSize()
External Links
- PETSc Manual:
DM/DMGetStratumIS
PETSc.LibPETSc.DMGetStratumSize — Method
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- TheDMobjectname- The label name of the stratumvalue- 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
- PETSc Manual:
DM/DMGetStratumSize
PETSc.LibPETSc.DMGetType — Method
type::DMType = DMGetType(petsclib::PetscLibType,dm::PetscDM)Gets the DM type name (as a string) from the DM.
Not Collective
Input Parameter:
dm- TheDM
Output Parameter:
type- TheDMTypename
Level: intermediate
See also:
DM, DMType, DMDA, DMPLEX, DMSetType(), DMCreate()
External Links
- PETSc Manual:
DM/DMGetType
PETSc.LibPETSc.DMGetUseNatural — Method
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- TheDM
Output Parameter:
useNatural-PETSC_TRUEto build the mapping to a natural order during distribution
Level: beginner
See also:
DM, DMSetUseNatural(), DMCreate()
External Links
- PETSc Manual:
DM/DMGetUseNatural
PETSc.LibPETSc.DMGetVecType — Method
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
- PETSc Manual:
DM/DMGetVecType
PETSc.LibPETSc.DMGlobalToLocal — Method
DMGlobalToLocal(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)update local vectors from global vector
Neighbor-wise Collective
Input Parameters:
dm- theDMobjectg- the global vectormode-INSERT_VALUESorADD_VALUESl- 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
- PETSc Manual:
DM/DMGlobalToLocal
PETSc.LibPETSc.DMGlobalToLocalBegin — Method
DMGlobalToLocalBegin(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)Begins updating local vectors from global vector
Neighbor-wise Collective
Input Parameters:
dm- theDMobjectg- the global vectormode-INSERT_VALUESorADD_VALUESl- 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
- PETSc Manual:
DM/DMGlobalToLocalBegin
PETSc.LibPETSc.DMGlobalToLocalBeginDefaultShell — Method
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-DMSHELLg- global vectormode-InsertModel- local vector
Level: advanced
-seealso: DM, DMSHELL, DMGlobalToLocalEndDefaultShell()
External Links
- PETSc Manual:
DM/DMGlobalToLocalBeginDefaultShell
PETSc.LibPETSc.DMGlobalToLocalEnd — Method
DMGlobalToLocalEnd(petsclib::PetscLibType,dm::PetscDM, g::PetscVec, mode::InsertMode, l::PetscVec)Ends updating local vectors from global vector
Neighbor-wise Collective
Input Parameters:
dm- theDMobjectg- the global vectormode-INSERT_VALUESorADD_VALUESl- the local vector
Level: intermediate
Note: See DMGlobalToLocalBegin() for details.
See also:
DM, DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocal(), DMLocalToGlobalBegin(), DMLocalToGlobal(), DMLocalToGlobalEnd()
External Links
- PETSc Manual:
DM/DMGlobalToLocalEnd
PETSc.LibPETSc.DMGlobalToLocalEndDefaultShell — Method
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-DMSHELLg- global vectormode-InsertModel- local vector
Level: advanced
-seealso: DM, DMSHELL, DMGlobalToLocalBeginDefaultShell()
External Links
- PETSc Manual:
DM/DMGlobalToLocalEndDefaultShell
PETSc.LibPETSc.DMGlobalToLocalHookAdd — Method
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- theDMbeginhook- function to run at the beginning ofDMGlobalToLocalBegin()endhook- function to run afterDMGlobalToLocalEnd()has completedctx- [optional] user-defined context for provide data for the hooks (may beNULL)
Calling sequence of beginhook:
dm- globalDMg- global vectormode- model- local vectorctx- optional user-defined function context
Calling sequence of endhook:
dm- globalDMg- global vectormode- model- local vectorctx- 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
- PETSc Manual:
DM/DMGlobalToLocalHookAdd
PETSc.LibPETSc.DMGlobalToLocalSolve — Method
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- TheDMobjectx- The local vectory- 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
- PETSc Manual:
DM/DMGlobalToLocalSolve
PETSc.LibPETSc.DMHasBasisTransform — Method
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- TheDM
Output Parameter:
flg-PETSC_TRUEif a basis transformation should be done
Level: developer
See also:
DM, DMPlexGlobalToLocalBasis(), DMPlexLocalToGlobalBasis(), DMPlexCreateBasisRotation()
External Links
- PETSc Manual:
DM/DMHasBasisTransform
PETSc.LibPETSc.DMHasBound — Method
hasBound::PetscBool = DMHasBound(petsclib::PetscLibType,dm::PetscDM)Determine whether a bound condition was specified
Logically collective
Input Parameter:
dm- TheDM, with aPetscDSthat 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
- PETSc Manual:
DM/DMHasBound
PETSc.LibPETSc.DMHasColoring — Method
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_TRUEif theDMhas facilities forDMCreateColoring().
Level: developer
See also:
DM, DMCreateColoring()
External Links
- PETSc Manual:
DM/DMHasColoring
PETSc.LibPETSc.DMHasCreateInjection — Method
flg::PetscBool = DMHasCreateInjection(petsclib::PetscLibType,dm::PetscDM)does the DM object have a method of providing an injection?
Not Collective
Input Parameter:
dm- theDMobject
Output Parameter:
flg-PETSC_TRUEif theDMhas facilities forDMCreateInjection().
Level: developer
See also:
DM, DMCreateInjection(), DMHasCreateRestriction(), DMHasCreateInterpolation()
External Links
- PETSc Manual:
DM/DMHasCreateInjection
PETSc.LibPETSc.DMHasCreateRestriction — Method
flg::PetscBool = DMHasCreateRestriction(petsclib::PetscLibType,dm::PetscDM)does the DM object have a method of providing a restriction?
Not Collective
Input Parameter:
dm- theDMobject
Output Parameter:
flg-PETSC_TRUEif theDMhas facilities forDMCreateRestriction().
Level: developer
See also:
DM, DMCreateRestriction(), DMHasCreateInterpolation(), DMHasCreateInjection()
External Links
- PETSc Manual:
DM/DMHasCreateRestriction
PETSc.LibPETSc.DMHasLabel — Method
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- TheDMobjectname- The label name
Output Parameter:
hasLabel-PETSC_TRUEif the label is present
Level: intermediate
See also:
DM, DMLabel, DMGetLabel(), DMGetLabelByNum(), DMCreateLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()
External Links
- PETSc Manual:
DM/DMHasLabel
PETSc.LibPETSc.DMHasNamedGlobalVector — Method
exists::PetscBool = DMHasNamedGlobalVector(petsclib::PetscLibType,dm::PetscDM, name::String)check for a named, persistent global vector created with DMGetNamedGlobalVector()
Not Collective
Input Parameters:
dm-DMto hold named vectorsname- unique name forVec
Output Parameter:
exists- true if the vector was previously created
Level: developer
-seealso: DM, DMGetNamedGlobalVector(), DMRestoreNamedLocalVector(), DMClearNamedGlobalVectors()
External Links
- PETSc Manual:
DM/DMHasNamedGlobalVector
PETSc.LibPETSc.DMHasNamedLocalVector — Method
exists::PetscBool = DMHasNamedLocalVector(petsclib::PetscLibType,dm::PetscDM, name::String)check for a named, persistent local vector created with DMGetNamedLocalVector()
Not Collective
Input Parameters:
dm-DMto hold named vectorsname- unique name forVec
Output Parameter:
exists- true if the vector was previously created
Level: developer
-seealso: DM, DMGetNamedGlobalVector(), DMRestoreNamedLocalVector(), DMClearNamedLocalVectors()
External Links
- PETSc Manual:
DM/DMHasNamedLocalVector
PETSc.LibPETSc.DMHasVariableBounds — Method
flg::PetscBool = DMHasVariableBounds(petsclib::PetscLibType,dm::PetscDM)does the DM object have a variable bounds function?
Not Collective
Input Parameter:
dm- theDMobject to destroy
Output Parameter:
flg-PETSC_TRUEif the variable bounds function exists
Level: developer
See also:
DM, DMComputeVariableBounds(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMGetApplicationContext()
External Links
- PETSc Manual:
DM/DMHasVariableBounds
PETSc.LibPETSc.DMInitializePackage — Method
DMInitializePackage(petsclib::PetscLibType)This function initializes everything in the DM package. It is called from PetscDLLibraryRegister_petscdm() when using dynamic libraries, and on the first call to DMCreate() or similar routines when using shared or static libraries.
Level: developer
-seealso: PetscInitialize()
External Links
- PETSc Manual:
DM/DMInitializePackage
PETSc.LibPETSc.DMInterpolate — Method
DMInterpolate(petsclib::PetscLibType,coarse::PetscDM, interp::PetscMat, fine::PetscDM)interpolates user
Collective if any hooks are
Input Parameters:
coarse- coarserDMto use as a baseinterp- interpolation matrix, apply usingMatInterpolate()fine- finerDMto 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
- PETSc Manual:
DM/DMInterpolate
PETSc.LibPETSc.DMInterpolateSolution — Method
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- coarseDMfine- fineDMinterp- (optional) the matrix computed byDMCreateInterpolation(). 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
- PETSc Manual:
DM/DMInterpolateSolution
PETSc.LibPETSc.DMInterpolationAddPoints — Method
DMInterpolationAddPoints(petsclib::PetscLibType,ctx::DMInterpolationInfo, n::PetscInt, points::Vector{PetscReal})Add points at which we will interpolate the fields
Not Collective
Input Parameters:
ctx- the contextn- the number of pointspoints- the coordinates for each point, an array of sizen* dim
Level: intermediate
Note: The input coordinate information is copied into the object.
See also:
DM, DMInterpolationInfo, DMInterpolationSetDim(), DMInterpolationEvaluate(), DMInterpolationCreate()
External Links
- PETSc Manual:
DM/DMInterpolationAddPoints
PETSc.LibPETSc.DMInterpolationCreate — Method
ctx::DMInterpolationInfo = DMInterpolationCreate(petsclib::PetscLibType,comm::MPI_Comm)Creates a DMInterpolationInfo context
Collective
Input Parameter:
comm- the communicator
Output Parameter:
ctx- the context
Level: beginner
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
- PETSc Manual:
DM/DMInterpolationCreate
PETSc.LibPETSc.DMInterpolationDestroy — Method
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
- PETSc Manual:
DM/DMInterpolationDestroy
PETSc.LibPETSc.DMInterpolationEvaluate — Method
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- TheDMInterpolationInfocontext obtained withDMInterpolationCreate()dm- TheDMx- The local vector containing the field to be interpolated, can be created withDMCreateGlobalVector()
Output Parameter:
v- The vector containing the interpolated values, obtained withDMInterpolationGetVector()
Level: beginner
See also:
DM, DMInterpolationInfo, DMInterpolationGetVector(), DMInterpolationAddPoints(), DMInterpolationCreate(), DMInterpolationGetCoordinates()
External Links
- PETSc Manual:
DM/DMInterpolationEvaluate
PETSc.LibPETSc.DMInterpolationGetCoordinates — Method
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
- PETSc Manual:
DM/DMInterpolationGetCoordinates
PETSc.LibPETSc.DMInterpolationGetDim — Method
dim::PetscInt = DMInterpolationGetDim(petsclib::PetscLibType,ctx::DMInterpolationInfo)Gets the spatial dimension for the interpolation context
Not Collective
Input Parameter:
ctx- the context
Output Parameter:
dim- the spatial dimension
Level: intermediate
See also:
DM, DMInterpolationInfo, DMInterpolationSetDim(), DMInterpolationEvaluate(), DMInterpolationAddPoints()
External Links
- PETSc Manual:
DM/DMInterpolationGetDim
PETSc.LibPETSc.DMInterpolationGetDof — Method
dof::PetscInt = DMInterpolationGetDof(petsclib::PetscLibType,ctx::DMInterpolationInfo)Gets the number of fields interpolated at a point for the interpolation context
Not Collective
Input Parameter:
ctx- the context
Output Parameter:
dof- the number of fields
Level: intermediate
See also:
DM, DMInterpolationInfo, DMInterpolationSetDof(), DMInterpolationEvaluate(), DMInterpolationAddPoints()
External Links
- PETSc Manual:
DM/DMInterpolationGetDof
PETSc.LibPETSc.DMInterpolationGetVector — Method
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
- PETSc Manual:
DM/DMInterpolationGetVector
PETSc.LibPETSc.DMInterpolationRestoreVector — Method
DMInterpolationRestoreVector(petsclib::PetscLibType,ctx::DMInterpolationInfo, v::PetscVec)Returns a Vec which can hold all the interpolated field values
Collective
Input Parameters:
ctx- the contextv- a vector capable of holding the interpolated field values
Level: intermediate
See also:
DM, DMInterpolationInfo, DMInterpolationGetVector(), DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationCreate()
External Links
- PETSc Manual:
DM/DMInterpolationRestoreVector
PETSc.LibPETSc.DMInterpolationSetDim — Method
DMInterpolationSetDim(petsclib::PetscLibType,ctx::DMInterpolationInfo, dim::PetscInt)Sets the spatial dimension for the interpolation context
Not Collective
Input Parameters:
ctx- the contextdim- the spatial dimension
Level: intermediate
See also:
DM, DMInterpolationInfo, DMInterpolationGetDim(), DMInterpolationEvaluate(), DMInterpolationAddPoints()
External Links
- PETSc Manual:
DM/DMInterpolationSetDim
PETSc.LibPETSc.DMInterpolationSetDof — Method
DMInterpolationSetDof(petsclib::PetscLibType,ctx::DMInterpolationInfo, dof::PetscInt)Sets the number of fields interpolated at a point for the interpolation context
Not Collective
Input Parameters:
ctx- the contextdof- the number of fields
Level: intermediate
See also:
DM, DMInterpolationInfo, DMInterpolationGetDof(), DMInterpolationEvaluate(), DMInterpolationAddPoints()
External Links
- PETSc Manual:
DM/DMInterpolationSetDof
PETSc.LibPETSc.DMInterpolationSetUp — Method
DMInterpolationSetUp(petsclib::PetscLibType,ctx::DMInterpolationInfo, dm::PetscDM, redundantPoints::PetscBool, ignoreOutsideDomain::PetscBool)Compute spatial indices for point location during interpolation
Collective
Input Parameters:
ctx- the contextdm- theDMfor the function space used for interpolationredundantPoints- IfPETSC_TRUE, all processes are passing in the same array of points. Otherwise, points need to be communicated among processes.ignoreOutsideDomain- IfPETSC_TRUE, ignore points outside the domain, otherwise return an error
Level: intermediate
See also:
DM, DMInterpolationInfo, DMInterpolationEvaluate(), DMInterpolationAddPoints(), DMInterpolationCreate()
External Links
- PETSc Manual:
DM/DMInterpolationSetUp
PETSc.LibPETSc.DMIsBoundaryPoint — Method
isBd::PetscBool = DMIsBoundaryPoint(petsclib::PetscLibType,dm::PetscDM, point::PetscInt)External Links
- PETSc Manual:
DM/DMIsBoundaryPoint
PETSc.LibPETSc.DMIsForest — Method
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
- PETSc Manual:
DM/DMIsForest
PETSc.LibPETSc.DMKSPGetComputeInitialGuess — Method
DMKSPGetComputeInitialGuess(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeInitialGuessFn, ctx::Cvoid)get KSP initial guess evaluation function
Not Collective
Input Parameter:
dm-DMused with aKSP
Output Parameters:
func- initial guess evaluation function, for calling sequence seeKSPComputeInitialGuessFnctx- context for right-hand side evaluation
Level: advanced
-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), KSPSetComputeRHS(), DMKSPSetComputeRHS(), KSPComputeInitialGuessFn
External Links
- PETSc Manual:
Ksp/DMKSPGetComputeInitialGuess
PETSc.LibPETSc.DMKSPGetComputeOperators — Method
DMKSPGetComputeOperators(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeOperatorsFn, ctx::Cvoid)get KSP matrix evaluation function
Not Collective
Input Parameter:
dm-DMused with aKSP
Output Parameters:
func- matrix evaluation function, for calling sequence seeKSPComputeOperatorsFnctx- context for matrix evaluation
Level: developer
-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), KSPSetComputeOperators(), DMKSPSetComputeOperators(), KSPComputeOperatorsFn
External Links
- PETSc Manual:
Ksp/DMKSPGetComputeOperators
PETSc.LibPETSc.DMKSPGetComputeRHS — Method
DMKSPGetComputeRHS(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeRHSFn, ctx::Cvoid)get KSP right
Not Collective
Input Parameter:
dm-DMto be used withKSP
Output Parameters:
func- right-hand side evaluation function, for calling sequence seeKSPComputeRHSFnctx- context for right-hand side evaluation
Level: advanced
-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), KSPSetComputeRHS(), DMKSPSetComputeRHS(), KSPComputeRHSFn
External Links
- PETSc Manual:
Ksp/DMKSPGetComputeRHS
PETSc.LibPETSc.DMKSPSetComputeInitialGuess — Method
DMKSPSetComputeInitialGuess(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeInitialGuessFn, ctx::Cvoid)set KSP initial guess evaluation function
Not Collective
Input Parameters:
dm-DMto be used withKSPfunc- initial guess evaluation function, for calling sequence seeKSPComputeInitialGuessFnctx- context for initial guess evaluation
Level: developer
-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), DMKSPGetComputeRHS(), KSPComputeInitialGuessFn
External Links
- PETSc Manual:
Ksp/DMKSPSetComputeInitialGuess
PETSc.LibPETSc.DMKSPSetComputeOperators — Method
DMKSPSetComputeOperators(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeOperatorsFn, ctx::Cvoid)set KSP matrix evaluation function
Not Collective
Input Parameters:
dm-DMto be used withKSPfunc- matrix evaluation function, for calling sequence seeKSPComputeOperatorsFnctx- context for matrix evaluation
Level: developer
-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), DMKSPGetComputeOperators(), KSPSetOperators(), KSPComputeOperatorsFn
External Links
- PETSc Manual:
Ksp/DMKSPSetComputeOperators
PETSc.LibPETSc.DMKSPSetComputeRHS — Method
DMKSPSetComputeRHS(petsclib::PetscLibType,dm::PetscDM, func::KSPComputeRHSFn, ctx::Cvoid)set KSP right
Not Collective
Input Parameters:
dm-DMused with aKSPfunc- right-hand side evaluation function, for calling sequence seeKSPComputeRHSFnctx- context for right-hand side evaluation
Level: developer
-seealso: , DMKSP, DM, KSP, DMKSPSetContext(), DMKSPGetComputeRHS()
External Links
- PETSc Manual:
Ksp/DMKSPSetComputeRHS
PETSc.LibPETSc.DMLoad — Method
DMLoad(petsclib::PetscLibType,newdm::PetscDM, viewer::PetscViewer)Loads a DM that has been stored in binary with DMView().
Collective
Input Parameters:
newdm- the newly loadedDM, this needs to have been created withDMCreate()or
some related function before a call to DMLoad().
viewer- binary file viewer, obtained fromPetscViewerBinaryOpen()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
- PETSc Manual:
DM/DMLoad
PETSc.LibPETSc.DMLocalToGlobal — Method
DMLocalToGlobal(petsclib::PetscLibType,dm::PetscDM, l::PetscVec, mode::InsertMode, g::PetscVec)updates global vectors from local vectors
Neighbor-wise Collective
Input Parameters:
dm- theDMobjectl- the local vectormode- ifINSERT_VALUESthen no parallel communication is used, ifADD_VALUESthen 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
- PETSc Manual:
DM/DMLocalToGlobal
PETSc.LibPETSc.DMLocalToGlobalBegin — Method
DMLocalToGlobalBegin(petsclib::PetscLibType,dm::PetscDM, l::PetscVec, mode::InsertMode, g::PetscVec)begins updating global vectors from local vectors
Neighbor-wise Collective
Input Parameters:
dm- theDMobjectl- the local vectormode- ifINSERT_VALUESthen no parallel communication is used, ifADD_VALUESthen 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
- PETSc Manual:
DM/DMLocalToGlobalBegin
PETSc.LibPETSc.DMLocalToGlobalBeginDefaultShell — Method
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-DMSHELLl- local vectormode-InsertModeg- global vector
Level: advanced
-seealso: DM, DMSHELL, DMLocalToGlobalEndDefaultShell()
External Links
- PETSc Manual:
DM/DMLocalToGlobalBeginDefaultShell
PETSc.LibPETSc.DMLocalToGlobalEnd — Method
DMLocalToGlobalEnd(petsclib::PetscLibType,dm::PetscDM, l::PetscVec, mode::InsertMode, g::PetscVec)updates global vectors from local vectors
Neighbor-wise Collective
Input Parameters:
dm- theDMobjectl- the local vectormode-INSERT_VALUESorADD_VALUESg- the global vector
Level: intermediate
Note: See DMLocalToGlobalBegin() for full details
See also:
DM, DMLocalToGlobalBegin(), DMCoarsen(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMGlobalToLocalEnd()
External Links
- PETSc Manual:
DM/DMLocalToGlobalEnd
PETSc.LibPETSc.DMLocalToGlobalEndDefaultShell — Method
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-DMSHELLl- local vectormode-InsertModeg- global vector
Level: advanced
-seealso: DM, DMSHELL, DMLocalToGlobalBeginDefaultShell()
External Links
- PETSc Manual:
DM/DMLocalToGlobalEndDefaultShell
PETSc.LibPETSc.DMLocalToGlobalHookAdd — Method
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- theDMbeginhook- function to run at the beginning ofDMLocalToGlobalBegin()endhook- function to run afterDMLocalToGlobalEnd()has completedctx- [optional] user-defined context for provide data for the hooks (may beNULL)
Calling sequence of beginhook:
global- globalDMl- local vectormode- modeg- global vectorctx- optional user-defined function context
Calling sequence of endhook:
global- globalDMl- local vectormode- modeg- global vectorctx- optional user-defined function context
Level: advanced
See also:
DM, DMLocalToGlobal(), DMRefineHookAdd(), DMGlobalToLocalHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate()
External Links
- PETSc Manual:
DM/DMLocalToGlobalHookAdd
PETSc.LibPETSc.DMLocalToLocalBegin — Method
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- theDMobjectg- the original local vectormode- one ofINSERT_VALUESorADD_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
- PETSc Manual:
DM/DMLocalToLocalBegin
PETSc.LibPETSc.DMLocalToLocalBeginDefaultShell — Method
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-DMSHELLg- the original local vectormode-InsertMode
Output Parameter:
l- the local vector with correct ghost values
Level: advanced
-seealso: DM, DMSHELL, DMLocalToLocalEndDefaultShell()
External Links
- PETSc Manual:
DM/DMLocalToLocalBeginDefaultShell
PETSc.LibPETSc.DMLocalToLocalEnd — Method
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- theDMobjectg- the original local vectormode- one ofINSERT_VALUESorADD_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
- PETSc Manual:
DM/DMLocalToLocalEnd
PETSc.LibPETSc.DMLocalToLocalEndDefaultShell — Method
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-DMSHELLg- the original local vectormode-InsertMode
Output Parameter:
l- the local vector with correct ghost values
Level: advanced
-seealso: DM, DMSHELL, DMLocalToLocalBeginDefaultShell()
External Links
- PETSc Manual:
DM/DMLocalToLocalEndDefaultShell
PETSc.LibPETSc.DMLocalizeCoordinate — Method
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- TheDMin- 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
- PETSc Manual:
DM/DMLocalizeCoordinate
PETSc.LibPETSc.DMLocalizeCoordinates — Method
DMLocalizeCoordinates(petsclib::PetscLibType,dm::PetscDM)If a mesh is periodic, create local coordinates for cells having periodic faces
Collective
Input Parameter:
dm- TheDM
Level: developer
-seealso: DM, DMSetPeriodicity(), DMLocalizeCoordinate(), DMLocalizeAddCoordinate()
External Links
- PETSc Manual:
DM/DMLocalizeCoordinates
PETSc.LibPETSc.DMLocatePoints — Method
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- TheDMltype- The type of point location, e.g.DM_POINTLOCATION_NONEorDM_POINTLOCATION_NEAREST
Input/Output Parameters:
v- TheVecof points, on output contains the nearest mesh points to the given points ifDM_POINTLOCATION_NEARESTis usedcellSF- Points to eitherNULL, or aPetscSFwith 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
- PETSc Manual:
DM/DMLocatePoints
PETSc.LibPETSc.DMMoabCheckBoundaryVertices — Method
isbdvtx::PetscBool = DMMoabCheckBoundaryVertices(petsclib::PetscLibType,dm::PetscDM, nconn::PetscInt, cnt::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabCheckBoundaryVertices
PETSc.LibPETSc.DMMoabCreate — Method
dmb::PetscDM = DMMoabCreate(petsclib::PetscLibType,comm::MPI_Comm)External Links
- PETSc Manual:
DMMoab/DMMoabCreate
PETSc.LibPETSc.DMMoabCreateBoxMesh — Method
bounds::PetscReal,dm::PetscDM = DMMoabCreateBoxMesh(petsclib::PetscLibType,comm::MPI_Comm, dim::PetscInt, useSimplex::PetscBool, nele::PetscInt, nghost::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabCreateBoxMesh
PETSc.LibPETSc.DMMoabCreateElement — Method
conn::moab_EntityHandle,oelem::moab_EntityHandle = DMMoabCreateElement(petsclib::PetscLibType,dm::PetscDM, type::moab_EntityType, nverts::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabCreateElement
PETSc.LibPETSc.DMMoabCreateMoab — Method
mbiface::moab_Interface,ltog_tag::moab_Tag,range::moab_Range,dmb::PetscDM = DMMoabCreateMoab(petsclib::PetscLibType,comm::MPI_Comm)External Links
- PETSc Manual:
DMMoab/DMMoabCreateMoab
PETSc.LibPETSc.DMMoabCreateSubmesh — Method
newdm::PetscDM = DMMoabCreateSubmesh(petsclib::PetscLibType,dm::PetscDM)External Links
- PETSc Manual:
DMMoab/DMMoabCreateSubmesh
PETSc.LibPETSc.DMMoabCreateVector — Method
range::moab_Range,vec::PetscVec = DMMoabCreateVector(petsclib::PetscLibType,dm::PetscDM, tag::moab_Tag, is_global_vec::PetscBool, destroy_tag::PetscBool)External Links
- PETSc Manual:
DMMoab/DMMoabCreateVector
PETSc.LibPETSc.DMMoabCreateVertices — Method
coords::PetscReal,overts::moab_Range = DMMoabCreateVertices(petsclib::PetscLibType,dm::PetscDM, nverts::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabCreateVertices
PETSc.LibPETSc.DMMoabFEMComputeBasis — Method
coordinates::PetscReal,phypts::PetscReal,jacobian_quadrature_weight_product::PetscReal,fe_basis::PetscReal = DMMoabFEMComputeBasis(petsclib::PetscLibType,dim::PetscInt, nverts::PetscInt, quadrature::PetscQuadrature, fe_basis_derivatives::PetscReal)External Links
- PETSc Manual:
DMMoab/DMMoabFEMComputeBasis
PETSc.LibPETSc.DMMoabFEMCreateQuadratureDefault — Method
quadrature::PetscQuadrature = DMMoabFEMCreateQuadratureDefault(petsclib::PetscLibType,dim::PetscInt, nverts::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabFEMCreateQuadratureDefault
PETSc.LibPETSc.DMMoabGenerateHierarchy — Method
ldegrees::PetscInt = DMMoabGenerateHierarchy(petsclib::PetscLibType,dm::PetscDM, nlevels::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabGenerateHierarchy
PETSc.LibPETSc.DMMoabGetAllVertices — Method
DMMoabGetAllVertices(petsclib::PetscLibType,dm::PetscDM, loc::moab_Range)External Links
- PETSc Manual:
DMMoab/DMMoabGetAllVertices
PETSc.LibPETSc.DMMoabGetBlockSize — Method
bs::PetscInt = DMMoabGetBlockSize(petsclib::PetscLibType,dm::PetscDM)External Links
- PETSc Manual:
DMMoab/DMMoabGetBlockSize
PETSc.LibPETSc.DMMoabGetBoundaryMarkers — Method
DMMoabGetBoundaryMarkers(petsclib::PetscLibType,dm::PetscDM, bdvtx::moab_Range, bdelems::moab_Range, bdfaces::moab_Range)External Links
- PETSc Manual:
DMMoab/DMMoabGetBoundaryMarkers
PETSc.LibPETSc.DMMoabGetDimension — Method
dim::PetscInt = DMMoabGetDimension(petsclib::PetscLibType,dm::PetscDM)External Links
- PETSc Manual:
DMMoab/DMMoabGetDimension
PETSc.LibPETSc.DMMoabGetDofs — Method
dof::PetscInt = DMMoabGetDofs(petsclib::PetscLibType,dm::PetscDM, npoints::PetscInt, points::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabGetDofs
PETSc.LibPETSc.DMMoabGetDofsBlocked — Method
dof::PetscInt = DMMoabGetDofsBlocked(petsclib::PetscLibType,dm::PetscDM, npoints::PetscInt, points::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabGetDofsBlocked
PETSc.LibPETSc.DMMoabGetDofsBlockedLocal — Method
dof::PetscInt = DMMoabGetDofsBlockedLocal(petsclib::PetscLibType,dm::PetscDM, npoints::PetscInt, points::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabGetDofsBlockedLocal
PETSc.LibPETSc.DMMoabGetDofsLocal — Method
dof::PetscInt = DMMoabGetDofsLocal(petsclib::PetscLibType,dm::PetscDM, npoints::PetscInt, points::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabGetDofsLocal
PETSc.LibPETSc.DMMoabGetElementConnectivity — Method
nconn::PetscInt = DMMoabGetElementConnectivity(petsclib::PetscLibType,dm::PetscDM, ehandle::moab_EntityHandle, conn::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabGetElementConnectivity
PETSc.LibPETSc.DMMoabGetFieldDof — Method
dof::PetscInt = DMMoabGetFieldDof(petsclib::PetscLibType,dm::PetscDM, point::moab_EntityHandle, field::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabGetFieldDof
PETSc.LibPETSc.DMMoabGetFieldDofs — Method
dof::PetscInt = DMMoabGetFieldDofs(petsclib::PetscLibType,dm::PetscDM, npoints::PetscInt, points::moab_EntityHandle, field::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabGetFieldDofs
PETSc.LibPETSc.DMMoabGetFieldDofsLocal — Method
dof::PetscInt = DMMoabGetFieldDofsLocal(petsclib::PetscLibType,dm::PetscDM, npoints::PetscInt, points::moab_EntityHandle, field::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabGetFieldDofsLocal
PETSc.LibPETSc.DMMoabGetFieldName — Method
DMMoabGetFieldName(petsclib::PetscLibType,dm::PetscDM, field::PetscInt, fieldName::String)External Links
- PETSc Manual:
DMMoab/DMMoabGetFieldName
PETSc.LibPETSc.DMMoabGetHierarchyLevel — Method
nlevel::PetscInt = DMMoabGetHierarchyLevel(petsclib::PetscLibType,dm::PetscDM)External Links
- PETSc Manual:
DMMoab/DMMoabGetHierarchyLevel
PETSc.LibPETSc.DMMoabGetInterface — Method
DMMoabGetInterface(petsclib::PetscLibType,dm::PetscDM, mbiface::moab_Interface)External Links
- PETSc Manual:
DMMoab/DMMoabGetInterface
PETSc.LibPETSc.DMMoabGetLocalElements — Method
DMMoabGetLocalElements(petsclib::PetscLibType,dm::PetscDM, range::moab_Range)External Links
- PETSc Manual:
DMMoab/DMMoabGetLocalElements
PETSc.LibPETSc.DMMoabGetLocalSize — Method
nel::PetscInt,neg::PetscInt,nvl::PetscInt,nvg::PetscInt = DMMoabGetLocalSize(petsclib::PetscLibType,dm::PetscDM)External Links
- PETSc Manual:
DMMoab/DMMoabGetLocalSize
PETSc.LibPETSc.DMMoabGetLocalToGlobalTag — Method
DMMoabGetLocalToGlobalTag(petsclib::PetscLibType,dm::PetscDM, ltog_tag::moab_Tag)External Links
- PETSc Manual:
DMMoab/DMMoabGetLocalToGlobalTag
PETSc.LibPETSc.DMMoabGetLocalVertices — Method
DMMoabGetLocalVertices(petsclib::PetscLibType,dm::PetscDM, owned::moab_Range, ghost::moab_Range)External Links
- PETSc Manual:
DMMoab/DMMoabGetLocalVertices
PETSc.LibPETSc.DMMoabGetMaterialBlock — Method
mat::PetscInt = DMMoabGetMaterialBlock(petsclib::PetscLibType,dm::PetscDM, ehandle::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabGetMaterialBlock
PETSc.LibPETSc.DMMoabGetOffset — Method
offset::PetscInt = DMMoabGetOffset(petsclib::PetscLibType,dm::PetscDM)External Links
- PETSc Manual:
DMMoab/DMMoabGetOffset
PETSc.LibPETSc.DMMoabGetParallelComm — Method
DMMoabGetParallelComm(petsclib::PetscLibType,dm::PetscDM, pcomm::moab_ParallelComm)External Links
- PETSc Manual:
DMMoab/DMMoabGetParallelComm
PETSc.LibPETSc.DMMoabGetSize — Method
neg::PetscInt,nvg::PetscInt = DMMoabGetSize(petsclib::PetscLibType,dm::PetscDM)External Links
- PETSc Manual:
DMMoab/DMMoabGetSize
PETSc.LibPETSc.DMMoabGetVecRange — Method
DMMoabGetVecRange(petsclib::PetscLibType,vec::PetscVec, range::moab_Range)External Links
- PETSc Manual:
DMMoab/DMMoabGetVecRange
PETSc.LibPETSc.DMMoabGetVecTag — Method
DMMoabGetVecTag(petsclib::PetscLibType,vec::PetscVec, tag::moab_Tag)External Links
- PETSc Manual:
DMMoab/DMMoabGetVecTag
PETSc.LibPETSc.DMMoabGetVertexConnectivity — Method
nconn::PetscInt = DMMoabGetVertexConnectivity(petsclib::PetscLibType,dm::PetscDM, vhandle::moab_EntityHandle, conn::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabGetVertexConnectivity
PETSc.LibPETSc.DMMoabGetVertexCoordinates — Method
vpos::PetscReal = DMMoabGetVertexCoordinates(petsclib::PetscLibType,dm::PetscDM, nconn::PetscInt, conn::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabGetVertexCoordinates
PETSc.LibPETSc.DMMoabGetVertexDofsBlocked — Method
DMMoabGetVertexDofsBlocked(petsclib::PetscLibType,dm::PetscDM, dof::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabGetVertexDofsBlocked
PETSc.LibPETSc.DMMoabGetVertexDofsBlockedLocal — Method
DMMoabGetVertexDofsBlockedLocal(petsclib::PetscLibType,dm::PetscDM, dof::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabGetVertexDofsBlockedLocal
PETSc.LibPETSc.DMMoabIsEntityOnBoundary — Method
ent_on_boundary::PetscBool = DMMoabIsEntityOnBoundary(petsclib::PetscLibType,dm::PetscDM, ent::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabIsEntityOnBoundary
PETSc.LibPETSc.DMMoabLoadFromFile — Method
DMMoabLoadFromFile(petsclib::PetscLibType,comm::MPI_Comm, dim::PetscInt, nghost::PetscInt, filename::String, usrreadopts::String, dm::PetscDM)External Links
- PETSc Manual:
DMMoab/DMMoabLoadFromFile
PETSc.LibPETSc.DMMoabOutput — Method
DMMoabOutput(petsclib::PetscLibType,dm::PetscDM, filename::String, usrwriteopts::String)External Links
- PETSc Manual:
DMMoab/DMMoabOutput
PETSc.LibPETSc.DMMoabPToRMapping — Method
coordinates::PetscReal,xphy::PetscReal,natparam::PetscReal,phi::PetscReal = DMMoabPToRMapping(petsclib::PetscLibType,dim::PetscInt, nverts::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabPToRMapping
PETSc.LibPETSc.DMMoabRenumberMeshEntities — Method
DMMoabRenumberMeshEntities(petsclib::PetscLibType,dm::PetscDM)External Links
- PETSc Manual:
DMMoab/DMMoabRenumberMeshEntities
PETSc.LibPETSc.DMMoabRestoreVertexConnectivity — Method
nconn::PetscInt = DMMoabRestoreVertexConnectivity(petsclib::PetscLibType,dm::PetscDM, ehandle::moab_EntityHandle, conn::moab_EntityHandle)External Links
- PETSc Manual:
DMMoab/DMMoabRestoreVertexConnectivity
PETSc.LibPETSc.DMMoabSetBlockFills — Method
dfill::PetscInt,ofill::PetscInt = DMMoabSetBlockFills(petsclib::PetscLibType,dm::PetscDM)External Links
- PETSc Manual:
DMMoab/DMMoabSetBlockFills
PETSc.LibPETSc.DMMoabSetBlockSize — Method
DMMoabSetBlockSize(petsclib::PetscLibType,dm::PetscDM, bs::PetscInt)External Links
- PETSc Manual:
DMMoab/DMMoabSetBlockSize
PETSc.LibPETSc.DMMoabSetFieldName — Method
DMMoabSetFieldName(petsclib::PetscLibType,dm::PetscDM, field::PetscInt, fieldName::String)External Links
- PETSc Manual:
DMMoab/DMMoabSetFieldName
PETSc.LibPETSc.DMMoabSetFieldNames — Method
DMMoabSetFieldNames(petsclib::PetscLibType,dm::PetscDM, numFields::PetscInt, fields::String)External Links
- PETSc Manual:
DMMoab/DMMoabSetFieldNames
PETSc.LibPETSc.DMMoabSetFieldVector — Method
DMMoabSetFieldVector(petsclib::PetscLibType,dm::PetscDM, ifield::PetscInt, fvec::PetscVec)External Links
- PETSc Manual:
DMMoab/DMMoabSetFieldVector
PETSc.LibPETSc.DMMoabSetGlobalFieldVector — Method
DMMoabSetGlobalFieldVector(petsclib::PetscLibType,dm::PetscDM, fvec::PetscVec)External Links
- PETSc Manual:
DMMoab/DMMoabSetGlobalFieldVector
PETSc.LibPETSc.DMMoabSetInterface — Method
DMMoabSetInterface(petsclib::PetscLibType,dm::PetscDM, mbiface::moab_Interface)External Links
- PETSc Manual:
DMMoab/DMMoabSetInterface
PETSc.LibPETSc.DMMoabSetLocalElements — Method
DMMoabSetLocalElements(petsclib::PetscLibType,dm::PetscDM, range::moab_Range)External Links
- PETSc Manual:
DMMoab/DMMoabSetLocalElements
PETSc.LibPETSc.DMMoabSetLocalToGlobalTag — Method
DMMoabSetLocalToGlobalTag(petsclib::PetscLibType,dm::PetscDM, ltogtag::moab_Tag)External Links
- PETSc Manual:
DMMoab/DMMoabSetLocalToGlobalTag
PETSc.LibPETSc.DMMoabSetLocalVertices — Method
DMMoabSetLocalVertices(petsclib::PetscLibType,dm::PetscDM, range::moab_Range)External Links
- PETSc Manual:
DMMoab/DMMoabSetLocalVertices
PETSc.LibPETSc.DMMoabVecGetArray — Method
DMMoabVecGetArray(petsclib::PetscLibType,dm::PetscDM, vec::PetscVec, array::Cvoid)External Links
- PETSc Manual:
DMMoab/DMMoabVecGetArray
PETSc.LibPETSc.DMMoabVecGetArrayRead — Method
DMMoabVecGetArrayRead(petsclib::PetscLibType,dm::PetscDM, vec::PetscVec, array::Cvoid)External Links
- PETSc Manual:
DMMoab/DMMoabVecGetArrayRead
PETSc.LibPETSc.DMMoabVecRestoreArray — Method
DMMoabVecRestoreArray(petsclib::PetscLibType,dm::PetscDM, vec::PetscVec, array::Cvoid)External Links
- PETSc Manual:
DMMoab/DMMoabVecRestoreArray
PETSc.LibPETSc.DMMoabVecRestoreArrayRead — Method
DMMoabVecRestoreArrayRead(petsclib::PetscLibType,dm::PetscDM, vec::PetscVec, array::Cvoid)External Links
- PETSc Manual:
DMMoab/DMMoabVecRestoreArrayRead
PETSc.LibPETSc.DMMonitor — Method
DMMonitor(petsclib::PetscLibType,dm::PetscDM)runs the user provided monitor routines, if they exist
Collective
Input Parameter:
dm- TheDM
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
- PETSc Manual:
DM/DMMonitor
PETSc.LibPETSc.DMMonitorCancel — Method
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
- PETSc Manual:
DM/DMMonitorCancel
PETSc.LibPETSc.DMMonitorSet — Method
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- theDMf- the monitor functionmctx- [optional] user-defined context for private data for the monitor routine (useNULLif no context is desired)monitordestroy- [optional] routine that frees monitor context (may beNULL), seePetscCtxDestroyFnfor the calling sequence
Options Database Key:
-dm_monitor_cancel- cancels all monitors that have been hardwired into a code by calls toDMMonitorSet(), 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
- PETSc Manual:
DM/DMMonitorSet
PETSc.LibPETSc.DMMonitorSetFromOptions — Method
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-DMobject you wish to monitorname- the monitor type one is seekinghelp- message indicating what monitoring is donemanual- manual page for the monitormonitor- the monitor function, this must use aPetscViewerFormatas its contextmonitorsetup- a function that is called once ONLY if the user selected this monitor that may set additional features of theDMorPetscViewerobjects
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
- PETSc Manual:
DM/DMMonitorSetFromOptions
PETSc.LibPETSc.DMOutputSequenceLoad — Method
val::PetscReal = DMOutputSequenceLoad(petsclib::PetscLibType,dm::PetscDM, viewer::PetscViewer, name::String, num::PetscInt)Retrieve the sequence value from a PetscViewer
Input Parameters:
dm- The originalDMviewer- ThePetscViewerto get it fromname- The sequence namenum- 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
- PETSc Manual:
DM/DMOutputSequenceLoad
PETSc.LibPETSc.DMPatchCreate — Method
mesh::PetscDM = DMPatchCreate(petsclib::PetscLibType,comm::MPI_Comm)Creates a DMPatch object, which is a collections of DMs called patches.
Collective
Input Parameter:
comm- The communicator for the DMPatch object
Output Parameter:
mesh- The DMPatch object
-seealso: DMPatchZoom()
External Links
- PETSc Manual:
DMPatch/DMPatchCreate
PETSc.LibPETSc.DMPatchCreateGrid — Method
dm::PetscDM = DMPatchCreateGrid(petsclib::PetscLibType,comm::MPI_Comm, dim::PetscInt, patchSize::MatStencil, commSize::MatStencil, gridSize::MatStencil)External Links
- PETSc Manual:
DMPatch/DMPatchCreateGrid
PETSc.LibPETSc.DMPatchGetCoarse — Method
DMPatchGetCoarse(petsclib::PetscLibType,dm::PetscDM, dmCoarse::PetscDM)External Links
- PETSc Manual:
DMPatch/DMPatchGetCoarse
PETSc.LibPETSc.DMPatchGetCommSize — Method
DMPatchGetCommSize(petsclib::PetscLibType,dm::PetscDM, commSize::MatStencil)External Links
- PETSc Manual:
DMPatch/DMPatchGetCommSize
PETSc.LibPETSc.DMPatchGetPatchSize — Method
DMPatchGetPatchSize(petsclib::PetscLibType,dm::PetscDM, patchSize::MatStencil)External Links
- PETSc Manual:
DMPatch/DMPatchGetPatchSize
PETSc.LibPETSc.DMPatchSetCommSize — Method
DMPatchSetCommSize(petsclib::PetscLibType,dm::PetscDM, commSize::MatStencil)External Links
- PETSc Manual:
DMPatch/DMPatchSetCommSize
PETSc.LibPETSc.DMPatchSetPatchSize — Method
DMPatchSetPatchSize(petsclib::PetscLibType,dm::PetscDM, patchSize::MatStencil)External Links
- PETSc Manual:
DMPatch/DMPatchSetPatchSize
PETSc.LibPETSc.DMPatchSolve — Method
PETSc.LibPETSc.DMPatchZoom — Method
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- theDMlower- the lower left corner of the requested patchupper- the upper right corner of the requested patchcommz- the new communicator for the patch,MPI_COMM_NULLindicates that the given rank will not own a patch
Output Parameters:
dmz- the patchDMsfz- thePetscSFmapping the patch+halo to the zoomed version (optional)sfzr- thePetscSFmapping the patch to the restricted zoomed version
Level: intermediate
-seealso: DMPatchSolve(), DMDACreatePatchIS()
External Links
- PETSc Manual:
DMPatch/DMPatchZoom
PETSc.LibPETSc.DMPolytopeGetOrientation — Method
ornt::PetscInt = DMPolytopeGetOrientation(petsclib::PetscLibType,ct::DMPolytopeType, sourceCone::Vector{PetscInt}, targetCone::Vector{PetscInt})Determine an orientation (transformation) that takes the source face arrangement to the target face arrangement
Not Collective
Input Parameters:
ct- TheDMPolytopeTypesourceCone- The source arrangement of facestargetCone- 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
- PETSc Manual:
DM/DMPolytopeGetOrientation
PETSc.LibPETSc.DMPolytopeGetVertexOrientation — Method
ornt::PetscInt = DMPolytopeGetVertexOrientation(petsclib::PetscLibType,ct::DMPolytopeType, sourceCone::Vector{PetscInt}, targetCone::Vector{PetscInt})Determine an orientation (transformation) that takes the source vertex arrangement to the target vertex arrangement
Not Collective
Input Parameters:
ct- TheDMPolytopeTypesourceCone- The source arrangement of verticestargetCone- 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
- PETSc Manual:
DM/DMPolytopeGetVertexOrientation
PETSc.LibPETSc.DMPolytopeInCellTest — Method
inside::PetscBool = DMPolytopeInCellTest(petsclib::PetscLibType,ct::DMPolytopeType, point::Vector{PetscReal})Check whether a point lies inside the reference cell of given type
Not Collective
Input Parameters:
ct- TheDMPolytopeTypepoint- 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
- PETSc Manual:
DM/DMPolytopeInCellTest
PETSc.LibPETSc.DMPolytopeMatchOrientation — Method
ornt::PetscInt,found::PetscBool = DMPolytopeMatchOrientation(petsclib::PetscLibType,ct::DMPolytopeType, sourceCone::Vector{PetscInt}, targetCone::Vector{PetscInt})Determine an orientation (transformation) that takes the source face arrangement to the target face arrangement
Not Collective
Input Parameters:
ct- TheDMPolytopeTypesourceCone- The source arrangement of facestargetCone- The target arrangement of faces
Output Parameters:
ornt- The orientation (transformation) which will take the source arrangement to the target arrangementfound- 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
- PETSc Manual:
DM/DMPolytopeMatchOrientation
PETSc.LibPETSc.DMPolytopeMatchVertexOrientation — Method
ornt::PetscInt,found::PetscBool = DMPolytopeMatchVertexOrientation(petsclib::PetscLibType,ct::DMPolytopeType, sourceVert::Vector{PetscInt}, targetVert::Vector{PetscInt})Determine an orientation (transformation) that takes the source vertex arrangement to the target vertex arrangement
Not Collective
Input Parameters:
ct- TheDMPolytopeTypesourceVert- The source arrangement of verticestargetVert- The target arrangement of vertices
Output Parameters:
ornt- The orientation (transformation) which will take the source arrangement to the target arrangementfound- 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
- PETSc Manual:
DM/DMPolytopeMatchVertexOrientation
PETSc.LibPETSc.DMPrintCellIndices — Method
DMPrintCellIndices(petsclib::PetscLibType,c::PetscInt, name::String, len::PetscInt, x::Vector{PetscInt})External Links
- PETSc Manual:
DM/DMPrintCellIndices
PETSc.LibPETSc.DMPrintCellMatrix — Method
DMPrintCellMatrix(petsclib::PetscLibType,c::PetscInt, name::String, rows::PetscInt, cols::PetscInt, A::Vector{PetscScalar})External Links
- PETSc Manual:
DM/DMPrintCellMatrix
PETSc.LibPETSc.DMPrintCellVector — Method
DMPrintCellVector(petsclib::PetscLibType,c::PetscInt, name::String, len::PetscInt, x::Vector{PetscScalar})External Links
- PETSc Manual:
DM/DMPrintCellVector
PETSc.LibPETSc.DMPrintCellVectorReal — Method
DMPrintCellVectorReal(petsclib::PetscLibType,c::PetscInt, name::String, len::PetscInt, x::Vector{PetscReal})External Links
- PETSc Manual:
DM/DMPrintCellVectorReal
PETSc.LibPETSc.DMPrintLocalVec — Method
DMPrintLocalVec(petsclib::PetscLibType,dm::PetscDM, name::String, tol::PetscReal, X::PetscVec)External Links
- PETSc Manual:
DM/DMPrintLocalVec
PETSc.LibPETSc.DMProjectField — Method
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- TheDMtime- The timeU- The input field vectorfuncs- The functions to evaluate, one per field, seePetscPointFnmode- 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
- PETSc Manual:
DM/DMProjectField
PETSc.LibPETSc.DMRefine — Method
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- theDMobjectcomm- the communicator to contain the newDMobject (orMPI_COMM_NULL)
Output Parameter:
dmf- the refinedDM, orNULL
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
- PETSc Manual:
DM/DMRefine
PETSc.LibPETSc.DMRefineHierarchy — Method
DMRefineHierarchy(petsclib::PetscLibType,dm::PetscDM, nlevels::PetscInt, dmf::Vector{PetscDM})Refines a DM object, all levels at once
Collective
Input Parameters:
dm- theDMobjectnlevels- the number of levels of refinement
Output Parameter:
dmf- the refinedDMhierarchy
Level: developer
See also:
DM, DMCoarsen(), DMCoarsenHierarchy(), DMDestroy(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation()
External Links
- PETSc Manual:
DM/DMRefineHierarchy
PETSc.LibPETSc.DMRefineHookAdd — Method
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-DMon which to run a hook when interpolating to a finer levelrefinehook- function to run when setting up the finer levelinterphook- function to run to update data on finer levels (once perSNESSolve())ctx- [optional] user-defined context for provide data for the hooks (may beNULL)
Calling sequence of refinehook:
coarse- coarse levelDMfine- fine levelDMto interpolate problem toctx- optional user-defined function context
Calling sequence of interphook:
coarse- coarse levelDMinterp- matrix interpolating a coarse-level solution to the finer gridfine- fine levelDMto updatectx- 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
- PETSc Manual:
DM/DMRefineHookAdd
PETSc.LibPETSc.DMRefineHookRemove — Method
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- theDMon which to run a hook when restricting to a coarser levelrefinehook- function to run when setting up a finer levelinterphook- function to run to update data on finer levelsctx- [optional] user-defined context for provide data for the hooks (may beNULL)
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
- PETSc Manual:
DM/DMRefineHookRemove
PETSc.LibPETSc.DMRegister — Method
DMRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds a new DM type implementation
Not Collective, No Fortran Support
Input Parameters:
sname- The name of a new user-defined creation routinefunction- 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
- PETSc Manual:
DM/DMRegister
PETSc.LibPETSc.DMRemoveLabel — Method
DMRemoveLabel(petsclib::PetscLibType,dm::PetscDM, name::String, label::DMLabel)Remove the label given by name from this DM
Not Collective
Input Parameters:
dm- TheDMobjectname- The label name
Output Parameter:
label- TheDMLabel, orNULLif the label is absent. Pass inNULLto callDMLabelDestroy()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
- PETSc Manual:
DM/DMRemoveLabel
PETSc.LibPETSc.DMRemoveLabelBySelf — Method
DMRemoveLabelBySelf(petsclib::PetscLibType,dm::PetscDM, label::DMLabel, failNotFound::PetscBool)Remove the label from this DM
Not Collective
Input Parameters:
dm- TheDMobjectlabel- TheDMLabelto be removed from theDMfailNotFound- Should it fail if the label is not found in theDM?
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
- PETSc Manual:
DM/DMRemoveLabelBySelf
PETSc.LibPETSc.DMReorderSectionGetDefault — Method
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
- PETSc Manual:
DM/DMReorderSectionGetDefault
PETSc.LibPETSc.DMReorderSectionGetType — Method
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
- PETSc Manual:
DM/DMReorderSectionGetType
PETSc.LibPETSc.DMReorderSectionSetDefault — Method
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 DMreorder- Flag for reordering
Level: intermediate
-seealso: DMReorderSectionGetDefault()
External Links
- PETSc Manual:
DM/DMReorderSectionSetDefault
PETSc.LibPETSc.DMReorderSectionSetType — Method
DMReorderSectionSetType(petsclib::PetscLibType,dm::PetscDM, reorder::MatOrderingType)Set the type of local section reordering
Logically collective
Input Parameters:
dm- The DMreorder- The reordering method
Level: intermediate
-seealso: DMReorderSectionGetType(), DMReorderSectionSetDefault()
External Links
- PETSc Manual:
DM/DMReorderSectionSetType
PETSc.LibPETSc.DMRestoreGlobalVector — Method
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- theDMg- the global vector
Level: beginner
-seealso: DM, DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToGlobalBegin(), DMGlobalToGlobalEnd(), DMGlobalToGlobal(), DMCreateLocalVector(), DMGetGlobalVector(), DMClearGlobalVectors()
External Links
- PETSc Manual:
DM/DMRestoreGlobalVector
PETSc.LibPETSc.DMRestoreLocalVector — Method
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- theDMg- the local vector
Level: beginner
-seealso: DM, DMCreateGlobalVector(), VecDuplicate(), VecDuplicateVecs(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin(), DMCreateLocalVector(), DMGetLocalVector(), DMClearLocalVectors()
External Links
- PETSc Manual:
DM/DMRestoreLocalVector
PETSc.LibPETSc.DMRestoreNamedGlobalVector — Method
DMRestoreNamedGlobalVector(petsclib::PetscLibType,dm::PetscDM, name::String, X::PetscVec)restore access to a named, persistent global vector
Collective
Input Parameters:
dm-DMon whichXwas gottenname- name under whichXwas gottenX-Vecto restore
Level: developer
-seealso: DM, DMGetNamedGlobalVector(), DMClearNamedGlobalVectors()
External Links
- PETSc Manual:
DM/DMRestoreNamedGlobalVector
PETSc.LibPETSc.DMRestoreNamedLocalVector — Method
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-DMon whichXwas gottenname- name under whichXwas gottenX-Vecto restore
Level: developer
-seealso: DM, DMRestoreNamedGlobalVector(), DMGetNamedLocalVector(), DMClearNamedLocalVectors()
External Links
- PETSc Manual:
DM/DMRestoreNamedLocalVector
PETSc.LibPETSc.DMRestrict — Method
DMRestrict(petsclib::PetscLibType,fine::PetscDM, restrct::PetscMat, rscale::PetscVec, inject::PetscMat, coarse::PetscDM)restricts user
Collective if any hooks are
Input Parameters:
fine- finerDMfrom which the data is obtainedrestrct- restriction matrix, apply usingMatRestrict(), usually the transpose of the interpolationrscale- scaling vector for restrictioninject- injection matrix, also useMatRestrict()coarse- coarserDMto 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
- PETSc Manual:
DM/DMRestrict
PETSc.LibPETSc.DMSNESCheckDiscretization — Method
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- theSNESobjectdm- theDMt- the timeu- aDMvectortol- 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, orNULL
Level: developer
-seealso: , PetscDSSetExactSolution(), DNSNESCheckFromOptions(), DMSNESCheckResidual(), DMSNESCheckJacobian()
External Links
- PETSc Manual:
Snes/DMSNESCheckDiscretization
PETSc.LibPETSc.DMSNESCheckFromOptions — Method
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- theSNESobjectu- representativeSNESvector
Level: developer
External Links
- PETSc Manual:
Snes/DMSNESCheckFromOptions
PETSc.LibPETSc.DMSNESCheckJacobian — Method
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- theSNESobjectdm- theDMu- aDMvectortol- A tolerance for the check, or -1 to print the results instead
Output Parameters:
isLinear- Flag indicaing that the function looks linear, orNULLconvRate- The rate of convergence of the linear model, orNULL
Level: developer
-seealso: , DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckResidual()
External Links
- PETSc Manual:
Snes/DMSNESCheckJacobian
PETSc.LibPETSc.DMSNESCheckResidual — Method
residual::PetscReal = DMSNESCheckResidual(petsclib::PetscLibType,snes::PetscSNES, dm::PetscDM, u::PetscVec, tol::PetscReal)Check the residual of the exact solution
Input Parameters:
snes- theSNESobjectdm- theDMu- aDMvectortol- A tolerance for the check, or -1 to print the results instead
Output Parameter:
residual- The residual norm of the exact solution, orNULL
Level: developer
-seealso: , DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckJacobian()
External Links
- PETSc Manual:
Snes/DMSNESCheckResidual
PETSc.LibPETSc.DMSNESComputeJacobianAction — Method
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- TheDMX- Local solution vectorY- Local input vectoruser- The user context
Output Parameter:
F- local output vector
Level: developer
-seealso: , DM, DMSNESCreateJacobianMF(), DMPlexSNESComputeResidualFEM()
External Links
- PETSc Manual:
Snes/DMSNESComputeJacobianAction
PETSc.LibPETSc.DMSNESCreateJacobianMF — Method
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- TheDMX- The evaluation point for the Jacobianuser- A user context, orNULL
Output Parameter:
J- TheMat
Level: advanced
-seealso: , DM, SNES, DMSNESComputeJacobianAction()
External Links
- PETSc Manual:
Snes/DMSNESCreateJacobianMF
PETSc.LibPETSc.DMSNESGetFunction — Method
DMSNESGetFunction(petsclib::PetscLibType,dm::PetscDM, f::SNESFunctionFn, ctx::Cvoid)get SNES residual evaluation function from a DMSNES object
Not Collective
Input Parameter:
dm-DMto be used withSNES
Output Parameters:
f- residual evaluation function; seeSNESFunctionFnfor calling sequencectx- context for residual evaluation
Level: developer
-seealso: , DMSNES, DMSNESSetContext(), DMSNESSetFunction(), SNESSetFunction(), SNESFunctionFn
External Links
- PETSc Manual:
Snes/DMSNESGetFunction
PETSc.LibPETSc.DMSNESGetJacobian — Method
DMSNESGetJacobian(petsclib::PetscLibType,dm::PetscDM, J::SNESJacobianFn, ctx::Cvoid)get SNES Jacobian evaluation function from a DMSNES object
Not Collective
Input Parameter:
dm-DMto be used withSNES
Output Parameters:
J- Jacobian evaluation function; for all calling sequence seeSNESJacobianFnctx- context for residual evaluation
Level: developer
-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), SNESJacobianFn
External Links
- PETSc Manual:
Snes/DMSNESGetJacobian
PETSc.LibPETSc.DMSNESGetObjective — Method
DMSNESGetObjective(petsclib::PetscLibType,dm::PetscDM, obj::SNESObjectiveFn, ctx::Cvoid)Returns the objective function set with DMSNESSetObjective()
Not Collective
Input Parameter:
dm-DMto be used withSNES
Output Parameters:
obj- objective evaluation routine (orNULL); seeSNESObjectiveFnfor the calling sequencectx- the function context (orNULL)
Level: developer
-seealso: , DMSNES, DMSNESSetContext(), DMSNESSetObjective(), SNESSetFunction(), SNESObjectiveFn
External Links
- PETSc Manual:
Snes/DMSNESGetObjective
PETSc.LibPETSc.DMSNESGetPicard — Method
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-DMto be used withSNES
Output Parameters:
b- RHS evaluation function; seeSNESFunctionFnfor calling sequenceJ- Jacobian evaluation function; seeSNESJacobianFnfor calling sequencectx- context for residual and matrix evaluation
Level: developer
-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), SNESFunctionFn, SNESJacobianFn
External Links
- PETSc Manual:
Snes/DMSNESGetPicard
PETSc.LibPETSc.DMSNESSetBoundaryLocal — Method
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-DMto associate callback withfunc- local boundary value evaluationctx- optional context for local boundary value evaluation
Calling sequence of func:
dm- theDMcontextX- ghosted solution vector, appropriate locations (such as essential boundary condition nodes) should be filledctx- option context passed inDMSNESSetBoundaryLocal()
Level: advanced
-seealso: , DMSNESSetObjectiveLocal(), DMSNESSetFunctionLocal(), DMSNESSetJacobianLocal()
External Links
- PETSc Manual:
Snes/DMSNESSetBoundaryLocal
PETSc.LibPETSc.DMSNESSetFunction — Method
DMSNESSetFunction(petsclib::PetscLibType,dm::PetscDM, f::SNESFunctionFn, ctx::Cvoid)set SNES residual evaluation function
Not Collective
Input Parameters:
dm- DM to be used withSNESf- residual evaluation function; seeSNESFunctionFnfor calling sequencectx- context for residual evaluation
Level: developer
-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), SNESFunctionFn
External Links
- PETSc Manual:
Snes/DMSNESSetFunction
PETSc.LibPETSc.DMSNESSetFunctionContextDestroy — Method
DMSNESSetFunctionContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)set SNES residual evaluation context destroy function
Not Collective
Input Parameters:
dm-DMto be used withSNESf- residual evaluation context destroy function, seePetscCtxDestroyFnfor its calling sequence
Level: developer
-seealso: , DMSNES, DMSNESSetFunction(), SNESSetFunction(), PetscCtxDestroyFn
External Links
- PETSc Manual:
Snes/DMSNESSetFunctionContextDestroy
PETSc.LibPETSc.DMSNESSetFunctionLocal — Method
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-DMto associate callback withfunc- local residual evaluationctx- optional context for local residual evaluation
Calling sequence of func:
dm-DMfor the functionx- vector to state at which to evaluate residualf- vector to hold the function evaluationctx- optional context passed above
Level: advanced
-seealso: , DMSNESSetFunction(), DMSNESSetJacobianLocal()
External Links
- PETSc Manual:
Snes/DMSNESSetFunctionLocal
PETSc.LibPETSc.DMSNESSetJacobian — Method
DMSNESSetJacobian(petsclib::PetscLibType,dm::PetscDM, J::SNESJacobianFn, ctx::Cvoid)set SNES Jacobian evaluation function into a DMSNES object
Not Collective
Input Parameters:
dm-DMto be used withSNESJ- Jacobian evaluation function, seeSNESJacobianFnctx- context for Jacobian evaluation
Level: developer
-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESGetJacobian(), SNESSetJacobian(), SNESJacobianFn
External Links
- PETSc Manual:
Snes/DMSNESSetJacobian
PETSc.LibPETSc.DMSNESSetJacobianContextDestroy — Method
DMSNESSetJacobianContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)set SNES Jacobian evaluation context destroy function into a DMSNES object
Not Collective
Input Parameters:
dm-DMto be used withSNESf- Jacobian evaluation context destroy function, seePetscCtxDestroyFnfor its calling sequence
Level: developer
-seealso: , DMSNES, DMSNESSetJacobian()
External Links
- PETSc Manual:
Snes/DMSNESSetJacobianContextDestroy
PETSc.LibPETSc.DMSNESSetJacobianLocal — Method
DMSNESSetJacobianLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::Cvoid)set a local Jacobian evaluation function
Logically Collective
Input Parameters:
dm-DMto associate callback withfunc- local Jacobian evaluationctx- optional context for local Jacobian evaluation
Calling sequence of func:
dm- theDMcontextX- current solution vector (ghosted or not?)J- the JacobianJp- approximate Jacobian used to compute the preconditioner, oftenJctx- a user provided context
Level: advanced
-seealso: , DMSNESSetObjectiveLocal(), DMSNESSetFunctionLocal(), DMSNESSetBoundaryLocal()
External Links
- PETSc Manual:
Snes/DMSNESSetJacobianLocal
PETSc.LibPETSc.DMSNESSetMFFunction — Method
DMSNESSetMFFunction(petsclib::PetscLibType,dm::PetscDM, func::SNESFunctionFn, ctx::Cvoid)set SNES residual evaluation function used in applying the matrix
Logically Collective
Input Parameters:
dm-DMto be used withSNESfunc- residual evaluation function; seeSNESFunctionFnfor calling sequencectx- optional function context
Level: developer
-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), DMSNESSetFunction(), SNESFunctionFn
External Links
- PETSc Manual:
Snes/DMSNESSetMFFunction
PETSc.LibPETSc.DMSNESSetNGS — Method
DMSNESSetNGS(petsclib::PetscLibType,dm::PetscDM, f::external, ctx::Cvoid)set SNES Gauss
Not Collective
Input Parameters:
dm-DMto be used withSNESf- relaxation function, seeSNESGSFunctionctx- context for residual evaluation
Level: developer
-seealso: , DMSNES, DMSNESSetContext(), SNESSetFunction(), DMSNESSetJacobian(), DMSNESSetFunction(), SNESGSFunction
External Links
- PETSc Manual:
Snes/DMSNESSetNGS
PETSc.LibPETSc.DMSNESSetObjective — Method
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-DMto be used withSNESobj- objective evaluation routine; seeSNESObjectiveFnfor the calling sequencectx- [optional] user-defined context for private data for the objective evaluation routine (may beNULL)
Level: developer
-seealso: , DMSNES, DMSNESSetContext(), SNESGetObjective(), DMSNESSetFunction(), SNESObjectiveFn
External Links
- PETSc Manual:
Snes/DMSNESSetObjective
PETSc.LibPETSc.DMSNESSetObjectiveLocal — Method
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-DMto associate callback withfunc- local objective evaluationctx- optional context for local residual evaluation
Level: advanced
-seealso: DMSNESSetFunctionLocal(), DMSNESSetJacobianLocal()
External Links
- PETSc Manual:
Snes/DMSNESSetObjectiveLocal
PETSc.LibPETSc.DMSNESSetPicard — Method
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-DMto be used withSNESb- RHS evaluation function; seeSNESFunctionFnfor calling sequenceJ- Picard matrix evaluation function; seeSNESJacobianFnfor calling sequencectx- context for residual and matrix evaluation
Level: developer
-seealso: , DMSNES, SNESSetPicard(), DMSNESSetFunction(), DMSNESSetJacobian(), SNESFunctionFn, SNESJacobianFn
External Links
- PETSc Manual:
Snes/DMSNESSetPicard
PETSc.LibPETSc.DMSetAdjacency — Method
DMSetAdjacency(petsclib::PetscLibType,dm::PetscDM, f::PetscInt, useCone::PetscBool, useClosure::PetscBool)Set the flags for determining variable influence
Not Collective
Input Parameters:
dm- TheDMobjectf- The field numberuseCone- Flag for variable influence starting with the cone operationuseClosure- Flag for variable influence using transitive closure
Level: developer
See also:
DM, DMGetAdjacency(), DMGetField(), DMSetField()
External Links
- PETSc Manual:
DM/DMSetAdjacency
PETSc.LibPETSc.DMSetApplicationContext — Method
DMSetApplicationContext(petsclib::PetscLibType,dm::PetscDM, ctx::Cvoid)Set a user context into a DM object
Not Collective
Input Parameters:
dm- theDMobjectctx- 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
- PETSc Manual:
DM/DMSetApplicationContext
PETSc.LibPETSc.DMSetApplicationContextDestroy — Method
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- theDMobjectdestroy- the destroy function, seePetscCtxDestroyFnfor the calling sequence
Level: intermediate
See also:
DM, DMSetApplicationContext(), DMView(), DMCreateGlobalVector(), DMCreateInterpolation(), DMCreateColoring(), DMCreateMatrix(), DMCreateMassMatrix(), DMGetApplicationContext(), PetscCtxDestroyFn
External Links
- PETSc Manual:
DM/DMSetApplicationContextDestroy
PETSc.LibPETSc.DMSetAuxiliaryVec — Method
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- TheDMlabel- TheDMLabelvalue- The label value indicating the regionpart- The equation part, or 0 if unusedaux- TheVecholding auxiliary field data
Level: advanced
See also:
DM, DMClearAuxiliaryVec(), DMGetAuxiliaryVec(), DMGetAuxiliaryLabels(), DMCopyAuxiliaryVec()
External Links
- PETSc Manual:
DM/DMSetAuxiliaryVec
PETSc.LibPETSc.DMSetBasicAdjacency — Method
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- TheDMobjectuseCone- Flag for variable influence starting with the cone operationuseClosure- 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
- PETSc Manual:
DM/DMSetBasicAdjacency
PETSc.LibPETSc.DMSetBlockingType — Method
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- theDMbtype- 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
- PETSc Manual:
DM/DMSetBlockingType
PETSc.LibPETSc.DMSetCellCoordinateDM — Method
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- theDMcdm- cellwise coordinateDM
Level: intermediate
-seealso: DMGetCellCoordinateDM(), DMSetCellCoordinates(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMGetCellCoordinatesLocal(), DMSetCoordinateDM(), DMGetCoordinateDM()
External Links
- PETSc Manual:
DM/DMSetCellCoordinateDM
PETSc.LibPETSc.DMSetCellCoordinateField — Method
DMSetCellCoordinateField(petsclib::PetscLibType,dm::PetscDM, field::DMField)External Links
- PETSc Manual:
DM/DMSetCellCoordinateField
PETSc.LibPETSc.DMSetCellCoordinateSection — Method
DMSetCellCoordinateSection(petsclib::PetscLibType,dm::PetscDM, dim::PetscInt, section::PetscSection)Set the PetscSection of cellwise coordinate values over the mesh.
Not Collective
Input Parameters:
dm- TheDMobjectdim- The embedding dimension, orPETSC_DETERMINEsection- ThePetscSectionobject for a cellwise layout
Level: intermediate
-seealso: DM, DMGetCoordinateDim(), DMSetCoordinateSection(), DMGetCellCoordinateSection(), DMGetCoordinateSection(), DMGetCellCoordinateDM(), DMGetLocalSection(), DMSetLocalSection()
External Links
- PETSc Manual:
DM/DMSetCellCoordinateSection
PETSc.LibPETSc.DMSetCellCoordinates — Method
DMSetCellCoordinates(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)Sets into the DM a global vector that holds the cellwise coordinates
Collective
Input Parameters:
dm- theDMc- cellwise coordinate vector
Level: intermediate
-seealso: DM, DMGetCoordinates(), DMSetCellCoordinatesLocal(), DMGetCellCoordinates(), DMGetCellCoordinatesLocal(), DMGetCellCoordinateDM()
External Links
- PETSc Manual:
DM/DMSetCellCoordinates
PETSc.LibPETSc.DMSetCellCoordinatesLocal — Method
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- theDMc- cellwise coordinate vector
Level: intermediate
-seealso: DM, DMGetCellCoordinatesLocal(), DMSetCellCoordinates(), DMGetCellCoordinates(), DMGetCellCoordinateDM()
External Links
- PETSc Manual:
DM/DMSetCellCoordinatesLocal
PETSc.LibPETSc.DMSetCoarseDM — Method
DMSetCoarseDM(petsclib::PetscLibType,dm::PetscDM, cdm::PetscDM)Set the coarse DM from which this DM was obtained by refinement
Input Parameters:
dm- TheDMobjectcdm- The coarseDM
Level: intermediate
Note: Normally this is set automatically by DMRefine()
See also:
DM, DMGetCoarseDM(), DMCoarsen(), DMSetRefine(), DMSetFineDM()
External Links
- PETSc Manual:
DM/DMSetCoarseDM
PETSc.LibPETSc.DMSetCoarsenLevel — Method
DMSetCoarsenLevel(petsclib::PetscLibType,dm::PetscDM, level::PetscInt)Sets the number of coarsenings that have generated this DM.
Collective
Input Parameters:
dm- theDMobjectlevel- 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
- PETSc Manual:
DM/DMSetCoarsenLevel
PETSc.LibPETSc.DMSetCoordinateDM — Method
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- theDMcdm- coordinateDM
Level: intermediate
-seealso: DM, DMGetCoordinateDM(), DMSetCoordinates(), DMGetCellCoordinateDM(), DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMGSetCellCoordinateDM()
External Links
- PETSc Manual:
DM/DMSetCoordinateDM
PETSc.LibPETSc.DMSetCoordinateDim — Method
DMSetCoordinateDim(petsclib::PetscLibType,dm::PetscDM, dim::PetscInt)Set the dimension of the embedding space for coordinate values.
Not Collective
Input Parameters:
dm- TheDMobjectdim- The embedding dimension
Level: intermediate
-seealso: DM, DMGetCoordinateDim(), DMSetCoordinateSection(), DMGetCoordinateSection(), DMGetLocalSection(), DMSetLocalSection()
External Links
- PETSc Manual:
DM/DMSetCoordinateDim
PETSc.LibPETSc.DMSetCoordinateDisc — Method
DMSetCoordinateDisc(petsclib::PetscLibType,dm::PetscDM, disc::PetscFE, locized::PetscBool, project::PetscBool)Set a coordinate space
Input Parameters:
dm- TheDMobjectdisc- The new coordinate discretization orNULLto ensure a coordinate discretization existslocalized- Set a localized (DG) coordinate spaceproject- Project coordinates to new discretization
Level: intermediate
-seealso: DM, PetscFE, DMGetCoordinateField()
External Links
- PETSc Manual:
DM/DMSetCoordinateDisc
PETSc.LibPETSc.DMSetCoordinateField — Method
DMSetCoordinateField(petsclib::PetscLibType,dm::PetscDM, field::DMField)External Links
- PETSc Manual:
DM/DMSetCoordinateField
PETSc.LibPETSc.DMSetCoordinateSection — Method
DMSetCoordinateSection(petsclib::PetscLibType,dm::PetscDM, dim::PetscInt, section::PetscSection)Set the PetscSection of coordinate values over the mesh.
Not Collective
Input Parameters:
dm- TheDMobjectdim- The embedding dimension, orPETSC_DETERMINEsection- ThePetscSectionobject
Level: intermediate
-seealso: DM, DMGetCoordinateDim(), DMGetCoordinateSection(), DMGetLocalSection(), DMSetLocalSection()
External Links
- PETSc Manual:
DM/DMSetCoordinateSection
PETSc.LibPETSc.DMSetCoordinates — Method
DMSetCoordinates(petsclib::PetscLibType,dm::PetscDM, c::PetscVec)Sets into the DM a global vector that holds the coordinates
Logically Collective
Input Parameters:
dm- theDMc- coordinate vector
Level: intermediate
-seealso: DM, DMSetCoordinatesLocal(), DMGetCoordinates(), DMGetCoordinatesLocal(), DMGetCoordinateDM(), DMDASetUniformCoordinates()
External Links
- PETSc Manual:
DM/DMSetCoordinates
PETSc.LibPETSc.DMSetCoordinatesLocal — Method
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- theDMc- coordinate vector
Level: intermediate
-seealso: DM, DMGetCoordinatesLocal(), DMSetCoordinates(), DMGetCoordinates(), DMGetCoordinateDM()
External Links
- PETSc Manual:
DM/DMSetCoordinatesLocal
PETSc.LibPETSc.DMSetDefaultConstraints — Method
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- TheDMsection- ThePetscSectiondescribing 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_SELFor derivative).mat- TheMatthat interpolates local constraints: its width should be the layout size of the default section:NULLindicates no constraints. Must have a local communicator (PETSC_COMM_SELFor derivative).bias- A bias vector to be added to constrained values in the local vector.NULLindicates no bias. Must have a local communicator (PETSC_COMM_SELFor 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
- PETSc Manual:
DM/DMSetDefaultConstraints
PETSc.LibPETSc.DMSetDimension — Method
DMSetDimension(petsclib::PetscLibType,dm::PetscDM, dim::PetscInt)Set the topological dimension of the DM
Collective
Input Parameters:
dm- TheDMdim- The topological dimension
Level: beginner
See also:
DM, DMGetDimension(), DMCreate()
External Links
- PETSc Manual:
DM/DMSetDimension
PETSc.LibPETSc.DMSetField — Method
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- TheDMf- The field numberlabel- The label indicating the support of the field, orNULLfor the entire meshdisc- The discretization object
Level: intermediate
See also:
DM, DMAddField(), DMGetField()
External Links
- PETSc Manual:
DM/DMSetField
PETSc.LibPETSc.DMSetFieldAvoidTensor — Method
DMSetFieldAvoidTensor(petsclib::PetscLibType,dm::PetscDM, f::PetscInt, avoidTensor::PetscBool)Set flag to avoid defining the field on tensor cells
Logically Collective
Input Parameters:
dm- TheDMf- The field indexavoidTensor-PETSC_TRUEto skip defining the field on tensor cells
Level: intermediate
See also:
DM, DMGetFieldAvoidTensor(), DMSetField(), DMGetField()
External Links
- PETSc Manual:
DM/DMSetFieldAvoidTensor
PETSc.LibPETSc.DMSetFineDM — Method
DMSetFineDM(petsclib::PetscLibType,dm::PetscDM, fdm::PetscDM)Set the fine mesh from which this was obtained by coarsening
Input Parameters:
dm- TheDMobjectfdm- The fineDM
Level: developer
Note: Normally this is set automatically by DMCoarsen()
See also:
DM, DMGetFineDM(), DMCoarsen(), DMRefine()
External Links
- PETSc Manual:
DM/DMSetFineDM
PETSc.LibPETSc.DMSetFromOptions — Method
DMSetFromOptions(petsclib::PetscLibType,dm::PetscDM)sets parameters in a DM from the options database
Collective
Input Parameter:
dm- theDMobject to set options for
Options Database Keys:
-dm_preallocate_only- Only preallocate the matrix forDMCreateMatrix()andDMCreateMassMatrix(), but do not fill it with zeros-dm_vec_type <type>- type of vector to create insideDM-dm_mat_type <type>- type of matrix to create insideDM-dm_is_coloring_type- <global or local>-dm_bind_below <n>- bind (force execution on CPU) forVecandMatobjects with local size (number of vector entries or matrix rows) below n; currently only supported forDMDA-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 asBOX,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_TRUEfor simplex elements,PETSC_FALSEfor tensor elements-dm_plex_interpolate <bool>-PETSC_TRUEturns on topological interpolation (creating edges and faces)-dm_plex_orient <bool>-PETSC_TRUEturns 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 theDMBoundaryTypefor 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 theDMPlexTransformthat 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 forPointSF-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
- PETSc Manual:
DM/DMSetFromOptions
PETSc.LibPETSc.DMSetGlobalSection — Method
DMSetGlobalSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)Set the PetscSection encoding the global data layout for the DM.
Input Parameters:
dm- TheDMsection- The PetscSection, orNULL
Level: intermediate
Note: Any existing PetscSection will be destroyed
See also:
DM, DMGetGlobalSection(), DMSetLocalSection()
External Links
- PETSc Manual:
DM/DMSetGlobalSection
PETSc.LibPETSc.DMSetISColoringType — Method
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- theDMcontextctype- 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
- PETSc Manual:
DM/DMSetISColoringType
PETSc.LibPETSc.DMSetLabel — Method
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- TheDMobjectlabel- TheDMLabel, 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
- PETSc Manual:
DM/DMSetLabel
PETSc.LibPETSc.DMSetLabelOutput — Method
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- TheDMobjectname- The label nameoutput-PETSC_TRUEto save the label to the viewer
Level: developer
See also:
DM, DMLabel, DMGetOutputFlag(), DMGetLabelOutput(), DMCreateLabel(), DMHasLabel(), DMGetLabelValue(), DMSetLabelValue(), DMGetStratumIS()
External Links
- PETSc Manual:
DM/DMSetLabelOutput
PETSc.LibPETSc.DMSetLabelValue — Method
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- TheDMobjectname- The label namepoint- The mesh pointvalue- The label value for this point
Output Parameter:
Level: beginner
See also:
DM, DMLabelSetValue(), DMGetStratumIS(), DMClearLabelValue()
External Links
- PETSc Manual:
DM/DMSetLabelValue
PETSc.LibPETSc.DMSetLocalSection — Method
DMSetLocalSection(petsclib::PetscLibType,dm::PetscDM, section::PetscSection)Set the PetscSection encoding the local data layout for the DM.
Input Parameters:
dm- TheDMsection- ThePetscSection
Level: intermediate
Note: Any existing Section will be destroyed
See also:
DM, PetscSection, DMGetLocalSection(), DMSetGlobalSection()
External Links
- PETSc Manual:
DM/DMSetLocalSection
PETSc.LibPETSc.DMSetMatType — Method
DMSetMatType(petsclib::PetscLibType,dm::PetscDM, ctype::MatType)Sets the type of matrix created with DMCreateMatrix()
Logically Collective
Input Parameters:
dm- theDMcontextctype- the matrix type, for exampleMATMPIAIJ
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
- PETSc Manual:
DM/DMSetMatType
PETSc.LibPETSc.DMSetMatrixPreallocateOnly — Method
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- theDMonly-PETSC_TRUEif only want preallocation
Options Database Key:
-dm_preallocate_only- Only preallocate the matrix forDMCreateMatrix(),DMCreateMassMatrix(), but do not fill it with zeros
Level: developer
See also:
DM, DMCreateMatrix(), DMCreateMassMatrix(), DMSetMatrixStructureOnly(), DMSetMatrixPreallocateSkip()
External Links
- PETSc Manual:
DM/DMSetMatrixPreallocateOnly
PETSc.LibPETSc.DMSetMatrixPreallocateSkip — Method
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- theDMskip-PETSC_TRUEto 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
- PETSc Manual:
DM/DMSetMatrixPreallocateSkip
PETSc.LibPETSc.DMSetMatrixStructureOnly — Method
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- theDMonly-PETSC_TRUEif you only want matrix nonzero structure
Level: developer
See also:
DM, DMCreateMatrix(), DMSetMatrixPreallocateOnly(), DMSetMatrixPreallocateSkip()
External Links
- PETSc Manual:
DM/DMSetMatrixStructureOnly
PETSc.LibPETSc.DMSetNaturalSF — Method
DMSetNaturalSF(petsclib::PetscLibType,dm::PetscDM, sf::PetscSF)Set the PetscSF encoding the map back to the original mesh ordering
Input Parameters:
dm- The DMsf- The PetscSF
Level: intermediate
See also:
DM, DMGetNaturalSF(), DMSetUseNatural(), DMGetUseNatural(), DMPlexCreateGlobalToNaturalSF(), DMPlexDistribute()
External Links
- PETSc Manual:
DM/DMSetNaturalSF
PETSc.LibPETSc.DMSetNearNullSpaceConstructor — Method
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- TheDMfield- The field number for the nullspacenullsp- A callback to create the near-nullspace
Calling sequence of nullsp:
dm- The presentDMorigField- The field number given above, in the originalDMfield- The field number in dmnullSpace- The nullspace for the given field
Level: intermediate
See also:
DM, DMAddField(), DMGetNearNullSpaceConstructor(), DMSetNullSpaceConstructor(), DMGetNullSpaceConstructor(), DMCreateSubDM(), DMCreateSuperDM(), MatNullSpace
External Links
- PETSc Manual:
DM/DMSetNearNullSpaceConstructor
PETSc.LibPETSc.DMSetNullSpaceConstructor — Method
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- TheDMfield- The field number for the nullspacenullsp- A callback to create the nullspace
Calling sequence of nullsp:
dm- The presentDMorigField- The field number given above, in the originalDMfield- The field number in dmnullSpace- The nullspace for the given field
Level: intermediate
See also:
DM, DMAddField(), DMGetNullSpaceConstructor(), DMSetNearNullSpaceConstructor(), DMGetNearNullSpaceConstructor(), DMCreateSubDM(), DMCreateSuperDM()
External Links
- PETSc Manual:
DM/DMSetNullSpaceConstructor
PETSc.LibPETSc.DMSetNumFields — Method
DMSetNumFields(petsclib::PetscLibType,dm::PetscDM, numFields::PetscInt)Set the number of fields in the DM
Logically Collective
Input Parameters:
dm- TheDMnumFields- The number of fields
Level: intermediate
See also:
DM, DMGetNumFields(), DMSetField()
External Links
- PETSc Manual:
DM/DMSetNumFields
PETSc.LibPETSc.DMSetOptionsPrefix — Method
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- theDMcontextprefix- 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
- PETSc Manual:
DM/DMSetOptionsPrefix
PETSc.LibPETSc.DMSetOutputSequenceNumber — Method
DMSetOutputSequenceNumber(petsclib::PetscLibType,dm::PetscDM, num::PetscInt, val::PetscReal)Set the sequence number/value for output
Input Parameters:
dm- The originalDMnum- The output sequence numberval- 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
- PETSc Manual:
DM/DMSetOutputSequenceNumber
PETSc.LibPETSc.DMSetPeriodicity — Method
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- TheDMobjectmaxCell- Over distances greater than this, we can assume a point has crossed over to another sheet, when trying to localize cell coordinates. PassNULLto remove such information.Lstart- If we assume the mesh is a torus, this is the start of each coordinate, orNULLfor 0.0L- 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
- PETSc Manual:
DM/DMSetPeriodicity
PETSc.LibPETSc.DMSetPointSF — Method
DMSetPointSF(petsclib::PetscLibType,dm::PetscDM, sf::PetscSF)Set the PetscSF encoding the parallel section point overlap for the DM.
Collective
Input Parameters:
dm- TheDMsf- ThePetscSF
Level: intermediate
See also:
DM, DMGetPointSF(), DMGetSectionSF(), DMSetSectionSF(), DMCreateSectionSF()
External Links
- PETSc Manual:
DM/DMSetPointSF
PETSc.LibPETSc.DMSetRefineLevel — Method
DMSetRefineLevel(petsclib::PetscLibType,dm::PetscDM, level::PetscInt)Sets the number of refinements that have generated this DM.
Not Collective
Input Parameters:
dm- theDMobjectlevel- 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
- PETSc Manual:
DM/DMSetRefineLevel
PETSc.LibPETSc.DMSetRegionDS — Method
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- TheDMlabel- TheDMLabeldefining the mesh region, orNULLfor the entire meshfields- TheIScontaining theDMfield numbers for the fields in thisPetscDS, orNULLfor all fieldsds- ThePetscDSdefined on the given regiondsIn- ThePetscDSfor input on the given cell, orNULLif it is the samePetscDS
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
- PETSc Manual:
DM/DMSetRegionDS
PETSc.LibPETSc.DMSetRegionNumDS — Method
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- TheDMnum- The region number, in [0, Nds)label- The region label, orNULLfields- TheIScontaining theDMfield numbers for the fields in thisPetscDS, orNULLto prevent settingds- ThePetscDSdefined on the given region, orNULLto prevent settingdsIn- ThePetscDSfor input on the given cell, orNULLif it is the samePetscDS
Level: advanced
See also:
DM, DMGetRegionDS(), DMSetRegionDS(), DMGetDS(), DMGetCellDS()
External Links
- PETSc Manual:
DM/DMSetRegionNumDS
PETSc.LibPETSc.DMSetSectionSF — Method
DMSetSectionSF(petsclib::PetscLibType,dm::PetscDM, sf::PetscSF)Set the PetscSF encoding the parallel dof overlap for the DM
Input Parameters:
dm- TheDMsf- ThePetscSF
Level: intermediate
Note: Any previous PetscSF is destroyed
See also:
DM, DMGetSectionSF(), DMCreateSectionSF()
External Links
- PETSc Manual:
DM/DMSetSectionSF
PETSc.LibPETSc.DMSetSnapToGeomModel — Method
DMSetSnapToGeomModel(petsclib::PetscLibType,dm::PetscDM, name::String)Choose a geometry model for this DM.
Not Collective
Input Parameters:
dm- TheDMobjectname- A geometry model name, orNULLfor the default
Level: intermediate
-seealso: , DM, DMPLEX, DMRefine(), DMPlexCreate(), DMSnapToGeomModel()
External Links
- PETSc Manual:
DM/DMSetSnapToGeomModel
PETSc.LibPETSc.DMSetSparseLocalize — Method
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- TheDMsparse-PETSC_TRUEif only cells near the periodic boundary are localized
Level: intermediate
-seealso: DMGetSparseLocalize(), DMLocalizeCoordinates(), DMSetPeriodicity()
External Links
- PETSc Manual:
DM/DMSetSparseLocalize
PETSc.LibPETSc.DMSetStratumIS — Method
DMSetStratumIS(petsclib::PetscLibType,dm::PetscDM, name::String, value::PetscInt, points::IS)Set the points in a label stratum
Not Collective
Input Parameters:
dm- TheDMobjectname- The label namevalue- The stratum valuepoints- The stratum points
Level: beginner
See also:
DM, DMLabel, DMClearLabelStratum(), DMLabelClearStratum(), DMLabelSetStratumIS(), DMGetStratumSize()
External Links
- PETSc Manual:
DM/DMSetStratumIS
PETSc.LibPETSc.DMSetType — Method
DMSetType(petsclib::PetscLibType,dm::PetscDM, method::DMType)Builds a DM, for a particular DM implementation.
Collective
Input Parameters:
dm- TheDMobjectmethod- The name of theDMType, for exampleDMDA,DMPLEX
Options Database Key:
-dm_type <type>- Sets theDMtype; 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
- PETSc Manual:
DM/DMSetType
PETSc.LibPETSc.DMSetUp — Method
DMSetUp(petsclib::PetscLibType,dm::PetscDM)sets up the data structures inside a DM object
Collective
Input Parameter:
dm- theDMobject 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
- PETSc Manual:
DM/DMSetUp
PETSc.LibPETSc.DMSetUseNatural — Method
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- TheDMuseNatural-PETSC_TRUEto 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
- PETSc Manual:
DM/DMSetUseNatural
PETSc.LibPETSc.DMSetVI — Method
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- theDMobjectinactive- anISindicating which points are currently not active
Level: intermediate
-seealso: , SNES, SNESVINEWTONRSLS, SNESVIGetInactiveSet()
External Links
- PETSc Manual:
Snes/DMSetVI
PETSc.LibPETSc.DMSetVariableBounds — Method
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 objectf- the function that computes variable bounds used bySNESVI(useNULLto 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
- PETSc Manual:
DM/DMSetVariableBounds
PETSc.LibPETSc.DMSetVecType — Method
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 arrayctype- the vector type, for exampleVECSTANDARD,VECCUDA, orVECVIENNACL
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
- PETSc Manual:
DM/DMSetVecType
PETSc.LibPETSc.DMSlicedCreate — Method
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 vectorbs- the block sizenlocal- number of vector entries on this processNghosts- number of ghost points needed on this processghosts- global indices of all ghost points for this processd_nnz- matrix preallocation information representing coupling within this processo_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
- PETSc Manual:
DM/DMSlicedCreate
PETSc.LibPETSc.DMSlicedSetBlockFills — Method
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- theDMobjectdfill- the fill pattern in the diagonal block (may beNULL, means use dense block)ofill- the fill pattern in the off-diagonal blocks
Level: advanced
-seealso: DM, DMSLICED, DMSlicedGetMatrix(), DMDASetBlockFills()
External Links
- PETSc Manual:
DM/DMSlicedSetBlockFills
PETSc.LibPETSc.DMSlicedSetGhosts — Method
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- theDMSLICEDobjectbs- block sizenlocal- number of local (owned, non-ghost) blocksNghosts- number of ghost blocks on this processghosts- global indices of each ghost block
Level: advanced
-seealso: DM, DMSLICED, DMDestroy(), DMCreateGlobalVector()
External Links
- PETSc Manual:
DM/DMSlicedSetGhosts
PETSc.LibPETSc.DMSlicedSetPreallocation — Method
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- theDMobjectd_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
- PETSc Manual:
DM/DMSlicedSetPreallocation
PETSc.LibPETSc.DMSnapToGeomModel — Method
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- TheDMPLEXobjectp- The mesh pointdE- The coordinate dimensionmcoords- 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
- PETSc Manual:
DM/DMSnapToGeomModel
PETSc.LibPETSc.DMSubDomainHookAdd — Method
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_- globalDMddhook- function to run to pass data to the decompositionDMupon its creationrestricthook- 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 beNULL)
Calling sequence of ddhook:
global- globalDMblock- subdomainDMctx- optional user-defined function context
Calling sequence of restricthook:
global- globalDMout- scatter to the outer (with ghost and overlap points) sub vectorin- scatter to sub vector values only owned locallyblock- subdomainDMctx- 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
- PETSc Manual:
DM/DMSubDomainHookAdd
PETSc.LibPETSc.DMSubDomainHookRemove — Method
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- globalDMddhook- function to run to pass data to the decompositionDMupon its creationrestricthook- 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 beNULL)
Level: advanced
Note: See DMSubDomainHookAdd() for the calling sequences of ddhook and restricthook
See also:
DM, DMSubDomainHookAdd(), SNESFASGetInterpolation(), SNESFASGetInjection(), PetscObjectCompose(), PetscContainerCreate(), DMCreateDomainDecomposition()
External Links
- PETSc Manual:
DM/DMSubDomainHookRemove
PETSc.LibPETSc.DMSubDomainRestrict — Method
DMSubDomainRestrict(petsclib::PetscLibType,global_::PetscDM, oscatter::VecScatter, gscatter::VecScatter, subdm::PetscDM)restricts user
Collective if any hooks are
Input Parameters:
global- The globalDMto use as a baseoscatter- The scatter from domain global vector filling subdomain global vector with overlapgscatter- The scatter from domain global vector filling subdomain local vector with ghostssubdm- The subdomainDMto update
Level: developer
See also:
DM, DMCoarsenHookAdd(), MatRestrict(), DMCreateDomainDecomposition()
External Links
- PETSc Manual:
DM/DMSubDomainRestrict
PETSc.LibPETSc.DMTSCheckFromOptions — Method
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- theTSobjectu- representativeTSvector
Level: developer
-seealso: DMTS
External Links
- PETSc Manual:
Ts/DMTSCheckFromOptions
PETSc.LibPETSc.DMTSCheckJacobian — Method
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- theTSobjectdm- theDMt- the timeu- aDMvectoru_t- aDMvectortol- A tolerance for the check, or -1 to print the results instead
Output Parameters:
isLinear- Flag indicating that the function looks linear, orNULLconvRate- The rate of convergence of the linear model, orNULL
Level: developer
-seealso: , DNTSCheckFromOptions(), DMTSCheckResidual(), DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckResidual()
External Links
- PETSc Manual:
Ts/DMTSCheckJacobian
PETSc.LibPETSc.DMTSCheckResidual — Method
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- theTSobjectdm- theDMt- the timeu- aDMvectoru_t- aDMvectortol- A tolerance for the check, or -1 to print the results instead
Output Parameter:
residual- The residual norm of the exact solution, orNULL
Level: developer
-seealso: , DM, DMTSCheckFromOptions(), DMTSCheckJacobian(), DNSNESCheckFromOptions(), DMSNESCheckDiscretization(), DMSNESCheckJacobian()
External Links
- PETSc Manual:
Ts/DMTSCheckResidual
PETSc.LibPETSc.DMTSCreateRHSMassMatrix — Method
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-DMproviding the mass matrix
Level: developer
-seealso: , DM, DMTSCreateRHSMassMatrixLumped(), DMTSDestroyRHSMassMatrix(), DMCreateMassMatrix(), DMTS
External Links
- PETSc Manual:
Ts/DMTSCreateRHSMassMatrix
PETSc.LibPETSc.DMTSCreateRHSMassMatrixLumped — Method
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-DMproviding the mass matrix
Level: developer
-seealso: , DM, DMTSCreateRHSMassMatrix(), DMTSDestroyRHSMassMatrix(), DMCreateMassMatrix(), DMTS
External Links
- PETSc Manual:
Ts/DMTSCreateRHSMassMatrixLumped
PETSc.LibPETSc.DMTSDestroyRHSMassMatrix — Method
DMTSDestroyRHSMassMatrix(petsclib::PetscLibType,dm::PetscDM)Destroys the mass matrix and solver stored in the DM context, if they exist.
Logically Collective
Input Parameter:
dm-DMproviding the mass matrix
Level: developer
-seealso: , DM, DMTSCreateRHSMassMatrixLumped(), DMCreateMassMatrix(), DMTS
External Links
- PETSc Manual:
Ts/DMTSDestroyRHSMassMatrix
PETSc.LibPETSc.DMTSGetForcingFunction — Method
DMTSGetForcingFunction(petsclib::PetscLibType,dm::PetscDM, f::TSForcingFn, ctx::Cvoid)get TS forcing function evaluation function from a DMTS
Not Collective
Input Parameter:
dm-DMto be used withTS
Output Parameters:
f- forcing function evaluation function; seeTSForcingFnfor the calling sequencectx- context for solution evaluation
Level: developer
-seealso: , DMTS, TS, DM, TSSetForcingFunction(), TSForcingFn
External Links
- PETSc Manual:
Ts/DMTSGetForcingFunction
PETSc.LibPETSc.DMTSGetI2Function — Method
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-DMto be used withTS
Output Parameters:
fun- function evaluation function, for calling sequence seeTSSetI2Function()ctx- context for residual evaluation
Level: developer
-seealso: , DMTS, DM, TS, DMTSSetI2Function(), TSGetI2Function()
External Links
- PETSc Manual:
Ts/DMTSGetI2Function
PETSc.LibPETSc.DMTSGetI2Jacobian — Method
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-DMto be used withTS
Output Parameters:
jac- Jacobian evaluation function, for calling sequence seeTSI2JacobianFnctx- context for Jacobian evaluation
Level: developer
-seealso: , DMTS, DM, TS, DMTSSetI2Jacobian(), TSGetI2Jacobian(), TSI2JacobianFn
External Links
- PETSc Manual:
Ts/DMTSGetI2Jacobian
PETSc.LibPETSc.DMTSGetIFunction — Method
DMTSGetIFunction(petsclib::PetscLibType,dm::PetscDM, func::TSIFunctionFn, ctx::Cvoid)get TS implicit residual evaluation function from a DMTS
Not Collective
Input Parameter:
dm-DMto be used withTS
Output Parameters:
func- function evaluation function, for calling sequence seeTSIFunctionFnctx- context for residual evaluation
Level: developer
-seealso: , DMTS, TS, DM, DMTSSetIFunction(), TSIFunctionFn
External Links
- PETSc Manual:
Ts/DMTSGetIFunction
PETSc.LibPETSc.DMTSGetIJacobian — Method
DMTSGetIJacobian(petsclib::PetscLibType,dm::PetscDM, func::TSIJacobianFn, ctx::Cvoid)get TS Jacobian evaluation function from a DMTS
Not Collective
Input Parameter:
dm-DMto be used withTS
Output Parameters:
func- Jacobian evaluation function, for calling sequence seeTSIJacobianFnctx- context for residual evaluation
Level: developer
-seealso: , DMTS, DM, TS, DMTSSetIJacobian(), TSIJacobianFn
External Links
- PETSc Manual:
Ts/DMTSGetIJacobian
PETSc.LibPETSc.DMTSGetRHSFunction — Method
DMTSGetRHSFunction(petsclib::PetscLibType,dm::PetscDM, func::TSRHSFunctionFn, ctx::Cvoid)get TS explicit residual evaluation function from a DMTS
Not Collective
Input Parameter:
dm-DMto be used withTS
Output Parameters:
func- residual evaluation function, for calling sequence seeTSRHSFunctionFnctx- context for residual evaluation
Level: developer
-seealso: , DMTS, DM, TS, TSRHSFunctionFn, TSGetRHSFunction()
External Links
- PETSc Manual:
Ts/DMTSGetRHSFunction
PETSc.LibPETSc.DMTSGetRHSJacobian — Method
DMTSGetRHSJacobian(petsclib::PetscLibType,dm::PetscDM, func::TSRHSJacobianFn, ctx::Cvoid)get TS Jacobian evaluation function from a DMTS
Not Collective
Input Parameter:
dm-DMto be used withTS
Output Parameters:
func- Jacobian evaluation function, for calling sequence seeTSRHSJacobianFnctx- context for residual evaluation
Level: developer
-seealso: , DMTS, DM, TS, DMTSSetRHSJacobian(), TSRHSJacobianFn
External Links
- PETSc Manual:
Ts/DMTSGetRHSJacobian
PETSc.LibPETSc.DMTSGetSolutionFunction — Method
DMTSGetSolutionFunction(petsclib::PetscLibType,dm::PetscDM, func::TSSolutionFn, ctx::Cvoid)gets the TS solution evaluation function from a DMTS
Not Collective
Input Parameter:
dm-DMto be used withTS
Output Parameters:
func- solution function evaluation function, for calling sequence seeTSSolutionFnctx- context for solution evaluation
Level: developer
-seealso: , DMTS, TS, DM, DMTSSetSolutionFunction(), TSSolutionFn
External Links
- PETSc Manual:
Ts/DMTSGetSolutionFunction
PETSc.LibPETSc.DMTSGetTransientVariable — Method
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-DMto be used withTS
Output Parameters:
tvar- a function that transforms to transient variables, seeTSTransientVariableFnfor the calling sequencectx- a context for tvar
Level: developer
-seealso: , DMTS, DM, DMTSSetTransientVariable(), DMTSGetIFunction(), DMTSGetIJacobian(), TSTransientVariableFn
External Links
- PETSc Manual:
Ts/DMTSGetTransientVariable
PETSc.LibPETSc.DMTSSetBoundaryLocal — Method
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-DMto associate callback withfunc- local function evaluationctx- context for function evaluation
Level: intermediate
-seealso: , DM, TS, DMTSSetIFunction(), DMTSSetIJacobianLocal()
External Links
- PETSc Manual:
Ts/DMTSSetBoundaryLocal
PETSc.LibPETSc.DMTSSetForcingFunction — Method
DMTSSetForcingFunction(petsclib::PetscLibType,dm::PetscDM, func::TSForcingFn, ctx::Cvoid)set TS forcing function evaluation function into a DMTS
Not Collective
Input Parameters:
dm-DMto be used withTSfunc- forcing function evaluation routine, for calling sequence seeTSForcingFnctx- context for solution evaluation
Level: developer
-seealso: , DMTS, DM, TS, TSForcingFn, TSSetForcingFunction(), DMTSGetForcingFunction()
External Links
- PETSc Manual:
Ts/DMTSSetForcingFunction
PETSc.LibPETSc.DMTSSetI2Function — Method
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-DMto be used withTSfun- function evaluation routinectx- context for residual evaluation
Level: developer
-seealso: , DMTS, DM, TS, TSSetI2Function()
External Links
- PETSc Manual:
Ts/DMTSSetI2Function
PETSc.LibPETSc.DMTSSetI2FunctionContextDestroy — Method
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-DMto be used withTSf- implicit evaluation context destroy function, seePetscCtxDestroyFnfor its calling sequence
Level: developer
-seealso: , DMTS, TSSetI2FunctionContextDestroy(), DMTSSetI2Function(), TSSetI2Function()
External Links
- PETSc Manual:
Ts/DMTSSetI2FunctionContextDestroy
PETSc.LibPETSc.DMTSSetI2Jacobian — Method
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-DMto be used withTSjac- Jacobian evaluation routinectx- context for Jacobian evaluation
Level: developer
-seealso: , DMTS, DM, TS, TSI2JacobianFn, TSSetI2Jacobian()
External Links
- PETSc Manual:
Ts/DMTSSetI2Jacobian
PETSc.LibPETSc.DMTSSetI2JacobianContextDestroy — Method
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-DMto be used withTSf- implicit Jacobian evaluation context destroy function, seePetscCtxDestroyFnfor its calling sequence
Level: developer
-seealso: , DMTS, DM, TS, TSSetI2JacobianContextDestroy(), DMTSSetI2Jacobian(), TSSetI2Jacobian()
External Links
- PETSc Manual:
Ts/DMTSSetI2JacobianContextDestroy
PETSc.LibPETSc.DMTSSetIFunction — Method
DMTSSetIFunction(petsclib::PetscLibType,dm::PetscDM, func::TSIFunctionFn, ctx::Cvoid)set TS implicit function evaluation function into a DMTS
Not Collective
Input Parameters:
dm-DMto be used withTSfunc- function evaluating f(t,u,u_t)ctx- context for residual evaluation
Level: developer
-seealso: , DMTS, TS, DM, TSIFunctionFn
External Links
- PETSc Manual:
Ts/DMTSSetIFunction
PETSc.LibPETSc.DMTSSetIFunctionContextDestroy — Method
DMTSSetIFunctionContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)set TS implicit evaluation context destroy function into a DMTS
Not Collective
Input Parameters:
dm-DMto be used withTSf- implicit evaluation context destroy function, seePetscCtxDestroyFnfor its calling sequence
Level: developer
-seealso: , DMTS, DM, TS, DMTSSetIFunction(), TSSetIFunction(), PetscCtxDestroyFn
External Links
- PETSc Manual:
Ts/DMTSSetIFunctionContextDestroy
PETSc.LibPETSc.DMTSSetIFunctionLocal — Method
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-DMto associate callback withfunc- local function evaluationctx- context for function evaluation
Level: beginner
-seealso: , DM, DMTSGetIFunctionLocal(), DMTSSetIFunction(), DMTSSetIJacobianLocal()
External Links
- PETSc Manual:
Ts/DMTSSetIFunctionLocal
PETSc.LibPETSc.DMTSSetIFunctionSerialize — Method
DMTSSetIFunctionSerialize(petsclib::PetscLibType,dm::PetscDM, view::external, load::external)sets functions used to view and load a TSIFunctionFn context
Not Collective
Input Parameters:
dm-DMto be used withTSview- viewer functionload- loading function
Level: developer
External Links
- PETSc Manual:
Ts/DMTSSetIFunctionSerialize
PETSc.LibPETSc.DMTSSetIJacobian — Method
DMTSSetIJacobian(petsclib::PetscLibType,dm::PetscDM, func::TSIJacobianFn, ctx::Cvoid)set TS Jacobian evaluation function into a DMTS
Not Collective
Input Parameters:
dm-DMto be used withTSfunc- Jacobian evaluation routine, seeTSIJacobianFnfor the calling sequencectx- context for residual evaluation
Level: developer
-seealso: , DMTS, TS, DM, TSIJacobianFn, DMTSGetIJacobian(), TSSetIJacobian()
External Links
- PETSc Manual:
Ts/DMTSSetIJacobian
PETSc.LibPETSc.DMTSSetIJacobianContextDestroy — Method
DMTSSetIJacobianContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)set TS Jacobian evaluation context destroy function into a DMTS
Not Collective
Input Parameters:
dm-DMto be used withTSf- Jacobian evaluation context destroy function, seePetscCtxDestroyFnfor its calling sequence
Level: developer
-seealso: , DMTS, TSSetIJacobianContextDestroy(), TSSetI2JacobianContextDestroy(), DMTSSetIJacobian(), TSSetIJacobian()
External Links
- PETSc Manual:
Ts/DMTSSetIJacobianContextDestroy
PETSc.LibPETSc.DMTSSetIJacobianLocal — Method
DMTSSetIJacobianLocal(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::Cvoid)set a local Jacobian evaluation function
Logically Collective
Input Parameters:
dm-DMto associate callback withfunc- local Jacobian evaluationctx- optional context for local Jacobian evaluation
Level: beginner
-seealso: , DM, DMTSGetIJacobianLocal(), DMTSSetIFunctionLocal(), DMTSSetIJacobian(), DMTSSetIFunction()
External Links
- PETSc Manual:
Ts/DMTSSetIJacobianLocal
PETSc.LibPETSc.DMTSSetIJacobianSerialize — Method
DMTSSetIJacobianSerialize(petsclib::PetscLibType,dm::PetscDM, view::external, load::external)sets functions used to view and load a TSIJacobianFn context
Not Collective
Input Parameters:
dm-DMto be used withTSview- viewer functionload- loading function
Level: developer
External Links
- PETSc Manual:
Ts/DMTSSetIJacobianSerialize
PETSc.LibPETSc.DMTSSetRHSFunction — Method
DMTSSetRHSFunction(petsclib::PetscLibType,dm::PetscDM, func::TSRHSFunctionFn, ctx::Cvoid)set TS explicit residual evaluation function into a DMTS
Not Collective
Input Parameters:
dm-DMto be used withTSfunc- RHS function evaluation routine, seeTSRHSFunctionFnfor the calling sequencectx- context for residual evaluation
Level: developer
-seealso: , DMTS, DM, TS, TSRHSFunctionFn
External Links
- PETSc Manual:
Ts/DMTSSetRHSFunction
PETSc.LibPETSc.DMTSSetRHSFunctionContextDestroy — Method
DMTSSetRHSFunctionContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)set TS explicit residual evaluation context destroy function into a DMTS
Not Collective
Input Parameters:
dm-DMto be used withTSf- explicit evaluation context destroy function, seePetscCtxDestroyFnfor its calling sequence
Level: developer
-seealso: , DMTS, TSSetRHSFunctionContextDestroy(), DMTSSetRHSFunction(), TSSetRHSFunction()
External Links
- PETSc Manual:
Ts/DMTSSetRHSFunctionContextDestroy
PETSc.LibPETSc.DMTSSetRHSFunctionLocal — Method
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-DMto associate callback withfunc- local function evaluationctx- context for function evaluation
Level: beginner
-seealso: , DM, DMTSGetRHSFunctionLocal(), DMTSSetRHSFunction(), DMTSSetIFunction(), DMTSSetIJacobianLocal()
External Links
- PETSc Manual:
Ts/DMTSSetRHSFunctionLocal
PETSc.LibPETSc.DMTSSetRHSJacobian — Method
DMTSSetRHSJacobian(petsclib::PetscLibType,dm::PetscDM, func::TSRHSJacobianFn, ctx::Cvoid)set TS Jacobian evaluation function into a DMTS
Not Collective
Input Parameters:
dm-DMto be used withTSfunc- Jacobian evaluation routine, for calling sequence seeTSIJacobianFnctx- context for residual evaluation
Level: developer
-seealso: , DMTS, TSRHSJacobianFn, DMTSGetRHSJacobian(), TSSetRHSJacobian()
External Links
- PETSc Manual:
Ts/DMTSSetRHSJacobian
PETSc.LibPETSc.DMTSSetRHSJacobianContextDestroy — Method
DMTSSetRHSJacobianContextDestroy(petsclib::PetscLibType,dm::PetscDM, f::PetscCtxDestroyFn)set TS Jacobian evaluation context destroy function from a DMTS
Not Collective
Input Parameters:
dm-DMto be used withTSf- Jacobian evaluation context destroy function, seePetscCtxDestroyFnfor its calling sequence
Level: developer
-seealso: , DMTS, TS, TSSetRHSJacobianContextDestroy(), DMTSSetRHSJacobian(), TSSetRHSJacobian()
External Links
- PETSc Manual:
Ts/DMTSSetRHSJacobianContextDestroy
PETSc.LibPETSc.DMTSSetSolutionFunction — Method
DMTSSetSolutionFunction(petsclib::PetscLibType,dm::PetscDM, func::TSSolutionFn, ctx::Cvoid)set TS solution evaluation function into a DMTS
Not Collective
Input Parameters:
dm-DMto be used withTSfunc- solution function evaluation routine, for calling sequence seeTSSolutionFnctx- context for solution evaluation
Level: developer
-seealso: , DMTS, DM, TS, DMTSGetSolutionFunction(), TSSolutionFn
External Links
- PETSc Manual:
Ts/DMTSSetSolutionFunction
PETSc.LibPETSc.DMTSSetTransientVariable — Method
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-DMto be used withTStvar- a function that transforms to transient variables, seeTSTransientVariableFnfor the calling sequencectx- a context for tvar
Level: developer
-seealso: , DMTS, TS, TSBDF, TSSetTransientVariable(), DMTSGetTransientVariable(), DMTSSetIFunction(), DMTSSetIJacobian(), TSTransientVariableFn
External Links
- PETSc Manual:
Ts/DMTSSetTransientVariable
PETSc.LibPETSc.DMUseTensorOrder — Method
DMUseTensorOrder(petsclib::PetscLibType,dm::PetscDM, tensor::PetscBool)Use a tensor product closure ordering for the default section
Input Parameters:
dm- The DMtensor- Flag for tensor order
Level: developer
-seealso: DMPlexSetClosurePermutationTensor(), PetscSectionResetClosurePermutation()
External Links
- PETSc Manual:
DM/DMUseTensorOrder
PETSc.LibPETSc.DMView — Method
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- theDMobject to viewv- 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
- PETSc Manual:
DM/DMView
PETSc.LibPETSc.DMViewFromOptions — Method
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- theDMobjectobj- optional object that provides the prefix for the options database (ifNULLthen the prefix inobjis 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
- PETSc Manual:
DM/DMViewFromOptions
PETSc.LibPETSc.DMAdaptorAdapt — Method
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- TheDMAdaptorobjectx- The global approximate solutionstrategy- The adaptation strategy, seeDMAdaptationStrategy
Output Parameters:
adm- The adaptedDMax- 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
- PETSc Manual:
DM/DMAdaptorAdapt
PETSc.LibPETSc.DMAdaptorCreate — Method
adaptor::DMAdaptor = DMAdaptorCreate(petsclib::PetscLibType,comm::MPI_Comm)Create a DMAdaptor object. Its purpose is to construct a adaptation DMLabel or metric Vec that can be used to modify the DM.
Collective
Input Parameter:
comm- The communicator for theDMAdaptorobject
Output Parameter:
adaptor- TheDMAdaptorobject
Level: beginner
See also:
DM, DMAdaptor, DMAdaptorDestroy(), DMAdaptorAdapt(), PetscConvEst, PetscConvEstCreate()
External Links
- PETSc Manual:
DM/DMAdaptorCreate
PETSc.LibPETSc.DMAdaptorDestroy — Method
DMAdaptorDestroy(petsclib::PetscLibType,adaptor::DMAdaptor)Destroys a DMAdaptor object
Collective
Input Parameter:
adaptor- TheDMAdaptorobject
Level: beginner
See also:
DM, DMAdaptor, DMAdaptorCreate(), DMAdaptorAdapt()
External Links
- PETSc Manual:
DM/DMAdaptorDestroy
PETSc.LibPETSc.DMAdaptorGetCriterion — Method
DMAdaptorGetCriterion(petsclib::PetscLibType,adaptor::DMAdaptor, criterion::DMAdaptationCriterion)Get the adaptation criterion
Not Collective
Input Parameter:
adaptor- theDMAdaptor
Output Parameter:
criterion- the criterion for adaptation
Level: advanced
-seealso: DMAdaptor, DMAdaptorSetCriterion(), DMAdaptationCriterion
External Links
- PETSc Manual:
DM/DMAdaptorGetCriterion
PETSc.LibPETSc.DMAdaptorGetSequenceLength — Method
num::PetscInt = DMAdaptorGetSequenceLength(petsclib::PetscLibType,adaptor::DMAdaptor)Gets the number of sequential adaptations used by an adapter
Not Collective
Input Parameter:
adaptor- TheDMAdaptorobject
Output Parameter:
num- The number of adaptations
Level: intermediate
See also:
DMAdaptor, DMAdaptorSetSequenceLength(), DMAdaptorCreate(), DMAdaptorAdapt()
External Links
- PETSc Manual:
DM/DMAdaptorGetSequenceLength
PETSc.LibPETSc.DMAdaptorGetSolver — Method
DMAdaptorGetSolver(petsclib::PetscLibType,adaptor::DMAdaptor, snes::PetscSNES)Gets the solver used to produce discrete solutions
Not Collective
Input Parameter:
adaptor- TheDMAdaptorobject
Output Parameter:
snes- The solver
Level: intermediate
See also:
DM, DMAdaptor, DMAdaptorSetSolver(), DMAdaptorCreate(), DMAdaptorAdapt()
External Links
- PETSc Manual:
DM/DMAdaptorGetSolver
PETSc.LibPETSc.DMAdaptorGetType — Method
type::DMAdaptorType = DMAdaptorGetType(petsclib::PetscLibType,adaptor::DMAdaptor)Gets the type name (as a string) from the adaptor.
Not Collective
Input Parameter:
adaptor- TheDMAdaptor
Output Parameter:
type- TheDMAdaptorTypename
Level: intermediate
-seealso: , DM, DMPLEX, DMAdaptor, DMAdaptorType, DMAdaptorSetType(), DMAdaptorCreate()
External Links
- PETSc Manual:
DM/DMAdaptorGetType
PETSc.LibPETSc.DMAdaptorMonitor — Method
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- theDMAdaptorit- iteration numberodm- the originalDMadm- the adaptedDMNf- the number of fieldsenorms- the 2-norm error values for each fielderror-Vecof cellwise errors
Level: developer
-seealso: , DMAdaptorMonitorSet()
External Links
- PETSc Manual:
DM/DMAdaptorMonitor
PETSc.LibPETSc.DMAdaptorMonitorCancel — Method
DMAdaptorMonitorCancel(petsclib::PetscLibType,adaptor::DMAdaptor)Clears all monitors for a DMAdaptor object.
Logically Collective
Input Parameter:
adaptor- theDMAdaptor
Options Database Key:
-dm_adaptor_monitor_cancel- Cancels all monitors that have been hardwired into a code by calls toDMAdaptorMonitorSet(), but does not cancel those set via the options database.
Level: intermediate
-seealso: , DMAdaptorMonitorError(), DMAdaptorMonitorSet(), DMAdaptor
External Links
- PETSc Manual:
DM/DMAdaptorMonitorCancel
PETSc.LibPETSc.DMAdaptorMonitorError — Method
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- theDMAdaptorn- iteration numberodm- the originalDMadm- the adaptedDMNf- number of fieldsenorms- 2-norm error values for each field (may be estimated).error-Vecof cellwise errorsvf- The viewer context
Options Database Key:
-adaptor_monitor_error- ActivatesDMAdaptorMonitorError()
Level: intermediate
-seealso: , DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDraw(), DMAdaptorMonitorErrorDrawLG()
External Links
- PETSc Manual:
DM/DMAdaptorMonitorError
PETSc.LibPETSc.DMAdaptorMonitorErrorDraw — Method
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- theDMAdaptorn- iteration numberodm- the originalDMadm- the adaptedDMNf- number of fieldsenorms- 2-norm error values for each field (may be estimated).error-Vecof cellwise errorsvf- The viewer context
Options Database Key:
-adaptor_monitor_error draw- ActivatesDMAdaptorMonitorErrorDraw()
Level: intermediate
-seealso: , PETSCVIEWERDRAW, DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDrawLG()
External Links
- PETSc Manual:
DM/DMAdaptorMonitorErrorDraw
PETSc.LibPETSc.DMAdaptorMonitorErrorDrawLG — Method
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- theDMAdaptorn- iteration numberodm- the originalDMadm- the adaptedDMNf- number of fieldsenorms- 2-norm error values for each field (may be estimated).error-Vecof cellwise errorsvf- The viewer context, obtained viaDMAdaptorMonitorErrorDrawLGCreate()
Options Database Key:
-adaptor_error draw::draw_lg- ActivatesDMAdaptorMonitorErrorDrawLG()
Level: intermediate
-seealso: , PETSCVIEWERDRAW, DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDraw(), DMAdaptorMonitorError(), DMAdaptorMonitorTrueResidualDrawLGCreate()
External Links
- PETSc Manual:
DM/DMAdaptorMonitorErrorDrawLG
PETSc.LibPETSc.DMAdaptorMonitorErrorDrawLGCreate — Method
vf::PetscViewerAndFormat = DMAdaptorMonitorErrorDrawLGCreate(petsclib::PetscLibType,viewer::PetscViewer, format::PetscViewerFormat, ctx::Cvoid)Creates the context for the error plotter DMAdaptorMonitorErrorDrawLG()
Collective
Input Parameters:
viewer- ThePetscViewerformat- The viewer formatctx- An optional user context
Output Parameter:
vf- The viewer context
Level: intermediate
-seealso: , PETSCVIEWERDRAW, PetscViewerMonitorGLSetUp(), DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorErrorDrawLG()
External Links
- PETSc Manual:
DM/DMAdaptorMonitorErrorDrawLGCreate
PETSc.LibPETSc.DMAdaptorMonitorRegister — Method
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 routinevtype- APetscViewerTypefor the outputformat- APetscViewerFormatfor the outputmonitor- Monitor routinecreate- Creation routine, orNULLdestroy- Destruction routine, orNULL
Level: advanced
-seealso: , DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorRegisterAll(), DMAdaptorMonitorSetFromOptions()
External Links
- PETSc Manual:
DM/DMAdaptorMonitorRegister
PETSc.LibPETSc.DMAdaptorMonitorRegisterAll — Method
DMAdaptorMonitorRegisterAll(petsclib::PetscLibType)Registers all of the mesh adaptation monitors in the SNES package.
Not Collective
Level: advanced
-seealso: , SNES, DM, DMAdaptorMonitorRegister(), DMAdaptorRegister()
External Links
- PETSc Manual:
DM/DMAdaptorMonitorRegisterAll
PETSc.LibPETSc.DMAdaptorMonitorRegisterDestroy — Method
DMAdaptorMonitorRegisterDestroy(petsclib::PetscLibType)This function destroys the registered monitors for DMAdaptor. It is called from PetscFinalize().
Not collective
Level: developer
-seealso: , DM, DMPLEX, DMAdaptorMonitorRegisterAll(), DMAdaptor, PetscFinalize()
External Links
- PETSc Manual:
DM/DMAdaptorMonitorRegisterDestroy
PETSc.LibPETSc.DMAdaptorMonitorSet — Method
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- theDMAdaptormonitor- pointer to function (if this isNULL, it turns off monitoringctx- [optional] context for private data for the monitor routine (useNULLif no context is needed)monitordestroy- [optional] routine that frees monitor context (may beNULL), seePetscCtxDestroyFnfor its calling sequence
Calling sequence of monitor:
adaptor- theDMAdaptorit- iteration numberodm- the originalDMadm- the adaptedDMNf- number of fieldsenorms- (estimated) 2-norm of the error for each fielderror-Vecof cellwise errorsctx- optional monitoring context, as set byDMAdaptorMonitorSet()
Options Database Keys:
-adaptor_monitor_size- setsDMAdaptorMonitorSize()-adaptor_monitor_error- setsDMAdaptorMonitorError()-adaptor_monitor_error draw- setsDMAdaptorMonitorErrorDraw()and plots error-adaptor_monitor_error draw::draw_lg- setsDMAdaptorMonitorErrorDrawLG()and plots error-dm_adaptor_monitor_cancel- Cancels all monitors that have been hardwired into a code by calls toDMAdaptorMonitorSet(), but does not cancel those set via the options database.
Level: beginner
-seealso: , DMAdaptorMonitorError(), DMAdaptor, PetscCtxDestroyFn
External Links
- PETSc Manual:
DM/DMAdaptorMonitorSet
PETSc.LibPETSc.DMAdaptorMonitorSetFromOptions — Method
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-DMadaptorobject you wish to monitoropt- the command line option for this monitorname- the monitor type one is seekingctx- An optional user context for the monitor, orNULL
Level: developer
-seealso: , DMAdaptorMonitorRegister(), DMAdaptorMonitorSet(), PetscOptionsGetViewer()
External Links
- PETSc Manual:
DM/DMAdaptorMonitorSetFromOptions
PETSc.LibPETSc.DMAdaptorMonitorSize — Method
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- theDMAdaptorn- iteration numberodm- the originalDMadm- the adaptedDMNf- number of fieldsenorms- 2-norm error values for each field (may be estimated).error-Vecof cellwise errorsvf- The viewer context
Options Database Key:
-adaptor_monitor_size- ActivatesDMAdaptorMonitorSize()
Level: intermediate
-seealso: , DMAdaptor, DMAdaptorMonitorSet(), DMAdaptorMonitorError(), DMAdaptorMonitorErrorDraw(), DMAdaptorMonitorErrorDrawLG()
External Links
- PETSc Manual:
DM/DMAdaptorMonitorSize
PETSc.LibPETSc.DMAdaptorRegisterAll — Method
DMAdaptorRegisterAll(petsclib::PetscLibType)Registers all of the adaptor components in the DM package.
Not Collective
Level: advanced
-seealso: , DM, DMPLEX, DMAdaptorType, DMRegisterAll(), DMAdaptorRegisterDestroy()
External Links
- PETSc Manual:
DM/DMAdaptorRegisterAll
PETSc.LibPETSc.DMAdaptorRegisterDestroy — Method
DMAdaptorRegisterDestroy(petsclib::PetscLibType)This function destroys the registered DMAdaptorType. It is called from PetscFinalize().
Not collective
Level: developer
-seealso: , DM, DMPLEX, DMAdaptorRegisterAll(), DMAdaptorType, PetscFinalize()
External Links
- PETSc Manual:
DM/DMAdaptorRegisterDestroy
PETSc.LibPETSc.DMAdaptorSetCriterion — Method
DMAdaptorSetCriterion(petsclib::PetscLibType,adaptor::DMAdaptor, criterion::DMAdaptationCriterion)Set the adaptation criterion
Not Collective
Input Parameters:
adaptor- theDMAdaptorcriterion- the adaptation criterion
Level: advanced
-seealso: DMAdaptor, DMAdaptorGetCriterion(), DMAdaptationCriterion
External Links
- PETSc Manual:
DM/DMAdaptorSetCriterion
PETSc.LibPETSc.DMAdaptorSetFromOptions — Method
DMAdaptorSetFromOptions(petsclib::PetscLibType,adaptor::DMAdaptor)Sets properties of a DMAdaptor object from values in the options database
Collective
Input Parameter:
adaptor- TheDMAdaptorobject
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
- PETSc Manual:
DM/DMAdaptorSetFromOptions
PETSc.LibPETSc.DMAdaptorSetMixedSetupFunction — Method
DMAdaptorSetMixedSetupFunction(petsclib::PetscLibType,adaptor::DMAdaptor, setupFunc::external)Set the function setting up the mixed problem
Not Collective
Input Parameters:
adaptor- theDMAdaptorsetupFunc- the function setting up the mixed problem
Level: advanced
-seealso: DMAdaptor, DMAdaptorGetMixedSetupFunction(), DMAdaptorAdapt()
External Links
- PETSc Manual:
DM/DMAdaptorSetMixedSetupFunction
PETSc.LibPETSc.DMAdaptorSetOptionsPrefix — Method
DMAdaptorSetOptionsPrefix(petsclib::PetscLibType,adaptor::DMAdaptor, prefix::String)Sets the prefix used for searching for all DMAdaptor options in the database.
Logically Collective
Input Parameters:
adaptor- theDMAdaptorprefix- the prefix to prepend to all option names
Level: advanced
-seealso: , DMAdaptor, SNESSetOptionsPrefix(), DMAdaptorSetFromOptions()
External Links
- PETSc Manual:
DM/DMAdaptorSetOptionsPrefix
PETSc.LibPETSc.DMAdaptorSetSequenceLength — Method
DMAdaptorSetSequenceLength(petsclib::PetscLibType,adaptor::DMAdaptor, num::PetscInt)Sets the number of sequential adaptations
Not Collective
Input Parameters:
adaptor- TheDMAdaptorobjectnum- The number of adaptations
Level: intermediate
See also:
DMAdaptorGetSequenceLength(), DMAdaptorCreate(), DMAdaptorAdapt()
External Links
- PETSc Manual:
DM/DMAdaptorSetSequenceLength
PETSc.LibPETSc.DMAdaptorSetSolver — Method
DMAdaptorSetSolver(petsclib::PetscLibType,adaptor::DMAdaptor, snes::PetscSNES)Sets the solver used to produce discrete solutions
Not Collective
Input Parameters:
adaptor- TheDMAdaptorobjectsnes- The solver, this MUST have an attachedDM/PetscDS, so that the exact solution can be computed
Level: intermediate
See also:
DMAdaptor, DMAdaptorGetSolver(), DMAdaptorCreate(), DMAdaptorAdapt()
External Links
- PETSc Manual:
DM/DMAdaptorSetSolver
PETSc.LibPETSc.DMAdaptorSetTransferFunction — Method
DMAdaptorSetTransferFunction(petsclib::PetscLibType,adaptor::DMAdaptor, tfunc::external)External Links
- PETSc Manual:
DM/DMAdaptorSetTransferFunction
PETSc.LibPETSc.DMAdaptorSetType — Method
DMAdaptorSetType(petsclib::PetscLibType,adaptor::DMAdaptor, method::DMAdaptorType)Sets the particular implementation for a adaptor.
Collective
Input Parameters:
adaptor- TheDMAdaptormethod- The name of the adaptor type
Options Database Key:
-adaptor_type <type>- Sets the adaptor type; seeDMAdaptorType
Level: intermediate
-seealso: , DM, DMPLEX, DMAdaptor, DMAdaptorType, DMAdaptorGetType(), DMAdaptorCreate()
External Links
- PETSc Manual:
DM/DMAdaptorSetType
PETSc.LibPETSc.DMAdaptorSetUp — Method
DMAdaptorSetUp(petsclib::PetscLibType,adaptor::DMAdaptor)After the solver is specified, creates data structures for controlling adaptivity
Collective
Input Parameter:
adaptor- TheDMAdaptorobject
Level: beginner
See also:
DMAdaptor, DMAdaptorCreate(), DMAdaptorAdapt()
External Links
- PETSc Manual:
DM/DMAdaptorSetUp
PETSc.LibPETSc.DMAdaptorView — Method
DMAdaptorView(petsclib::PetscLibType,adaptor::DMAdaptor, viewer::PetscViewer)Views a DMAdaptor object
Collective
Input Parameters:
adaptor- TheDMAdaptorobjectviewer- ThePetscViewerobject
Level: beginner
See also:
DM, DMAdaptor, DMAdaptorCreate(), DMAdaptorAdapt()
External Links
- PETSc Manual:
DM/DMAdaptorView
PETSc.LibPETSc.DMFieldCreateDA — Method
cornerValues::PetscScalar,field::DMField = DMFieldCreateDA(petsclib::PetscLibType,dm::PetscDM, nc::PetscInt)External Links
- PETSc Manual:
DM/DMFieldCreateDA
PETSc.LibPETSc.DMFieldCreateDS — Method
field::DMField = DMFieldCreateDS(petsclib::PetscLibType,dm::PetscDM, fieldNum::PetscInt, vec::PetscVec)External Links
- PETSc Manual:
DM/DMFieldCreateDS
PETSc.LibPETSc.DMFieldCreateDSWithDG — Method
field::DMField = DMFieldCreateDSWithDG(petsclib::PetscLibType,dm::PetscDM, dmDG::PetscDM, fieldNum::PetscInt, vec::PetscVec, vecDG::PetscVec)External Links
- PETSc Manual:
DM/DMFieldCreateDSWithDG
PETSc.LibPETSc.DMFieldCreateDefaultFaceQuadrature — Method
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- theDMFieldobjectpointIS- the index set of points over which we wish to integrate the field over faces
Output Parameter:
quad- aPetscQuadratureobject
Level: developer
-seealso: DMFieldCreateDefaultQuadrature(), DMField, PetscQuadrature, IS, DMFieldEvaluteFE(), DMFieldGetDegree()
External Links
- PETSc Manual:
DM/DMFieldCreateDefaultFaceQuadrature
PETSc.LibPETSc.DMFieldCreateDefaultQuadrature — Method
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- theDMFieldobjectpointIS- the index set of points over which we wish to integrate the field
Output Parameter:
quad- aPetscQuadratureobject
Level: developer
-seealso: DMFieldCreateDefaultFaceQuadrature(), DMField, PetscQuadrature, IS, DMFieldEvaluteFE(), DMFieldGetDegree()
External Links
- PETSc Manual:
DM/DMFieldCreateDefaultQuadrature
PETSc.LibPETSc.DMFieldCreateFEGeom — Method
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- theDMFieldobjectpointIS- the index set of points over which we wish to integrate the fieldquad- the quadrature points at which to evaluate the geometric factorsmode- Type of geometry data to store
Output Parameter:
geom- the geometric factors
Level: developer
-seealso: DMField, PetscQuadrature, IS, PetscFEGeom, DMFieldEvaluateFE(), DMFieldCreateDefaulteQuadrature(), DMFieldGetDegree()
External Links
- PETSc Manual:
DM/DMFieldCreateFEGeom
PETSc.LibPETSc.DMFieldCreateShell — Method
ctx::Cvoid,field::DMField = DMFieldCreateShell(petsclib::PetscLibType,dm::PetscDM, numComponents::PetscInt, continuity::DMFieldContinuity)External Links
- PETSc Manual:
DM/DMFieldCreateShell
PETSc.LibPETSc.DMFieldDestroy — Method
DMFieldDestroy(petsclib::PetscLibType,field::DMField)destroy a DMField
Collective
Input Parameter:
field- address ofDMField
Level: advanced
-seealso: DMField, DMFieldCreate()
External Links
- PETSc Manual:
DM/DMFieldDestroy
PETSc.LibPETSc.DMFieldEvaluate — Method
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- TheDMFieldobjectpoints- 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: eitherPETSC_REALorPETSC_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
- PETSc Manual:
DM/DMFieldEvaluate
PETSc.LibPETSc.DMFieldEvaluateFE — Method
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- TheDMFieldobjectcellIS- Index set for cells on which to evaluate the fieldpoints- The quadature containing the points in the reference cell at which to evaluate the field.datatype- The PetscDataType of the output arrays: eitherPETSC_REALorPETSC_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
- PETSc Manual:
DM/DMFieldEvaluateFE
PETSc.LibPETSc.DMFieldEvaluateFV — Method
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- TheDMFieldobjectcellIS- Index set for cells on which to evaluate the fielddatatype- The PetscDataType of the output arrays: eitherPETSC_REALorPETSC_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
- PETSc Manual:
DM/DMFieldEvaluateFV
PETSc.LibPETSc.DMFieldFinalizePackage — Method
DMFieldFinalizePackage(petsclib::PetscLibType)Finalize DMField package, it is called from PetscFinalize()
Logically Collective
Level: developer
-seealso: DMFieldInitializePackage()
External Links
- PETSc Manual:
DM/DMFieldFinalizePackage
PETSc.LibPETSc.DMFieldGetDM — Method
DMFieldGetDM(petsclib::PetscLibType,field::DMField, dm::PetscDM)Returns the DM for the manifold over which the field is defined.
Not Collective
Input Parameter:
field- TheDMFieldobject
Output Parameter:
dm- TheDMobject
Level: intermediate
-seealso: DMField, DM, DMFieldEvaluate()
External Links
- PETSc Manual:
DM/DMFieldGetDM
PETSc.LibPETSc.DMFieldGetDegree — Method
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- theDMFieldobjectcellIS- 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 elementmaxDegree- the largest degree of the smallest polynomial space containing the field on any element
Level: intermediate
-seealso: DMField, IS, DMFieldEvaluateFE()
External Links
- PETSc Manual:
DM/DMFieldGetDegree
PETSc.LibPETSc.DMFieldGetNumComponents — Method
nc::PetscInt = DMFieldGetNumComponents(petsclib::PetscLibType,field::DMField)Returns the number of components in the field
Not Collective
Input Parameter:
field- TheDMFieldobject
Output Parameter:
nc- The number of field components
Level: intermediate
-seealso: DMField, DMFieldEvaluate()
External Links
- PETSc Manual:
DM/DMFieldGetNumComponents
PETSc.LibPETSc.DMFieldGetType — Method
type::DMFieldType = DMFieldGetType(petsclib::PetscLibType,field::DMField)Gets the DMFieldType name (as a string) from the DMField.
Not Collective
Input Parameter:
field- TheDMFieldcontext
Output Parameter:
type- TheDMFieldTypename
Level: advanced
-seealso: DMField, DMFieldSetType(), DMFieldType
External Links
- PETSc Manual:
DM/DMFieldGetType
PETSc.LibPETSc.DMFieldInitializePackage — Method
DMFieldInitializePackage(petsclib::PetscLibType)Initialize DMField package
Logically Collective
Level: developer
-seealso: DMFieldFinalizePackage()
External Links
- PETSc Manual:
DM/DMFieldInitializePackage
PETSc.LibPETSc.DMFieldRegister — Method
DMFieldRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds an implementation of the DMField object.
Not collective, No Fortran Support
Input Parameters:
sname- name of a new user-defined implementationfunction- routine to create method context
-seealso: DMField, DMFieldRegisterAll(), DMFieldRegisterDestroy()
External Links
- PETSc Manual:
DM/DMFieldRegister
PETSc.LibPETSc.DMFieldSetType — Method
DMFieldSetType(petsclib::PetscLibType,field::DMField, type::DMFieldType)set the DMField implementation
Collective
Input Parameters:
field- theDMFieldcontexttype- a known method
Level: advanced
-seealso: DMField, DMFieldGetType(), DMFieldType,
External Links
- PETSc Manual:
DM/DMFieldSetType
PETSc.LibPETSc.DMFieldShellEvaluateFEDefault — Method
DMFieldShellEvaluateFEDefault(petsclib::PetscLibType,field::DMField, pointIS::IS, quad::PetscQuadrature, type::PetscDataType, B::Cvoid, D::Cvoid, H::Cvoid)External Links
- PETSc Manual:
DM/DMFieldShellEvaluateFEDefault
PETSc.LibPETSc.DMFieldShellEvaluateFVDefault — Method
DMFieldShellEvaluateFVDefault(petsclib::PetscLibType,field::DMField, pointIS::IS, type::PetscDataType, B::Cvoid, D::Cvoid, H::Cvoid)External Links
- PETSc Manual:
DM/DMFieldShellEvaluateFVDefault
PETSc.LibPETSc.DMFieldShellGetContext — Method
DMFieldShellGetContext(petsclib::PetscLibType,field::DMField, ctx::Cvoid)External Links
- PETSc Manual:
DM/DMFieldShellGetContext
PETSc.LibPETSc.DMFieldShellSetCreateDefaultQuadrature — Method
DMFieldShellSetCreateDefaultQuadrature(petsclib::PetscLibType,field::DMField, createDefaultQuadrature::external)External Links
- PETSc Manual:
DM/DMFieldShellSetCreateDefaultQuadrature
PETSc.LibPETSc.DMFieldShellSetDestroy — Method
DMFieldShellSetDestroy(petsclib::PetscLibType,field::DMField, destroy::external)External Links
- PETSc Manual:
DM/DMFieldShellSetDestroy
PETSc.LibPETSc.DMFieldShellSetEvaluate — Method
DMFieldShellSetEvaluate(petsclib::PetscLibType,field::DMField, evaluate::external)External Links
- PETSc Manual:
DM/DMFieldShellSetEvaluate
PETSc.LibPETSc.DMFieldShellSetEvaluateFE — Method
DMFieldShellSetEvaluateFE(petsclib::PetscLibType,field::DMField, evaluateFE::external)External Links
- PETSc Manual:
DM/DMFieldShellSetEvaluateFE
PETSc.LibPETSc.DMFieldShellSetEvaluateFV — Method
DMFieldShellSetEvaluateFV(petsclib::PetscLibType,field::DMField, evaluateFV::external)External Links
- PETSc Manual:
DM/DMFieldShellSetEvaluateFV
PETSc.LibPETSc.DMFieldShellSetGetDegree — Method
DMFieldShellSetGetDegree(petsclib::PetscLibType,field::DMField, getDegree::external)External Links
- PETSc Manual:
DM/DMFieldShellSetGetDegree
PETSc.LibPETSc.DMFieldView — Method
DMFieldView(petsclib::PetscLibType,field::DMField, viewer::PetscViewer)view a DMField
Collective
Input Parameters:
field-DMFieldviewer- viewer to display field, for examplePETSC_VIEWER_STDOUT_WORLD
Level: advanced
-seealso: DMField, DMFieldCreate()
External Links
- PETSc Manual:
DM/DMFieldView
PETSc.LibPETSc.DMLabelAddStrata — Method
DMLabelAddStrata(petsclib::PetscLibType,label::DMLabel, numStrata::PetscInt, stratumValues::Vector{PetscInt})Adds new stratum values in a DMLabel
Not Collective
Input Parameters:
label- TheDMLabelnumStrata- The number of stratum valuesstratumValues- The stratum values
Level: beginner
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()
External Links
- PETSc Manual:
DM/DMLabelAddStrata
PETSc.LibPETSc.DMLabelAddStrataIS — Method
DMLabelAddStrataIS(petsclib::PetscLibType,label::DMLabel, valueIS::IS)Adds new stratum values in a DMLabel
Not Collective
Input Parameters:
label- TheDMLabelvalueIS- Index set with stratum values
Level: beginner
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()
External Links
- PETSc Manual:
DM/DMLabelAddStrataIS
PETSc.LibPETSc.DMLabelAddStratum — Method
DMLabelAddStratum(petsclib::PetscLibType,label::DMLabel, value::PetscInt)Adds a new stratum value in a DMLabel
Input Parameters:
label- TheDMLabelvalue- The stratum value
Level: beginner
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()
External Links
- PETSc Manual:
DM/DMLabelAddStratum
PETSc.LibPETSc.DMLabelClearStratum — Method
DMLabelClearStratum(petsclib::PetscLibType,label::DMLabel, value::PetscInt)Remove a stratum
Not Collective
Input Parameters:
label- theDMLabelvalue- the stratum value
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelClearStratum
PETSc.LibPETSc.DMLabelClearValue — Method
DMLabelClearValue(petsclib::PetscLibType,label::DMLabel, point::PetscInt, value::PetscInt)Clear the value a label assigns to a point
Not Collective
Input Parameters:
label- theDMLabelpoint- the pointvalue- The point value
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue()
External Links
- PETSc Manual:
DM/DMLabelClearValue
PETSc.LibPETSc.DMLabelCompare — Method
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 labelsl0- FirstDMLabell1- SecondDMLabel
Output Parameters:
equal- (Optional) Flag whether the two labels are equalmessage- (Optional) Message describing the difference
Level: intermediate
-seealso: DMLabel, DM, DMCompareLabels(), DMLabelGetNumValues(), DMLabelGetDefaultValue(), DMLabelGetNonEmptyStratumValuesIS(), DMLabelGetStratumIS()
External Links
- PETSc Manual:
DM/DMLabelCompare
PETSc.LibPETSc.DMLabelComputeIndex — Method
DMLabelComputeIndex(petsclib::PetscLibType,label::DMLabel)Create an index structure for membership determination, automatically determining the bounds
Not Collective
Input Parameter:
label- TheDMLabel
Level: intermediate
-seealso: DMLabel, DM, DMLabelHasPoint(), DMLabelCreateIndex(), DMLabelDestroyIndex(), DMLabelGetValue(), DMLabelSetValue()
External Links
- PETSc Manual:
DM/DMLabelComputeIndex
PETSc.LibPETSc.DMLabelConvertToSection — Method
DMLabelConvertToSection(petsclib::PetscLibType,label::DMLabel, section::PetscSection, is::IS)Make a PetscSection/IS pair that encodes the label
Not Collective
Input Parameter:
label- theDMLabel
Output Parameters:
section- the section giving offsets for each stratumis- AnIScontaining all the label points
Level: developer
-seealso: DMLabel, DM, DMLabelDistribute()
External Links
- PETSc Manual:
DM/DMLabelConvertToSection
PETSc.LibPETSc.DMLabelCreate — Method
label::DMLabel = DMLabelCreate(petsclib::PetscLibType,comm::MPI_Comm, name::String)Create a DMLabel object, which is a multimap
Collective
Input Parameters:
comm- The communicator, usuallyPETSC_COMM_SELFname- The label name
Output Parameter:
label- TheDMLabel
Level: beginner
-seealso: DMLabel, DM, DMLabelDestroy()
External Links
- PETSc Manual:
DM/DMLabelCreate
PETSc.LibPETSc.DMLabelCreateIndex — Method
DMLabelCreateIndex(petsclib::PetscLibType,label::DMLabel, pStart::PetscInt, pEnd::PetscInt)Create an index structure for membership determination
Not Collective
Input Parameters:
label- TheDMLabelpStart- The smallest pointpEnd- The largest point + 1
Level: intermediate
-seealso: DMLabel, DM, DMLabelHasPoint(), DMLabelComputeIndex(), DMLabelDestroyIndex(), DMLabelGetValue(), DMLabelSetValue()
External Links
- PETSc Manual:
DM/DMLabelCreateIndex
PETSc.LibPETSc.DMLabelDestroy — Method
DMLabelDestroy(petsclib::PetscLibType,label::DMLabel)Destroys a DMLabel
Collective
Input Parameter:
label- TheDMLabel
Level: beginner
-seealso: DMLabel, DM, DMLabelReset(), DMLabelCreate()
External Links
- PETSc Manual:
DM/DMLabelDestroy
PETSc.LibPETSc.DMLabelDestroyIndex — Method
DMLabelDestroyIndex(petsclib::PetscLibType,label::DMLabel)Destroy the index structure
Not Collective
Input Parameter:
label- theDMLabel
Level: intermediate
-seealso: DMLabel, DM, DMLabelHasPoint(), DMLabelCreateIndex(), DMLabelGetValue(), DMLabelSetValue()
External Links
- PETSc Manual:
DM/DMLabelDestroyIndex
PETSc.LibPETSc.DMLabelDistribute — Method
DMLabelDistribute(petsclib::PetscLibType,label::DMLabel, sf::PetscSF, labelNew::DMLabel)Create a new label pushed forward over the PetscSF
Collective
Input Parameters:
label- theDMLabelsf- 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
- PETSc Manual:
DM/DMLabelDistribute
PETSc.LibPETSc.DMLabelDuplicate — Method
labelnew::DMLabel = DMLabelDuplicate(petsclib::PetscLibType,label::DMLabel)Duplicates a DMLabel
Collective
Input Parameter:
label- TheDMLabel
Output Parameter:
labelnew- new label
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()
External Links
- PETSc Manual:
DM/DMLabelDuplicate
PETSc.LibPETSc.DMLabelEphemeralGetLabel — Method
DMLabelEphemeralGetLabel(petsclib::PetscLibType,label::DMLabel, olabel::DMLabel)Get the base label for this ephemeral label
Not Collective
Input Parameter:
label- theDMLabel
Output Parameter:
olabel- the base label for this ephemeral label
Level: intermediate
-seealso: DMLabelEphemeralSetLabel(), DMLabelEphemeralGetTransform(), DMLabelSetType()
External Links
- PETSc Manual:
DM/DMLabelEphemeralGetLabel
PETSc.LibPETSc.DMLabelEphemeralGetTransform — Method
DMLabelEphemeralGetTransform(petsclib::PetscLibType,label::DMLabel, tr::DMPlexTransform)Get the transform for this ephemeral label
Not Collective
Input Parameter:
label- theDMLabel
Output Parameter:
tr- the transform for this ephemeral label
Level: intermediate
-seealso: DMLabelEphemeralSetTransform(), DMLabelEphemeralGetLabel(), DMLabelSetType()
External Links
- PETSc Manual:
DM/DMLabelEphemeralGetTransform
PETSc.LibPETSc.DMLabelEphemeralSetLabel — Method
DMLabelEphemeralSetLabel(petsclib::PetscLibType,label::DMLabel, olabel::DMLabel)Set the base label for this ephemeral label
Not Collective
Input Parameters:
label- theDMLabelolabel- the base label for this ephemeral label
Level: intermediate
-seealso: DMLabelEphemeralGetLabel(), DMLabelEphemeralSetTransform(), DMLabelSetType()
External Links
- PETSc Manual:
DM/DMLabelEphemeralSetLabel
PETSc.LibPETSc.DMLabelEphemeralSetTransform — Method
DMLabelEphemeralSetTransform(petsclib::PetscLibType,label::DMLabel, tr::DMPlexTransform)Set the transform for this ephemeral label
Not Collective
Input Parameters:
label- theDMLabeltr- the transform for this ephemeral label
Level: intermediate
-seealso: DMLabelEphemeralGetTransform(), DMLabelEphemeralSetLabel(), DMLabelSetType()
External Links
- PETSc Manual:
DM/DMLabelEphemeralSetTransform
PETSc.LibPETSc.DMLabelFilter — Method
DMLabelFilter(petsclib::PetscLibType,label::DMLabel, start::PetscInt, end_::PetscInt)Remove all points outside of [start, end)
Not Collective
Input Parameters:
label- theDMLabelstart- the first point keptend- one more than the last point kept
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelFilter
PETSc.LibPETSc.DMLabelGather — Method
DMLabelGather(petsclib::PetscLibType,label::DMLabel, sf::PetscSF, labelNew::DMLabel)Gather all label values from leafs into roots
Collective
Input Parameters:
label- theDMLabelsf- thePetscSFcommunication map
Output Parameter:
labelNew- the newDMLabelwith localised leaf values
Level: developer
-seealso: DMLabel, DM, DMLabelDistribute()
External Links
- PETSc Manual:
DM/DMLabelGather
PETSc.LibPETSc.DMLabelGetBounds — Method
pStart::PetscInt,pEnd::PetscInt = DMLabelGetBounds(petsclib::PetscLibType,label::DMLabel)Return the smallest and largest point in the label
Not Collective
Input Parameter:
label- theDMLabel
Output Parameters:
pStart- The smallest pointpEnd- The largest point + 1
Level: intermediate
-seealso: DMLabel, DM, DMLabelHasPoint(), DMLabelCreateIndex(), DMLabelGetValue(), DMLabelSetValue()
External Links
- PETSc Manual:
DM/DMLabelGetBounds
PETSc.LibPETSc.DMLabelGetDefaultValue — Method
defaultValue::PetscInt = DMLabelGetDefaultValue(petsclib::PetscLibType,label::DMLabel)Get the default value returned by DMLabelGetValue() if a point has not been explicitly given a value. When a label is created, it is initialized to -1.
Not Collective
Input Parameter:
label- aDMLabelobject
Output Parameter:
defaultValue- the default value
Level: beginner
-seealso: DMLabel, DM, DMLabelSetDefaultValue(), DMLabelGetValue(), DMLabelSetValue()
External Links
- PETSc Manual:
DM/DMLabelGetDefaultValue
PETSc.LibPETSc.DMLabelGetNonEmptyStratumValuesIS — Method
DMLabelGetNonEmptyStratumValuesIS(petsclib::PetscLibType,label::DMLabel, values::IS)Get an IS of all values that the DMlabel takes
Not Collective
Input Parameter:
label- theDMLabel
Output Parameter:
values- the valueIS
Level: intermediate
-seealso: DMLabel, DM, DMLabelGetValueIS(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelGetNonEmptyStratumValuesIS
PETSc.LibPETSc.DMLabelGetNumValues — Method
numValues::PetscInt = DMLabelGetNumValues(petsclib::PetscLibType,label::DMLabel)Get the number of values that the DMLabel takes
Not Collective
Input Parameter:
label- theDMLabel
Output Parameter:
numValues- the number of values
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelGetNumValues
PETSc.LibPETSc.DMLabelGetStratumBounds — Method
start::PetscInt,end_::PetscInt = DMLabelGetStratumBounds(petsclib::PetscLibType,label::DMLabel, value::PetscInt)Get the largest and smallest point of a stratum
Not Collective
Input Parameters:
label- theDMLabelvalue- the stratum value
Output Parameters:
start- the smallest point in the stratumend- the largest point in the stratum
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelGetStratumBounds
PETSc.LibPETSc.DMLabelGetStratumIS — Method
DMLabelGetStratumIS(petsclib::PetscLibType,label::DMLabel, value::PetscInt, points::IS)Get an IS with the stratum points
Not Collective
Input Parameters:
label- theDMLabelvalue- the stratum value
Output Parameter:
points- The stratum points
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelGetStratumIS
PETSc.LibPETSc.DMLabelGetStratumPointIndex — Method
index::PetscInt = DMLabelGetStratumPointIndex(petsclib::PetscLibType,label::DMLabel, value::PetscInt, p::PetscInt)Get the index of a point in a given stratum
Not Collective
Input Parameters:
label- TheDMLabelvalue- The label valuep- 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
- PETSc Manual:
DM/DMLabelGetStratumPointIndex
PETSc.LibPETSc.DMLabelGetStratumSize — Method
size::PetscInt = DMLabelGetStratumSize(petsclib::PetscLibType,label::DMLabel, value::PetscInt)Get the size of a stratum
Not Collective
Input Parameters:
label- theDMLabelvalue- the stratum value
Output Parameter:
size- The number of points in the stratum
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelGetStratumSize
PETSc.LibPETSc.DMLabelGetType — Method
type::DMLabelType = DMLabelGetType(petsclib::PetscLibType,label::DMLabel)Gets the type name (as a string) from the label.
Not Collective
Input Parameter:
label- TheDMLabel
Output Parameter:
type- TheDMLabeltype name
Level: intermediate
-seealso: DMLabel, DM, DMLabelSetType(), DMLabelCreate()
External Links
- PETSc Manual:
DM/DMLabelGetType
PETSc.LibPETSc.DMLabelGetValue — Method
value::PetscInt = DMLabelGetValue(petsclib::PetscLibType,label::DMLabel, point::PetscInt)Return the value a label assigns to a point, or the label's default value (which is initially DMLabelSetDefaultValue())
Not Collective
Input Parameters:
label- theDMLabelpoint- 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
- PETSc Manual:
DM/DMLabelGetValue
PETSc.LibPETSc.DMLabelGetValueBounds — Method
minValue::PetscInt,maxValue::PetscInt = DMLabelGetValueBounds(petsclib::PetscLibType,label::DMLabel)Return the smallest and largest value in the label
Not Collective
Input Parameter:
label- theDMLabel
Output Parameters:
minValue- The smallest valuemaxValue- The largest value
Level: intermediate
-seealso: DMLabel, DM, DMLabelGetBounds(), DMLabelGetValue(), DMLabelSetValue()
External Links
- PETSc Manual:
DM/DMLabelGetValueBounds
PETSc.LibPETSc.DMLabelGetValueIS — Method
DMLabelGetValueIS(petsclib::PetscLibType,label::DMLabel, values::IS)Get an IS of all values that the DMlabel takes
Not Collective
Input Parameter:
label- theDMLabel
Output Parameter:
values- the valueIS
Level: intermediate
-seealso: DMLabel, DM, DMLabelGetNonEmptyStratumValuesIS(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelGetValueIS
PETSc.LibPETSc.DMLabelGetValueIndex — Method
index::PetscInt = DMLabelGetValueIndex(petsclib::PetscLibType,label::DMLabel, value::PetscInt)Get the index of a given value in the list of values for the DMlabel, or
Not Collective
Input Parameters:
label- theDMLabelvalue- 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
- PETSc Manual:
DM/DMLabelGetValueIndex
PETSc.LibPETSc.DMLabelHasPoint — Method
contains::PetscBool = DMLabelHasPoint(petsclib::PetscLibType,label::DMLabel, point::PetscInt)Determine whether a label assigns a value to a point
Not Collective
Input Parameters:
label- theDMLabelpoint- 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
- PETSc Manual:
DM/DMLabelHasPoint
PETSc.LibPETSc.DMLabelHasStratum — Method
exists::PetscBool = DMLabelHasStratum(petsclib::PetscLibType,label::DMLabel, value::PetscInt)Determine whether points exist with the given value
Not Collective
Input Parameters:
label- theDMLabelvalue- the stratum value
Output Parameter:
exists- Flag saying whether points exist
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelHasStratum
PETSc.LibPETSc.DMLabelHasValue — Method
contains::PetscBool = DMLabelHasValue(petsclib::PetscLibType,label::DMLabel, value::PetscInt)Determine whether a label assigns the value to any point
Not Collective
Input Parameters:
label- theDMLabelvalue- 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
- PETSc Manual:
DM/DMLabelHasValue
PETSc.LibPETSc.DMLabelInsertIS — Method
DMLabelInsertIS(petsclib::PetscLibType,label::DMLabel, is::IS, value::PetscInt)Set all points in the IS to a value
Not Collective
Input Parameters:
label- theDMLabelis- the pointISvalue- The point value
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelInsertIS
PETSc.LibPETSc.DMLabelPermute — Method
DMLabelPermute(petsclib::PetscLibType,label::DMLabel, permutation::IS, labelNew::DMLabel)Create a new label with permuted points
Not Collective
Input Parameters:
label- theDMLabelpermutation- the point permutation
Output Parameter:
labelNew- the new label containing the permuted points
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelPermute
PETSc.LibPETSc.DMLabelPermuteValues — Method
DMLabelPermuteValues(petsclib::PetscLibType,label::DMLabel, permutation::IS)Permute the values in a label
Not collective
Input Parameters:
label- theDMLabelpermutation- the value permutation, permutation[old value] = new value
Output Parameter:
label- theDMLabelnow with permuted values
-seealso: DMLabelRewriteValues(), DMLabel, DM, DMLabelPermute(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelPermuteValues
PETSc.LibPETSc.DMLabelPropagateBegin — Method
DMLabelPropagateBegin(petsclib::PetscLibType,label::DMLabel, sf::PetscSF)Setup a cycle of label propagation
Collective
Input Parameters:
label- TheDMLabelto propagate across processessf- ThePetscSFdescribing parallel layout of the label points
Level: intermediate
-seealso: DMLabel, DM, DMLabelPropagateEnd(), DMLabelPropagatePush()
External Links
- PETSc Manual:
DM/DMLabelPropagateBegin
PETSc.LibPETSc.DMLabelPropagateEnd — Method
DMLabelPropagateEnd(petsclib::PetscLibType,label::DMLabel, pointSF::PetscSF)Tear down a cycle of label propagation
Collective
Input Parameters:
label- TheDMLabelto propagate across processespointSF- ThePetscSFdescribing parallel layout of the label points
Level: intermediate
-seealso: DMLabel, DM, DMLabelPropagateBegin(), DMLabelPropagatePush()
External Links
- PETSc Manual:
DM/DMLabelPropagateEnd
PETSc.LibPETSc.DMLabelPropagatePush — Method
DMLabelPropagatePush(petsclib::PetscLibType,label::DMLabel, pointSF::PetscSF, markPoint::external, ctx::Cvoid)Tear down a cycle of label propagation
Collective
Input Parameters:
label- TheDMLabelto propagate across processespointSF- ThePetscSFdescribing parallel layout of the label pointsmarkPoint- An optional callback that is called when a point is marked, orNULLctx- An optional user context for the callback, orNULL
Calling sequence of markPoint:
label- TheDMLabelp- The point being markedval- The label value forpctx- An optional user context
Level: intermediate
-seealso: DMLabel, DM, DMLabelPropagateBegin(), DMLabelPropagateEnd()
External Links
- PETSc Manual:
DM/DMLabelPropagatePush
PETSc.LibPETSc.DMLabelRegisterAll — Method
DMLabelRegisterAll(petsclib::PetscLibType)Registers all of the DMLabel implementations in the DM package.
Not Collective
Level: advanced
-seealso: DMLabel, DM, DMRegisterAll(), DMLabelRegisterDestroy()
External Links
- PETSc Manual:
DM/DMLabelRegisterAll
PETSc.LibPETSc.DMLabelRegisterDestroy — Method
DMLabelRegisterDestroy(petsclib::PetscLibType)This function destroys the DMLabel registry. It is called from PetscFinalize().
Level: developer
-seealso: DMLabel, DM, PetscInitialize()
External Links
- PETSc Manual:
DM/DMLabelRegisterDestroy
PETSc.LibPETSc.DMLabelReset — Method
DMLabelReset(petsclib::PetscLibType,label::DMLabel)Destroys internal data structures in a DMLabel
Not Collective
Input Parameter:
label- TheDMLabel
Level: beginner
-seealso: DMLabel, DM, DMLabelDestroy(), DMLabelCreate()
External Links
- PETSc Manual:
DM/DMLabelReset
PETSc.LibPETSc.DMLabelRewriteValues — Method
DMLabelRewriteValues(petsclib::PetscLibType,label::DMLabel, permutation::IS)Permute the values in a label, but some may be omitted
Not collective
Input Parameters:
label- theDMLabelpermutation- the value permutation, permutation[old value] = new value, but some maybe omitted
Output Parameter:
label- theDMLabelnow with permuted values
-seealso: DMLabelPermuteValues(), DMLabel, DM, DMLabelPermute(), DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelRewriteValues
PETSc.LibPETSc.DMLabelSetDefaultValue — Method
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- aDMLabelobject
Output Parameter:
defaultValue- the default value
Level: beginner
-seealso: DMLabel, DM, DMLabelGetDefaultValue(), DMLabelGetValue(), DMLabelSetValue()
External Links
- PETSc Manual:
DM/DMLabelSetDefaultValue
PETSc.LibPETSc.DMLabelSetStratumBounds — Method
DMLabelSetStratumBounds(petsclib::PetscLibType,label::DMLabel, value::PetscInt, pStart::PetscInt, pEnd::PetscInt)Efficiently give a contiguous set of points a given label value
Not Collective
Input Parameters:
label- TheDMLabelvalue- The label value for all pointspStart- The first pointpEnd- A point beyond all marked points
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelSetStratumIS(), DMLabelGetStratumIS()
External Links
- PETSc Manual:
DM/DMLabelSetStratumBounds
PETSc.LibPETSc.DMLabelSetStratumIS — Method
DMLabelSetStratumIS(petsclib::PetscLibType,label::DMLabel, value::PetscInt, is::IS)Set the stratum points using an IS
Not Collective
Input Parameters:
label- theDMLabelvalue- the stratum valueis- The stratum points
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelSetStratumIS
PETSc.LibPETSc.DMLabelSetType — Method
DMLabelSetType(petsclib::PetscLibType,label::DMLabel, method::DMLabelType)Sets the particular implementation for a label.
Collective
Input Parameters:
label- The labelmethod- 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 seeDMLabelType
Level: intermediate
-seealso: DMLabel, DM, DMLabelGetType(), DMLabelCreate()
External Links
- PETSc Manual:
DM/DMLabelSetType
PETSc.LibPETSc.DMLabelSetUp — Method
DMLabelSetUp(petsclib::PetscLibType,label::DMLabel)SetUp a DMLabel object
Collective
Input Parameters:
label- TheDMLabel
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelDestroy()
External Links
- PETSc Manual:
DM/DMLabelSetUp
PETSc.LibPETSc.DMLabelSetValue — Method
DMLabelSetValue(petsclib::PetscLibType,label::DMLabel, point::PetscInt, value::PetscInt)Set the value a label assigns to a point. If the value is the same as the label's default value (which is initially be changed with DMLabelSetDefaultValue() to something different), then this function will do nothing.
Not Collective
Input Parameters:
label- theDMLabelpoint- the pointvalue- The point value
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelGetValue(), DMLabelClearValue(), DMLabelGetDefaultValue(), DMLabelSetDefaultValue()
External Links
- PETSc Manual:
DM/DMLabelSetValue
PETSc.LibPETSc.DMLabelStratumHasPoint — Method
contains::PetscBool = DMLabelStratumHasPoint(petsclib::PetscLibType,label::DMLabel, value::PetscInt, point::PetscInt)Return true if the stratum contains a point
Not Collective
Input Parameters:
label- theDMLabelvalue- the stratum valuepoint- the point
Output Parameter:
contains- true if the stratum contains the point
Level: intermediate
-seealso: DMLabel, DM, DMLabelCreate(), DMLabelSetValue(), DMLabelClearValue()
External Links
- PETSc Manual:
DM/DMLabelStratumHasPoint
PETSc.LibPETSc.DMLabelView — Method
DMLabelView(petsclib::PetscLibType,label::DMLabel, viewer::PetscViewer)View the label
Collective
Input Parameters:
label- TheDMLabelviewer- ThePetscViewer
Level: intermediate
-seealso: DMLabel, PetscViewer, DM, DMLabelCreate(), DMLabelDestroy()
External Links
- PETSc Manual:
DM/DMLabelView