コード例 #1
0
ファイル: mappers.py プロジェクト: isuruf/pytential
 def map_int_g(self, expr):
     return componentwise(
             lambda subexpr: type(expr)(
                     expr.kernel,
                     self.rec(subexpr),
                     expr.qbx_forced_limit, expr.source, expr.target,
                     kernel_arguments=dict(
                             (name, self.rec(arg_expr))
                             for name, arg_expr in expr.kernel_arguments.items()
                             )),
             expr.density)
コード例 #2
0
ファイル: primitives.py プロジェクト: inducer/pytential
    def __new__(cls, operand=None, where=None):
        # If the constructor is handed a multivector object, return an
        # object array of the operator applied to each of the
        # coefficients in the multivector.

        if isinstance(operand, (np.ndarray, MultiVector)):
            def make_op(operand_i):
                return cls(operand_i, where)

            return componentwise(make_op, operand)
        else:
            return Expression.__new__(cls)
コード例 #3
0
ファイル: primitives.py プロジェクト: inducer/pytential
    def __new__(cls, ref_axes=None, operand=None, where=None):
        # If the constructor is handed a multivector object, return an
        # object array of the operator applied to each of the
        # coefficients in the multivector.

        if isinstance(operand, np.ndarray):
            def make_op(operand_i):
                return cls(ref_axes, operand_i, where=where)

            return componentwise(make_op, operand)
        else:
            return DiscretizationProperty.__new__(cls)
コード例 #4
0
ファイル: primitives.py プロジェクト: inducer/pytential
    def __new__(cls, kernel=None, density=None, *args, **kwargs):
        # If the constructor is handed a multivector object, return an
        # object array of the operator applied to each of the
        # coefficients in the multivector.

        if isinstance(density, (np.ndarray, MultiVector)):
            def make_op(operand_i):
                return cls(kernel, operand_i, *args, **kwargs)

            return componentwise(make_op, density)
        else:
            return Expression.__new__(cls)
コード例 #5
0
 def map_num_reference_derivative(self, expr):
     return componentwise(
         lambda subexpr: type(expr)
         (expr.ref_axes, self.rec(subexpr), expr.dofdesc), expr.operand)
コード例 #6
0
 def map_node_sum(self, expr):
     return componentwise(type(expr), self.rec(expr.operand))