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.DMForestGetAdaptivityForestMethod
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 which dm is/was adapted

Level: intermediate

-seealso: DM, DMFOREST, DMForestSetAdaptivityForest(), DMForestSetAdaptivityPurpose()

External Links

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

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

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

source
PETSc.LibPETSc.DMForestGetAdaptivityStrategyMethod
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 (default DMFORESTADAPTALL)

Level: advanced

-seealso: DM, DMFOREST, DMFORESTADAPTALL, DMFORESTADAPTANY, DMForestSetAdaptivityStrategy()

External Links

source
PETSc.LibPETSc.DMForestGetAdaptivitySuccessMethod
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_TRUE if the post-adaptation forest is different from the pre-adaptation forest.

Level: intermediate

-seealso: DM, DMFOREST

External Links

source
PETSc.LibPETSc.DMForestGetAdjacencyCodimensionMethod
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 (see DMGetDimension()), since this is the codimension of vertices

Level: intermediate

-seealso: DM, DMFOREST, DMForestSetAdjacencyCodimension(), DMForestGetAdjacencyDimension()

External Links

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

source
PETSc.LibPETSc.DMForestGetBaseDMMethod
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 base DM of the forest

Level: intermediate

-seealso: DM, DMFOREST, DMForestSetBaseDM()

External Links

source
PETSc.LibPETSc.DMForestGetCellChartMethod
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 process
  • cEnd - one after the final cell on this process

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetCellSF()

External Links

source
PETSc.LibPETSc.DMForestGetCellSFMethod
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 - the PetscSF

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetCellChart()

External Links

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

source
PETSc.LibPETSc.DMForestGetCellWeightsMethod
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, or NULL to indicate each cell has weight 1.

Level: advanced

-seealso: DM, DMFOREST, DMForestSetCellWeights(), DMForestSetWeightCapacity()

External Links

source
PETSc.LibPETSc.DMForestGetComputeAdaptivitySFMethod
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 - default PETSC_TRUE

Level: advanced

-seealso: DM, DMFOREST, DMForestSetComputeAdaptivitySF(), DMForestGetAdaptivitySF()

External Links

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

source
PETSc.LibPETSc.DMForestGetInitialRefinementMethod
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 - default PETSC_DEFAULT (interpreted by the subtype of DMFOREST)

Level: intermediate

-seealso: DM, DMFOREST, DMForestSetMinimumRefinement(), DMForestSetMaximumRefinement(), DMForestGetBaseDM()

External Links

source
PETSc.LibPETSc.DMForestGetMaximumRefinementMethod
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 - default PETSC_DEFAULT (interpreted by the subtype of DMFOREST)

Level: intermediate

-seealso: DM, DMFOREST, DMForestSetMaximumRefinement(), DMForestGetMinimumRefinement(), DMForestGetInitialRefinement(), DMForestGetBaseDM(), DMForestGetAdaptivityForest()

External Links

source
PETSc.LibPETSc.DMForestGetMinimumRefinementMethod
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 - default PETSC_DEFAULT (interpreted by the subtype of DMFOREST)

Level: intermediate

-seealso: DM, DMFOREST, DMForestSetMinimumRefinement(), DMForestGetMaximumRefinement(), DMForestGetInitialRefinement(), DMForestGetBaseDM(), DMForestGetAdaptivityForest()

External Links

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

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

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

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

source
PETSc.LibPETSc.DMForestSetAdaptivityForestMethod
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 adapt
  • adapt - the old forest

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetAdaptivityForest(), DMForestSetAdaptivityPurpose()

External Links

source
PETSc.LibPETSc.DMForestSetAdaptivityLabelMethod
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 forest
  • adaptLabel - the label in the pre-adaptation forest

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetAdaptivityLabel()

External Links

source
PETSc.LibPETSc.DMForestSetAdaptivityPurposeMethod
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 forest
  • purpose - the adaptivity purpose

Level: advanced

-seealso: DM, DMFOREST, DMForestTemplate(), DMForestSetAdaptivityForest(), DMForestGetAdaptivityForest(), DMAdaptFlag

External Links

source
PETSc.LibPETSc.DMForestSetAdaptivityStrategyMethod
DMForestSetAdaptivityStrategy(petsclib::PetscLibType,dm::PetscDM, adaptStrategy::DMForestAdaptivityStrategy)

During the pre

Logically Collective

Input Parameters:

  • dm - the forest
  • adaptStrategy - default DMFORESTADAPTALL

Level: advanced

-seealso: DM, DMFOREST, DMForestGetAdaptivityStrategy(), DMFORESTADAPTALL, DMFORESTADAPTANY

External Links

source
PETSc.LibPETSc.DMForestSetAdjacencyCodimensionMethod
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 forest
  • adjCodim - default is the dimension of the forest (see DMGetDimension()), since this is the codimension of vertices

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetAdjacencyCodimension(), DMForestSetAdjacencyDimension()

External Links

source
PETSc.LibPETSc.DMForestSetAdjacencyDimensionMethod
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 forest
  • adjDim - default 0 (i.e., vertices determine adjacency)

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetAdjacencyDimension(), DMForestSetAdjacencyCodimension(), DMForestSetPartitionOverlap()

External Links

source
PETSc.LibPETSc.DMForestSetBaseDMMethod
DMForestSetBaseDM(petsclib::PetscLibType,dm::PetscDM, base::PetscDM)

During the pre DMFOREST forest.

Logically Collective

Input Parameters:

  • dm - the forest
  • base - the base DM of the forest

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetBaseDM()

External Links

source
PETSc.LibPETSc.DMForestSetCellWeightFactorMethod
DMForestSetCellWeightFactor(petsclib::PetscLibType,dm::PetscDM, weightsFactor::PetscReal)

During the pre the cell weight (see DMForestSetCellWeights()) when calculating partitions.

Logically Collective

Input Parameters:

  • dm - the forest
  • weightsFactor - default 1.

Level: advanced

-seealso: DM, DMFOREST, DMForestGetCellWeightFactor(), DMForestSetCellWeights()

External Links

source
PETSc.LibPETSc.DMForestSetCellWeightsMethod
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 forest
  • weights - the array of weights (see DMForestSetWeightCapacity()) for all cells, or NULL to indicate each cell has weight 1.
  • copyMode - how weights should reference weights

Level: advanced

-seealso: DM, DMFOREST, DMForestGetCellWeights(), DMForestSetWeightCapacity()

External Links

source
PETSc.LibPETSc.DMForestSetComputeAdaptivitySFMethod
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 forest
  • computeSF - default PETSC_TRUE

Level: advanced

-seealso: DM, DMFOREST, DMForestGetComputeAdaptivitySF(), DMForestGetAdaptivitySF()

External Links

source
PETSc.LibPETSc.DMForestSetGradeFactorMethod
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 forest
  • grade - the grading factor

Level: advanced

-seealso: DM, DMFOREST, DMForestGetGradeFactor()

External Links

source
PETSc.LibPETSc.DMForestSetInitialRefinementMethod
DMForestSetInitialRefinement(petsclib::PetscLibType,dm::PetscDM, initRefinement::PetscInt)

During the pre DM, see DMForestGetBaseDM()) allowed in the forest.

Logically Collective

Input Parameters:

  • dm - the forest
  • initRefinement - default PETSC_DEFAULT (interpreted by the subtype of DMFOREST)

Level: intermediate

-seealso: DM, DMFOREST, DMForestSetMinimumRefinement(), DMForestSetMaximumRefinement(), DMForestGetBaseDM()

External Links

source
PETSc.LibPETSc.DMForestSetMaximumRefinementMethod
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 forest
  • maxRefinement - default PETSC_DEFAULT (interpreted by the subtype of DMFOREST)

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetMinimumRefinement(), DMForestSetInitialRefinement(), DMForestGetBaseDM(), DMForestGetAdaptivityDM()

External Links

source
PETSc.LibPETSc.DMForestSetMinimumRefinementMethod
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 forest
  • minRefinement - default PETSC_DEFAULT (interpreted by the subtype of DMFOREST)

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetMinimumRefinement(), DMForestSetMaximumRefinement(), DMForestSetInitialRefinement(), DMForestGetBaseDM(), DMForestGetAdaptivityForest()

External Links

source
PETSc.LibPETSc.DMForestSetPartitionOverlapMethod
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 forest
  • overlap - default 0

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetPartitionOverlap(), DMForestSetAdjacencyDimension(), DMForestSetAdjacencyCodimension()

External Links

source
PETSc.LibPETSc.DMForestSetTopologyMethod
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 forest
  • topology - the topology of the forest

Level: intermediate

-seealso: DM, DMFOREST, DMForestGetTopology(), DMForestSetBaseDM()

External Links

source
PETSc.LibPETSc.DMForestSetWeightCapacityMethod
DMForestSetWeightCapacity(petsclib::PetscLibType,dm::PetscDM, capacity::PetscReal)

During the pre a pre-adaptation forest (see DMForestGetAdaptivityForest()).

Logically Collective

Input Parameters:

  • dm - the forest
  • capacity - this process's capacity

Level: advanced

-seealso: DM, DMFOREST, DMForestGetWeightCapacity(), DMForestSetCellWeights(), DMForestSetCellWeightFactor()

External Links

source
PETSc.LibPETSc.DMForestTemplateMethod
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 source DM object
  • comm - the communicator for the new DM (this communicator is currently ignored, but is present so that DMForestTemplate() can be used within DMCoarsen())

Output Parameter:

  • tdm - the new DM object

Level: intermediate

-seealso: DM, DMFOREST, DMForestSetAdaptivityForest()

External Links

source