Date: 2025-03-28T21:10:40+00:00

Actual source code: petscao.h

      1: #pragma once

      3: #include <petscis.h>

      5: /* SUBMANSEC = AO */

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

     10:    Level: intermediate

     12:    Note:
     13:    An application ordering is usually a mapping between an application-centric
     14:    numbering (the ordering that is "natural" for the application) and
     15:    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)
     16:    that PETSc uses.

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

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

     25:    Level: beginner

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

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

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

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

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

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

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

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

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

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

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