# ArchDom in ScotchPy

ArchDomains are implemented in ScotchPy with the ArchDom class.

## The ArchDom class

class ArchDom

  > The ArchDom constructor itself calls libscotch’s `archDomAlloc` function. This object doesn’t need to be initialized.

  > The following routines, which need to be called from an :class:`ArchDom` object are relayed to the ArchDom class but not present in the class itself:

dom_size(domn)

  > This routine returns the size of the domain.

  > param domn:

  >   Domain to be considered.

  > type domn:

  >   `ArchDom`

  > returns:

  >   The size of the domain.

  > rtype:

  >   Integer

  dom_wght(domn)

    This routine returns the weight of the domain.

    Parameters:

      domn (`ArchDom`) – Domain to be considered.

    Returns:

      The weight of the domain.

    Return type:

      Integer

  dom_dist(domn0, domn1)

    This routine returns the distance of the domain.

    Parameters:

      - domn0 (`ArchDom`) – First domain.

      - domn1 (`ArchDom`) – Second domain.

    Returns:

      The distance between the two domains.

    Return type:

      Integer

  dom_frst(domn)

    This routine initializes the domain with the biggest domain of the architecture.

    Parameters:

      domn (`ArchDom`) – Domain to be initialized.

  dom_term(domn, domnum)

    This routine initializes the domain to correspond to the terminal domain of index `domnum` in the architecture.

    Parameters:

      - domn (`ArchDom`) – Domain to be initialized.

      - domnum (Integer) – Index of the terminal domain.

  dom_num(domn)

    This routine returns the number of the domain.

    Parameters:

      domn (`ArchDom`) – Domain to be considered.

    Returns:

      The number of the domain.

    Return type:

      Integer

  dom_bipart(domn, dom0, dom1)

    This routine initializes the two subdomains to correspond to the two parts of the bipartition of the `domn` domain.

    Parameters:

      - domn (`ArchDom`) – Domain to be considered.

      - dom0 (`ArchDom`) – First subdomain.

      - dom1 (`ArchDom`) – Second subdomain.