RectangularDomain

class pysit.core.domain.RectangularDomain(*configs)[source]

Bases: pysit.core.domain.DomainBase

Class for describing rectangular domains in pysit.

Parameters:
configs

A variable number of config tuples, see Notes for details. One tuple for each desired problem dimension.

Notes

  1. A config tuple is a 4-tuple (or 5-tuple) with the following elements:
    1. left boundary position
    2. right boundary position
    3. left boundary condition
    4. right boundary condition
    5. unit, (optional)

    The left and right boundary positions are in physical coordinates. The left and right boundary conditions are instances of the subclasses of pysit.core.domain.DomainBC.

  2. The coordinate system is stored in a left-handed ordering (the positive z-direction points downward).

  3. In any iterable which depends on dimension, the z-dimension is always the last element. Thus, in 1D, the dimension is assumed to be z.

  4. The negative direction is always referred to as the left side and the positive direction is always the right side. For example, for the z-dimension, the top is left and the bottom is right.

  5. A dimension parameters Bunch contains six keys:
    1. lbound: a float with the closed left boundary of the domain
    2. rbound: a float with the open right boundary of the domain
    3. lbc: the left boundary condition
    4. rbc: the right boundary condition
    5. unit: a string with the physical units of the dimension, e.g., ‘m’
    6. length: a float with the length of the domain, rbound-lbound
  6. The parameters dictionary can be accessed by number, by letter, or in the style of an attribute of the RectangularDomain.

    1. Number

      >>> # Assume 3D, z is last
      >>> my_domain.parameters[2]
      
    2. Letter

      >>> my_domain.parameters['z']
      
    3. Attribute

      >>> my_domain.z
      
Attributes:
type : str

class attribute, identifies the type of domain as ‘rectangular’

dim : int

Dimension \(d\) in \(\mathcal{R}^d\) of the domain.

parameters : dict of Bunch

Dictionary containing descriptions of each dimension.

Attributes Summary

type

Methods Summary

collect(self, prop) Collects a ndim-tuple of property prop.
get_lengths(self) Returns the physical size of the domain as a ndim-tuple.

Attributes Documentation

type = 'rectangular'

Methods Documentation

collect(self, prop)[source]

Collects a ndim-tuple of property prop.

get_lengths(self)[source]

Returns the physical size of the domain as a ndim-tuple.