Date: 2026-07-30T21:13:58+00:00

Actual source code: petscao.h

      1: #pragma once

      3: #include <petscis.h>

      5: /* MANSEC = Vec */
      6: /* SUBMANSEC = AO */

      8: /*S
      9:    AO - Abstract PETSc object that manages mapping between different global numberings

     11:    Level: intermediate

     13:    Note:
     14:    An application ordering is usually a mapping between an application-centric
     15:    numbering (the ordering that is "natural" for the application) and
     16:    the parallel numbering ($0$ to $n_0-1$ on the first MPI process, $n_0$ to $n_1 - 1$ on the second MPI process, etc)
     17:    that PETSc uses.

     19: .seealso: `AOCreateBasic()`, `AOCreateBasicIS()`, `AOPetscToApplication()`, `AOView()`, `AOApplicationToPetsc()`, `AOType`, `AOSetType()`
     20: S*/
     21: typedef struct _p_AO *AO;

     23: /*J
     24:     AOType - String with the name of a PETSc application ordering type

     26:    Level: beginner

     28: .seealso: `AOSetType()`, `AO`, `AOApplicationToPetsc()`, `AOCreateBasic()`, `AOCreate()`
     29: J*/
     30: typedef const char *AOType;
     31: #define AOBASIC          "basic"
     32: #define AOADVANCED       "advanced"
     33: #define AOMAPPING        "mapping"
     34: #define AOMEMORYSCALABLE "memoryscalable"

     36: /* Logging support */
     37: PETSC_EXTERN PetscClassId AO_CLASSID;

     39: PETSC_EXTERN PetscErrorCode AOInitializePackage(void);
     40: PETSC_EXTERN PetscErrorCode AOFinalizePackage(void);

     42: PETSC_EXTERN PetscErrorCode AOCreate(MPI_Comm, AO *);
     43: PETSC_EXTERN PetscErrorCode AOSetIS(AO, IS, IS);
     44: PETSC_EXTERN PetscErrorCode AOSetFromOptions(AO);

     46: PETSC_EXTERN PetscErrorCode AOCreateBasic(MPI_Comm, PetscInt, const PetscInt[], const PetscInt[], AO *);
     47: PETSC_EXTERN PetscErrorCode AOCreateBasicIS(IS, IS, AO *);
     48: PETSC_EXTERN PetscErrorCode AOCreateMemoryScalable(MPI_Comm, PetscInt, const PetscInt[], const PetscInt[], AO *);
     49: PETSC_EXTERN PetscErrorCode AOCreateMemoryScalableIS(IS, IS, AO *);
     50: PETSC_EXTERN PetscErrorCode AOCreateMapping(MPI_Comm, PetscInt, const PetscInt[], const PetscInt[], AO *);
     51: PETSC_EXTERN PetscErrorCode AOCreateMappingIS(IS, IS, AO *);

     53: PETSC_EXTERN PetscErrorCode AOView(AO, PetscViewer);
     54: PETSC_EXTERN PetscErrorCode AOViewFromOptions(AO, PetscObject, const char[]);
     55: PETSC_EXTERN PetscErrorCode AODestroy(AO *);

     57: /* Dynamic creation and loading functions */
     58: PETSC_EXTERN PetscErrorCode AOSetType(AO, AOType);
     59: PETSC_EXTERN PetscErrorCode AOGetType(AO, AOType *);

     61: PETSC_EXTERN PetscErrorCode AORegister(const char[], PetscErrorCode (*)(AO));
     62: PETSC_EXTERN PetscErrorCode AORegisterAll(void);

     64: PETSC_EXTERN PetscErrorCode AOPetscToApplication(AO, PetscInt, PetscInt[]);
     65: PETSC_EXTERN PetscErrorCode AOApplicationToPetsc(AO, PetscInt, PetscInt[]);
     66: PETSC_EXTERN PetscErrorCode AOPetscToApplicationIS(AO, IS);
     67: PETSC_EXTERN PetscErrorCode AOApplicationToPetscIS(AO, IS);

     69: PETSC_EXTERN PetscErrorCode AOPetscToApplicationPermuteInt(AO, PetscInt, PetscInt[]);
     70: PETSC_EXTERN PetscErrorCode AOApplicationToPetscPermuteInt(AO, PetscInt, PetscInt[]);
     71: PETSC_EXTERN PetscErrorCode AOPetscToApplicationPermuteReal(AO, PetscInt, PetscReal[]);
     72: PETSC_EXTERN PetscErrorCode AOApplicationToPetscPermuteReal(AO, PetscInt, PetscReal[]);

     74: PETSC_EXTERN PetscErrorCode AOMappingHasApplicationIndex(AO, PetscInt, PetscBool *);
     75: PETSC_EXTERN PetscErrorCode AOMappingHasPetscIndex(AO, PetscInt, PetscBool *);