# petsc4py.PETSc.DualSpace

class petsc4py.PETSc.DualSpace

  Bases: `Object`

  Dual space to a linear space.

  Enumerations

  `Type` | The dual space types.

  Methods Summary

  `create`([comm]) | Create an empty `DualSpace` object.
  `destroy`() | Destroy the `DualSpace` object.
  `duplicate`() | Create a duplicate `DualSpace` object that is not set up.
  `getDM`() | Return the `DM` representing the reference cell of a `DualSpace`.
  `getDimension`() | Return the dimension of the dual space.
  `getFunctional`(i) | Return the i-th basis functional in the dual space.
  `getInteriorDimension`() | Return the interior dimension of the dual space.
  `getLagrangeContinuity`() | Return whether the element is continuous.
  `getLagrangeTensor`() | Return the tensor nature of the dual space.
  `getLagrangeTrimmed`() | Return the trimmed nature of the dual space.
  `getNumComponents`() | Return the number of components for this space.
  `getNumDof`() | Return the number of degrees of freedom for each spatial dimension.
  `getOrder`() | Return the order of the dual space.
  `getType`() | Return the type of the dual space object.
  `setDM`(dm) | Set the `DM` representing the reference cell.
  `setLagrangeContinuity`(continuous) | Indicate whether the element is continuous.
  `setLagrangeTensor`(tensor) | Set the tensor nature of the dual space.
  `setLagrangeTrimmed`(trimmed) | Set the trimmed nature of the dual space.
  `setNumComponents`(nc) | Set the number of components for this space.
  `setOrder`(order) | Set the order of the dual space.
  `setSimpleDimension`(dim) | Set the number of functionals in the dual space basis.
  `setSimpleFunctional`(func, functional) | Set the given basis element for this dual space.
  `setType`(dualspace_type) | Build a particular type of dual space.
  `setUp`() | Construct a basis for a `DualSpace`.
  `view`([viewer]) | View a `DualSpace`.

  Methods Documentation

  create(comm=None)

    Create an empty `DualSpace` 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

    `PetscDualSpaceCreate`

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

  destroy()

    Destroy the `DualSpace` object.

    Collective.

    See also

    `PetscDualSpaceDestroy`

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

    Return type:

      Self

  duplicate()

    Create a duplicate `DualSpace` object that is not set up.

    Collective.

    See also

    `PetscDualSpaceDuplicate`

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

    Return type:

      DualSpace

  getDM()

    Return the `DM` representing the reference cell of a `DualSpace`.

    Not collective.

    See also

    `setDM`, `PetscDualSpaceGetDM`

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

    Return type:

      DM

  getDimension()

    Return the dimension of the dual space.

    Not collective.

    The dimension of the dual space, i.e. the number of basis functionals.

    See also

    `PetscDualSpaceGetDimension`

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

    Return type:

      int

  getFunctional(i)

    Return the i-th basis functional in the dual space.

    Not collective.

    Parameters:

      i (int) – The basis number.

    Return type:

      Quad

    See also

    `PetscDualSpaceGetFunctional`

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

  getInteriorDimension()

    Return the interior dimension of the dual space.

    Not collective.

    The interior dimension of the dual space, i.e. the number of basis functionals assigned to the interior of the reference domain.

    See also

    `PetscDualSpaceGetInteriorDimension`

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

    Return type:

      int

  getLagrangeContinuity()

    Return whether the element is continuous.

    Not collective.

    See also

    `setLagrangeContinuity`, `PetscDualSpaceLagrangeGetContinuity`

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

    Return type:

      bool

  getLagrangeTensor()

    Return the tensor nature of the dual space.

    Not collective.

    See also

    `setLagrangeTensor`, `PetscDualSpaceLagrangeGetTensor`

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

    Return type:

      bool

  getLagrangeTrimmed()

    Return the trimmed nature of the dual space.

    Not collective.

    See also

    `setLagrangeTrimmed`, `PetscDualSpaceLagrangeGetTrimmed`

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

    Return type:

      bool

  getNumComponents()

    Return the number of components for this space.

    Not collective.

    See also

    `setNumComponents`, `PetscDualSpaceGetNumComponents`

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

    Return type:

      int

  getNumDof()

    Return the number of degrees of freedom for each spatial dimension.

    Not collective.

    See also

    `PetscDualSpaceGetNumDof`

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

    Return type:

      ArrayInt

  getOrder()

    Return the order of the dual space.

    Not collective.

    See also

    `setOrder`, `PetscDualSpaceGetOrder`

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

    Return type:

      int

  getType()

    Return the type of the dual space object.

    Not collective.

    See also

    `setType`, `PetscDualSpaceGetType`

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

    Return type:

      str

  setDM(dm)

    Set the `DM` representing the reference cell.

    Not collective.

    Parameters:

      dm (DM) – The reference cell.

    Return type:

      None

    See also

    `getDM`, `PetscDualSpaceSetDM`

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

  setLagrangeContinuity(continuous)

    Indicate whether the element is continuous.

    Not collective.

    Parameters:

      continuous (bool) – The flag for element continuity.

    Return type:

      None

    See also

    `getLagrangeContinuity`, `PetscDualSpaceLagrangeSetContinuity`

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

  setLagrangeTensor(tensor)

    Set the tensor nature of the dual space.

    Not collective.

    Parameters:

      tensor (bool) – Whether the dual space has tensor layout (vs. simplicial).

    Return type:

      None

    See also

    `getLagrangeTensor`, `PetscDualSpaceLagrangeSetTensor`

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

  setLagrangeTrimmed(trimmed)

    Set the trimmed nature of the dual space.

    Not collective.

    Parameters:

      trimmed (bool) – Whether the dual space represents to dual basis of a trimmed polynomial space (e.g. Raviart-Thomas and higher order / other form degree variants).

    Return type:

      None

    See also

    `getLagrangeTrimmed`, `PetscDualSpaceLagrangeSetTrimmed`

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

  setNumComponents(nc)

    Set the number of components for this space.

    Logically collective.

    Parameters:

      nc (int) – The number of components

    Return type:

      None

    See also

    `getNumComponents`, `PetscDualSpaceSetNumComponents`

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

  setOrder(order)

    Set the order of the dual space.

    Not collective.

    Parameters:

      order (int) – The order.

    Return type:

      None

    See also

    `getOrder`, `PetscDualSpaceSetOrder`

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

  setSimpleDimension(dim)

    Set the number of functionals in the dual space basis.

    Logically collective.

    Parameters:

      dim (int) – The basis dimension.

    Return type:

      None

    See also

    `PetscDualSpaceSimpleSetDimension`

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

  setSimpleFunctional(func, functional)

    Set the given basis element for this dual space.

    Not collective.

    Parameters:

      - func (int) – The basis index.

      - functional (Quad) – The basis functional.

    Return type:

      None

    See also

    `PetscDualSpaceSimpleSetFunctional`

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

  setType(dualspace_type)

    Build a particular type of dual space.

    Collective.

    Parameters:

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

    Return type:

      Self

    See also

    `getType`, `PetscDualSpaceSetType`

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

  setUp()

    Construct a basis for a `DualSpace`.

    Collective.

    See also

    `PetscDualSpaceSetUp`

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

    Return type:

      None

  view(viewer=None)

    View a `DualSpace`.

    Collective.

    Parameters:

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

    Return type:

      None

    See also

    `PetscDualSpaceView`

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