Exemplo n.º 1
0
    def _eval_base(self, coors, diff=False,
                   suppress_errors=False, eps=1e-15):
        """See PolySpace.eval_base()."""
        from extmods.fem import eval_lagrange_simplex

        if diff:
            bdim = self.geometry.dim
        else:
            bdim = 1
        
        base = nm.empty((coors.shape[0], bdim, self.n_nod - 1), dtype=nm.float64)

        # Work array.
        bc = nm.zeros((self.geometry.n_vertex, coors.shape[0]), nm.float64)

        eval_lagrange_simplex(base, coors, self.nodes[:-1],
                              self.order, diff,
                              self.mtx_i, bc, suppress_errors, eps)

        bubble = nm.empty((coors.shape[0], bdim, 1), dtype=nm.float64)
        eval_lagrange_simplex(bubble, coors, self.bnode,
                              int(self.bnode.sum()), diff,
                              self.mtx_i, bc, suppress_errors, eps)

        base -= bubble / (self.n_nod - 1)
        base = nm.ascontiguousarray(nm.dstack((base, bubble)))

        return base
Exemplo n.º 2
0
    def _eval_base(self, coors, diff=False,
                   suppress_errors=False, eps=1e-15):
        """See PolySpace.eval_base()."""
        from extmods.fem import eval_lagrange_simplex

        if diff:
            bdim = self.geometry.dim
        else:
            bdim = 1
        
        base = nm.empty((coors.shape[0], bdim, self.n_nod), dtype=nm.float64)

        # Work array.
        bc = nm.zeros((self.geometry.n_vertex, coors.shape[0]), nm.float64)

        eval_lagrange_simplex(base, coors, self.nodes, self.order, diff,
                              self.mtx_i, bc, suppress_errors, eps)

        return base