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 ISGetLocalSize to get the local portion
  • Scatter operations handle parallel communication automatically

Function Reference

PETSc.LibPETSc.ISAllGatherMethod
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

source
PETSc.LibPETSc.ISAllGatherColorsMethod
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 indices
  • n - local size of set
  • lindices - local colors

Output Parameters:

  • outN - total number of indices
  • outindices - all of the colors

Level: intermediate

-seealso: ISColoringValue, ISColoring(), ISCreateGeneral(), ISCreateStride(), ISCreateBlock(), ISAllGather()

External Links

source
PETSc.LibPETSc.ISBlockGetIndicesMethod
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

source
PETSc.LibPETSc.ISBlockGetLocalSizeMethod
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

source
PETSc.LibPETSc.ISBlockGetSizeMethod
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

source
PETSc.LibPETSc.ISBlockRestoreIndicesMethod
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

source
PETSc.LibPETSc.ISBlockSetIndicesMethod
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 set
  • bs - number of elements in each block
  • n - 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 size
  • mode - see PetscCopyMode, only PETSC_COPY_VALUES and PETSC_OWN_POINTER are supported

Level: beginner

-seealso: , IS, ISCreateStride(), ISCreateGeneral(), ISAllGather(), ISCreateBlock(), ISBLOCK, ISGeneralSetIndices()

External Links

source
PETSc.LibPETSc.ISBuildTwoSidedMethod
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 - an IS describes to which rank each entry will be mapped. Negative target rank will be ignored
  • toindx - an IS describes what indices should send. NULL means sending natural numbering

Output Parameter:

  • rows - contains new numbers from remote or local

Level: advanced

-seealso: , IS, MatPartitioningCreate(), ISPartitioningToNumbering(), ISPartitioningCount()

External Links

source
PETSc.LibPETSc.ISClearInfoCacheMethod
ISClearInfoCache(petsclib::PetscLibType,is::IS, clear_permanent_loc::PetscBool)

clear the cache of computed index set properties

Not Collective

Input Parameters:

  • is - the index set
  • clear_permanent_local - whether to remove the permanent status of local properties

Level: developer

-seealso: IS, ISInfo, ISInfoType, ISSetInfo()

External Links

source
PETSc.LibPETSc.ISComplementMethod
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 set
  • nmin - the first index desired in the local part of the complement
  • nmax - the largest index desired in the local part of the complement (note that all indices in is must be greater or equal to nmin and less than nmax)

Output Parameter:

  • isout - the complement

Level: intermediate

-seealso: , IS, ISCreateGeneral(), ISCreateStride(), ISCreateBlock(), ISAllGather()

External Links

source
PETSc.LibPETSc.ISComplementVecMethod
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 PETSc IS
  • V - the reference vector space

Output Parameter:

  • T - the complement of S

Level: advanced

-seealso: IS, Vec, ISCreateGeneral()

External Links

source
PETSc.LibPETSc.ISCompressIndicesGeneralMethod
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 set
  • nkeys - expected number of keys when using PETSC_USE_CTABLE
  • bs - the size of block
  • imax - the number of index sets
  • is_in - the non-blocked array of index sets

Output Parameter:

  • is_out - the blocked new index set, as ISGENERAL, not as ISBLOCK

Level: intermediate

-seealso: , IS, ISGENERAL, ISExpandIndicesGeneral()

External Links

source
PETSc.LibPETSc.ISConcatenateMethod
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 concatenated IS.
  • len - size of islist array (nonnegative)
  • islist - array of index sets

Output Parameter:

  • isout - The concatenated index set; empty, if len == 0.

Level: intermediate

-seealso: , IS, ISDifference(), ISSum(), ISExpand(), ISIntersect()

External Links

source
PETSc.LibPETSc.ISContiguousLocalMethod
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 set
  • gstart - global start
  • gend - global end

Output Parameters:

  • start - start of contiguous block, as an offset from gstart
  • contig - PETSC_TRUE if the index set refers to contiguous entries on this process, else PETSC_FALSE

Level: developer

-seealso: IS, ISGetLocalSize(), VecGetOwnershipRange()

External Links

source
PETSc.LibPETSc.ISCopyMethod
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

source
PETSc.LibPETSc.ISCreateMethod
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

source
PETSc.LibPETSc.ISCreateBlockMethod
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 communicator
  • bs - number of elements in each block
  • n - 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 size
  • mode - see PetscCopyMode, only PETSC_COPY_VALUES and PETSC_OWN_POINTER are supported in this routine

Output Parameter:

  • is - the new index set

Level: beginner

-seealso: , IS, ISCreateStride(), ISCreateGeneral(), ISAllGather(), ISBlockSetIndices(), ISBLOCK, ISGENERAL

External Links

source
PETSc.LibPETSc.ISCreateGeneralMethod
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 communicator
  • n - the length of the index set
  • idx - the list of integers
  • mode - PETSC_COPY_VALUES, PETSC_OWN_POINTER, or PETSC_USE_POINTER; see PetscCopyMode for 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

source
PETSc.LibPETSc.ISCreateStrideMethod
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 communicator
  • n - the length of the locally owned portion of the index set
  • first - the first element of the locally owned portion of the index set
  • step - the change to the next index

Output Parameter:

  • is - the new index set

Level: beginner

-seealso: , IS, ISStrideSetStride(), ISCreateGeneral(), ISCreateBlock(), ISAllGather(), ISSTRIDE

External Links

source
PETSc.LibPETSc.ISCreateSubISMethod
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 set
  • comps - which components we will extract from is

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

source
PETSc.LibPETSc.ISDestroyMethod
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

source
PETSc.LibPETSc.ISDifferenceMethod
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 it
  • is2 - index values to be removed

Output Parameter:

  • isout - is1 - is2

Level: intermediate

-seealso: , IS, ISDestroy(), ISView(), ISSum(), ISExpand()

External Links

source
PETSc.LibPETSc.ISDuplicateMethod
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

source
PETSc.LibPETSc.ISEmbedMethod
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 - IS to embed
  • b - IS to embed into
  • drop - flag indicating whether to drop indices of a that are not in b.

Output Parameter:

  • c - local embedding indices

Level: developer

-seealso: IS, ISLocalToGlobalMapping

External Links

source
PETSc.LibPETSc.ISEqualMethod
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 compare
  • is2 - second index set to compare

Output Parameter:

  • flg - output flag, either PETSC_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

source
PETSc.LibPETSc.ISEqualUnsortedMethod
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 compare
  • is2 - second index set to compare

Output Parameter:

  • flg - output flag, either PETSC_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, ISEqual()

External Links

source
PETSc.LibPETSc.ISExpandMethod
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 set
  • is2 - index values to be added

Output Parameter:

  • isout - is1 + is2 The index set is2 is appended to is1 removing duplicates

Level: intermediate

-seealso: , IS, ISDestroy(), ISView(), ISDifference(), ISSum(), ISIntersect()

External Links

source
PETSc.LibPETSc.ISExpandIndicesGeneralMethod
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 when PETSC_USE_CTABLE is used
  • bs - the size of block
  • imax - the number of index sets
  • is_in - the blocked array of index sets, must be as large as imax

Output Parameter:

  • is_out - the non-blocked new index set, as ISGENERAL, must be as large as imax

Level: intermediate

-seealso: , IS, ISGENERAL, ISCompressIndicesGeneral()

External Links

source
PETSc.LibPETSc.ISGeneralFilterMethod
ISGeneralFilter(petsclib::PetscLibType,is::IS, start::PetscInt, _::PetscInt)

Remove all indices outside of [start, end) from an ISGENERAL

Collective

Input Parameters:

  • is - the index set
  • start - the lowest index kept
  • end - one more than the highest index kept, startend_

Level: beginner

-seealso: , IS, ISGENERAL, ISCreateGeneral(), ISGeneralSetIndices()

External Links

source
PETSc.LibPETSc.ISGeneralSetIndicesMethod
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 set
  • n - the length of the index set
  • idx - the list of integers
  • mode - see PetscCopyMode for meaning of this flag.

Level: beginner

-seealso: , IS, ISBLOCK, ISCreateGeneral(), ISGeneralSetIndicesFromMask(), ISBlockSetIndices(), ISGENERAL, PetscCopyMode

External Links

source
PETSc.LibPETSc.ISGeneralSetIndicesFromMaskMethod
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 set
  • rstart - 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 each PETSC_TRUE value in the array

Level: beginner

-seealso: , IS, ISCreateGeneral(), ISGeneralSetIndices(), ISGENERAL

External Links

source
PETSc.LibPETSc.ISGetBlockSizeMethod
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

source
PETSc.LibPETSc.ISGetCompressOutputMethod
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

source
PETSc.LibPETSc.ISGetIndicesMethod
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

source
PETSc.LibPETSc.ISGetInfoMethod
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 set
  • info - describing a property of the index set, one of those listed in the documentation of ISSetInfo()
  • compute - if PETSC_FALSE, the property will not be computed if it is not already known and the property will be assumed to be false
  • type - 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

source
PETSc.LibPETSc.ISGetLayoutMethod
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

source
PETSc.LibPETSc.ISGetLocalSizeMethod
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

source
PETSc.LibPETSc.ISGetMinMaxMethod
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 pass NULL
  • max - the maximum value, you may pass NULL

Level: intermediate

-seealso: IS, ISGetIndices(), ISRestoreIndices()

External Links

source
PETSc.LibPETSc.ISGetNonlocalISMethod
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 - sequential IS with indices identical to the result of

ISGetNonlocalIndices()

Level: intermediate

-seealso: IS, ISGetNonlocalIndices(), ISRestoreNonlocalIndices(), ISAllGather(), ISGetSize()

External Links

source
PETSc.LibPETSc.ISGetNonlocalIndicesMethod
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

source
PETSc.LibPETSc.ISGetPointRangeMethod
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 - The IS object

Output Parameters:

  • pStart - The first index, see notes
  • pEnd - One past the last index, see notes
  • points - The indices, see notes

Level: intermediate

-seealso: , IS, ISRestorePointRange(), ISGetPointSubrange(), ISGetIndices(), ISCreateStride()

External Links

source
PETSc.LibPETSc.ISGetPointSubrangeMethod
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 - The IS object to be configured
  • pStart - The first index of the subrange
  • pEnd - One past the last index for the subrange
  • points - The indices for the entire range, from ISGetPointRange()

Output Parameters:

  • subpointIS - The IS object now configured to be a subrange

Level: intermediate

-seealso: , IS, ISGetPointRange(), ISRestorePointRange(), ISGetIndices(), ISCreateStride()

External Links

source
PETSc.LibPETSc.ISGetSizeMethod
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

source
PETSc.LibPETSc.ISGetTotalIndicesMethod
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

source
PETSc.LibPETSc.ISGetTypeMethod
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

source
PETSc.LibPETSc.ISGlobalToLocalMappingApplyMethod
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 numbering
  • type - 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 map
  • idx - global indices to map

Output Parameters:

  • nout - number of indices in output array (if type == IS_GTOLM_MASK then 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

source
PETSc.LibPETSc.ISGlobalToLocalMappingApplyBlockMethod
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 numbering
  • type - 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 map
  • idx - global indices to map

Output Parameters:

  • nout - number of indices in output array (if type == IS_GTOLM_MASK then 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

source
PETSc.LibPETSc.ISGlobalToLocalMappingApplyISMethod
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 numbering
  • type - 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

source
PETSc.LibPETSc.ISIdentityMethod
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_TRUE if an identity, else PETSC_FALSE

Level: intermediate

-seealso: IS, ISSetIdentity(), ISGetInfo()

External Links

source
PETSc.LibPETSc.ISInitializePackageMethod
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

source
PETSc.LibPETSc.ISIntersectMethod
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 set
  • is2 - second index set

Output Parameter:

  • isout - the sorted intersection of is1 and is2

Level: intermediate

-seealso: , IS, ISDestroy(), ISView(), ISDifference(), ISSum(), ISExpand(), ISConcatenate()

External Links

source
PETSc.LibPETSc.ISInvertPermutationMethod
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 set
  • nlocal - 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

source
PETSc.LibPETSc.ISListToPairMethod
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_Comm
  • listlen - IS list length
  • islist - IS list

Output Parameters:

  • xis - domain IS
  • yis - range IS

Level: developer

-seealso: IS, ISPairToList()

External Links

source
PETSc.LibPETSc.ISLoadMethod
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 with ISCreate() or some related function before a call to ISLoad().
  • viewer - binary file viewer, obtained from PetscViewerBinaryOpen() or HDF5 file viewer, obtained from PetscViewerHDF5Open()

Level: intermediate

-seealso: IS, PetscViewerBinaryOpen(), ISView(), MatLoad(), VecLoad()

External Links

source
PETSc.LibPETSc.ISLocateMethod
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 set
  • key - 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

source
PETSc.LibPETSc.ISOnCommMethod
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 set
  • comm - communicator for new index set
  • mode - copy semantics, PETSC_USE_POINTER for no-copy if possible, otherwise PETSC_COPY_VALUES

Output Parameter:

  • newis - new IS on comm

Level: advanced

-seealso: IS

External Links

source
PETSc.LibPETSc.ISPairToListMethod
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 - domain IS
  • yis - range IS, the maximum value must be less than PETSC_MPI_INT_MAX

Output Parameters:

  • listlen - length of islist
  • islist - list of ISs breaking up indices by color

Level: developer

-seealso: IS, ISListToPair()

External Links

source
PETSc.LibPETSc.ISPartitioningCountMethod
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 by MatPartitioningApply() or MatPartitioningApplyND()
  • 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

source
PETSc.LibPETSc.ISPartitioningToNumberingMethod
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 by MatPartitioningApply() or MatPartitioningApplyND()

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

source
PETSc.LibPETSc.ISPermutationMethod
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_TRUE if a permutation, else PETSC_FALSE

Level: intermediate

-seealso: IS, ISSetPermutation(), ISGetInfo()

External Links

source
PETSc.LibPETSc.ISRegisterMethod
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 routine
  • function - The creation routine itself

-seealso: , IS, ISType, ISSetType(), ISRegisterAll(), ISRegisterDestroy()

External Links

source
PETSc.LibPETSc.ISRenumberMethod
N::PetscInt = ISRenumber(petsclib::PetscLibType,subset::IS, subset_mult::IS, subset_n::IS)

Renumbers the non

Collective

Input Parameters:

  • subset - the index set
  • subset_mult - the multiplicity of each entry in subset (optional, can be NULL)

Output Parameters:

  • N - one past the largest entry of the new IS
  • subset_n - the new IS

Level: intermediate

-seealso: IS

External Links

source
PETSc.LibPETSc.ISRestoreIndicesMethod
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 set
  • ptr - the pointer obtained by ISGetIndices()

Level: intermediate

-seealso: IS, ISGetIndices()

External Links

source
PETSc.LibPETSc.ISRestoreNonlocalISMethod
ISRestoreNonlocalIS(petsclib::PetscLibType,is::IS, complement::IS)

Restore the IS obtained with ISGetNonlocalIS().

Not collective.

Input Parameters:

  • is - the index set
  • complement - index set of is's nonlocal indices

Level: intermediate

-seealso: IS, ISGetNonlocalIS(), ISGetNonlocalIndices(), ISRestoreNonlocalIndices()

External Links

source
PETSc.LibPETSc.ISRestoreNonlocalIndicesMethod
ISRestoreNonlocalIndices(petsclib::PetscLibType,is::IS, indices::Vector{PetscInt})

Restore the index array obtained with ISGetNonlocalIndices().

Not Collective.

Input Parameters:

  • is - the index set
  • indices - index array; must be the array obtained with ISGetNonlocalIndices()

Level: intermediate

-seealso: IS, ISGetTotalIndices(), ISGetNonlocalIndices(), ISRestoreTotalIndices()

External Links

source
PETSc.LibPETSc.ISRestorePointRangeMethod
ISRestorePointRange(petsclib::PetscLibType,pointIS::IS, pStart::PetscInt, pEnd::PetscInt, points::Vector{PetscInt})

Destroys the traversal description created with ISGetPointRange()

Not Collective

Input Parameters:

  • pointIS - The IS object
  • pStart - The first index, from ISGetPointRange()
  • pEnd - One past the last index, from ISGetPointRange()
  • points - The indices, from ISGetPointRange()

Level: intermediate

-seealso: , IS, ISGetPointRange(), ISGetPointSubrange(), ISGetIndices(), ISCreateStride()

External Links

source
PETSc.LibPETSc.ISRestoreTotalIndicesMethod
ISRestoreTotalIndices(petsclib::PetscLibType,is::IS, indices::Vector{PetscInt})

Restore the index array obtained with ISGetTotalIndices().

Not Collective.

Input Parameters:

  • is - the index set
  • indices - index array; must be the array obtained with ISGetTotalIndices()

Level: intermediate

-seealso: IS, ISGetNonlocalIndices()

External Links

source
PETSc.LibPETSc.ISSetBlockSizeMethod
ISSetBlockSize(petsclib::PetscLibType,is::IS, bs::PetscInt)

informs an index set that it has a given block size

Logicall Collective

Input Parameters:

  • is - index set
  • bs - block size

Level: intermediate

-seealso: IS, ISGetBlockSize(), ISCreateBlock(), ISBlockGetIndices(),

External Links

source
PETSc.LibPETSc.ISSetCompressOutputMethod
ISSetCompressOutput(petsclib::PetscLibType,is::IS, compress::PetscBool)

set the flag for output compression

Logicall Collective

Input Parameters:

  • is - index set
  • compress - flag for output compression

Level: intermediate

-seealso: IS, ISGetCompressOutput(), ISView()

External Links

source
PETSc.LibPETSc.ISSetIdentityMethod
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

source
PETSc.LibPETSc.ISSetInfoMethod
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 set
  • info - describing a property of the index set, one of those listed below,
  • type - IS_LOCAL if the information describes the local portion of the index set,

IS_GLOBAL if it describes the whole index set

  • permanent - PETSC_TRUE if it is known that the property will persist through changes to the index set, PETSC_FALSE otherwise

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 order
  • IS_UNIQUE - each entry in the [local part of the] index set is unique
  • IS_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 set
  • IS_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

source
PETSc.LibPETSc.ISSetLayoutMethod
ISSetLayout(petsclib::PetscLibType,is::IS, map::PetscLayout)

set PetscLayout describing index set layout

Collective

Input Parameters:

  • is - the index set
  • map - the layout

Level: developer

-seealso: IS, PetscLayout, ISCreate(), ISGetLayout(), ISGetSize(), ISGetLocalSize()

External Links

source
PETSc.LibPETSc.ISSetPermutationMethod
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

source
PETSc.LibPETSc.ISSetTypeMethod
ISSetType(petsclib::PetscLibType,is::IS, method::ISType)

Builds a index set, for a particular ISType

Collective

Input Parameters:

  • is - The index set object
  • method - The name of the index set type

Options Database Key:

  • -is_type <type> - Sets the index set type; use -help for a list of available types

Level: intermediate

-seealso: , IS, ISGENERAL, ISBLOCK, ISGetType(), ISCreate(), ISCreateGeneral(), ISCreateStride(), ISCreateBlock()

External Links

source
PETSc.LibPETSc.ISShiftMethod
ISShift(petsclib::PetscLibType,is::IS, offset::PetscInt, isy::IS)

Shift all indices by given offset

Collective

Input Parameters:

  • is - the index set
  • offset - the offset

Output Parameter:

  • isy - the shifted copy of the input index set

Level: beginner

-seealso: ISDuplicate(), ISCopy()

External Links

source
PETSc.LibPETSc.ISSortMethod
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

source
PETSc.LibPETSc.ISSortPermutationMethod
ISSortPermutation(petsclib::PetscLibType,f::IS, always::PetscBool, h::IS)

calculate the permutation of the indices into a nondecreasing order.

Not Collective

Input Parameters:

  • f - IS to sort
  • always - build the permutation even when f's indices are nondecreasing.

Output Parameter:

  • h - permutation or NULL, if f is nondecreasing and always == PETSC_FALSE.

Level: advanced

-seealso: IS, ISLocalToGlobalMapping, ISSort()

External Links

source
PETSc.LibPETSc.ISSortRemoveDupsMethod
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

source
PETSc.LibPETSc.ISSortedMethod
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, either PETSC_TRUE if the index set is sorted,

or PETSC_FALSE otherwise.

Level: intermediate

-seealso: ISSort(), ISSortRemoveDups()

External Links

source
PETSc.LibPETSc.ISStrideGetInfoMethod
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 index
  • step - the stride width

Level: intermediate

-seealso: , IS, ISCreateStride(), ISGetSize(), ISSTRIDE

External Links

source
PETSc.LibPETSc.ISStrideSetStrideMethod
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 set
  • n - the length of the locally owned portion of the index set
  • first - the first element of the locally owned portion of the index set
  • step - the change to the next index

Level: beginner

-seealso: , IS, ISCreateGeneral(), ISCreateBlock(), ISAllGather(), ISSTRIDE, ISCreateStride(), ISStrideGetInfo()

External Links

source
PETSc.LibPETSc.ISSumMethod
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 extended
  • is2 - index values to be added

Output Parameter:

  • is3 - the sum; this can not be is1 or is2

Level: intermediate

-seealso: , IS, ISDestroy(), ISView(), ISDifference(), ISExpand()

External Links

source
PETSc.LibPETSc.ISToGeneralMethod
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

source
PETSc.LibPETSc.ISViewMethod
ISView(petsclib::PetscLibType,is::IS, viewer::PetscViewer)

Displays an index set.

Collective

Input Parameters:

  • is - the index set
  • viewer - viewer used to display the set, for example PETSC_VIEWER_STDOUT_SELF.

Level: intermediate

-seealso: IS, PetscViewer, PetscViewerASCIIOpen(), ISViewFromOptions()

External Links

source
PETSc.LibPETSc.ISViewFromOptionsMethod
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 set
  • obj - Optional object that provides the prefix for the options database
  • name - command line option

Level: intermediate

-seealso: IS, ISView(), PetscObjectViewFromOptions(), ISCreate()

External Links

source

IS Add-ons

Additional IS utilities and helper functions:

PETSc.LibPETSc.ISColoringCreateMethod
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 coloring
  • ncolors - max color value
  • n - number of nodes on this processor
  • colors - array containing the colors for this MPI rank, color numbers begin at 0, for each local node
  • mode - see PetscCopyMode for meaning of this flag.

Output Parameter:

  • iscoloring - the resulting coloring data structure

Options Database Key:

  • -is_coloring_view - Activates ISColoringView()

Level: advanced

-seealso: ISColoring, ISColoringValue, MatColoringCreate(), ISColoringView(), ISColoringDestroy(), ISColoringSetType()

External Links

source
PETSc.LibPETSc.ISColoringDestroyMethod
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

source
PETSc.LibPETSc.ISColoringGetColorsMethod
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 nodes
  • nc - number of colors
  • colors - color for each node

Level: advanced

-seealso: ISColoring, ISColoringValue, ISColoringRestoreIS(), ISColoringView(), ISColoringGetIS()

External Links

source
PETSc.LibPETSc.ISColoringGetISMethod
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 context
  • mode - if this value is PETSC_OWN_POINTER then the caller owns the pointer and must free the array of IS and each IS in the array

Output Parameters:

  • nn - number of index sets in the coloring context
  • isis - array of index sets

Level: advanced

-seealso: ISColoring, IS, ISColoringRestoreIS(), ISColoringView(), ISColoringGetColoring(), ISColoringGetColors()

External Links

source
PETSc.LibPETSc.ISColoringGetTypeMethod
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 - either IS_COLORING_LOCAL or IS_COLORING_GLOBAL

Level: intermediate

-seealso: MatFDColoringCreate(), ISColoring, ISColoringType, ISColoringCreate(), IS_COLORING_LOCAL, IS_COLORING_GLOBAL, ISColoringSetType()

External Links

source
PETSc.LibPETSc.ISColoringRestoreISMethod
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 context
  • mode - who retains ownership of the is
  • is - array of index sets

Level: advanced

-seealso: ISColoring(), IS, ISColoringGetIS(), ISColoringView(), PetscCopyMode

External Links

source
PETSc.LibPETSc.ISColoringSetTypeMethod
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 object
  • type - either IS_COLORING_LOCAL or IS_COLORING_GLOBAL

Level: intermediate

-seealso: MatFDColoringCreate(), ISColoring, ISColoringType, ISColoringCreate(), IS_COLORING_LOCAL, IS_COLORING_GLOBAL, ISColoringGetType()

External Links

source
PETSc.LibPETSc.ISColoringViewMethod
ISColoringView(petsclib::PetscLibType,iscoloring::ISColoring, viewer::PetscViewer)

Views an ISColoring coloring context.

Collective

Input Parameters:

  • iscoloring - the coloring context
  • viewer - the viewer

Level: advanced

-seealso: ISColoring(), ISColoringViewFromOptions(), ISColoringDestroy(), ISColoringGetIS(), MatColoring

External Links

source
PETSc.LibPETSc.ISColoringViewFromOptionsMethod
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 - the ISColoring object
  • bobj - prefix to use for viewing, or NULL to use prefix of mat
  • optionname - option to activate viewing

Level: intermediate

-seealso: ISColoring, ISColoringView()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingApplyMethod
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 context
  • N - number of integers
  • in - 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

source
PETSc.LibPETSc.ISLocalToGlobalMappingApplyBlockMethod
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 context
  • N - number of integers
  • in - 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

source
PETSc.LibPETSc.ISLocalToGlobalMappingApplyISMethod
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 numbering
  • is - index set in local numbering

Output Parameter:

  • newis - index set in global numbering

Level: advanced

-seealso: , ISLocalToGlobalMappingApply(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingDestroy(), ISGlobalToLocalMappingApply()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingConcatenateMethod
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 concatenate
  • n - number of mappings to concatenate
  • ltogs - local to global mappings

Output Parameter:

  • ltogcat - new mapping

Level: advanced

-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingCreate()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingCreateMethod
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 communicator
  • bs - the block size
  • n - the number of local elements divided by the block size, or equivalently the number of block indices
  • indices - 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 bs
  • mode - see PetscCopyMode

Output Parameter:

  • mapping - new mapping data structure

Level: advanced

-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingSetFromOptions(), ISLOCALTOGLOBALMAPPINGBASIC, ISLOCALTOGLOBALMAPPINGHASH ISLocalToGlobalMappingSetType(), ISLocalToGlobalMappingType

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingCreateISMethod
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

source
PETSc.LibPETSc.ISLocalToGlobalMappingCreateSFMethod
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, or PETSC_DECIDE to compute contiguous global numbering automatically

Output Parameter:

  • mapping - new mapping data structure

Level: advanced

-seealso: , PetscSF, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingSetFromOptions()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingDestroyMethod
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

source
PETSc.LibPETSc.ISLocalToGlobalMappingDuplicateMethod
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

source
PETSc.LibPETSc.ISLocalToGlobalMappingGetBlockIndicesMethod
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

source
PETSc.LibPETSc.ISLocalToGlobalMappingGetBlockInfoMethod
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 process
  • procs - neighboring processes
  • numprocs - number of block indices for each process
  • indices - block indices (in local numbering) shared with neighbors (sorted by global numbering)

Level: advanced

-seealso: , ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingRestoreBlockInfo(), ISLocalToGlobalMappingGetBlockMultiLeavesSF()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingGetBlockNodeInfoMethod
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 nodes
  • n_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

source
PETSc.LibPETSc.ISLocalToGlobalMappingGetBlockSizeMethod
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

source
PETSc.LibPETSc.ISLocalToGlobalMappingGetIndicesMethod
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 with ISLocalToGlobalMappingGetSize()

Level: advanced

-seealso: , ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingApply(), ISLocalToGlobalMappingRestoreIndices(), ISLocalToGlobalMappingGetBlockIndices(), ISLocalToGlobalMappingRestoreBlockIndices()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingGetInfoMethod
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 process
  • procs - neighboring processes
  • numprocs - number of indices for each process
  • indices - indices (in local numbering) shared with neighbors (sorted by global numbering)

Level: advanced

-seealso: , ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingRestoreInfo(), ISLocalToGlobalMappingGetNodeInfo()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingGetNodeInfoMethod
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 nodes
  • n_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

source
PETSc.LibPETSc.ISLocalToGlobalMappingGetSizeMethod
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

source
PETSc.LibPETSc.ISLocalToGlobalMappingGetTypeMethod
type::ISLocalToGlobalMappingType = ISLocalToGlobalMappingGetType(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping)

Get the type of the ISLocalToGlobalMapping

Not Collective

Input Parameter:

  • ltog - the ISLocalToGlobalMapping object

Output Parameter:

  • type - the type

Level: intermediate

-seealso: , ISLocalToGlobalMappingType, ISLocalToGlobalMappingRegister(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingSetType()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingLoadMethod
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 with ISLocalToGlobalMappingCreate() or some related function before a call to ISLocalToGlobalMappingLoad()
  • viewer - binary file viewer, obtained from PetscViewerBinaryOpen()

Level: intermediate

-seealso: , PetscViewer, ISLocalToGlobalMapping, ISLocalToGlobalMappingView(), ISLocalToGlobalMappingCreate()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingRegisterMethod
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 method
  • function - routine to create method context

-seealso: , ISLocalToGlobalMappingRegisterAll(), ISLocalToGlobalMappingRegisterDestroy(), ISLOCALTOGLOBALMAPPINGBASIC, ISLOCALTOGLOBALMAPPINGHASH, ISLocalToGlobalMapping, ISLocalToGlobalMappingApply()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreBlockIndicesMethod
ISLocalToGlobalMappingRestoreBlockIndices(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping, array::Vector{PetscInt})

Restore indices obtained with ISLocalToGlobalMappingGetBlockIndices()

Not Collective

Input Parameters:

  • ltog - local to global mapping
  • array - array of indices

Level: advanced

-seealso: , ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingApply(), ISLocalToGlobalMappingGetIndices()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreBlockInfoMethod
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 indexing
  • nproc - number of processes that are connected to the calling process
  • procs - neighboring processes
  • numprocs - number of block indices for each process
  • indices - block indices (in local numbering) shared with neighbors (sorted by global numbering)

Level: advanced

-seealso: , ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingGetInfo()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreBlockNodeInfoMethod
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 indexing
  • n - number of local block nodes
  • n_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

source
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreIndicesMethod
ISLocalToGlobalMappingRestoreIndices(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping, array::Vector{PetscInt})

Restore indices obtained with ISLocalToGlobalMappingGetIndices()

Not Collective

Input Parameters:

  • ltog - local to global mapping
  • array - array of indices

Level: advanced

-seealso: , ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingApply(), ISLocalToGlobalMappingGetIndices()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreInfoMethod
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 indexing
  • nproc - number of processes that are connected to the calling process
  • procs - neighboring processes
  • numprocs - number of indices for each process
  • indices - indices (in local numbering) shared with neighbors (sorted by global numbering)

Level: advanced

-seealso: , ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS(), ISLocalToGlobalMappingCreate(), ISLocalToGlobalMappingGetInfo()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingRestoreNodeInfoMethod
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 indexing
  • n - number of local nodes
  • n_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

source
PETSc.LibPETSc.ISLocalToGlobalMappingSetBlockSizeMethod
ISLocalToGlobalMappingSetBlockSize(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, bs::PetscInt)

Sets the blocksize of the mapping

Not Collective

Input Parameters:

  • mapping - mapping data structure
  • bs - the blocksize

Level: advanced

-seealso: , ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreateIS()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingSetFromOptionsMethod
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

source
PETSc.LibPETSc.ISLocalToGlobalMappingSetTypeMethod
ISLocalToGlobalMappingSetType(petsclib::PetscLibType,ltog::ISLocalToGlobalMapping, type::ISLocalToGlobalMappingType)

Sets the implementation type ISLocalToGlobalMapping will use

Logically Collective

Input Parameters:

  • ltog - the ISLocalToGlobalMapping object
  • type - 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

source
PETSc.LibPETSc.ISLocalToGlobalMappingViewMethod
ISLocalToGlobalMappingView(petsclib::PetscLibType,mapping::ISLocalToGlobalMapping, viewer::PetscViewer)

View a local to global mapping

Collective on viewer

Input Parameters:

  • mapping - local to global mapping
  • viewer - viewer

Level: intermediate

-seealso: , PetscViewer, ISLocalToGlobalMapping, ISLocalToGlobalMappingDestroy(), ISLocalToGlobalMappingCreate()

External Links

source
PETSc.LibPETSc.ISLocalToGlobalMappingViewFromOptionsMethod
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 object
  • obj - Optional object that provides the options prefix used for the options database query
  • name - command line option

Level: intermediate

-seealso: , PetscViewer, ISLocalToGlobalMapping, ISLocalToGlobalMappingView, PetscObjectViewFromOptions(), ISLocalToGlobalMappingCreate()

External Links

source