SubDimension
SubDimension(*args, **kwargs)Symbol defining a convex iteration sub-space derived from a parent Dimension.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| name | str | Name of the dimension. | required |
| parent | Dimension | The parent Dimension. | required |
| left | expr - like | Symbolic expression providing the left (lower) bound of the SubDimension. | required |
| right | expr - like | Symbolic expression providing the right (upper) bound of the SubDimension. | required |
| thickness | 2-tuple of 2-tuples | The thickness of the left and right regions, respectively. | required |
| local | bool | True if, in case of domain decomposition, the SubDimension is guaranteed not to span more than one domain, False otherwise. | required |
| separated | bool | Require a stencil-safe gap between nonempty left/right SubDimensions of the same parent. If both are separated, N - L - R >= space_order, where N is the global parent extent, L and R are their thicknesses, and space_order is the maximum compiled Function order along that axis. This is checked at Operator.apply, including runtime Grid overrides. By default, touching or overlapping regions are allowed and dependence analysis is conservative. Middle SubDimensions are unaffected. |
False |
Examples
SubDimensions should not be created directly in user code; SubDomains should be used instead. Exceptions are rare.
To create a SubDimension, one should use the shortcut methods left, right, middle. For example, to create a SubDimension that spans the entire space of the parent Dimension except for the two extremes:
>>> from devito import Dimension, SubDimension
>>> x = Dimension('x')
>>> xi = SubDimension.middle('xi', x, 1, 1)For a SubDimension that only spans the three leftmost points of its parent Dimension, instead:
>>> xl = SubDimension.left('xl', x, 3)SubDimensions created via the left and right shortcuts are, by default, local (i.e., non-distributed) Dimensions, as they are assumed to fit entirely within a single domain. This is the most typical use case (e.g., to set up boundary conditions). To drop this assumption, pass local=False.
Explicit runtime overrides of the root Dimension’s bounds are not supported. MPI may still localize the global regions automatically.
Attributes
| Name | Description |
|---|---|
| is_Sub | bool(x) -> bool |