petsc4py.PETSc.Space#

class petsc4py.PETSc.Space#

Bases: Object

Function space object.

Enumerations

Type

The function space types.

Methods Summary

create([comm])

Create an empty Space object.

destroy()

Destroy the Space object.

getDegree()

Return the polynomial degrees that characterize this space.

getDimension()

Return the number of basis vectors.

getNumComponents()

Return the number of components for this space.

getNumVariables()

Return the number of variables for this space.

getPTrimmedFormDegree()

Return the form degree of the trimmed polynomials.

getPointPoints()

Return the evaluation points for the space as the points of a quad.

getPolynomialTensor()

Return whether a function space is a space of tensor polynomials.

getSumConcatenate()

Return the concatenate flag for this space.

getSumNumSubspaces()

Return the number of spaces in the sum.

getSumSubspace(s)

Return a space in the sum.

getTensorNumSubspaces()

Return the number of spaces in the tensor product.

getTensorSubspace(s)

Return a space in the tensor product.

getType()

Return the type of the space object.

setDegree(degree, maxDegree)

Set the degree of approximation for this space.

setFromOptions()

Set parameters in Space from the options database.

setNumComponents(nc)

Set the number of components for this space.

setNumVariables(n)

Set the number of variables for this space.

setPTrimmedFormDegree(formDegree)

Set the form degree of the trimmed polynomials.

setPointPoints(quad)

Set the evaluation points for the space to be based on a quad.

setPolynomialTensor(tensor)

Set whether a function space is a space of tensor polynomials.

setSumConcatenate(concatenate)

Set the concatenate flag for this space.

setSumNumSubspaces(numSumSpaces)

Set the number of spaces in the sum.

setSumSubspace(s, subsp)

Set a space in the sum.

setTensorNumSubspaces(numTensSpaces)

Set the number of spaces in the tensor product.

setTensorSubspace(s, subsp)

Set a space in the tensor product.

setType(space_type)

Build a particular type of space.

setUp()

Construct data structures for the Space.

view([viewer])

View a Space.

Methods Documentation

create(comm=None)#

Create an empty Space object.

Collective.

The type can then be set with setType.

Parameters:

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

Return type:

Self

See also

PetscSpaceCreate

Source code at petsc4py/PETSc/Space.pyx:36

destroy()#

Destroy the Space object.

Collective.

Source code at petsc4py/PETSc/Space.pyx:59

Return type:

Self

getDegree()#

Return the polynomial degrees that characterize this space.

Not collective.

Returns:

  • minDegree (int) – The degree of the largest polynomial space contained in the space.

  • maxDegree (int) – The degree of the smallest polynomial space containing the space.

Return type:

tuple[int, int]

Source code at petsc4py/PETSc/Space.pyx:117

getDimension()#

Return the number of basis vectors.

Not collective.

Source code at petsc4py/PETSc/Space.pyx:103

Return type:

int

getNumComponents()#

Return the number of components for this space.

Not collective.

Source code at petsc4py/PETSc/Space.pyx:195

Return type:

int

getNumVariables()#

Return the number of variables for this space.

Not collective.

Source code at petsc4py/PETSc/Space.pyx:163

Return type:

int

getPTrimmedFormDegree()#

Return the form degree of the trimmed polynomials.

Not collective.

Source code at petsc4py/PETSc/Space.pyx:545

Return type:

int

getPointPoints()#

Return the evaluation points for the space as the points of a quad.

Logically collective.

Source code at petsc4py/PETSc/Space.pyx:513

Return type:

Quad

getPolynomialTensor()#

Return whether a function space is a space of tensor polynomials.

Not collective.

Return True if a function space is a space of tensor polynomials (the space is spanned by polynomials whose degree in each variable is bounded by the given order), as opposed to polynomials (the space is spanned by polynomials whose total degree—summing over all variables is bounded by the given order).

Source code at petsc4py/PETSc/Space.pyx:448

Return type:

bool

getSumConcatenate()#

Return the concatenate flag for this space.

Not collective.

A concatenated sum space will have the number of components equal to the sum of the number of components of all subspaces. A non-concatenated, or direct sum space will have the same number of components as its subspaces.

Source code at petsc4py/PETSc/Space.pyx:261

Return type:

bool

getSumNumSubspaces()#

Return the number of spaces in the sum.

Not collective.

Source code at petsc4py/PETSc/Space.pyx:304

Return type:

int

getSumSubspace(s)#

Return a space in the sum.

Not collective.

Parameters:

s (int) – The space number.

Return type:

Space

Source code at petsc4py/PETSc/Space.pyx:318

getTensorNumSubspaces()#

Return the number of spaces in the tensor product.

Not collective.

Source code at petsc4py/PETSc/Space.pyx:376

Return type:

int

getTensorSubspace(s)#

Return a space in the tensor product.

Not collective.

Parameters:

s (int) – The space number.

Return type:

Space

Source code at petsc4py/PETSc/Space.pyx:410

getType()#

Return the type of the space object.

Not collective.

Source code at petsc4py/PETSc/Space.pyx:227

Return type:

str

setDegree(degree, maxDegree)#

Set the degree of approximation for this space.

Logically collective.

One of degree and maxDegree can be None.

Parameters:
  • degree (int | None) – The degree of the largest polynomial space contained in the space.

  • maxDegree (int | None) – The degree of the largest polynomial space containing the space.

Return type:

None

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

setFromOptions()#

Set parameters in Space from the options database.

Collective.

Source code at petsc4py/PETSc/Space.pyx:91

Return type:

None

setNumComponents(nc)#

Set the number of components for this space.

Logically collective.

Parameters:

nc (int) – The number of components.

Return type:

None

Source code at petsc4py/PETSc/Space.pyx:209

setNumVariables(n)#

Set the number of variables for this space.

Logically collective.

Parameters:

n (int) – The number of variables (x, y, z etc.).

Return type:

None

Source code at petsc4py/PETSc/Space.pyx:177

setPTrimmedFormDegree(formDegree)#

Set the form degree of the trimmed polynomials.

Logically collective.

Parameters:

formDegree (int) – The form degree.

Return type:

None

Source code at petsc4py/PETSc/Space.pyx:527

setPointPoints(quad)#

Set the evaluation points for the space to be based on a quad.

Logically collective.

Sets the evaluation points for the space to coincide with the points of a quadrature rule.

Parameters:

quad (Quad) – The Quad defining the points.

Return type:

None

Source code at petsc4py/PETSc/Space.pyx:493

setPolynomialTensor(tensor)#

Set whether a function space is a space of tensor polynomials.

Logically collective.

Set to True for a function space which is a space of tensor polynomials (the space is spanned by polynomials whose degree in each variable is bounded by the given order), as opposed to polynomials (the space is spanned by polynomials whose total degree—summing over all variables is bounded by the given order).

Parameters:

tensor (bool) – True for a tensor polynomial space, False for a polynomial space.

Return type:

None

Source code at petsc4py/PETSc/Space.pyx:468

setSumConcatenate(concatenate)#

Set the concatenate flag for this space.

Logically collective.

A concatenated sum space will have the number of components equal to the sum of the number of components of all subspaces. A non-concatenated, or direct sum space will have the same number of components as its subspaces.

Parameters:

concatenate (bool) – True if subspaces are concatenated components, False if direct summands.

Return type:

None

Source code at petsc4py/PETSc/Space.pyx:280

setSumNumSubspaces(numSumSpaces)#

Set the number of spaces in the sum.

Logically collective.

Parameters:

numSumSpaces (int) – The number of spaces.

Return type:

None

Source code at petsc4py/PETSc/Space.pyx:358

setSumSubspace(s, subsp)#

Set a space in the sum.

Logically collective.

Parameters:
  • s (int) – The space number.

  • subsp (Space) – The number of spaces.

Return type:

None

Source code at petsc4py/PETSc/Space.pyx:338

setTensorNumSubspaces(numTensSpaces)#

Set the number of spaces in the tensor product.

Logically collective.

Parameters:

numTensSpaces (int) – The number of spaces.

Return type:

None

Source code at petsc4py/PETSc/Space.pyx:430

setTensorSubspace(s, subsp)#

Set a space in the tensor product.

Logically collective.

Parameters:
  • s (int) – The space number.

  • subsp (Space) – The number of spaces.

Return type:

None

Source code at petsc4py/PETSc/Space.pyx:390

setType(space_type)#

Build a particular type of space.

Collective.

Parameters:

space_type (Type | str) – The kind of space.

Return type:

Self

Source code at petsc4py/PETSc/Space.pyx:241

setUp()#

Construct data structures for the Space.

Collective.

See also

PetscSpaceSetUp

Source code at petsc4py/PETSc/Space.pyx:24

Return type:

None

view(viewer=None)#

View a Space.

Collective.

Parameters:

viewer (Viewer | None) – A Viewer to display the Space.

Return type:

None

See also

PetscSpaceView

Source code at petsc4py/PETSc/Space.pyx:72