PCASMWeightedSetScaling#

Sets the diagonal weights for the overlapping local corrections in weighted additive Schwarz.

Synopsis#

#include "petscpc.h" 
PetscErrorCode PCASMWeightedSetScaling(PC pc, PetscInt n, Vec scaling[])

Logically Collective

Input Parameters#

  • pc - the PCASM preconditioner

  • n - the number of local subdomains

  • scaling - one local scaling Vec per overlapping subdomain

Notes#

Call PCSetUp() before this routine, then use PCASMGetLocalSubdomains() to obtain the final overlapping index sets. Each vector must have a single-process communicator and the same length and ordering as its corresponding overlapping index set, after overlap expansion and sorting. Its vector type must match the local solver vectors. Compatible vectors can be created with MatCreateVecs() from the corresponding matrix returned by PCASMGetLocalSubmatrices(). These are local subdomain vectors, not vectors in the parallel global layout. Select PC_ASM_WEIGHTED with PCASMSetType() or -pc_asm_type weighted to use the weights. The weights are ignored by the other ASM types.

With restriction operators \(R_i\), local solvers \(A_i^{-1}\), and \(D_i = \text{diag}(scaling[i])\), the action is \(B = \sum_i R_i^T D_i A_i^{-1} R_i\). PETSc uses the supplied weights as-is, without checking whether they are real, non-negative, or satisfy \(\sum_i R_i^T D_i R_i = I\). The PC increments the reference count of the vectors but does not copy them. PCReset() discards the weights along with the subdomains. Alternatively, use PCASMWeightedSetComputeScaling() to fill internally-created vectors during PCSetUp().

Example Usage#

  KSPGetPC(ksp, &pc);
  PCASMSetType(pc, PC_ASM_WEIGHTED);
  PCSetUp(pc);
  PCASMGetLocalSubmatrices(pc, &n, &submat);
  PCASMGetLocalSubdomains(pc, NULL, &is, NULL);
  for (i = 0; i < n; i++) {
    MatCreateVecs(submat[i], &scaling[i], NULL); // a Vec of the right size and type
    // fill scaling[i] in the local ordering of is[i]
  }
  PCASMWeightedSetScaling(pc, n, scaling);

See Also#

KSP: Linear System Solvers, PCASM, PCASMType, PCASMSetType(), PCASMWeightedGetScaling(), PCASMGetLocalSubdomains(), PCASMGetLocalSubmatrices(), PCASMSetLocalSubdomains(), PCASMSetLocalType()

Level#

intermediate

Location#

src/ksp/pc/impls/asm/asm.c

Examples#

src/ksp/ksp/tutorials/ex8.c
src/ksp/pc/tests/ex13.c
src/ksp/pc/tests/ex13f.F90

Implementations#

PCASMWeightedSetScaling_ASM() in src/ksp/pc/impls/asm/asm.c


Index of all PC routines
Table of Contents for all manual pages
Index of all manual pages