DMForest (Adaptive Mesh Refinement)
DMForest manages adaptive mesh refinement (AMR) using forest-of-octrees (2D: quadtrees, 3D: octrees). It provides hierarchical mesh adaptation with efficient parallel implementation.
Overview
DMForest provides:
- Adaptive mesh refinement and coarsening
- Forest-of-octrees topology
- Integration with p4est library
- Multi-level mesh hierarchies for multigrid
- Metric-based adaptation
- Label-based adaptation
Basic Usage Pattern
using PETSc, MPI
# Initialize MPI and PETSc
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
# Create a DMForest
forest = LibPETSc.DMCreate(petsclib, MPI.COMM_WORLD)
LibPETSc.DMSetType(petsclib, forest, "forest") # String convenience wrapper
# Set^ the geometric/topological dimension (e.g., 2 for a surface)
LibPETSc.DMSetDimension(petsclib, forest, 2)
# Set forest topology (e.g., unit square/cube)
# Set topology by name (e.g., "brick")
LibPETSc.DMForestSetTopology(petsclib, forest, "brick")
# Set base DM (initial coarse mesh) using a simple DMPlex box mesh
base_dm = LibPETSc.DMPlexCreateBoxMesh(
petsclib, MPI.COMM_WORLD, 2, LibPETSc.PETSC_FALSE,
[2, 2], [0.0, 0.0], [1.0, 1.0], [LibPETSc.DM_BOUNDARY_NONE, LibPETSc.DM_BOUNDARY_NONE], LibPETSc.PETSC_TRUE, 0, LibPETSc.PETSC_FALSE
)
LibPETSc.DMForestSetBaseDM(petsclib, forest, base_dm)
# Set initial refinement level
LibPETSc.DMForestSetInitialRefinement(petsclib, forest, 2)
# Ensure adjacency dimension and partition overlap are non-negative (some builds may leave them unset)
LibPETSc.DMForestSetAdjacencyDimension(petsclib, forest, 0)
LibPETSc.DMForestSetPartitionOverlap(petsclib, forest, 0)
# Set up
# (Skip DMSetFromOptions in this simple example to avoid parsing unexpected runtime options)
LibPETSc.DMSetUp(petsclib, forest)
# Adapt based on some criterion
# Create adapted forest (returns via out-parameter)
tdm = LibPETSc.PetscDM(C_NULL, petsclib)
LibPETSc.DMForestTemplate(petsclib, forest, MPI.COMM_WORLD, tdm)
adapted = tdm
# `adapted` now points to the adapted DM (if any) and should be checked before use.
# Cleanup
LibPETSc.DMDestroy(petsclib, adapted)
LibPETSc.DMDestroy(petsclib, forest)
LibPETSc.DMDestroy(petsclib, base_dm)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()DMForest Functions
PETSc.LibPETSc.DMForestGetAdaptivityForest — Method
DMForestGetAdaptivityForest(petsclib::PetscLibType,dm::PetscDM, adapt::PetscDM)Get the forest from which the current forest is adapted.
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
adapt- the forest from whichdmis/was adapted
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetAdaptivityForest(), DMForestSetAdaptivityPurpose()
External Links
- PETSc Manual:
DMForest/DMForestGetAdaptivityForest
PETSc.LibPETSc.DMForestGetAdaptivityLabel — Method
DMForestGetAdaptivityLabel(petsclib::PetscLibType,dm::PetscDM, adaptLabel::DMLabel)Get the label of the pre holds the adaptation flags (refinement, coarsening, or some combination).
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
adaptLabel- the name of the label in the pre-adaptation forest
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetAdaptivityLabel()
External Links
- PETSc Manual:
DMForest/DMForestGetAdaptivityLabel
PETSc.LibPETSc.DMForestGetAdaptivityPurpose — Method
DMForestGetAdaptivityPurpose(petsclib::PetscLibType,dm::PetscDM, purpose::DMAdaptFlag)Get whether the current DM is being adapted from its source (set with DMForestSetAdaptivityForest()) for the purpose of refinement (DM_ADAPT_REFINE), coarsening (DM_ADAPT_COARSEN), coarsening only the last level (DM_ADAPT_COARSEN_LAST) or undefined (DM_ADAPT_DETERMINE).
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
purpose- the adaptivity purpose
Level: advanced
-seealso: DM, DMFOREST, DMForestTemplate(), DMForestSetAdaptivityForest(), DMForestGetAdaptivityForest(), DMAdaptFlag
External Links
- PETSc Manual:
DMForest/DMForestGetAdaptivityPurpose
PETSc.LibPETSc.DMForestGetAdaptivitySF — Method
DMForestGetAdaptivitySF(petsclib::PetscLibType,dm::PetscDM, preCoarseToFine::PetscSF, coarseToPreFine::PetscSF)Get PetscSFs that relate the pre post-adaptation forest.
Not Collective
Input Parameter:
dm- the post-adaptation forest
Output Parameters:
preCoarseToFine- pre-adaptation coarse cells to post-adaptation fine cells: BCast goes from pre- to post-coarseToPreFine- post-adaptation coarse cells to pre-adaptation fine cells: BCast goes from post- to pre-
Level: advanced
-seealso: DM, DMFOREST, DMForestGetComputeAdaptivitySF(), DMForestSetComputeAdaptivitySF()
External Links
- PETSc Manual:
DMForest/DMForestGetAdaptivitySF
PETSc.LibPETSc.DMForestGetAdaptivityStrategy — Method
DMForestGetAdaptivityStrategy(petsclib::PetscLibType,dm::PetscDM, adaptStrategy::DMForestAdaptivityStrategy)Get the strategy for combining adaptivity labels from multiple processes.
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
adaptStrategy- the adaptivity strategy (defaultDMFORESTADAPTALL)
Level: advanced
-seealso: DM, DMFOREST, DMFORESTADAPTALL, DMFORESTADAPTANY, DMForestSetAdaptivityStrategy()
External Links
- PETSc Manual:
DMForest/DMForestGetAdaptivityStrategy
PETSc.LibPETSc.DMForestGetAdaptivitySuccess — Method
success::PetscBool = DMForestGetAdaptivitySuccess(petsclib::PetscLibType,dm::PetscDM)Return whether the requested adaptation (refinement, coarsening, repartitioning, etc.) was successful.
Collective
Input Parameter:
dm- the post-adaptation forest
Output Parameter:
success-PETSC_TRUEif the post-adaptation forest is different from the pre-adaptation forest.
Level: intermediate
-seealso: DM, DMFOREST
External Links
- PETSc Manual:
DMForest/DMForestGetAdaptivitySuccess
PETSc.LibPETSc.DMForestGetAdjacencyCodimension — Method
adjCodim::PetscInt = DMForestGetAdjacencyCodimension(petsclib::PetscLibType,dm::PetscDM)Like DMForestGetAdjacencyDimension(), but specified as a co e.g., adjacency based on facets can be specified by codimension 1 in all cases)
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
adjCodim- default isthe dimension of the forest (seeDMGetDimension()), since this is the codimension of vertices
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetAdjacencyCodimension(), DMForestGetAdjacencyDimension()
External Links
- PETSc Manual:
DMForest/DMForestGetAdjacencyCodimension
PETSc.LibPETSc.DMForestGetAdjacencyDimension — Method
adjDim::PetscInt = DMForestGetAdjacencyDimension(petsclib::PetscLibType,dm::PetscDM)Get the dimension of interface points that determine cell adjacency (for the purposes of partitioning and overlap).
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
adjDim- default 0 (i.e., vertices determine adjacency)
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetAdjacencyDimension(), DMForestGetAdjacencyCodimension(), DMForestSetPartitionOverlap()
External Links
- PETSc Manual:
DMForest/DMForestGetAdjacencyDimension
PETSc.LibPETSc.DMForestGetBaseDM — Method
DMForestGetBaseDM(petsclib::PetscLibType,dm::PetscDM, base::PetscDM)Get the base DM of a DMFOREST
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
base- the baseDMof the forest
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetBaseDM()
External Links
- PETSc Manual:
DMForest/DMForestGetBaseDM
PETSc.LibPETSc.DMForestGetCellChart — Method
cStart::PetscInt,cEnd::PetscInt = DMForestGetCellChart(petsclib::PetscLibType,dm::PetscDM)After the setup phase, get the local half
Not Collective
Input Parameter:
dm- the forest
Output Parameters:
cStart- the first cell on this processcEnd- one after the final cell on this process
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetCellSF()
External Links
- PETSc Manual:
DMForest/DMForestGetCellChart
PETSc.LibPETSc.DMForestGetCellSF — Method
DMForestGetCellSF(petsclib::PetscLibType,dm::PetscDM, cellSF::PetscSF)After the setup phase, get the PetscSF for overlapping cells between processes
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
cellSF- thePetscSF
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetCellChart()
External Links
- PETSc Manual:
DMForest/DMForestGetCellSF
PETSc.LibPETSc.DMForestGetCellWeightFactor — Method
weightsFactor::PetscReal = DMForestGetCellWeightFactor(petsclib::PetscLibType,dm::PetscDM)Get the factor by which the level of refinement changes the cell weight (see DMForestSetCellWeights()) when calculating partitions.
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
weightsFactor- default 1.
Level: advanced
-seealso: DM, DMFOREST, DMForestSetCellWeightFactor(), DMForestSetCellWeights()
External Links
- PETSc Manual:
DMForest/DMForestGetCellWeightFactor
PETSc.LibPETSc.DMForestGetCellWeights — Method
weights::PetscReal = DMForestGetCellWeights(petsclib::PetscLibType,dm::PetscDM)Get the weights assigned to each of the cells (see DMForestGetCellChart()) of the current process: weights are used to determine parallel partitioning.
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
weights- the array of weights for all cells, orNULLto indicate each cell has weight 1.
Level: advanced
-seealso: DM, DMFOREST, DMForestSetCellWeights(), DMForestSetWeightCapacity()
External Links
- PETSc Manual:
DMForest/DMForestGetCellWeights
PETSc.LibPETSc.DMForestGetComputeAdaptivitySF — Method
computeSF::PetscBool = DMForestGetComputeAdaptivitySF(petsclib::PetscLibType,dm::PetscDM)Get whether transfer PetscSFs should be computed relating the cells of the pre-adaptation forest to the post-adaptiation forest. After DMSetUp() is called, these transfer PetscSFs can be accessed with DMForestGetAdaptivitySF().
Not Collective
Input Parameter:
dm- the post-adaptation forest
Output Parameter:
computeSF- defaultPETSC_TRUE
Level: advanced
-seealso: DM, DMFOREST, DMForestSetComputeAdaptivitySF(), DMForestGetAdaptivitySF()
External Links
- PETSc Manual:
DMForest/DMForestGetComputeAdaptivitySF
PETSc.LibPETSc.DMForestGetGradeFactor — Method
grade::PetscInt = DMForestGetGradeFactor(petsclib::PetscLibType,dm::PetscDM)Get the desired amount of grading in the mesh, e.g. give 2 to indicate that the diameter of neighboring cells should differ by at most a factor of 2. Subtypes of DMFOREST may only support one particular choice of grading factor.
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
grade- the grading factor
Level: advanced
-seealso: DM, DMFOREST, DMForestSetGradeFactor()
External Links
- PETSc Manual:
DMForest/DMForestGetGradeFactor
PETSc.LibPETSc.DMForestGetInitialRefinement — Method
initRefinement::PetscInt = DMForestGetInitialRefinement(petsclib::PetscLibType,dm::PetscDM)Get the initial level of refinement (relative to the base DM, see DMForestGetBaseDM()) allowed in the forest.
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
initRefinement- defaultPETSC_DEFAULT(interpreted by the subtype ofDMFOREST)
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetMinimumRefinement(), DMForestSetMaximumRefinement(), DMForestGetBaseDM()
External Links
- PETSc Manual:
DMForest/DMForestGetInitialRefinement
PETSc.LibPETSc.DMForestGetMaximumRefinement — Method
maxRefinement::PetscInt = DMForestGetMaximumRefinement(petsclib::PetscLibType,dm::PetscDM)Get the maximum level of refinement (relative to the base DM, see DMForestGetBaseDM()) allowed in the forest. If the forest is being created by refining a previous forest (see DMForestGetAdaptivityForest()), this limits the amount of refinement.
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
maxRefinement- defaultPETSC_DEFAULT(interpreted by the subtype ofDMFOREST)
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetMaximumRefinement(), DMForestGetMinimumRefinement(), DMForestGetInitialRefinement(), DMForestGetBaseDM(), DMForestGetAdaptivityForest()
External Links
- PETSc Manual:
DMForest/DMForestGetMaximumRefinement
PETSc.LibPETSc.DMForestGetMinimumRefinement — Method
minRefinement::PetscInt = DMForestGetMinimumRefinement(petsclib::PetscLibType,dm::PetscDM)Get the minimum level of refinement (relative to the base DM, see DMForestGetBaseDM()) allowed in the forest. If the forest is being created by coarsening a previous forest (see DMForestGetAdaptivityForest()), this limits the amount of coarsening.
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
minRefinement- defaultPETSC_DEFAULT(interpreted by the subtype ofDMFOREST)
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetMinimumRefinement(), DMForestGetMaximumRefinement(), DMForestGetInitialRefinement(), DMForestGetBaseDM(), DMForestGetAdaptivityForest()
External Links
- PETSc Manual:
DMForest/DMForestGetMinimumRefinement
PETSc.LibPETSc.DMForestGetPartitionOverlap — Method
overlap::PetscInt = DMForestGetPartitionOverlap(petsclib::PetscLibType,dm::PetscDM)Get the amount of cell
0 indicating subdomains that are expanded by that many iterations of adding adjacent cells
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
overlap- default 0
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetAdjacencyDimension(), DMForestSetAdjacencyCodimension()
External Links
- PETSc Manual:
DMForest/DMForestGetPartitionOverlap
PETSc.LibPETSc.DMForestGetTopology — Method
DMForestGetTopology(petsclib::PetscLibType,dm::PetscDM, topology::DMForestTopology)Get a string describing the topology of a DMFOREST.
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
topology- the topology of the forest (e.g., 'cube', 'shell')
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetTopology()
External Links
- PETSc Manual:
DMForest/DMForestGetTopology
PETSc.LibPETSc.DMForestGetWeightCapacity — Method
capacity::PetscReal = DMForestGetWeightCapacity(petsclib::PetscLibType,dm::PetscDM)Set the capacity of the current process when repartitioning a pre DMForestGetAdaptivityForest()).
Not Collective
Input Parameter:
dm- the forest
Output Parameter:
capacity- this process's capacity
Level: advanced
-seealso: DM, DMFOREST, DMForestSetWeightCapacity(), DMForestSetCellWeights(), DMForestSetCellWeightFactor()
External Links
- PETSc Manual:
DMForest/DMForestGetWeightCapacity
PETSc.LibPETSc.DMForestRegisterType — Method
DMForestRegisterType(petsclib::PetscLibType,name::DMType)Registers a DMType as a subtype of DMFOREST (so that DMIsForest() will be correct)
Not Collective
Input Parameter:
name- the name of the type
Level: advanced
-seealso: DMFOREST, DMIsForest()
External Links
- PETSc Manual:
DMForest/DMForestRegisterType
PETSc.LibPETSc.DMForestSetAdaptivityForest — Method
DMForestSetAdaptivityForest(petsclib::PetscLibType,dm::PetscDM, adapt::PetscDM)During the pre current forest will be adapted (e.g., the current forest will be refined/coarsened/repartitioned from it) in DMSetUp().
Logically Collective
Input Parameters:
dm- the new forest, which will be constructed from adaptadapt- the old forest
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetAdaptivityForest(), DMForestSetAdaptivityPurpose()
External Links
- PETSc Manual:
DMForest/DMForestSetAdaptivityForest
PETSc.LibPETSc.DMForestSetAdaptivityLabel — Method
DMForestSetAdaptivityLabel(petsclib::PetscLibType,dm::PetscDM, adaptLabel::DMLabel)During the pre DMForestGetAdaptivityForest()) that holds the adaptation flags (refinement, coarsening, or some combination).
Logically Collective
Input Parameters:
dm- the forestadaptLabel- the label in the pre-adaptation forest
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetAdaptivityLabel()
External Links
- PETSc Manual:
DMForest/DMForestSetAdaptivityLabel
PETSc.LibPETSc.DMForestSetAdaptivityPurpose — Method
DMForestSetAdaptivityPurpose(petsclib::PetscLibType,dm::PetscDM, purpose::DMAdaptFlag)During the pre source (set with DMForestSetAdaptivityForest()) for the purpose of refinement (DM_ADAPT_REFINE), coarsening (DM_ADAPT_COARSEN), or undefined (DM_ADAPT_DETERMINE).
Logically Collective
Input Parameters:
dm- the forestpurpose- the adaptivity purpose
Level: advanced
-seealso: DM, DMFOREST, DMForestTemplate(), DMForestSetAdaptivityForest(), DMForestGetAdaptivityForest(), DMAdaptFlag
External Links
- PETSc Manual:
DMForest/DMForestSetAdaptivityPurpose
PETSc.LibPETSc.DMForestSetAdaptivityStrategy — Method
DMForestSetAdaptivityStrategy(petsclib::PetscLibType,dm::PetscDM, adaptStrategy::DMForestAdaptivityStrategy)During the pre
Logically Collective
Input Parameters:
dm- the forestadaptStrategy- defaultDMFORESTADAPTALL
Level: advanced
-seealso: DM, DMFOREST, DMForestGetAdaptivityStrategy(), DMFORESTADAPTALL, DMFORESTADAPTANY
External Links
- PETSc Manual:
DMForest/DMForestSetAdaptivityStrategy
PETSc.LibPETSc.DMForestSetAdjacencyCodimension — Method
DMForestSetAdjacencyCodimension(petsclib::PetscLibType,dm::PetscDM, adjCodim::PetscInt)Like DMForestSetAdjacencyDimension(), but specified as a co e.g., adjacency based on facets can be specified by codimension 1 in all cases)
Logically Collective
Input Parameters:
dm- the forestadjCodim- default is the dimension of the forest (seeDMGetDimension()), since this is the codimension of vertices
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetAdjacencyCodimension(), DMForestSetAdjacencyDimension()
External Links
- PETSc Manual:
DMForest/DMForestSetAdjacencyCodimension
PETSc.LibPETSc.DMForestSetAdjacencyDimension — Method
DMForestSetAdjacencyDimension(petsclib::PetscLibType,dm::PetscDM, adjDim::PetscInt)During the pre cell adjacency (for the purposes of partitioning and overlap).
Logically Collective
Input Parameters:
dm- the forestadjDim- default 0 (i.e., vertices determine adjacency)
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetAdjacencyDimension(), DMForestSetAdjacencyCodimension(), DMForestSetPartitionOverlap()
External Links
- PETSc Manual:
DMForest/DMForestSetAdjacencyDimension
PETSc.LibPETSc.DMForestSetBaseCoordinateMapping — Method
DMForestSetBaseCoordinateMapping(petsclib::PetscLibType,dm::PetscDM, func::external, ctx::Cvoid)External Links
- PETSc Manual:
DMForest/DMForestSetBaseCoordinateMapping
PETSc.LibPETSc.DMForestSetBaseDM — Method
DMForestSetBaseDM(petsclib::PetscLibType,dm::PetscDM, base::PetscDM)During the pre DMFOREST forest.
Logically Collective
Input Parameters:
dm- the forestbase- the baseDMof the forest
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetBaseDM()
External Links
- PETSc Manual:
DMForest/DMForestSetBaseDM
PETSc.LibPETSc.DMForestSetCellWeightFactor — Method
DMForestSetCellWeightFactor(petsclib::PetscLibType,dm::PetscDM, weightsFactor::PetscReal)During the pre the cell weight (see DMForestSetCellWeights()) when calculating partitions.
Logically Collective
Input Parameters:
dm- the forestweightsFactor- default 1.
Level: advanced
-seealso: DM, DMFOREST, DMForestGetCellWeightFactor(), DMForestSetCellWeights()
External Links
- PETSc Manual:
DMForest/DMForestSetCellWeightFactor
PETSc.LibPETSc.DMForestSetCellWeights — Method
DMForestSetCellWeights(petsclib::PetscLibType,dm::PetscDM, weights::Vector{PetscReal}, copyMode::PetscCopyMode)Set the weights assigned to each of the cells (see DMForestGetCellChart()) of the current process: weights are used to determine parallel partitioning.
Logically Collective
Input Parameters:
dm- the forestweights- the array of weights (seeDMForestSetWeightCapacity()) for all cells, orNULLto indicate each cell has weight 1.copyMode- how weights should reference weights
Level: advanced
-seealso: DM, DMFOREST, DMForestGetCellWeights(), DMForestSetWeightCapacity()
External Links
- PETSc Manual:
DMForest/DMForestSetCellWeights
PETSc.LibPETSc.DMForestSetComputeAdaptivitySF — Method
DMForestSetComputeAdaptivitySF(petsclib::PetscLibType,dm::PetscDM, computeSF::PetscBool)During the pre relating the cells of the pre-adaptation forest to the post-adaptiation forest.
Logically Collective
Input Parameters:
dm- the post-adaptation forestcomputeSF- defaultPETSC_TRUE
Level: advanced
-seealso: DM, DMFOREST, DMForestGetComputeAdaptivitySF(), DMForestGetAdaptivitySF()
External Links
- PETSc Manual:
DMForest/DMForestSetComputeAdaptivitySF
PETSc.LibPETSc.DMForestSetGradeFactor — Method
DMForestSetGradeFactor(petsclib::PetscLibType,dm::PetscDM, grade::PetscInt)During the pre mesh, e.g. give 2 to indicate that the diameter of neighboring cells should differ by at most a factor of 2.
Logically Collective
Input Parameters:
dm- the forestgrade- the grading factor
Level: advanced
-seealso: DM, DMFOREST, DMForestGetGradeFactor()
External Links
- PETSc Manual:
DMForest/DMForestSetGradeFactor
PETSc.LibPETSc.DMForestSetInitialRefinement — Method
DMForestSetInitialRefinement(petsclib::PetscLibType,dm::PetscDM, initRefinement::PetscInt)During the pre DM, see DMForestGetBaseDM()) allowed in the forest.
Logically Collective
Input Parameters:
dm- the forestinitRefinement- defaultPETSC_DEFAULT(interpreted by the subtype ofDMFOREST)
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetMinimumRefinement(), DMForestSetMaximumRefinement(), DMForestGetBaseDM()
External Links
- PETSc Manual:
DMForest/DMForestSetInitialRefinement
PETSc.LibPETSc.DMForestSetMaximumRefinement — Method
DMForestSetMaximumRefinement(petsclib::PetscLibType,dm::PetscDM, maxRefinement::PetscInt)During the pre DM, see DMForestGetBaseDM()) allowed in the forest. If the forest is being created by refining a previous forest (see DMForestGetAdaptivityForest()), this limits the amount of refinement.
Logically Collective
Input Parameters:
dm- the forestmaxRefinement- defaultPETSC_DEFAULT(interpreted by the subtype ofDMFOREST)
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetMinimumRefinement(), DMForestSetInitialRefinement(), DMForestGetBaseDM(), DMForestGetAdaptivityDM()
External Links
- PETSc Manual:
DMForest/DMForestSetMaximumRefinement
PETSc.LibPETSc.DMForestSetMinimumRefinement — Method
DMForestSetMinimumRefinement(petsclib::PetscLibType,dm::PetscDM, minRefinement::PetscInt)During the pre DM, see DMForestGetBaseDM()) allowed in the forest. If the forest is being created by coarsening a previous forest (see DMForestGetAdaptivityForest()) this limits the amount of coarsening.
Logically Collective
Input Parameters:
dm- the forestminRefinement- defaultPETSC_DEFAULT(interpreted by the subtype ofDMFOREST)
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetMinimumRefinement(), DMForestSetMaximumRefinement(), DMForestSetInitialRefinement(), DMForestGetBaseDM(), DMForestGetAdaptivityForest()
External Links
- PETSc Manual:
DMForest/DMForestSetMinimumRefinement
PETSc.LibPETSc.DMForestSetPartitionOverlap — Method
DMForestSetPartitionOverlap(petsclib::PetscLibType,dm::PetscDM, overlap::PetscInt)During the pre partitions of a forest, with values > 0 indicating subdomains that are expanded by that many iterations of adding adjacent cells
Logically Collective
Input Parameters:
dm- the forestoverlap- default 0
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetPartitionOverlap(), DMForestSetAdjacencyDimension(), DMForestSetAdjacencyCodimension()
External Links
- PETSc Manual:
DMForest/DMForestSetPartitionOverlap
PETSc.LibPETSc.DMForestSetTopology — Method
DMForestSetTopology(petsclib::PetscLibType,dm::PetscDM, topology::DMForestTopology)Set the topology of a DMFOREST during the pre "cube", "shell") and can be interpreted by subtypes of DMFOREST) to construct the base DM of a forest during DMSetUp().
Logically collectiv
Input Parameters:
dm- the foresttopology- the topology of the forest
Level: intermediate
-seealso: DM, DMFOREST, DMForestGetTopology(), DMForestSetBaseDM()
External Links
- PETSc Manual:
DMForest/DMForestSetTopology
PETSc.LibPETSc.DMForestSetWeightCapacity — Method
DMForestSetWeightCapacity(petsclib::PetscLibType,dm::PetscDM, capacity::PetscReal)During the pre a pre-adaptation forest (see DMForestGetAdaptivityForest()).
Logically Collective
Input Parameters:
dm- the forestcapacity- this process's capacity
Level: advanced
-seealso: DM, DMFOREST, DMForestGetWeightCapacity(), DMForestSetCellWeights(), DMForestSetCellWeightFactor()
External Links
- PETSc Manual:
DMForest/DMForestSetWeightCapacity
PETSc.LibPETSc.DMForestTemplate — Method
DMForestTemplate(petsclib::PetscLibType,dm::PetscDM, comm::MPI_Comm, tdm::PetscDM)Create a new DM that will be adapted from a source DM.
Collective
Input Parameters:
dm- the sourceDMobjectcomm- the communicator for the newDM(this communicator is currently ignored, but is present so thatDMForestTemplate()can be used withinDMCoarsen())
Output Parameter:
tdm- the newDMobject
Level: intermediate
-seealso: DM, DMFOREST, DMForestSetAdaptivityForest()
External Links
- PETSc Manual:
DMForest/DMForestTemplate
PETSc.LibPETSc.DMForestTransferVec — Method
DMForestTransferVec(petsclib::PetscLibType,dmIn::PetscDM, vecIn::PetscVec, dmOut::PetscDM, vecOut::PetscVec, useBCs::PetscBool, time::PetscReal)External Links
- PETSc Manual:
DMForest/DMForestTransferVec
PETSc.LibPETSc.DMForestTransferVecFromBase — Method
DMForestTransferVecFromBase(petsclib::PetscLibType,dm::PetscDM, vecIn::PetscVec, vecOut::PetscVec)External Links
- PETSc Manual:
DMForest/DMForestTransferVecFromBase