ddg.datastructures.nets.net module
- class ddg.datastructures.nets.net.Net(fct, domain, *args, name='Net')[source]
Bases:
CallableBase class for nets.
- Parameters:
- fctfunction
Function defining the net.
- domainddg.datastructures.nets.domain.Domain or list of intervals
Domain of
fct.- namestr, optional
Name of the net (mostly used for blender conversion).
See also
- Attributes:
- fctfunction
Function defining the net.
- domainddg.datastructures.nets.domain.Domain
Domain of
fct.- namestr
Name of the net (mostly used for blender conversion).
- dimensionint
Dimension of the domain.
- property fct
- property dimension
- class ddg.datastructures.nets.net.EmptyNet(coordinates, name='Empty')[source]
Bases:
Net,Iterable- property dimension
- property fct
- class ddg.datastructures.nets.net.PointNet(value, name='Point')[source]
Bases:
Net,Iterable- property dimension
- property fct
- class ddg.datastructures.nets.net.SmoothNet(fct, domain, *args, **kwargs)[source]
Bases:
NetStore and manage data of a smooth net.
- Parameters:
- fctfunction
Function defining the net.
- domainddg.datastructures.nets.domain.SmoothDomain or list of intervals
Domain of
fct.- periodicityset, optional
Set containing indices of periodic coordinate directions.
- periodicbool
Alternative way of specifying periodicity for one dimensional net. It precedes periodicity if set.
- namestr, optional
Name of the net (mostly used for blender conversion).
See also
- property dimension
- property fct
- class ddg.datastructures.nets.net.SmoothCurve(*args, **kwargs)[source]
Bases:
SmoothNet- property dimension
- property fct
- class ddg.datastructures.nets.net.DiscreteNet(fct, domain, hint=None, **kwargs)[source]
Bases:
Net,IterableStore and manage data of a discrete net.
- Parameters:
- fctfunction
Function defining the net.
- domainddg.datastructures.nets.domain.DiscreteDomain or list of intervals
Domain of ‘fct’.
- periodicityset, optional
Set containing indices of periodic coordinate directions.
- traverserddg.datastructures.nets.traverser.Traverser, optional
Traversing scheme of the dicrete net.
- namestr, optional
Name of the net (mostly used for blender conversion).
- inititerable or ddg.datastructures.nets.domain.DiscreteDomain, optional
Preset initial data or generate all data in the given domain.
- hintfunction, optional
Function returning the net points needed to compute the value for a given net point (by default there is no hint function). If specified the values are calculated iteratively.
See also
Notes
The
hintfunction has to return an empty list for all net points which are initialized byfct.The function
fctwill be called repeatedly to calculate the value for the given index. It has to guarantee that the calculation will stop, i.e. that it will hit initial data.:E.g.: Suppose the missing vertex has the index (i,j). Then `fct` could use the values at vertices ((i-1,j-1), (i,j-1), (i-1, j)) to calculate the missing value (i-1,j) (i,j) input -> o--------o <- missing | | | | | | input -> o--------o <- input (i-1,j-1) (i,j-1) If the standard axis {(i,0) | i int} and {(0,i) | i int} are initial data (either given by `fct` itself or previously set) this definition is well defined.If
hintis not given the calculations are made recursively. So it may easyly generateRecursionErrorfor exeeding recursition depth. Thus it is important to take the search pattern offctinto account for choosing the traverser.:E.g.: Suppose the inital data is given in a zick-zack pattern in the fourth quadrant like (0,0) o--o | (-1,-1) o--o | (-2,-2) o--o If we suppose `fct` to use the search pattern from the comment above a (finite) linear traverser will generate `RecursitionError` for a relatively small search box (about 80x80). However a diagonal traverser will guarantee a small recursition depth. 1-->2-->3-->4 1 5 8 10 \ \ \ 5-->6-->7 2 6 9 \ \ 8-->9 3 7 \ 10 4 (lin. trav.) (diag. trav.)
- Attributes:
traverserddg.datastructures.nets.traverser.TraverserGet the traverser of the Domain.
- property traverser
Get the traverser of the Domain.
- Returns:
- ddg.datastructures.nets.traverser.Traverser
- property dimension
- property fct
- class ddg.datastructures.nets.net.DiscreteRecursiveNet(*args, **kwargs)[source]
Bases:
DiscreteNetRecursive implementation of DiscreteNet.
- property dimension
- evaluate()
- property fct
- property traverser
Get the traverser of the Domain.
- Returns:
- ddg.datastructures.nets.traverser.Traverser
- class ddg.datastructures.nets.net.DiscreteIterativeNet(*args, **kwargs)[source]
Bases:
DiscreteNetIterative implementation of DiscreteNet.
- property dimension
- evaluate()
- property fct
- property traverser
Get the traverser of the Domain.
- Returns:
- ddg.datastructures.nets.traverser.Traverser
- class ddg.datastructures.nets.net.DiscreteCurve(*args, **kwargs)[source]
Bases:
DiscreteRecursiveNet- property dimension
- evaluate()
- property fct
- property traverser
Get the traverser of the Domain.
- Returns:
- ddg.datastructures.nets.traverser.Traverser
- class ddg.datastructures.nets.net.NetCollection(nets=[], name='NetCollection')[source]
Bases:
Sized,Iterable,ContainerCollection of Nets
- Parameters:
- netsList of nets
Nets to be contained in the collection.
- namestr (default=’NetCollection’)
Name of the collection.
- Attributes:
- namestring
Name of the collection
dimensionintDimension of the collection.
- property dimension
Dimension of the collection.
Only works if all nets in the collection have the same dimension.
- Returns:
- int
- Raises:
- AttributeError
If collection is empty
If nets in collection have different dimensions.