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
- A
config
tuple is a 4-tuple (or 5-tuple) with the following elements: - left boundary position
- right boundary position
- left boundary condition
- right boundary condition
- 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
.- A
The coordinate system is stored in a left-handed ordering (the positive z-direction points downward).
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.
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.
- A dimension parameters Bunch contains six keys:
lbound
: a float with the closed left boundary of the domainrbound
: a float with the open right boundary of the domainlbc
: the left boundary conditionrbc
: the right boundary conditionunit
: a string with the physical units of the dimension, e.g., ‘m’length
: a float with the length of the domain,rbound
-lbound
The parameters dictionary can be accessed by number, by letter, or in the style of an attribute of the
RectangularDomain
.Number
>>> # Assume 3D, z is last >>> my_domain.parameters[2]
Letter
>>> my_domain.parameters['z']
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