petsc4py.PETSc.DMInterpolation#

class petsc4py.PETSc.DMInterpolation#

Bases: object

Interpolation on a mesh.

Methods Summary

create([comm])

Create a DMInterpolation context.

destroy()

Destroy the DMInterpolation context.

evaluate(dm, x[, v])

Calculate interpolated field values at the interpolation points.

getCoordinates()

Return the coordinates of each interpolation point.

getDim()

Return the spatial dimension of the interpolation context.

getDof()

Return the number of fields interpolated at a point.

getVector()

Return a Vec which can hold all the interpolated field values.

restoreVector(vec)

Restore a Vec which can hold all the interpolated field values.

setDim(dim)

Set the spatial dimension for the interpolation context.

setDof(dof)

Set the number of fields interpolated at a point.

setUp(dm[, redundantPoints, ignoreOutsideDomain])

Compute spatial indices for point location during interpolation.

Methods Documentation

create(comm=None)#

Create a DMInterpolation context.

Collective.

Parameters:

comm (Comm | None) – MPI communicator, defaults to COMM_SELF.

Return type:

Self

Source code at petsc4py/PETSc/DMUtils.pyx:13

destroy()#

Destroy the DMInterpolation context.

Collective.

Source code at petsc4py/PETSc/DMUtils.pyx:35

Return type:

Self

evaluate(dm, x, v=None)#

Calculate interpolated field values at the interpolation points.

Collective.

Parameters:
  • dm (DM) – The DM.

  • x (Vec) – The local vector containing the field to be interpolated.

  • v (Vec | None) – A vector capable of holding the interpolated field values.

Return type:

Vec

Source code at petsc4py/PETSc/DMUtils.pyx:48

getCoordinates()#

Return the coordinates of each interpolation point.

Collective.

The local vector entries correspond to interpolation points lying on this process, according to the associated DM.

Source code at petsc4py/PETSc/DMUtils.pyx:74

Return type:

Vec

getDim()#

Return the spatial dimension of the interpolation context.

Not collective.

Source code at petsc4py/PETSc/DMUtils.pyx:92

Return type:

int

getDof()#

Return the number of fields interpolated at a point.

Not collective.

Source code at petsc4py/PETSc/DMUtils.pyx:106

Return type:

int

getVector()#

Return a Vec which can hold all the interpolated field values.

Collective.

This vector should be returned using restoreVector.

Source code at petsc4py/PETSc/DMUtils.pyx:185

Return type:

Vec

restoreVector(vec)#

Restore a Vec which can hold all the interpolated field values.

Collective.

Parameters:

vec (Vec) – A vector capable of holding the interpolated field values.

Return type:

None

Source code at petsc4py/PETSc/DMUtils.pyx:201

setDim(dim)#

Set the spatial dimension for the interpolation context.

Not collective.

Parameters:

dim (int) – The spatial dimension.

Return type:

None

Source code at petsc4py/PETSc/DMUtils.pyx:120

setDof(dof)#

Set the number of fields interpolated at a point.

Not collective.

Parameters:

dof (int) – The number of fields.

Return type:

None

Source code at petsc4py/PETSc/DMUtils.pyx:138

setUp(dm, redundantPoints=False, ignoreOutsideDomain=False)#

Compute spatial indices for point location during interpolation.

Collective.

Parameters:
  • dm (DM) – The DM for the function space used for interpolation.

  • redundantPoints (bool) – If True, all processes are passing in the same array of points. Otherwise, points need to be communicated among processes.

  • ignoreOutsideDomain (bool) – Ignore points outside of the domain if True; otherwise, return an error.

Return type:

None

Source code at petsc4py/PETSc/DMUtils.pyx:156