(self, discretization, vertex_values=None, project=False)
Initialization.
Initialization.
Initialization .
def __init__(self, discretization, vertex_values=None, project=False):
        """Initialization."""
        super(_Triangulation, self).__init__()

        self.discretization = discretization
        self.input_dim = discretization.ndim

        self._parameters = None
        self.parameters = vertex_values

        disc = self.discretization

        # Get triangulation
        if len(disc.limits) == 1:
            corners = np.array([[0], disc.unit_maxes])
            self.triangulation = _Delaunay1D(corners)
        else:
            product = cartesian(*np.diag(disc.unit_maxes))
            hyperrectangle_corners = np.array(list(product),
                                              dtype=config.np_dtype)
            self.triangulation = spatial.Delaunay(hyperrectangle_corners)
        self.unit_simplices = self._triangulation_simplex_indices()

        # Some statistics about the triangulation
        self.nsimplex = self.triangulation.nsimplex * disc.nrectangles

        # Parameters for the hyperplanes of the triangulation
        self.hyperplanes = None
        self._update_hyperplanes()

        self.project = project
def __init__ ( self , discretization , vertex_values = None , project = False ) : super ( _Triangulation , self ) . __init__ ( ) self . discretization = discretization self . input_dim = discretization . ndim self . _parameters = None self . parameters = vertex_values disc = self . discretization # Get triangulation if len ( disc . limits ) == 1 : corners = np . array ( [ [ 0 ] , disc . unit_maxes ] ) self . triangulation = _Delaunay1D ( corners ) else : product = cartesian ( * np . diag ( disc . unit_maxes ) ) hyperrectangle_corners = np . array ( list ( product ) , dtype = config . np_dtype ) self . triangulation = spatial . Delaunay ( hyperrectangle_corners ) self . unit_simplices = self . _triangulation_simplex_indices ( ) # Some statistics about the triangulation self . nsimplex = self . triangulation . nsimplex * disc . nrectangles # Parameters for the hyperplanes of the triangulation self . hyperplanes = None self . _update_hyperplanes ( ) self . project = project