petsc4py.PETSc.LGMap#

class petsc4py.PETSc.LGMap#

Bases: Object

Mapping from a local to a global ordering.

Enumerations

GLMapMode

Enum describing mapping behavior when global indices are missing.

Type

Local to global map types.

Methods Summary

apply(indices[, result])

Convert a locally numbered list of integers to a global numbering.

applyBlock(indices[, result])

Convert a local block numbering to a global block numbering.

applyBlockInverse(indices[, mode])

Compute blocked local numbering from blocked global numbering.

applyIS(iset)

Create an index set with global numbering from a local numbering.

applyInverse(indices[, mode])

Compute local numbering from global numbering.

create(indices[, bsize, comm])

Create a local-to-global mapping.

createIS(iset)

Create a local-to-global mapping from an index set.

createSF(sf, start)

Create a local-to-global mapping from a star forest.

destroy()

Destroy the local-to-global mapping.

getBlockIndices()

Return the global indices for each local block.

getBlockInfo()

Determine the block indices shared with neighboring processes.

getBlockSize()

Return the block size of the local-to-global mapping.

getIndices()

Return the global indices for each local point in the mapping.

getInfo()

Determine the indices shared with neighboring processes.

getSize()

Return the local size of the local-to-global mapping.

setFromOptions()

Set mapping options from the options database.

setType(lgmap_type)

Set the type of the local-to-global map.

view([viewer])

View the local-to-global mapping.

Attributes Summary

block_indices

The global indices for each local block in the mapping.

block_info

Mapping describing block indices shared with neighboring processes.

block_size

The block size.

indices

The global indices for each local point in the mapping.

info

Mapping describing indices shared with neighboring processes.

size

The local size.

Methods Documentation

apply(indices, result=None)#

Convert a locally numbered list of integers to a global numbering.

Not collective.

Parameters:
  • indices (Sequence[int]) – Input indices in local numbering.

  • result (ArrayInt | None) – Array to write the global numbering to. If None then a new array will be allocated.

Returns:

Indices in global numbering. If result is not None then this is returned here.

Return type:

ArrayInt

Source code at petsc4py/PETSc/IS.pyx:1404

applyBlock(indices, result=None)#

Convert a local block numbering to a global block numbering.

Not collective.

Parameters:
  • indices (Sequence[int]) – Input block indices in local numbering.

  • result (ArrayInt | None) – Array to write the global numbering to. If None then a new array will be allocated.

Returns:

Block indices in global numbering. If result is not None then this is returned here.

Return type:

ArrayInt

Source code at petsc4py/PETSc/IS.pyx:1441

applyBlockInverse(indices, mode=None)#

Compute blocked local numbering from blocked global numbering.

Not collective.

Parameters:
  • indices (Sequence[int]) – Indices with a global block numbering.

  • mode (GLMapMode | str | None) – Flag indicating what to do with indices that have no local value, defaults to "mask".

Returns:

Indices with a local block numbering.

Return type:

ArrayInt

Source code at petsc4py/PETSc/IS.pyx:1542

applyIS(iset)#

Create an index set with global numbering from a local numbering.

Collective.

Parameters:

iset (IS) – Index set with local numbering.

Returns:

Index set with global numbering.

Return type:

IS

Source code at petsc4py/PETSc/IS.pyx:1478

applyInverse(indices, mode=None)#

Compute local numbering from global numbering.

Not collective.

Parameters:
  • indices (Sequence[int]) – Indices with a global numbering.

  • mode (GLMapMode | str | None) – Flag indicating what to do with indices that have no local value, defaults to "mask".

Returns:

Indices with a local numbering.

Return type:

ArrayInt

Source code at petsc4py/PETSc/IS.pyx:1503

create(indices, bsize=None, comm=None)#

Create a local-to-global mapping.

Not collective.

Parameters:
Return type:

Self

Source code at petsc4py/PETSc/IS.pyx:1187

createIS(iset)#

Create a local-to-global mapping from an index set.

Not collective.

Parameters:

iset (IS) – Index set containing the global numbers for each local number.

Return type:

Self

Source code at petsc4py/PETSc/IS.pyx:1222

createSF(sf, start)#

Create a local-to-global mapping from a star forest.

Collective.

Parameters:
  • sf (SF) – Star forest mapping contiguous local indices to (rank, offset).

  • start (int) – First global index on this process.

Return type:

Self

Source code at petsc4py/PETSc/IS.pyx:1243

destroy()#

Destroy the local-to-global mapping.

Not collective.

Source code at petsc4py/PETSc/IS.pyx:1174

Return type:

Self

getBlockIndices()#

Return the global indices for each local block.

Not collective.

Source code at petsc4py/PETSc/IS.pyx:1318

Return type:

ArrayInt

getBlockInfo()#

Determine the block indices shared with neighboring processes.

Collective.

Returns:

Mapping from neighboring processor number to an array of shared block indices (in local numbering).

Return type:

dict

Source code at petsc4py/PETSc/IS.pyx:1373

getBlockSize()#

Return the block size of the local-to-global mapping.

Not collective.

Source code at petsc4py/PETSc/IS.pyx:1280

Return type:

int

getIndices()#

Return the global indices for each local point in the mapping.

Not collective.

Source code at petsc4py/PETSc/IS.pyx:1294

Return type:

ArrayInt

getInfo()#

Determine the indices shared with neighboring processes.

Collective.

Returns:

Mapping from neighboring processor number to an array of shared indices (in local numbering).

Return type:

dict

Source code at petsc4py/PETSc/IS.pyx:1344

getSize()#

Return the local size of the local-to-global mapping.

Not collective.

Source code at petsc4py/PETSc/IS.pyx:1266

Return type:

int

setFromOptions()#

Set mapping options from the options database.

Not collective.

Source code at petsc4py/PETSc/IS.pyx:1143

Return type:

None

setType(lgmap_type)#

Set the type of the local-to-global map.

Logically collective.

Parameters:

lgmap_type (Type | str) – The type of the local-to-global mapping.

Return type:

None

Notes

Use -islocaltoglobalmapping_type to set the type in the options database.

Source code at petsc4py/PETSc/IS.pyx:1119

view(viewer=None)#

View the local-to-global mapping.

Not collective.

Parameters:

viewer (Viewer | None) – Viewer instance, defaults to an instance of Viewer.Type.ASCII.

Return type:

None

Source code at petsc4py/PETSc/IS.pyx:1155

Attributes Documentation

block_indices#

The global indices for each local block in the mapping.

Not collective.

Source code at petsc4py/PETSc/IS.pyx:1621

block_info#

Mapping describing block indices shared with neighboring processes.

Collective.

Source code at petsc4py/PETSc/IS.pyx:1647

block_size#

The block size.

Not collective.

Source code at petsc4py/PETSc/IS.pyx:1595

indices#

The global indices for each local point in the mapping.

Not collective.

Source code at petsc4py/PETSc/IS.pyx:1608

info#

Mapping describing indices shared with neighboring processes.

Collective.

Source code at petsc4py/PETSc/IS.pyx:1634

size#

The local size.

Not collective.

See also

LGMap.getSize

Source code at petsc4py/PETSc/IS.pyx:1582