SimplexShape¶
About the SimplexShape
class¶
The WaveBlocks Project
@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 R. Bourquin @license: Modified BSD License
Inheritance diagram¶
Class documentation¶
-
class
WaveBlocksND.
SimplexShape
(D, K)[source]¶ This class implements the simplex basis shape which is a special type of sparse basis set. A basis shape is essentially all information and operations related to the set of multi-indices . The simplex shape in dimensions and with maximal 1-norm is defined as the set
-
__hash__
()[source]¶ Compute a unique hash for the basis shape. In the case of simplex basis shapes the basis is fully specified by its dimension and the maximal 1-norm parameter .
-
__iter__
()[source]¶ Implements iteration over the multi-indices of the basis set .
Note: The order of iteration is NOT fixed. If you need a special iteration scheme, use
get_node_iterator()
.
-
__contains__
(k)[source]¶ Checks if a given multi-index is part of the basis set .
Parameters: k (tuple) – The multi-index we want to test.
-
contains
(k)[source]¶ Checks if a given multi-index is part of the basis set .
Parameters: k (tuple) – The multi-index we want to test.
-
extend
()[source]¶ Extend the basis shape such that (at least) all neighbours of all boundary nodes are included in the extended basis shape.
-
find_largest_index
()¶ Find the index with maximal distance from the zero index. In case of multiple maxima the method returns the first one found.
-
get_basis_size
(extended=False)¶ Returns the size of the basis. The size is the number of distinct multi-indices that belong to the basis .
Raise: NotImplementedError
Abstract interface.
-
get_description
()[source]¶ Return a description of this basis shape object. A description is a
dict
containing all key-value pairs necessary to reconstruct the current basis shape. A description never contains any data.
-
get_dimension
()¶ Returns the dimension of the basis shape . This is defined as the number of components each multi-index has.
Raise: NotImplementedError
Abstract interface.
-
get_limits
()[source]¶ Returns the upper limit which is the same for all directions .
Returns: A tuple of the maximum of the multi-index in each direction.
-
get_neighbours
(k, selection=None, direction=None)[source]¶ Returns a list of all multi-indices that are neighbours of a given multi-index . A direct neighbour is defined as .
Parameters: - k (tuple) – The multi-index of which we want to get the neighbours.
- selection (string with fixed values
forward
,backward
orall
. The valuesall
is equivalent to the valueNone
(default).) – - direction (int) – The direction in which we want to find the neighbours .
Returns: A list containing the pairs .
-
get_node_iterator
(mode='lex', direction=None)[source]¶ Returns an iterator to iterate over all basis elements .
Parameters: - mode (string) – The mode by which we iterate over the indices. Default is
lex
for lexicographical order. Supported is alsochain
, for the chain-like mode, details see the manual. - direction (integer.) – If iterating in chainmode this specifies the direction the chains go.
- mode (string) – The mode by which we iterate over the indices. Default is
-