IS (Index Sets) - Low-level Interface
The IS (Index Set) component provides data structures and operations for managing sets of indices, which are fundamental for parallel data distribution, matrix/vector assembly, and mapping between different numbering schemes.
Overview
Index sets are used throughout PETSc for:
- Parallel data distribution: Specifying which indices are owned by each processor
- Submatrix/subvector extraction: Selecting specific rows/columns
- Scatter/gather operations: Defining communication patterns
- Field splitting: Identifying DOFs belonging to different fields
- Reordering: Specifying permutations for bandwidth reduction
PETSc provides several IS types:
- General IS: Arbitrary list of indices
- Stride IS: Regularly spaced indices (start, step, length)
- Block IS: Block-structured indices
- Complement IS: All indices except specified ones
Basic Usage
using PETSc, MPI
# Initialize MPI and PETSc
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)
# Get PETSc types
PetscInt = petsclib.PetscInt
# Create an index set from an array of indices (0-based)
# Note: indices should be PetscInt type (typically Int64 or Int32 depending on PETSc configuration)
indices = PetscInt[0, 2, 4, 6, 8]
is = LibPETSc.ISCreateGeneral(petsclib, LibPETSc.PETSC_COMM_SELF, PetscInt(length(indices)), indices, LibPETSc.PETSC_COPY_VALUES)
# Create a stride index set: indices = first:step:(first + step*(n-1))
is_stride = LibPETSc.ISCreateStride(petsclib, LibPETSc.PETSC_COMM_SELF, PetscInt(10), PetscInt(0), PetscInt(2)) # 0, 2, 4, ..., 18
# Get the size of an index set (returns value directly)
n = LibPETSc.ISGetSize(petsclib, is)
# Get local size (returns value directly)
local_n = LibPETSc.ISGetLocalSize(petsclib, is)
# Get indices as an array
indices = LibPETSc.ISGetIndices(petsclib, is)
# ... use indices ...
LibPETSc.ISRestoreIndices(petsclib, is, indices)
# Cleanup
LibPETSc.ISDestroy(petsclib, is)
LibPETSc.ISDestroy(petsclib, is_stride)
# Finalize PETSc and MPI
PETSc.finalize(petsclib)
MPI.Finalize()Common Operations
Creating Index Sets
# General index set from array
LibPETSc.ISCreateGeneral(petsclib, comm, n, indices, copymode, is)
# Stride index set: first, first+step, first+2*step, ...
LibPETSc.ISCreateStride(petsclib, comm, n, first, step, is)
# Block index set: block-structured indices
LibPETSc.ISCreateBlock(petsclib, comm, blocksize, n, indices, copymode, is)Set Operations
# Union of two index sets
LibPETSc.ISSum(petsclib, is1, is2, is_union)
# Difference: is1 - is2
LibPETSc.ISDifference(petsclib, is1, is2, is_diff)
# Intersection
LibPETSc.ISIntersect(petsclib, is1, is2, is_intersect)
# Complement: all indices in [0, n) not in is
LibPETSc.ISComplement(petsclib, is, nmin, nmax, is_complement)Querying Properties
# Check if index set is sorted
is_sorted = Ref{PetscBool}()
LibPETSc.ISSorted(petsclib, is, is_sorted)
# Check if identity permutation
is_identity = Ref{PetscBool}()
LibPETSc.ISIdentity(petsclib, is, is_identity)
# Check if a permutation
is_perm = Ref{PetscBool}()
LibPETSc.ISPermutation(petsclib, is, is_perm)Index Set Types
Available through ISSetType:
- ISGENERAL: General list of indices
- ISSTRIDE: Arithmetic sequence
- ISBLOCK: Block-structured indices
Scatter Context
Index sets are used to create scatter contexts for moving data between vectors:
# Create scatter context
scatter = Ref{LibPETSc.VecScatter}()
LibPETSc.VecScatterCreate(petsclib, vec_from, is_from, vec_to, is_to, scatter)
# Perform scatter operation
LibPETSc.VecScatterBegin(petsclib, scatter[], vec_from, vec_to, INSERT_VALUES, SCATTER_FORWARD)
LibPETSc.VecScatterEnd(petsclib, scatter[], vec_from, vec_to, INSERT_VALUES, SCATTER_FORWARD)Parallel Considerations
- Index sets use global indexing by default
- Each processor owns a portion of the index set
- Use
ISGetLocalSizeto get the local portion - Scatter operations handle parallel communication automatically
Function Reference
PETSc.LibPETSc.ISAllGather — Method
ISAllGather(petsclib::PetscLibType,is::IS, isout::IS)Given an index set IS on each processor, generates a large index set (same on each processor) by concatenating together each processors index set.
Collective
Input Parameter:
is- the distributed index set
Output Parameter:
isout- the concatenated index set (same on all processors)
Level: intermediate
-seealso: , IS, ISCreateGeneral(), ISCreateStride(), ISCreateBlock()
External Links
- PETSc Manual:
Vec/ISAllGather
PETSc.LibPETSc.ISAllGatherColors — Method
outN::PetscInt = ISAllGatherColors(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, lindices::Vector{ISColoringValue}, outindices::Vector{ISColoringValue})Given a set of colors on each processor, generates a large set (same on each processor) by concatenating together each processors colors
Collective
Input Parameters:
comm- communicator to share the indicesn- local size of setlindices- local colors
Output Parameters:
outN- total number of indicesoutindices- all of the colors
Level: intermediate
-seealso: ISColoringValue, ISColoring(), ISCreateGeneral(), ISCreateStride(), ISCreateBlock(), ISAllGather()
External Links
- PETSc Manual:
Vec/ISAllGatherColors
PETSc.LibPETSc.ISBlockGetIndices — Method
idx::Vector{PetscInt} = ISBlockGetIndices(petsclib::PetscLibType,is::IS)Gets the indices associated with each block in an ISBLOCK
Not Collective
Input Parameter:
is- the index set
Output Parameter:
idx- the integer indices, one for each block and count of block not indices
Level: intermediate
-seealso: , IS, ISBLOCK, ISGetIndices(), ISBlockRestoreIndices(), ISBlockSetIndices(), ISCreateBlock()
External Links
- PETSc Manual:
Vec/ISBlockGetIndices
PETSc.LibPETSc.ISBlockGetLocalSize — Method
size::PetscInt = ISBlockGetLocalSize(petsclib::PetscLibType,is::IS)Returns the local number of blocks in the index set of ISType ISBLOCK
Not Collective
Input Parameter:
is- the index set
Output Parameter:
size- the local number of blocks
Level: intermediate
-seealso: , IS, ISGetBlockSize(), ISBlockGetSize(), ISGetSize(), ISCreateBlock(), ISBLOCK
External Links
- PETSc Manual:
Vec/ISBlockGetLocalSize
PETSc.LibPETSc.ISBlockGetSize — Method
size::PetscInt = ISBlockGetSize(petsclib::PetscLibType,is::IS)Returns the global number of blocks in parallel in the index set of ISType ISBLOCK
Not Collective
Input Parameter:
is- the index set
Output Parameter:
size- the global number of blocks
Level: intermediate
-seealso: , IS, ISGetBlockSize(), ISBlockGetLocalSize(), ISGetSize(), ISCreateBlock(), ISBLOCK
External Links
- PETSc Manual:
Vec/ISBlockGetSize
PETSc.LibPETSc.ISBlockRestoreIndices — Method
idx::Vector{PetscInt} = ISBlockRestoreIndices(petsclib::PetscLibType,is::IS)Restores the indices associated with each block in an ISBLOCK obtained with ISBlockGetIndices()
Not Collective
Input Parameter:
is- the index set
Output Parameter:
idx- the integer indices
Level: intermediate
-seealso: , IS, ISBLOCK, ISRestoreIndices(), ISBlockGetIndices()
External Links
- PETSc Manual:
Vec/ISBlockRestoreIndices
PETSc.LibPETSc.ISBlockSetIndices — Method
ISBlockSetIndices(petsclib::PetscLibType,is::IS, bs::PetscInt, n::PetscInt, idx::Vector{PetscInt}, mode::PetscCopyMode)Set integers representing blocks of indices in an index set of ISType ISBLOCK
Collective
Input Parameters:
is- the index setbs- number of elements in each blockn- the length of the index set (the number of blocks)idx- the list of integers, one for each block, the integers contain the index of the first index of each block divided by the block sizemode- seePetscCopyMode, onlyPETSC_COPY_VALUESandPETSC_OWN_POINTERare supported
Level: beginner
-seealso: , IS, ISCreateStride(), ISCreateGeneral(), ISAllGather(), ISCreateBlock(), ISBLOCK, ISGeneralSetIndices()
External Links
- PETSc Manual:
Vec/ISBlockSetIndices
PETSc.LibPETSc.ISBuildTwoSided — Method
ISBuildTwoSided(petsclib::PetscLibType,ito::IS, toindx::IS, rows::IS)Takes an IS that describes where each element will be mapped globally over all ranks. Generates an IS that contains new numbers from remote or local on the IS.
Collective
Input Parameters:
ito- anISdescribes to which rank each entry will be mapped. Negative target rank will be ignoredtoindx- anISdescribes what indices should send.NULLmeans sending natural numbering
Output Parameter:
rows- contains new numbers from remote or local
Level: advanced
-seealso: , IS, MatPartitioningCreate(), ISPartitioningToNumbering(), ISPartitioningCount()
External Links
- PETSc Manual:
Vec/ISBuildTwoSided
PETSc.LibPETSc.ISClearInfoCache — Method
ISClearInfoCache(petsclib::PetscLibType,is::IS, clear_permanent_loc::PetscBool)clear the cache of computed index set properties
Not Collective
Input Parameters:
is- the index setclear_permanent_local- whether to remove the permanent status of local properties
Level: developer
-seealso: IS, ISInfo, ISInfoType, ISSetInfo()
External Links
- PETSc Manual:
Vec/ISClearInfoCache
PETSc.LibPETSc.ISComplement — Method
ISComplement(petsclib::PetscLibType,is::IS, nmin::PetscInt, nmax::PetscInt, isout::IS)Given an index set IS generates the complement index set. That is all indices that are NOT in the given set.
Collective
Input Parameters:
is- the index setnmin- the first index desired in the local part of the complementnmax- the largest index desired in the local part of the complement (note that all indices inismust be greater or equal tonminand less thannmax)
Output Parameter:
isout- the complement
Level: intermediate
-seealso: , IS, ISCreateGeneral(), ISCreateStride(), ISCreateBlock(), ISAllGather()
External Links
- PETSc Manual:
Vec/ISComplement
PETSc.LibPETSc.ISComplementVec — Method
ISComplementVec(petsclib::PetscLibType,S::IS, V::PetscVec, T::IS)Creates the complement of the index set relative to a layout defined by a Vec
Collective
Input Parameters:
S- a PETScISV- the reference vector space
Output Parameter:
T- the complement of S
Level: advanced
-seealso: IS, Vec, ISCreateGeneral()
External Links
- PETSc Manual:
Vec/ISComplementVec
PETSc.LibPETSc.ISCompressIndicesGeneral — Method
ISCompressIndicesGeneral(petsclib::PetscLibType,n::PetscInt, nkeys::PetscInt, bs::PetscInt, imax::PetscInt, is_in::Vector{IS}, is_out::Vector{IS})convert the indices of an array of IS into an array of ISGENERAL of block indices
Input Parameters:
n- maximum possible length of the index setnkeys- expected number of keys when usingPETSC_USE_CTABLEbs- the size of blockimax- the number of index setsis_in- the non-blocked array of index sets
Output Parameter:
is_out- the blocked new index set, asISGENERAL, not asISBLOCK
Level: intermediate
-seealso: , IS, ISGENERAL, ISExpandIndicesGeneral()
External Links
- PETSc Manual:
Vec/ISCompressIndicesGeneral
PETSc.LibPETSc.ISConcatenate — Method
ISConcatenate(petsclib::PetscLibType,comm::MPI_Comm, len::PetscInt, islist::Vector{IS}, isout::IS)Forms a new IS by locally concatenating the indices from an IS list without reordering.
Collective
Input Parameters:
comm- communicator of the concatenatedIS.len- size of islist array (nonnegative)islist- array of index sets
Output Parameter:
isout- The concatenated index set; empty, iflen== 0.
Level: intermediate
-seealso: , IS, ISDifference(), ISSum(), ISExpand(), ISIntersect()
External Links
- PETSc Manual:
Vec/ISConcatenate
PETSc.LibPETSc.ISContiguousLocal — Method
start::PetscInt,contig::PetscBool = ISContiguousLocal(petsclib::PetscLibType,is::IS, gstart::PetscInt, gend::PetscInt)Locates an index set with contiguous range within a global range, if possible
Not Collective
Input Parameters:
is- the index setgstart- global startgend- global end
Output Parameters:
start- start of contiguous block, as an offset fromgstartcontig-PETSC_TRUEif the index set refers to contiguous entries on this process, elsePETSC_FALSE
Level: developer
-seealso: IS, ISGetLocalSize(), VecGetOwnershipRange()
External Links
- PETSc Manual:
Vec/ISContiguousLocal
PETSc.LibPETSc.ISCopy — Method
ISCopy(petsclib::PetscLibType,is::IS, isy::IS)Copies an index set.
Collective
Input Parameter:
is- the index set
Output Parameter:
isy- the copy of the index set
Level: beginner
-seealso: IS, ISDuplicate(), ISShift()
External Links
- PETSc Manual:
Vec/ISCopy
PETSc.LibPETSc.ISCreate — Method
is::IS = ISCreate(petsclib::PetscLibType,comm::MPI_Comm)Create an index set object. IS, index sets, are PETSc objects used to do efficient indexing into other data structures such as Vec and Mat
Collective
Input Parameter:
comm- the MPI communicator
Output Parameter:
is- the new index set
Level: beginner
-seealso: , IS, ISType(), ISSetType(), ISCreateGeneral(), ISCreateStride(), ISCreateBlock(), ISAllGather()
External Links
- PETSc Manual:
Vec/ISCreate
PETSc.LibPETSc.ISCreateBlock — Method
is::IS = ISCreateBlock(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, idx::Vector{PetscInt}, mode::PetscCopyMode)Creates a data structure for an index set containing a list of integers. Each integer represents a fixed block size set of indices.
Collective
Input Parameters:
comm- the MPI communicatorbs- number of elements in each blockn- the length of the index set (the number of blocks)idx- the list of integers, one for each block, the integers contain the index of the first entry of each block divided by the block sizemode- seePetscCopyMode, onlyPETSC_COPY_VALUESandPETSC_OWN_POINTERare supported in this routine
Output Parameter:
is- the new index set
Level: beginner
-seealso: , IS, ISCreateStride(), ISCreateGeneral(), ISAllGather(), ISBlockSetIndices(), ISBLOCK, ISGENERAL
External Links
- PETSc Manual:
Vec/ISCreateBlock
PETSc.LibPETSc.ISCreateGeneral — Method
is::IS = ISCreateGeneral(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, idx::Vector{PetscInt}, mode::PetscCopyMode)Creates a data structure for an index set containing a list of integers.
Collective
Input Parameters:
comm- the MPI communicatorn- the length of the index setidx- the list of integersmode-PETSC_COPY_VALUES,PETSC_OWN_POINTER, orPETSC_USE_POINTER; seePetscCopyModefor meaning of this flag.
Output Parameter:
is- the new index set
Level: beginner
-seealso: , IS, ISGENERAL, ISCreateStride(), ISCreateBlock(), ISAllGather(), PETSC_COPY_VALUES, PETSC_OWN_POINTER, PETSC_USE_POINTER, PetscCopyMode, ISGeneralSetIndicesFromMask()
External Links
- PETSc Manual:
Vec/ISCreateGeneral
PETSc.LibPETSc.ISCreateStride — Method
is::IS = ISCreateStride(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, first::PetscInt, step::PetscInt)Creates a data structure for an index set containing a list of evenly spaced integers.
Collective
Input Parameters:
comm- the MPI communicatorn- the length of the locally owned portion of the index setfirst- the first element of the locally owned portion of the index setstep- the change to the next index
Output Parameter:
is- the new index set
Level: beginner
-seealso: , IS, ISStrideSetStride(), ISCreateGeneral(), ISCreateBlock(), ISAllGather(), ISSTRIDE
External Links
- PETSc Manual:
Vec/ISCreateStride
PETSc.LibPETSc.ISCreateSubIS — Method
subis::IS = ISCreateSubIS(petsclib::PetscLibType,is::IS, comps::IS)Create a sub index set from a global index set selecting some components.
Collective
Input Parameters:
is- the index setcomps- which components we will extract fromis
Output Parameters:
subis- the new sub index set
Example usage: We have an index set is living on 3 processes with the following values: | 4 9 0 | 2 6 7 | 10 11 1| and another index set comps used to indicate which components of is we want to take, | 7 5 | 1 2 | 0 4| The output index set subis should look like: | 11 7 | 9 0 | 4 6|
Level: intermediate
-seealso: IS, VecGetSubVector(), MatCreateSubMatrix()
External Links
- PETSc Manual:
Vec/ISCreateSubIS
PETSc.LibPETSc.ISDestroy — Method
ISDestroy(petsclib::PetscLibType,is::IS)Destroys an index set.
Collective
Input Parameter:
is- the index set
Level: beginner
-seealso: IS, ISCreateGeneral(), ISCreateStride(), ISCreateBlock()
External Links
- PETSc Manual:
Vec/ISDestroy
PETSc.LibPETSc.ISDifference — Method
ISDifference(petsclib::PetscLibType,is1::IS, is2::IS, isout::IS)Computes the difference between two index sets.
Collective
Input Parameters:
is1- first index, to have items removed from itis2- index values to be removed
Output Parameter:
isout- is1 - is2
Level: intermediate
-seealso: , IS, ISDestroy(), ISView(), ISSum(), ISExpand()
External Links
- PETSc Manual:
Vec/ISDifference
PETSc.LibPETSc.ISDuplicate — Method
newIS::IS = ISDuplicate(petsclib::PetscLibType,is::IS)Creates a duplicate copy of an index set.
Collective
Input Parameter:
is- the index set
Output Parameter:
newIS- the copy of the index set
Level: beginner
-seealso: IS, ISCreateGeneral(), ISCopy()
External Links
- PETSc Manual:
Vec/ISDuplicate
PETSc.LibPETSc.ISEmbed — Method
ISEmbed(petsclib::PetscLibType,a::IS, b::IS, drop::PetscBool, c::IS)Embed IS a into IS b by finding the locations in b that have the same indices as in a. If c is the IS of these locations, we have a = b*c, regarded as a composition of the corresponding ISLocalToGlobalMapping.
Not Collective
Input Parameters:
a-ISto embedb-ISto embed intodrop- flag indicating whether to drop indices ofathat are not inb.
Output Parameter:
c- local embedding indices
Level: developer
-seealso: IS, ISLocalToGlobalMapping
External Links
- PETSc Manual:
Vec/ISEmbed
PETSc.LibPETSc.ISEqual — Method
flg::PetscBool = ISEqual(petsclib::PetscLibType,is1::IS, is2::IS)Compares if two index sets have the same set of indices.
Collective
Input Parameters:
is1- first index set to compareis2- second index set to compare
Output Parameter:
flg- output flag, eitherPETSC_TRUE(if both index sets have the
same indices), or PETSC_FALSE if the index sets differ by size or by the set of indices)
Level: intermediate
-seealso: , IS, ISEqualUnsorted()
External Links
- PETSc Manual:
Vec/ISEqual
PETSc.LibPETSc.ISEqualUnsorted — Method
flg::PetscBool = ISEqualUnsorted(petsclib::PetscLibType,is1::IS, is2::IS)Compares if two index sets have the same indices.
Collective
Input Parameters:
is1- first index set to compareis2- second index set to compare
Output Parameter:
flg- output flag, eitherPETSC_TRUE(if both index sets have the
same indices), or PETSC_FALSE if the index sets differ by size or by the set of indices)
Level: intermediate
External Links
- PETSc Manual:
Vec/ISEqualUnsorted
PETSc.LibPETSc.ISExpand — Method
ISExpand(petsclib::PetscLibType,is1::IS, is2::IS, isout::IS)Computes the union of two index sets, by concatenating 2 lists and removing duplicates.
Collective
Input Parameters:
is1- first index setis2- index values to be added
Output Parameter:
isout-is1+is2The index setis2is appended tois1removing duplicates
Level: intermediate
-seealso: , IS, ISDestroy(), ISView(), ISDifference(), ISSum(), ISIntersect()
External Links
- PETSc Manual:
Vec/ISExpand
PETSc.LibPETSc.ISExpandIndicesGeneral — Method
ISExpandIndicesGeneral(petsclib::PetscLibType,n::PetscInt, nkeys::PetscInt, bs::PetscInt, imax::PetscInt, is_in::Vector{IS}, is_out::Vector{IS})convert the indices of an array IS into non
Input Parameters:
n- the length of the index set (not being used)nkeys- expected number of keys whenPETSC_USE_CTABLEis usedbs- the size of blockimax- the number of index setsis_in- the blocked array of index sets, must be as large asimax
Output Parameter:
is_out- the non-blocked new index set, asISGENERAL, must be as large asimax
Level: intermediate
-seealso: , IS, ISGENERAL, ISCompressIndicesGeneral()
External Links
- PETSc Manual:
Vec/ISExpandIndicesGeneral
PETSc.LibPETSc.ISFinalizePackage — Method
ISFinalizePackage(petsclib::PetscLibType)This function destroys everything in the IS package. It is called from PetscFinalize().
Level: developer
-seealso: PetscFinalize()
External Links
- PETSc Manual:
Vec/ISFinalizePackage
PETSc.LibPETSc.ISGeneralFilter — Method
ISGeneralFilter(petsclib::PetscLibType,is::IS, start::PetscInt, _::PetscInt)Remove all indices outside of [start, end) from an ISGENERAL
Collective
Input Parameters:
is- the index setstart- the lowest index keptend- one more than the highest index kept,start≤end_
Level: beginner
-seealso: , IS, ISGENERAL, ISCreateGeneral(), ISGeneralSetIndices()
External Links
- PETSc Manual:
Vec/ISGeneralFilter
PETSc.LibPETSc.ISGeneralSetIndices — Method
ISGeneralSetIndices(petsclib::PetscLibType,is::IS, n::PetscInt, idx::Vector{PetscInt}, mode::PetscCopyMode)Sets the indices for an ISGENERAL index set
Logically Collective
Input Parameters:
is- the index setn- the length of the index setidx- the list of integersmode- seePetscCopyModefor meaning of this flag.
Level: beginner
-seealso: , IS, ISBLOCK, ISCreateGeneral(), ISGeneralSetIndicesFromMask(), ISBlockSetIndices(), ISGENERAL, PetscCopyMode
External Links
- PETSc Manual:
Vec/ISGeneralSetIndices
PETSc.LibPETSc.ISGeneralSetIndicesFromMask — Method
ISGeneralSetIndicesFromMask(petsclib::PetscLibType,is::IS, rstart::PetscInt, rend::PetscInt, mask::Vector{PetscBool})Sets the indices for an ISGENERAL index set using a boolean mask
Collective
Input Parameters:
is- the index setrstart- the range start index (inclusive)rend- the range end index (exclusive)mask- the boolean mask array of length rend-rstart, indices will be set for eachPETSC_TRUEvalue in the array
Level: beginner
-seealso: , IS, ISCreateGeneral(), ISGeneralSetIndices(), ISGENERAL
External Links
- PETSc Manual:
Vec/ISGeneralSetIndicesFromMask
PETSc.LibPETSc.ISGetBlockSize — Method
size::PetscInt = ISGetBlockSize(petsclib::PetscLibType,is::IS)Returns the number of elements in a block.
Not Collective
Input Parameter:
is- the index set
Output Parameter:
size- the number of elements in a block
Level: intermediate
-seealso: IS, ISBlockGetSize(), ISGetSize(), ISCreateBlock(), ISSetBlockSize()
External Links
- PETSc Manual:
Vec/ISGetBlockSize
PETSc.LibPETSc.ISGetCompressOutput — Method
compress::PetscBool = ISGetCompressOutput(petsclib::PetscLibType,is::IS)Returns the flag for output compression
Not Collective
Input Parameter:
is- the index set
Output Parameter:
compress- the flag to compress output
Level: intermediate
-seealso: IS, ISSetCompressOutput(), ISView()
External Links
- PETSc Manual:
Vec/ISGetCompressOutput
PETSc.LibPETSc.ISGetIndices — Method
ptr::Vector{PetscInt} = ISGetIndices(petsclib::PetscLibType,is::IS)Returns a pointer to the indices. The user should call ISRestoreIndices() after having looked at the indices. The user should NOT change the indices.
Not Collective
Input Parameter:
is- the index set
Output Parameter:
ptr- the location to put the pointer to the indices
Level: intermediate
-seealso: IS, ISRestoreIndices()
External Links
- PETSc Manual:
Vec/ISGetIndices
PETSc.LibPETSc.ISGetInfo — Method
flg::PetscBool = ISGetInfo(petsclib::PetscLibType,is::IS, info::ISInfo, type::ISInfoType, compute::PetscBool)Determine whether an index set satisfies a given property
Collective or Logically Collective if the type is IS_GLOBAL (logically collective if the value of the property has been permanently set with ISSetInfo())
Input Parameters:
is- the index setinfo- describing a property of the index set, one of those listed in the documentation ofISSetInfo()compute- ifPETSC_FALSE, the property will not be computed if it is not already known and the property will be assumed to be falsetype- whether the property is local (IS_LOCAL) or global (IS_GLOBAL)
Output Parameter:
flg- whether the property is true (PETSC_TRUE) or false (PETSC_FALSE)
Level: advanced
-seealso: IS, ISInfo, ISInfoType, ISSetInfo(), ISClearInfoCache()
External Links
- PETSc Manual:
Vec/ISGetInfo
PETSc.LibPETSc.ISGetLayout — Method
ISGetLayout(petsclib::PetscLibType,is::IS, map::PetscLayout)get PetscLayout describing index set layout
Not Collective
Input Parameter:
is- the index set
Output Parameter:
map- the layout
Level: developer
-seealso: IS, PetscLayout, ISSetLayout(), ISGetSize(), ISGetLocalSize()
External Links
- PETSc Manual:
Vec/ISGetLayout
PETSc.LibPETSc.ISGetLocalSize — Method
size::PetscInt = ISGetLocalSize(petsclib::PetscLibType,is::IS)Returns the local (processor) length of an index set.
Not Collective
Input Parameter:
is- the index set
Output Parameter:
size- the local size
Level: beginner
-seealso: IS, ISGetSize()
External Links
- PETSc Manual:
Vec/ISGetLocalSize
PETSc.LibPETSc.ISGetMinMax — Method
min::PetscInt,max::PetscInt = ISGetMinMax(petsclib::PetscLibType,is::IS)Gets the minimum and maximum values in an IS
Not Collective
Input Parameter:
is- the index set
Output Parameters:
min- the minimum value, you may passNULLmax- the maximum value, you may passNULL
Level: intermediate
-seealso: IS, ISGetIndices(), ISRestoreIndices()
External Links
- PETSc Manual:
Vec/ISGetMinMax
PETSc.LibPETSc.ISGetNonlocalIS — Method
ISGetNonlocalIS(petsclib::PetscLibType,is::IS, complement::IS)Gather all nonlocal indices for this IS and present them as another sequential index set.
Collective
Input Parameter:
is- the index set
Output Parameter:
complement- sequentialISwith indices identical to the result of
ISGetNonlocalIndices()
Level: intermediate
-seealso: IS, ISGetNonlocalIndices(), ISRestoreNonlocalIndices(), ISAllGather(), ISGetSize()
External Links
- PETSc Manual:
Vec/ISGetNonlocalIS
PETSc.LibPETSc.ISGetNonlocalIndices — Method
indices::Vector{PetscInt} = ISGetNonlocalIndices(petsclib::PetscLibType,is::IS)Retrieve an array of indices from remote processors in this communicator.
Collective
Input Parameter:
is- the index set
Output Parameter:
indices- indices with rank 0 indices first, and so on, omitting
the current rank. Total number of indices is the difference total and local, obtained with ISGetSize() and ISGetLocalSize(), respectively.
Level: intermediate
-seealso: IS, ISGetTotalIndices(), ISRestoreNonlocalIndices(), ISGetSize(), ISGetLocalSize().
External Links
- PETSc Manual:
Vec/ISGetNonlocalIndices
PETSc.LibPETSc.ISGetPointRange — Method
pStart::PetscInt,pEnd::PetscInt,points::Vector{PetscInt} = ISGetPointRange(petsclib::PetscLibType,pointIS::IS)Returns a description of the points in an IS suitable for traversal
Not Collective
Input Parameter:
pointIS- TheISobject
Output Parameters:
pStart- The first index, see notespEnd- One past the last index, see notespoints- The indices, see notes
Level: intermediate
-seealso: , IS, ISRestorePointRange(), ISGetPointSubrange(), ISGetIndices(), ISCreateStride()
External Links
- PETSc Manual:
Vec/ISGetPointRange
PETSc.LibPETSc.ISGetPointSubrange — Method
ISGetPointSubrange(petsclib::PetscLibType,subpointIS::IS, pStart::PetscInt, pEnd::PetscInt, points::Vector{PetscInt})Configures the input IS to be a subrange for the traversal information given
Not Collective
Input Parameters:
subpointIS- TheISobject to be configuredpStart- The first index of the subrangepEnd- One past the last index for the subrangepoints- The indices for the entire range, fromISGetPointRange()
Output Parameters:
subpointIS- TheISobject now configured to be a subrange
Level: intermediate
-seealso: , IS, ISGetPointRange(), ISRestorePointRange(), ISGetIndices(), ISCreateStride()
External Links
- PETSc Manual:
Vec/ISGetPointSubrange
PETSc.LibPETSc.ISGetSize — Method
size::PetscInt = ISGetSize(petsclib::PetscLibType,is::IS)Returns the global length of an index set.
Not Collective
Input Parameter:
is- the index set
Output Parameter:
size- the global size
Level: beginner
-seealso: IS
External Links
- PETSc Manual:
Vec/ISGetSize
PETSc.LibPETSc.ISGetTotalIndices — Method
indices::Vector{PetscInt} = ISGetTotalIndices(petsclib::PetscLibType,is::IS)Retrieve an array containing all indices across the communicator.
Collective
Input Parameter:
is- the index set
Output Parameter:
indices- total indices with rank 0 indices first, and so on; total array size is
the same as returned with ISGetSize().
Level: intermediate
-seealso: IS, ISRestoreTotalIndices(), ISGetNonlocalIndices(), ISGetSize()
External Links
- PETSc Manual:
Vec/ISGetTotalIndices
PETSc.LibPETSc.ISGetType — Method
type::ISType = ISGetType(petsclib::PetscLibType,is::IS)Gets the index set type name, ISType, (as a string) from the IS.
Not Collective
Input Parameter:
is- The index set
Output Parameter:
type- The index set type name
Level: intermediate
-seealso: , IS, ISType, ISSetType(), ISCreate()
External Links
- PETSc Manual:
Vec/ISGetType
PETSc.LibPETSc.ISGlobalToLocalMappingApply — Method
nout::PetscInt,idxout::Vector{PetscInt} = ISGlobalToLocalMappingApply(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, type::ISGlobalToLocalMappingMode, n::PetscInt, idx::Vector{PetscInt})Provides the local numbering for a list of integers specified with a global numbering.
Not Collective
Input Parameters:
mapping- mapping between local and global numberingtype-IS_GTOLM_MASK- maps global indices with no local value to -1 in the output list (i.e., mask them)
IS_GTOLM_DROP - drops the indices with no local value from the output list
n- number of global indices to mapidx- global indices to map
Output Parameters:
nout- number of indices in output array (if type ==IS_GTOLM_MASKthen nout = n)idxout- local index of each global index, one must pass in an array long enough
to hold all the indices. You can call ISGlobalToLocalMappingApply() with idxout == NULL to determine the required length (returned in nout) and then allocate the required space and call ISGlobalToLocalMappingApply() a second time to set the values.
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingApply(), ISGlobalToLocalMappingApplyBlock(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingDestroy()
External Links
- PETSc Manual:
Vec/ISGlobalToLocalMappingApply
PETSc.LibPETSc.ISGlobalToLocalMappingApplyBlock — Method
nout::PetscInt,idxout::Vector{PetscInt} = ISGlobalToLocalMappingApplyBlock(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, type::ISGlobalToLocalMappingMode, n::PetscInt, idx::Vector{PetscInt})Provides the local block numbering for a list of integers specified with a block global numbering.
Not Collective
Input Parameters:
mapping- mapping between local and global numberingtype-IS_GTOLM_MASK- maps global indices with no local value to -1 in the output list (i.e., mask them)
IS_GTOLM_DROP - drops the indices with no local value from the output list
n- number of global indices to mapidx- global indices to map
Output Parameters:
nout- number of indices in output array (if type ==IS_GTOLM_MASKthen nout = n)idxout- local index of each global index, one must pass in an array long enough
to hold all the indices. You can call ISGlobalToLocalMappingApplyBlock() with idxout == NULL to determine the required length (returned in nout) and then allocate the required space and call ISGlobalToLocalMappingApplyBlock() a second time to set the values.
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingApply(), ISGlobalToLocalMappingApply(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingDestroy()
External Links
- PETSc Manual:
Vec/ISGlobalToLocalMappingApplyBlock
PETSc.LibPETSc.ISGlobalToLocalMappingApplyIS — Method
ISGlobalToLocalMappingApplyIS(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, type::ISGlobalToLocalMappingMode, is::IS, newis::IS)Creates from an IS in the global numbering a new index set using the local numbering defined in an ISLocalToGlobalMapping context.
Not Collective
Input Parameters:
mapping- mapping between local and global numberingtype-IS_GTOLM_MASK- maps global indices with no local value to -1 in the output list (i.e., mask them)
IS_GTOLM_DROP - drops the indices with no local value from the output list
is- index set in global numbering
Output Parameter:
newis- index set in local numbering
Level: advanced
-seealso: , ISGlobalToLocalMapping, ISGlobalToLocalMappingApply(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingDestroy()
External Links
- PETSc Manual:
Vec/ISGlobalToLocalMappingApplyIS
PETSc.LibPETSc.ISIdentity — Method
ident::PetscBool = ISIdentity(petsclib::PetscLibType,is::IS)Determines whether index set is the identity mapping.
Collective
Input Parameter:
is- the index set
Output Parameter:
ident-PETSC_TRUEif an identity, elsePETSC_FALSE
Level: intermediate
-seealso: IS, ISSetIdentity(), ISGetInfo()
External Links
- PETSc Manual:
Vec/ISIdentity
PETSc.LibPETSc.ISInitializePackage — Method
ISInitializePackage(petsclib::PetscLibType)This function initializes everything in the IS package. It is called from PetscDLLibraryRegister_petscvec() when using dynamic libraries, and on the first call to ISCreateXXXX() when using shared or static libraries.
Level: developer
-seealso: PetscInitialize()
External Links
- PETSc Manual:
Vec/ISInitializePackage
PETSc.LibPETSc.ISIntersect — Method
ISIntersect(petsclib::PetscLibType,is1::IS, is2::IS, isout::IS)Computes the intersection of two index sets, by sorting and comparing.
Collective
Input Parameters:
is1- first index setis2- second index set
Output Parameter:
isout- the sorted intersection ofis1andis2
Level: intermediate
-seealso: , IS, ISDestroy(), ISView(), ISDifference(), ISSum(), ISExpand(), ISConcatenate()
External Links
- PETSc Manual:
Vec/ISIntersect
PETSc.LibPETSc.ISInvertPermutation — Method
ISInvertPermutation(petsclib::PetscLibType,is::IS, nloc::PetscInt, isout::IS)Creates a new permutation that is the inverse of a given permutation.
Collective
Input Parameters:
is- the index setnlocal- number of indices on this processor in result (ignored for 1 processor) or
use PETSC_DECIDE
Output Parameter:
isout- the inverse permutation
Level: intermediate
-seealso: IS, ISGetInfo(), ISSetPermutation(), ISGetPermutation()
External Links
- PETSc Manual:
Vec/ISInvertPermutation
PETSc.LibPETSc.ISListToPair — Method
ISListToPair(petsclib::PetscLibType,comm::MPI_Comm, listlen::PetscInt, islist::Vector{IS}, xis::IS, yis::IS)Convert an IS list to a pair of IS of equal length defining an equivalent integer multimap. Each IS in islist is assigned an integer j so that all of the indices of that IS are mapped to j.
Collective
Input Parameters:
comm-MPI_Commlistlen-ISlist lengthislist-ISlist
Output Parameters:
xis- domainISyis- rangeIS
Level: developer
-seealso: IS, ISPairToList()
External Links
- PETSc Manual:
Vec/ISListToPair
PETSc.LibPETSc.ISLoad — Method
ISLoad(petsclib::PetscLibType,is::IS, viewer::PetscViewer)Loads an index set that has been stored in binary or HDF5 format with ISView().
Collective
Input Parameters:
is- the newly loaded index set, this needs to have been created withISCreate()or some related function before a call toISLoad().viewer- binary file viewer, obtained fromPetscViewerBinaryOpen()or HDF5 file viewer, obtained fromPetscViewerHDF5Open()
Level: intermediate
-seealso: IS, PetscViewerBinaryOpen(), ISView(), MatLoad(), VecLoad()
External Links
- PETSc Manual:
Vec/ISLoad
PETSc.LibPETSc.ISLocate — Method
location::PetscInt = ISLocate(petsclib::PetscLibType,is::IS, key::PetscInt)determine the location of an index within the local component of an index set
Not Collective
Input Parameters:
is- the index setkey- the search key
Output Parameter:
location- if >= 0, a location within the index set that is equal to the key, otherwise the key is not in the index set
Level: intermediate
-seealso: IS
External Links
- PETSc Manual:
Vec/ISLocate
PETSc.LibPETSc.ISOnComm — Method
ISOnComm(petsclib::PetscLibType,is::IS, comm::MPI_Comm, mode::PetscCopyMode, newis::IS)Split a parallel IS on subcomms (usually self) or concatenate index sets on subcomms into a parallel index set
Collective
Input Parameters:
is- index setcomm- communicator for new index setmode- copy semantics,PETSC_USE_POINTERfor no-copy if possible, otherwisePETSC_COPY_VALUES
Output Parameter:
newis- newISoncomm
Level: advanced
-seealso: IS
External Links
- PETSc Manual:
Vec/ISOnComm
PETSc.LibPETSc.ISPairToList — Method
listlen::PetscInt = ISPairToList(petsclib::PetscLibType,xis::IS, yis::IS, islist::IS)Convert an IS pair encoding an integer map to a list of IS.
Collective
Input Parameters:
xis- domainISyis- rangeIS, the maximum value must be less thanPETSC_MPI_INT_MAX
Output Parameters:
listlen- length ofislistislist- list ofISs breaking up indices by color
Level: developer
-seealso: IS, ISListToPair()
External Links
- PETSc Manual:
Vec/ISPairToList
PETSc.LibPETSc.ISPartitioningCount — Method
count::Vector{PetscInt} = ISPartitioningCount(petsclib::PetscLibType,part::IS, len::PetscInt)Takes a IS that represents a partitioning (the MPI rank that each local entry belongs to) and determines the number of resulting elements on each (partition) rank
Collective
Input Parameters:
part- a partitioning as generated byMatPartitioningApply()orMatPartitioningApplyND()len- length of the array count, this is the total number of partitions
Output Parameter:
count- array of length size, to contain the number of elements assigned
to each partition, where size is the number of partitions generated (see notes below).
Level: advanced
-seealso: , IS, MatPartitioningCreate(), AOCreateBasic(), ISPartitioningToNumbering(), MatPartitioningSetNParts(), MatPartitioningApply(), MatPartitioningApplyND()
External Links
- PETSc Manual:
Vec/ISPartitioningCount
PETSc.LibPETSc.ISPartitioningToNumbering — Method
ISPartitioningToNumbering(petsclib::PetscLibType,part::IS, is::IS)Takes an IS' that represents a partitioning (the MPI rank that each local entry belongs to) and on each MPI process generates anIS` that contains a new global node number in the new ordering for each entry
Collective
Input Parameter:
part- a partitioning as generated byMatPartitioningApply()orMatPartitioningApplyND()
Output Parameter:
is- on each processor the index set that defines the global numbers
(in the new numbering) for all the nodes currently (before the partitioning) on that processor
Level: advanced
-seealso: , IS, MatPartitioningCreate(), AOCreateBasic(), ISPartitioningCount()
External Links
- PETSc Manual:
Vec/ISPartitioningToNumbering
PETSc.LibPETSc.ISPermutation — Method
perm::PetscBool = ISPermutation(petsclib::PetscLibType,is::IS)PETSC_TRUE or PETSC_FALSE depending on whether the index set has been declared to be a permutation.
Logically Collective
Input Parameter:
is- the index set
Output Parameter:
perm-PETSC_TRUEif a permutation, elsePETSC_FALSE
Level: intermediate
-seealso: IS, ISSetPermutation(), ISGetInfo()
External Links
- PETSc Manual:
Vec/ISPermutation
PETSc.LibPETSc.ISRegister — Method
ISRegister(petsclib::PetscLibType,sname::String, fnc::external)Adds a new index set implementation
Not Collective, No Fortran Support
Input Parameters:
sname- The name of a new user-defined creation routinefunction- The creation routine itself
-seealso: , IS, ISType, ISSetType(), ISRegisterAll(), ISRegisterDestroy()
External Links
- PETSc Manual:
Vec/ISRegister
PETSc.LibPETSc.ISRegisterAll — Method
ISRegisterAll(petsclib::PetscLibType)Registers all of the index set components in the IS package.
Not Collective
Level: advanced
-seealso: , IS, ISType, ISRegister()
External Links
- PETSc Manual:
Vec/ISRegisterAll
PETSc.LibPETSc.ISRenumber — Method
N::PetscInt = ISRenumber(petsclib::PetscLibType,subset::IS, subset_mult::IS, subset_n::IS)Renumbers the non
Collective
Input Parameters:
subset- the index setsubset_mult- the multiplicity of each entry in subset (optional, can beNULL)
Output Parameters:
N- one past the largest entry of the newISsubset_n- the newIS
Level: intermediate
-seealso: IS
External Links
- PETSc Manual:
Vec/ISRenumber
PETSc.LibPETSc.ISRestoreIndices — Method
ISRestoreIndices(petsclib::PetscLibType,is::IS, ptr::Vector{PetscInt})Restores an index set to a usable state after a call to ISGetIndices().
Not Collective
Input Parameters:
is- the index setptr- the pointer obtained byISGetIndices()
Level: intermediate
-seealso: IS, ISGetIndices()
External Links
- PETSc Manual:
Vec/ISRestoreIndices
PETSc.LibPETSc.ISRestoreNonlocalIS — Method
ISRestoreNonlocalIS(petsclib::PetscLibType,is::IS, complement::IS)Restore the IS obtained with ISGetNonlocalIS().
Not collective.
Input Parameters:
is- the index setcomplement- index set ofis's nonlocal indices
Level: intermediate
-seealso: IS, ISGetNonlocalIS(), ISGetNonlocalIndices(), ISRestoreNonlocalIndices()
External Links
- PETSc Manual:
Vec/ISRestoreNonlocalIS
PETSc.LibPETSc.ISRestoreNonlocalIndices — Method
ISRestoreNonlocalIndices(petsclib::PetscLibType,is::IS, indices::Vector{PetscInt})Restore the index array obtained with ISGetNonlocalIndices().
Not Collective.
Input Parameters:
is- the index setindices- index array; must be the array obtained withISGetNonlocalIndices()
Level: intermediate
-seealso: IS, ISGetTotalIndices(), ISGetNonlocalIndices(), ISRestoreTotalIndices()
External Links
- PETSc Manual:
Vec/ISRestoreNonlocalIndices
PETSc.LibPETSc.ISRestorePointRange — Method
ISRestorePointRange(petsclib::PetscLibType,pointIS::IS, pStart::PetscInt, pEnd::PetscInt, points::Vector{PetscInt})Destroys the traversal description created with ISGetPointRange()
Not Collective
Input Parameters:
pointIS- TheISobjectpStart- The first index, fromISGetPointRange()pEnd- One past the last index, fromISGetPointRange()points- The indices, fromISGetPointRange()
Level: intermediate
-seealso: , IS, ISGetPointRange(), ISGetPointSubrange(), ISGetIndices(), ISCreateStride()
External Links
- PETSc Manual:
Vec/ISRestorePointRange
PETSc.LibPETSc.ISRestoreTotalIndices — Method
ISRestoreTotalIndices(petsclib::PetscLibType,is::IS, indices::Vector{PetscInt})Restore the index array obtained with ISGetTotalIndices().
Not Collective.
Input Parameters:
is- the index setindices- index array; must be the array obtained withISGetTotalIndices()
Level: intermediate
-seealso: IS, ISGetNonlocalIndices()
External Links
- PETSc Manual:
Vec/ISRestoreTotalIndices
PETSc.LibPETSc.ISSetBlockSize — Method
ISSetBlockSize(petsclib::PetscLibType,is::IS, bs::PetscInt)informs an index set that it has a given block size
Logicall Collective
Input Parameters:
is- index setbs- block size
Level: intermediate
-seealso: IS, ISGetBlockSize(), ISCreateBlock(), ISBlockGetIndices(),
External Links
- PETSc Manual:
Vec/ISSetBlockSize
PETSc.LibPETSc.ISSetCompressOutput — Method
ISSetCompressOutput(petsclib::PetscLibType,is::IS, compress::PetscBool)set the flag for output compression
Logicall Collective
Input Parameters:
is- index setcompress- flag for output compression
Level: intermediate
-seealso: IS, ISGetCompressOutput(), ISView()
External Links
- PETSc Manual:
Vec/ISSetCompressOutput
PETSc.LibPETSc.ISSetIdentity — Method
ISSetIdentity(petsclib::PetscLibType,is::IS)Informs the index set that it is an identity.
Logically Collective
Input Parameter:
is- the index set
Level: intermediate
-seealso: IS, ISIdentity(), ISSetInfo(), ISClearInfoCache()
External Links
- PETSc Manual:
Vec/ISSetIdentity
PETSc.LibPETSc.ISSetInfo — Method
ISSetInfo(petsclib::PetscLibType,is::IS, info::ISInfo, type::ISInfoType, permanent::PetscBool, flg::PetscBool)Set known information about an index set.
Logically Collective if ISInfoType is IS_GLOBAL
Input Parameters:
is- the index setinfo- describing a property of the index set, one of those listed below,type-IS_LOCALif the information describes the local portion of the index set,
IS_GLOBAL if it describes the whole index set
permanent-PETSC_TRUEif it is known that the property will persist through changes to the index set,PETSC_FALSEotherwise
If the user sets a property as permanently known, it will bypass computation of that property
flg- set the described property as true (PETSC_TRUE) or false (PETSC_FALSE)
Values of info Describing IS Structure:
IS_SORTED- the [local part of the] index set is sorted in ascending orderIS_UNIQUE- each entry in the [local part of the] index set is uniqueIS_PERMUTATION- the [local part of the] index set is a permutation of the integers {0, 1, ..., N-1}, where N is the size of the [local part of the] index setIS_INTERVAL- the [local part of the] index set is equal to a contiguous range of integers {f, f + 1, ..., f + N-1}IS_IDENTITY- the [local part of the] index set is equal to the integers {0, 1, ..., N-1}
Level: advanced
-seealso: ISInfo, ISInfoType, IS
External Links
- PETSc Manual:
Vec/ISSetInfo
PETSc.LibPETSc.ISSetLayout — Method
ISSetLayout(petsclib::PetscLibType,is::IS, map::PetscLayout)set PetscLayout describing index set layout
Collective
Input Parameters:
is- the index setmap- the layout
Level: developer
-seealso: IS, PetscLayout, ISCreate(), ISGetLayout(), ISGetSize(), ISGetLocalSize()
External Links
- PETSc Manual:
Vec/ISSetLayout
PETSc.LibPETSc.ISSetPermutation — Method
ISSetPermutation(petsclib::PetscLibType,is::IS)Informs the index set that it is a permutation.
Logically Collective
Input Parameter:
is- the index set
Level: intermediate
-seealso: IS, ISPermutation(), ISSetInfo(), ISClearInfoCache().
External Links
- PETSc Manual:
Vec/ISSetPermutation
PETSc.LibPETSc.ISSetType — Method
ISSetType(petsclib::PetscLibType,is::IS, method::ISType)Builds a index set, for a particular ISType
Collective
Input Parameters:
is- The index set objectmethod- The name of the index set type
Options Database Key:
-is_type <type>- Sets the index set type; use-helpfor a list of available types
Level: intermediate
-seealso: , IS, ISGENERAL, ISBLOCK, ISGetType(), ISCreate(), ISCreateGeneral(), ISCreateStride(), ISCreateBlock()
External Links
- PETSc Manual:
Vec/ISSetType
PETSc.LibPETSc.ISShift — Method
ISShift(petsclib::PetscLibType,is::IS, offset::PetscInt, isy::IS)Shift all indices by given offset
Collective
Input Parameters:
is- the index setoffset- the offset
Output Parameter:
isy- the shifted copy of the input index set
Level: beginner
-seealso: ISDuplicate(), ISCopy()
External Links
- PETSc Manual:
Vec/ISShift
PETSc.LibPETSc.ISSort — Method
ISSort(petsclib::PetscLibType,is::IS)Sorts the indices of an index set.
Collective
Input Parameter:
is- the index set
Level: intermediate
-seealso: IS, ISSortRemoveDups(), ISSorted()
External Links
- PETSc Manual:
Vec/ISSort
PETSc.LibPETSc.ISSortPermutation — Method
ISSortPermutation(petsclib::PetscLibType,f::IS, always::PetscBool, h::IS)calculate the permutation of the indices into a nondecreasing order.
Not Collective
Input Parameters:
f-ISto sortalways- build the permutation even whenf's indices are nondecreasing.
Output Parameter:
h- permutation orNULL, iffis nondecreasing andalways==PETSC_FALSE.
Level: advanced
-seealso: IS, ISLocalToGlobalMapping, ISSort()
External Links
- PETSc Manual:
Vec/ISSortPermutation
PETSc.LibPETSc.ISSortRemoveDups — Method
ISSortRemoveDups(petsclib::PetscLibType,is::IS)Sorts the indices of an index set, removing duplicates.
Collective
Input Parameter:
is- the index set
Level: intermediate
-seealso: IS, ISSort(), ISSorted()
External Links
- PETSc Manual:
Vec/ISSortRemoveDups
PETSc.LibPETSc.ISSorted — Method
flg::PetscBool = ISSorted(petsclib::PetscLibType,is::IS)Checks the indices to determine whether they have been sorted.
Not Collective
Input Parameter:
is- the index set
Output Parameter:
flg- output flag, eitherPETSC_TRUEif the index set is sorted,
or PETSC_FALSE otherwise.
Level: intermediate
-seealso: ISSort(), ISSortRemoveDups()
External Links
- PETSc Manual:
Vec/ISSorted
PETSc.LibPETSc.ISStrideGetInfo — Method
first::PetscInt,step::PetscInt = ISStrideGetInfo(petsclib::PetscLibType,is::IS)Returns the first index in a stride index set and the stride width from an IS of ISType ISSTRIDE
Not Collective
Input Parameter:
is- the index set
Output Parameters:
first- the first indexstep- the stride width
Level: intermediate
-seealso: , IS, ISCreateStride(), ISGetSize(), ISSTRIDE
External Links
- PETSc Manual:
Vec/ISStrideGetInfo
PETSc.LibPETSc.ISStrideSetStride — Method
ISStrideSetStride(petsclib::PetscLibType,is::IS, n::PetscInt, first::PetscInt, step::PetscInt)Sets the stride information for a stride index set.
Logically Collective
Input Parameters:
is- the index setn- the length of the locally owned portion of the index setfirst- the first element of the locally owned portion of the index setstep- the change to the next index
Level: beginner
-seealso: , IS, ISCreateGeneral(), ISCreateBlock(), ISAllGather(), ISSTRIDE, ISCreateStride(), ISStrideGetInfo()
External Links
- PETSc Manual:
Vec/ISStrideSetStride
PETSc.LibPETSc.ISSum — Method
ISSum(petsclib::PetscLibType,is1::IS, is2::IS, is3::IS)Computes the sum (union) of two index sets.
Only sequential version (at the moment)
Input Parameters:
is1- index set to be extendedis2- index values to be added
Output Parameter:
is3- the sum; this can not beis1oris2
Level: intermediate
-seealso: , IS, ISDestroy(), ISView(), ISDifference(), ISExpand()
External Links
- PETSc Manual:
Vec/ISSum
PETSc.LibPETSc.ISToGeneral — Method
ISToGeneral(petsclib::PetscLibType,is::IS)Converts an IS object of any type to ISGENERAL type
Collective
Input Parameter:
is- the index set
Level: intermediate
-seealso: IS, ISSorted()
External Links
- PETSc Manual:
Vec/ISToGeneral
PETSc.LibPETSc.ISView — Method
ISView(petsclib::PetscLibType,is::IS, viewer::PetscViewer)Displays an index set.
Collective
Input Parameters:
is- the index setviewer- viewer used to display the set, for examplePETSC_VIEWER_STDOUT_SELF.
Level: intermediate
-seealso: IS, PetscViewer, PetscViewerASCIIOpen(), ISViewFromOptions()
External Links
- PETSc Manual:
Vec/ISView
PETSc.LibPETSc.ISViewFromOptions — Method
ISViewFromOptions(petsclib::PetscLibType,A::IS, obj::PetscObject, name::String)View an IS based on options in the options database
Collective
Input Parameters:
A- the index setobj- Optional object that provides the prefix for the options databasename- command line option
Level: intermediate
-seealso: IS, ISView(), PetscObjectViewFromOptions(), ISCreate()
External Links
- PETSc Manual:
Vec/ISViewFromOptions
IS Add-ons
Additional IS utilities and helper functions:
PETSc.LibPETSc.ISColoringCreate — Method
iscoloring::ISColoring = ISColoringCreate(petsclib::PetscLibType,comm::MPI_Comm, ncolors::PetscInt, n::PetscInt, colors::Vector{ISColoringValue}, mode::PetscCopyMode)Generates an ISColoring context from lists (provided by each MPI process) of colors for each node.
Collective
Input Parameters:
comm- communicator for the processors creating the coloringncolors- max color valuen- number of nodes on this processorcolors- array containing the colors for this MPI rank, color numbers begin at 0, for each local nodemode- seePetscCopyModefor meaning of this flag.
Output Parameter:
iscoloring- the resulting coloring data structure
Options Database Key:
-is_coloring_view- ActivatesISColoringView()
Level: advanced
-seealso: ISColoring, ISColoringValue, MatColoringCreate(), ISColoringView(), ISColoringDestroy(), ISColoringSetType()
External Links
- PETSc Manual:
Vec/ISColoringCreate
PETSc.LibPETSc.ISColoringDestroy — Method
ISColoringDestroy(petsclib::PetscLibType,iscoloring::ISColoring)Destroys an ISColoring coloring context.
Collective
Input Parameter:
iscoloring- the coloring context
Level: advanced
-seealso: ISColoring, ISColoringView(), MatColoring
External Links
- PETSc Manual:
Vec/ISColoringDestroy
PETSc.LibPETSc.ISColoringGetColors — Method
n::PetscInt,nc::PetscInt = ISColoringGetColors(petsclib::PetscLibType,iscoloring::ISColoring, colors::ISColoringValue)Returns an array with the color for each local node
Not Collective
Input Parameter:
iscoloring- the coloring context
Output Parameters:
n- number of nodesnc- number of colorscolors- color for each node
Level: advanced
-seealso: ISColoring, ISColoringValue, ISColoringRestoreIS(), ISColoringView(), ISColoringGetIS()
External Links
- PETSc Manual:
Vec/ISColoringGetColors
PETSc.LibPETSc.ISColoringGetIS — Method
nn::PetscInt = ISColoringGetIS(petsclib::PetscLibType,iscoloring::ISColoring, mode::PetscCopyMode, isis::Vector{IS})Extracts index sets from the coloring context. Each is contains the nodes of one color
Collective
Input Parameters:
iscoloring- the coloring contextmode- if this value isPETSC_OWN_POINTERthen the caller owns the pointer and must free the array ofISand eachISin the array
Output Parameters:
nn- number of index sets in the coloring contextisis- array of index sets
Level: advanced
-seealso: ISColoring, IS, ISColoringRestoreIS(), ISColoringView(), ISColoringGetColoring(), ISColoringGetColors()
External Links
- PETSc Manual:
Vec/ISColoringGetIS
PETSc.LibPETSc.ISColoringGetType — Method
type::ISColoringType = ISColoringGetType(petsclib::PetscLibType,coloring::ISColoring)gets if the coloring is for the local representation (including ghost points) or the global representation
Collective
Input Parameter:
coloring- the coloring object
Output Parameter:
type- eitherIS_COLORING_LOCALorIS_COLORING_GLOBAL
Level: intermediate
-seealso: MatFDColoringCreate(), ISColoring, ISColoringType, ISColoringCreate(), IS_COLORING_LOCAL, IS_COLORING_GLOBAL, ISColoringSetType()
External Links
- PETSc Manual:
Vec/ISColoringGetType
PETSc.LibPETSc.ISColoringReference — Method
ISColoringReference(petsclib::PetscLibType,coloring::ISColoring)External Links
- PETSc Manual:
Vec/ISColoringReference
PETSc.LibPETSc.ISColoringRestoreIS — Method
ISColoringRestoreIS(petsclib::PetscLibType,iscoloring::ISColoring, mode::PetscCopyMode, is::Vector{IS})Restores the index sets extracted from the coloring context with ISColoringGetIS() using PETSC_USE_POINTER
Collective
Input Parameters:
iscoloring- the coloring contextmode- who retains ownership of the isis- array of index sets
Level: advanced
-seealso: ISColoring(), IS, ISColoringGetIS(), ISColoringView(), PetscCopyMode
External Links
- PETSc Manual:
Vec/ISColoringRestoreIS
PETSc.LibPETSc.ISColoringSetType — Method
ISColoringSetType(petsclib::PetscLibType,coloring::ISColoring, type::ISColoringType)indicates if the coloring is for the local representation (including ghost points) or the global representation of a Mat
Collective
Input Parameters:
coloring- the coloring objecttype- eitherIS_COLORING_LOCALorIS_COLORING_GLOBAL
Level: intermediate
-seealso: MatFDColoringCreate(), ISColoring, ISColoringType, ISColoringCreate(), IS_COLORING_LOCAL, IS_COLORING_GLOBAL, ISColoringGetType()
External Links
- PETSc Manual:
Vec/ISColoringSetType
PETSc.LibPETSc.ISColoringValueCast — Method
ISColoringValueCast(petsclib::PetscLibType,a::PetscCount, b::ISColoringValue)External Links
- PETSc Manual:
Vec/ISColoringValueCast
PETSc.LibPETSc.ISColoringView — Method
ISColoringView(petsclib::PetscLibType,iscoloring::ISColoring, viewer::PetscViewer)Views an ISColoring coloring context.
Collective
Input Parameters:
iscoloring- the coloring contextviewer- the viewer
Level: advanced
-seealso: ISColoring(), ISColoringViewFromOptions(), ISColoringDestroy(), ISColoringGetIS(), MatColoring
External Links
- PETSc Manual:
Vec/ISColoringView
PETSc.LibPETSc.ISColoringViewFromOptions — Method
ISColoringViewFromOptions(petsclib::PetscLibType,obj::ISColoring, bobj::PetscObject, optionname::String)Processes command line options to determine if/how an ISColoring object is to be viewed.
Collective
Input Parameters:
obj- theISColoringobjectbobj- prefix to use for viewing, orNULLto use prefix ofmatoptionname- option to activate viewing
Level: intermediate
-seealso: ISColoring, ISColoringView()
External Links
- PETSc Manual:
Vec/ISColoringViewFromOptions
PETSc.LibPETSc.ISLocalToGlobalMappingApply — Method
out::Vector{PetscInt} = ISLocalToGlobalMappingApply(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, N::PetscInt, in::Vector{PetscInt})Takes a list of integers in a local numbering and converts them to the global numbering.
Not Collective
Input Parameters:
mapping- the local to global mapping contextN- number of integersin- input indices in local numbering
Output Parameter:
out- indices in global numbering
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingApplyBlock(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingApplyIS(), AOCreateBasic(), AOApplicationToPetsc(), AOPetscToApplication(), ISGlobalToLocalMappingApply()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingApply
PETSc.LibPETSc.ISLocalToGlobalMappingApplyBlock — Method
out::Vector{PetscInt} = ISLocalToGlobalMappingApplyBlock(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, N::PetscInt, in::Vector{PetscInt})Takes a list of integers in a local block numbering and converts them to the global block numbering
Not Collective
Input Parameters:
mapping- the local to global mapping contextN- number of integersin- input indices in local block numbering
Output Parameter:
out- indices in global block numbering
Example: If the index values are {0,1,6,7} set with a call to ISLocalToGlobalMappingCreate(PETSC_COMM_SELF,2,2,{0,3}) then the mapping applied to 0 (the first block) would produce 0 and the mapping applied to 1 (the second block) would produce 3.
Level: advanced
-seealso: , ISLocalToGlobalMappingApply(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingApplyIS(), AOCreateBasic(), AOApplicationToPetsc(), AOPetscToApplication(), ISGlobalToLocalMappingApply()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingApplyBlock
PETSc.LibPETSc.ISLocalToGlobalMappingApplyIS — Method
ISLocalToGlobalMappingApplyIS(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, is::IS, newis::IS)Creates from an IS in the local numbering a new index set using the global numbering defined in an ISLocalToGlobalMapping context.
Collective
Input Parameters:
mapping- mapping between local and global numberingis- index set in local numbering
Output Parameter:
newis- index set in global numbering
Level: advanced
-seealso: , ISLocalToGlobalMappingApply(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingDestroy(), ISGlobalToLocalMappingApply()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingApplyIS
PETSc.LibPETSc.ISLocalToGlobalMappingConcatenate — Method
ISLocalToGlobalMappingConcatenate(petsclib::PetscLibType,comm::MPI_Comm, n::PetscInt, ltogs::Vector{ISLocalToGlobalMapping}, ltogcat::ISLocalToGlobalMapping)Create a new mapping that concatenates a list of mappings
Not Collective
Input Parameters:
comm- communicator for the new mapping, must contain the communicator of every mapping to concatenaten- number of mappings to concatenateltogs- local to global mappings
Output Parameter:
ltogcat- new mapping
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingCreate()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingConcatenate
PETSc.LibPETSc.ISLocalToGlobalMappingCreate — Method
mapping::ISLocalToGlobalMapping = ISLocalToGlobalMappingCreate(petsclib::PetscLibType,comm::MPI_Comm, bs::PetscInt, n::PetscInt, indices::Vector{PetscInt}, mode::PetscCopyMode)Creates a mapping between a local (0 to n) ordering and a global parallel ordering.
Not Collective, but communicator may have more than one process
Input Parameters:
comm- MPI communicatorbs- the block sizen- the number of local elements divided by the block size, or equivalently the number of block indicesindices- the global index for each local element, these do not need to be in increasing order (sorted), these values should not be scaled (i.e. multiplied) by the blocksize bsmode- see PetscCopyMode
Output Parameter:
mapping- new mapping data structure
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingSetFromOptions(), ISLOCALTOGLOBALMAPPINGBASIC, ISLOCALTOGLOBALMAPPINGHASH ISLocalToGlobalMappingSetType(), ISLocalToGlobalMappingType
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingCreate
PETSc.LibPETSc.ISLocalToGlobalMappingCreateIS — Method
mapping::ISLocalToGlobalMapping = ISLocalToGlobalMappingCreateIS(petsclib::PetscLibType,is::IS)Creates a mapping between a local (0 to n) ordering and a global parallel ordering.
Not Collective
Input Parameter:
is- index set containing the global numbers for each local number
Output Parameter:
mapping- new mapping data structure
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingSetFromOptions()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingCreateIS
PETSc.LibPETSc.ISLocalToGlobalMappingCreateSF — Method
mapping::ISLocalToGlobalMapping = ISLocalToGlobalMappingCreateSF(petsclib::PetscLibType,sf::PetscSF, start::PetscInt)Creates a mapping between a local (0 to n) ordering and a global parallel ordering induced by a star forest.
Collective
Input Parameters:
sf- star forest mapping contiguous local indices to (rank, offset)start- first global index on this process, orPETSC_DECIDEto compute contiguous global numbering automatically
Output Parameter:
mapping- new mapping data structure
Level: advanced
-seealso: , PetscSF, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingSetFromOptions()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingCreateSF
PETSc.LibPETSc.ISLocalToGlobalMappingDestroy — Method
ISLocalToGlobalMappingDestroy(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping)Destroys a mapping between a local (0 to n) ordering and a global parallel ordering.
Not Collective
Input Parameter:
mapping- mapping data structure
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingCreate()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingDestroy
PETSc.LibPETSc.ISLocalToGlobalMappingDuplicate — Method
nltog::ISLocalToGlobalMapping = ISLocalToGlobalMappingDuplicate(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping)Duplicates the local to global mapping object
Not Collective
Input Parameter:
ltog- local to global mapping
Output Parameter:
nltog- the duplicated local to global mapping
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreate()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingDuplicate
PETSc.LibPETSc.ISLocalToGlobalMappingGetBlockIndices — Method
array::Vector{PetscInt} = ISLocalToGlobalMappingGetBlockIndices(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping)Get global indices for every local block in a ISLocalToGlobalMapping
Not Collective
Input Parameter:
ltog- local to global mapping
Output Parameter:
array- array of indices
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingApply(), ISLocalToGlobalMappingRestoreBlockIndices()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingGetBlockIndices
PETSc.LibPETSc.ISLocalToGlobalMappingGetBlockInfo — Method
nproc::PetscInt,procs::Vector{PetscInt},numprocs::Vector{PetscInt},indices::Vector{PetscInt} = ISLocalToGlobalMappingGetBlockInfo(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping)Gets the neighbor information
Collective the first time it is called
Input Parameter:
mapping- the mapping from local to global indexing
Output Parameters:
nproc- number of processes that are connected to the calling processprocs- neighboring processesnumprocs- number of block indices for each processindices- block indices (in local numbering) shared with neighbors (sorted by global numbering)
Level: advanced
-seealso: , ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingRestoreBlockInfo(), ISLocalToGlobalMappingGetBlockMultiLeavesSF()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingGetBlockInfo
PETSc.LibPETSc.ISLocalToGlobalMappingGetBlockMultiLeavesSF — Method
ISLocalToGlobalMappingGetBlockMultiLeavesSF(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, mlsf::PetscSF)Get the star
Collective the first time it is called
Input Parameter:
mapping- the mapping from local to global indexing
Output Parameter:
mlsf- thePetscSF
Level: advanced
-seealso: , ISLocalToGlobalMappingGetBlockNodeInfo(), PetscSF
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingGetBlockMultiLeavesSF
PETSc.LibPETSc.ISLocalToGlobalMappingGetBlockNodeInfo — Method
n::PetscInt,n_procs::Vector{PetscInt},procs::Vector{PetscInt} = ISLocalToGlobalMappingGetBlockNodeInfo(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping)Gets the neighbor information for each local block index
Collective the first time it is called
Input Parameter:
mapping- the mapping from local to global indexing
Output Parameters:
n- number of local block nodesn_procs- an array storing the number of processes for each local block node (including self)procs- the processes' rank for each local block node (sorted, self is first)
Level: advanced
-seealso: ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingGetBlockInfo(), ISLocalToGlobalMappingRestoreBlockNodeInfo(), ISLocalToGlobalMappingGetNodeInfo()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingGetBlockNodeInfo
PETSc.LibPETSc.ISLocalToGlobalMappingGetBlockSize — Method
bs::PetscInt = ISLocalToGlobalMappingGetBlockSize(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping)Gets the blocksize of the mapping ordering and a global parallel ordering.
Not Collective
Input Parameter:
mapping- mapping data structure
Output Parameter:
bs- the blocksize
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingGetBlockSize
PETSc.LibPETSc.ISLocalToGlobalMappingGetIndices — Method
array::Vector{PetscInt} = ISLocalToGlobalMappingGetIndices(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping)Get global indices for every local point that is mapped
Not Collective
Input Parameter:
ltog- local to global mapping
Output Parameter:
array- array of indices, the length of this array may be obtained withISLocalToGlobalMappingGetSize()
Level: advanced
-seealso: , ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingApply(), ISLocalToGlobalMappingRestoreIndices(), ISLocalToGlobalMappingGetBlockIndices(), ISLocalToGlobalMappingRestoreBlockIndices()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingGetIndices
PETSc.LibPETSc.ISLocalToGlobalMappingGetInfo — Method
nproc::PetscInt,procs::Vector{PetscInt},numprocs::Vector{PetscInt},indices::Vector{PetscInt} = ISLocalToGlobalMappingGetInfo(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping)Gets the neighbor information for each process
Collective the first time it is called
Input Parameter:
mapping- the mapping from local to global indexing
Output Parameters:
nproc- number of processes that are connected to the calling processprocs- neighboring processesnumprocs- number of indices for each processindices- indices (in local numbering) shared with neighbors (sorted by global numbering)
Level: advanced
-seealso: , ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingRestoreInfo(), ISLocalToGlobalMappingGetNodeInfo()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingGetInfo
PETSc.LibPETSc.ISLocalToGlobalMappingGetNodeInfo — Method
n::PetscInt,n_procs::Vector{PetscInt},procs::Vector{PetscInt} = ISLocalToGlobalMappingGetNodeInfo(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping)Gets the neighbor information of local nodes
Collective the first time it is called
Input Parameter:
mapping- the mapping from local to global indexing
Output Parameters:
n- number of local nodesn_procs- an array storing the number of processes for each local node (including self)procs- the processes' rank for each local node (sorted, self is first)
Level: advanced
-seealso: , ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingGetInfo(), ISLocalToGlobalMappingRestoreNodeInfo(), ISLocalToGlobalMappingGetBlockNodeInfo()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingGetNodeInfo
PETSc.LibPETSc.ISLocalToGlobalMappingGetSize — Method
n::PetscInt = ISLocalToGlobalMappingGetSize(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping)Gets the local size of a local to global mapping
Not Collective
Input Parameter:
mapping- local to global mapping
Output Parameter:
n- the number of entries in the local mapping,ISLocalToGlobalMappingGetIndices()returns an array of this length
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreate()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingGetSize
PETSc.LibPETSc.ISLocalToGlobalMappingGetType — Method
type::ISLocalToGlobalMappingType = ISLocalToGlobalMappingGetType(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping)Get the type of the ISLocalToGlobalMapping
Not Collective
Input Parameter:
ltog- theISLocalToGlobalMappingobject
Output Parameter:
type- the type
Level: intermediate
-seealso: , ISLocalToGlobalMappingType, ISLocalToGlobalMappingRegister(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingSetType()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingGetType
PETSc.LibPETSc.ISLocalToGlobalMappingLoad — Method
ISLocalToGlobalMappingLoad(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, viewer::PetscViewer)Loads a local
Collective on viewer
Input Parameters:
mapping- the newly loaded map, this needs to have been created withISLocalToGlobalMappingCreate()or some related function before a call toISLocalToGlobalMappingLoad()viewer- binary file viewer, obtained fromPetscViewerBinaryOpen()
Level: intermediate
-seealso: , PetscViewer, ISLocalToGlobalMapping, ISLocalToGlobalMappingView(), ISLocalToGlobalMappingCreate()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingLoad
PETSc.LibPETSc.ISLocalToGlobalMappingRegister — Method
ISLocalToGlobalMappingRegister(petsclib::PetscLibType,sname::String, fnc::external)Registers a method for applying a global to local mapping with an ISLocalToGlobalMapping
Not Collective, No Fortran Support
Input Parameters:
sname- name of a new methodfunction- routine to create method context
-seealso: , ISLocalToGlobalMappingRegisterAll(), ISLocalToGlobalMappingRegisterDestroy(), ISLOCALTOGLOBALMAPPINGBASIC, ISLOCALTOGLOBALMAPPINGHASH, ISLocalToGlobalMapping, ISLocalToGlobalMappingApply()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingRegister
PETSc.LibPETSc.ISLocalToGlobalMappingRegisterAll — Method
ISLocalToGlobalMappingRegisterAll(petsclib::PetscLibType)Registers all of the local to global mapping components in the IS package.
Not Collective
Level: advanced
-seealso: , ISRegister(), ISLocalToGlobalRegister()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingRegisterAll
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreBlockIndices — Method
ISLocalToGlobalMappingRestoreBlockIndices(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping, array::Vector{PetscInt})Restore indices obtained with ISLocalToGlobalMappingGetBlockIndices()
Not Collective
Input Parameters:
ltog- local to global mappingarray- array of indices
Level: advanced
-seealso: , ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingApply(), ISLocalToGlobalMappingGetIndices()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingRestoreBlockIndices
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreBlockInfo — Method
ISLocalToGlobalMappingRestoreBlockInfo(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, nproc::PetscInt, procs::Vector{PetscInt}, numprocs::Vector{PetscInt}, indices::Vector{PetscInt})Frees the memory allocated by ISLocalToGlobalMappingGetBlockInfo()
Not Collective
Input Parameters:
mapping- the mapping from local to global indexingnproc- number of processes that are connected to the calling processprocs- neighboring processesnumprocs- number of block indices for each processindices- block indices (in local numbering) shared with neighbors (sorted by global numbering)
Level: advanced
-seealso: , ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingGetInfo()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingRestoreBlockInfo
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreBlockNodeInfo — Method
ISLocalToGlobalMappingRestoreBlockNodeInfo(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, n::PetscInt, n_procs::Vector{PetscInt}, procs::Vector{PetscInt})Frees the memory allocated by ISLocalToGlobalMappingGetBlockNodeInfo()
Not Collective
Input Parameters:
mapping- the mapping from local to global indexingn- number of local block nodesn_procs- an array storing the number of processes for each local block nodes (including self)procs- the processes' rank for each local block node (sorted, self is first)
Level: advanced
-seealso: ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingGetBlockNodeInfo()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingRestoreBlockNodeInfo
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreIndices — Method
ISLocalToGlobalMappingRestoreIndices(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping, array::Vector{PetscInt})Restore indices obtained with ISLocalToGlobalMappingGetIndices()
Not Collective
Input Parameters:
ltog- local to global mappingarray- array of indices
Level: advanced
-seealso: , ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingApply(), ISLocalToGlobalMappingGetIndices()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingRestoreIndices
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreInfo — Method
ISLocalToGlobalMappingRestoreInfo(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, nproc::PetscInt, procs::Vector{PetscInt}, numprocs::Vector{PetscInt}, indices::Vector{PetscInt})Frees the memory allocated by ISLocalToGlobalMappingGetInfo()
Not Collective
Input Parameters:
mapping- the mapping from local to global indexingnproc- number of processes that are connected to the calling processprocs- neighboring processesnumprocs- number of indices for each processindices- indices (in local numbering) shared with neighbors (sorted by global numbering)
Level: advanced
-seealso: , ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingGetInfo()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingRestoreInfo
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreNodeInfo — Method
ISLocalToGlobalMappingRestoreNodeInfo(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, n::PetscInt, n_procs::Vector{PetscInt}, procs::Vector{PetscInt})Frees the memory allocated by ISLocalToGlobalMappingGetNodeInfo()
Not Collective
Input Parameters:
mapping- the mapping from local to global indexingn- number of local nodesn_procs- an array storing the number of processes for each local node (including self)procs- the processes' rank for each local node (sorted, self is first)
Level: advanced
-seealso: , ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingGetInfo()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingRestoreNodeInfo
PETSc.LibPETSc.ISLocalToGlobalMappingSetBlockSize — Method
ISLocalToGlobalMappingSetBlockSize(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, bs::PetscInt)Sets the blocksize of the mapping
Not Collective
Input Parameters:
mapping- mapping data structurebs- the blocksize
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingSetBlockSize
PETSc.LibPETSc.ISLocalToGlobalMappingSetFromOptions — Method
ISLocalToGlobalMappingSetFromOptions(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping)Set mapping options from the options database.
Not Collective
Input Parameter:
mapping- mapping data structure
Options Database Key:
-islocaltoglobalmapping_type- <basic,hash> nonscalable and scalable versions
Level: advanced
-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLOCALTOGLOBALMAPPINGBASIC, ISLOCALTOGLOBALMAPPINGHASH, ISLocalToGlobalMappingSetType(), ISLocalToGlobalMappingType
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingSetFromOptions
PETSc.LibPETSc.ISLocalToGlobalMappingSetType — Method
ISLocalToGlobalMappingSetType(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping, type::ISLocalToGlobalMappingType)Sets the implementation type ISLocalToGlobalMapping will use
Logically Collective
Input Parameters:
ltog- theISLocalToGlobalMappingobjecttype- a known method
Options Database Key:
-islocaltoglobalmapping_type <method>- Sets the method; use -help for a list of available methods (for instance, basic or hash)
Level: intermediate
-seealso: , ISLocalToGlobalMappingType, ISLocalToGlobalMappingRegister(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingGetType()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingSetType
PETSc.LibPETSc.ISLocalToGlobalMappingView — Method
ISLocalToGlobalMappingView(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, viewer::PetscViewer)View a local to global mapping
Collective on viewer
Input Parameters:
mapping- local to global mappingviewer- viewer
Level: intermediate
-seealso: , PetscViewer, ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreate()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingView
PETSc.LibPETSc.ISLocalToGlobalMappingViewFromOptions — Method
ISLocalToGlobalMappingViewFromOptions(petsclib::PetscLibType,A::ISLocalToGlobalMapping, obj::PetscObject, name::String)View an ISLocalToGlobalMapping based on values in the options database
Collective
Input Parameters:
A- the local to global mapping objectobj- Optional object that provides the options prefix used for the options database queryname- command line option
Level: intermediate
-seealso: , PetscViewer, ISLocalToGlobalMapping, ISLocalToGlobalMappingView, PetscObjectViewFromOptions(), ISLocalToGlobalMappingCreate()
External Links
- PETSc Manual:
Vec/ISLocalToGlobalMappingViewFromOptions