ddg.datastructures.nets.domain module

ddg.datastructures.nets.domain.is_bounded_interval(interval)[source]

Checks whether an interval is bounded.

ddg.datastructures.nets.domain.domain_decomposer(domain)[source]

Decomposes a list of lists describing a domain into its intervals and periodicity.

class ddg.datastructures.nets.domain.Domain(dimension, *args)[source]

Bases: Container

Base class for storing information on a point-domain of a net.

Parameters:
dimensionnon negative int

Dimension of the Domain.

Attributes:
dimensionnon negative int

Dimension of the Domain.

class ddg.datastructures.nets.domain.EmptyDomain[source]

Bases: Domain

class ddg.datastructures.nets.domain.SmoothDomain(*args, domain_type='rectangular', **kwargs)[source]

Bases: Domain

Factory class for the smooth domains.

Parameters:
domain_type{‘rectangular’}, optional

The type of discrete domain to use.

Raises:
NotImplementedError

If the domain type does not exist.

class ddg.datastructures.nets.domain.SmoothRectangularDomain(domain)[source]

Bases: SmoothDomain, Sequence

Store information on a rectangular domain.

Parameters:
domainlist of tuples (float, float[, bool])

Tuples define the intervals as (lowerbound, upperbound, periodic) Periodic is optional and assumed False if not given.

See also

SmoothDomain
Domain
Attributes:
periodicityset

Set containing indices of periodic coordinate directions.

intervalslist of tuples

List of the coordinate intervals.

bounded_directionslist

List containing the indices of the bounded directions of the domain.

unbounded_directionslist

List containing the indices of the unbounded directions of the domain.

Methods

recover

Returns the current state of the domain in a format that can be used to initialize a constant domain with the same intervals and periodicity

property intervals
property periodicity
property bounded
property dimension
recover()[source]
property unbounded_directions
property bounded_directions
count(value) integer -- return number of occurrences of value
index(value[, start[, stop]]) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

class ddg.datastructures.nets.domain.SmoothInterval(interval)[source]

Bases: SmoothRectangularDomain

Special case of a one-dimensional rectangular domain.

Parameters:
intervaltuple of two floats and an optional bool

A tuple defining the endpoints and periodicity of the interval. Periodicity is assumed False if not given.

Attributes:
interval: tuple

The tuple defining the interval

property interval

Interval as a tuple.

property periodic
recover()[source]
property bounded
property bounded_directions
count(value) integer -- return number of occurrences of value
property dimension
index(value[, start[, stop]]) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

property intervals
property periodicity
property unbounded_directions
class ddg.datastructures.nets.domain.DiscreteDomain(*args, domain_type='rectangular', **kwargs)[source]

Bases: Domain

Factory class for the discrete domains.

Parameters:
traverserddg.datastructures.nets.traverser.Traverser

Traversing scheme of the discrete net.

domain_type{‘rectangular’, ‘triangular’, ‘diagonal’}, optional

The type of discrete domain to use.

Raises:
NotImplementedError

If the domain type does not exist.

Attributes:
edge_datalist

List of edges in the domain given by index pairs.

face_datalist

List of edges in the domain given by tuples of indices (at least triples).

traverserddg.datastructures.nets.traverser.Traverser

Traversing scheme of the discrete net.

property edge_data
property face_data
class ddg.datastructures.nets.domain.DiscreteRectangularDomain(domain, **kwargs)[source]

Bases: DiscreteDomain, Sequence

Store data on a rectangular index domain.

Parameters:
*argstuples of int

List of ranges of vertices.

periodicityset or list, optional

Specify which coordinate directions are periodic. (default: No periodicity).

traverserddg.datastructures.nets.traverser.Traverser, optional

Traversing scheme of the discrete domain.

Attributes:
periodicityset

Set containing indices of periodic coordinate directions.

intervalslist of tuples

List of the coordinate intervals.

bounded_directionslist

List containing the indices of the bounded directions of the domain.

unbounded_directionslist

List containing the indices of the unbounded directions of the domain.

Methods

recover

Returns the current state of the domain in a format that can be used to initialize a constant domain with the same intervals and periodicity

property edge_data
property face_data
property dimension
property double_edged
property intervals
property periodicity
property traverser
property bounded
recover()[source]
property unbounded_directions
property bounded_directions
count(value) integer -- return number of occurrences of value
index(value[, start[, stop]]) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

class ddg.datastructures.nets.domain.DiscreteInterval(*args)[source]

Bases: DiscreteRectangularDomain

Special case of a one-dimensional rectangular domain.

Parameters:
intervaltuple of two floats [and a single bool] or
function returning such a tuple

One tuple defining the endpoints of the interval and if it is periodic or not.

Attributes:
interval: tuple

The tuple defining the interval

periodicbool
property interval

Interval as a tuple.

property periodic
recover()[source]
property bounded
property bounded_directions
count(value) integer -- return number of occurrences of value
property dimension
property double_edged
property edge_data
property face_data
index(value[, start[, stop]]) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

property intervals
property periodicity
property traverser
property unbounded_directions
class ddg.datastructures.nets.domain.DiscreteTriangularDomain(*args, domain_type='rectangular', **kwargs)[source]

Bases: DiscreteDomain

Store data on a triangular index domain.

Parameters:
basefloat

Number of vertex points in base edge of triangle.

shifttuple of int, optional

Base shift for triangle.

mode{1, …, 8}, optional

Select triangle shape.

Notes

  • The number of vertex points is calculated from base by ceiling the absolut value of base.

  • The triangle is constructed from base by:

            o ^
          / | .
        /   | . base+1
      /     | .
    o-------o v
    < . . . >
     base+1
    
  • If base is inf the half axis is taken as the base edge.

  • The mode selects one of the following triangles (NOT IMPLEMENTED YET):

    o--------o--------o
    | \    3 | 2    / |
    |   \    |    /   |
    | 4   \  |  /   1 |
    o--------o--------o
    | 5   /  |  \   8 |
    |   /    |    \   |
    | /    6 | 7    \ |
    o--------o--------o
    
Attributes:
edge_datalist

List of edges in the domain given by index pairs.

face_datalist

List of edges in the domain given by tuples of indices (at least triples).

property edge_data
property face_data
class ddg.datastructures.nets.domain.DiscreteDiagonalDomain(*args, domain_type='rectangular', **kwargs)[source]

Bases: DiscreteDomain

Implement a diagonal strip index domain.

Parameters:
heightfloat

Hight of the strip.

widthfloat

Width of the strip.

shifttuple of int, optional

Base shift for diagonal domain.

Notes

  • The number of vertex points is calculated from the elements of args by ceiling their absolut values, respectively.

  • There needs to be at least one positional argument and at most two. If args has length one both sides are given that lenth.

  • The elements of args are assigned to the sides of the diagonal strip as follows:

               ^  o------o
    args[0]+1 .  /      /
             .  /      /
            v  o------o
               < . . .>
               args[1]+1
    
  • If base is inf the half axis is taken as the base edge.

  • The mode selects one of the following diagonal strips (NOT IMPLEMENTED YET):

    o------o------o                o------o------o
     \      \      \              /      /      /
      \   4  \   3  \            /  2   /   1  /
       \      \      \          /      /      /
        o------o------o        o------o------o
    
Attributes:
edge_datalist

List of edges in the domain given by index pairs.

face_datalist

List of edges in the domain given by tuples of indices (at least triples).

property edge_data
property face_data