1a4963045SJacob Faibussowitsch #pragma once 201e13f73SMatthew G. Knepley 3ac09b921SBarry Smith /* SUBMANSEC = IS */ 4ac09b921SBarry Smith 501e13f73SMatthew G. Knepley /*S 616a05f60SBarry Smith IS - Abstract PETSc object used for efficient indexing into vector and matrices 701e13f73SMatthew G. Knepley 801e13f73SMatthew G. Knepley Level: beginner 901e13f73SMatthew G. Knepley 1016a05f60SBarry Smith .seealso: `ISType`, `ISCreateGeneral()`, `ISCreateBlock()`, `ISCreateStride()`, `ISGetIndices()`, `ISDestroy()` 1101e13f73SMatthew G. Knepley S*/ 1201e13f73SMatthew G. Knepley typedef struct _p_IS *IS; 1301e13f73SMatthew G. Knepley 1401e13f73SMatthew G. Knepley /*S 1516a05f60SBarry Smith ISLocalToGlobalMapping - mappings from a 1616a05f60SBarry Smith local ordering (on individual MPI processes) of 0 to n-1 to a global PETSc ordering (across collections of MPI processes) 1701e13f73SMatthew G. Knepley used by a vector or matrix. 1801e13f73SMatthew G. Knepley 1901e13f73SMatthew G. Knepley Level: intermediate 2001e13f73SMatthew G. Knepley 2116a05f60SBarry Smith Note: 2287497f52SBarry Smith Mapping from local to global is scalable; but global 23bdaf1daeSBarry Smith to local may not be if the range of global values represented locally 2416a05f60SBarry Smith is very large. `ISLocalToGlobalMappingType` provides alternative ways of efficiently applying `ISGlobalToLocalMappingApply() 2501e13f73SMatthew G. Knepley 2616a05f60SBarry Smith Developer Note: 2787497f52SBarry Smith `ISLocalToGlobalMapping` is actually a private object; it is included 2887497f52SBarry Smith here for the inline function `ISLocalToGlobalMappingApply()` to allow it to be inlined since 2901e13f73SMatthew G. Knepley it is used so often. 3001e13f73SMatthew G. Knepley 3116a05f60SBarry Smith .seealso: `ISLocalToGlobalMappingCreate()`, `ISLocalToGlobalMappingApply()`, `ISLocalToGlobalMappingDestroy()`, `ISGlobalToLocalMappingApply()` 3201e13f73SMatthew G. Knepley S*/ 3301e13f73SMatthew G. Knepley typedef struct _p_ISLocalToGlobalMapping *ISLocalToGlobalMapping; 3401e13f73SMatthew G. Knepley 3501e13f73SMatthew G. Knepley /*S 36*af27ebaaSBarry Smith ISColoring - sets of `IS`s that define a coloring of something, such as a graph defined by a sparse matrix 3701e13f73SMatthew G. Knepley 3801e13f73SMatthew G. Knepley Level: intermediate 3901e13f73SMatthew G. Knepley 4001e13f73SMatthew G. Knepley Notes: 4101e13f73SMatthew G. Knepley One should not access the *is records below directly because they may not yet 4287497f52SBarry Smith have been created. One should use `ISColoringGetIS()` to make sure they are 4301e13f73SMatthew G. Knepley created when needed. 4401e13f73SMatthew G. Knepley 4587497f52SBarry Smith When the coloring type is `IS_COLORING_LOCAL` the coloring is in the local ordering of the unknowns. 46bdaf1daeSBarry Smith That is the matching the local (ghosted) vector; a local to global mapping must be applied to map 47bdaf1daeSBarry Smith them to the global ordering. 48bdaf1daeSBarry Smith 4987497f52SBarry Smith Developer Note: 5087497f52SBarry Smith This is not a `PetscObject` 5101e13f73SMatthew G. Knepley 5216a05f60SBarry Smith .seealso: `IS`, `MatColoringCreate()`, `MatColoring`, `ISColoringCreate()`, `ISColoringGetIS()`, `ISColoringView()` 5301e13f73SMatthew G. Knepley S*/ 5401e13f73SMatthew G. Knepley typedef struct _n_ISColoring *ISColoring; 5501e13f73SMatthew G. Knepley 5601e13f73SMatthew G. Knepley /*S 5716a05f60SBarry Smith PetscLayout - defines layout of vectors and matrices (that is the "global" numbering of vector and matrix entries) across MPI processes (which rows are owned by which processes) 5801e13f73SMatthew G. Knepley 5901e13f73SMatthew G. Knepley Level: developer 6001e13f73SMatthew G. Knepley 6116a05f60SBarry Smith Notes: 6216a05f60SBarry Smith PETSc vectors (`Vec`) have a global number associated with each vector entry. The first MPI process that shares the vector owns the first `n0` entries of the vector, 6316a05f60SBarry Smith the second MPI process the next `n1` entries, etc. A `PetscLayout` is a way of managing this information, for example the number of locally owned entries is provided 6416a05f60SBarry Smith by `PetscLayoutGetLocalSize()` and the range of indices for a given MPI process is provided by `PetscLayoutGetRange()`. 6516a05f60SBarry Smith 66f826b5fcSPierre Jolivet Each PETSc `Vec` contains a `PetscLayout` object which can be obtained with `VecGetLayout()`. For convenience `Vec` provides an API to access the layout information directly, 6716a05f60SBarry Smith for example with `VecGetLocalSize()` and `VecGetOwnershipRange()`. 6816a05f60SBarry Smith 691cc06b55SBarry Smith Similarly PETSc matrices have layouts, these are discussed in [](ch_matrices). 7016a05f60SBarry Smith 7116a05f60SBarry Smith .seealso: `PetscLayoutCreate()`, `PetscLayoutDestroy()`, `PetscLayoutGetRange()`, `PetscLayoutGetLocalSize()`, `PetscLayoutGetSize()`, 7216a05f60SBarry Smith `PetscLayoutGetBlockSize()`, `PetscLayoutGetRanges()`, `PetscLayoutFindOwner()`, `PetscLayoutFindOwnerIndex()`, 7316a05f60SBarry Smith `VecGetLayout()`, `VecGetLocalSize()`, `VecGetOwnershipRange()` 7401e13f73SMatthew G. Knepley S*/ 7501e13f73SMatthew G. Knepley typedef struct _n_PetscLayout *PetscLayout; 76