예제 #1
0
 def apply(self, u):
     a0 = 2
     a1 = 1
     a = sympy.Matrix([a0, a1, 0])
     return integrate(lambda x: -n_dot_grad(u(x)) + n_dot(a) * u(x), dS) - integrate(
         lambda x: 2 * pi ** 2 * sin(pi * x[0]) * sin(pi * x[1])
         + a0 * pi * cos(pi * x[0]) * sin(pi * x[1])
         + a1 * pi * sin(pi * x[0]) * cos(pi * x[1]),
         dV,
     )
예제 #2
0
 def apply(self, u):
     a0 = 2
     a1 = 1
     a = sympy.Matrix([a0, a1, 0])
     return integrate(
         lambda x: -n_dot_grad(u(x)) + n_dot(a) * u(x), dS) - integrate(
             lambda x: 2 * pi**2 * sin(pi * x[0]) * sin(pi * x[1]) + a0 * pi
             * cos(pi * x[0]) * sin(pi * x[1]) + a1 * pi * sin(pi * x[
                 0]) * cos(pi * x[1]),
             dV,
         )
예제 #3
0
    def apply(self, u):
        a0 = 2
        a1 = 1
        a = numpy.array([a0, a1, 0])

        def rhs(x):
            z = pi / 2 * (x[0]**2 + x[1]**2)
            return (2 * pi * (sin(z) + z * cos(z)) - a0 * pi * x[0] * sin(z) -
                    a1 * pi * x[1] * sin(z))

        return integrate(lambda x: -n_dot_grad(u(x)) + n_dot(a) * u(x),
                         dS) - integrate(rhs, dV)
예제 #4
0
    def apply(self, u):
        a0 = 2
        a1 = 1
        a = numpy.array([a0, a1, 0])

        def rhs(x):
            z = pi / 2 * (x[0] ** 2 + x[1] ** 2)
            return (
                2 * pi * (sin(z) + z * cos(z))
                - a0 * pi * x[0] * sin(z)
                - a1 * pi * x[1] * sin(z)
            )

        return integrate(lambda x: -n_dot_grad(u(x)) + n_dot(a) * u(x), dS) - integrate(
            rhs, dV
        )
예제 #5
0
    def apply(self, u):
        a0 = 2
        a1 = 1
        a2 = 3
        a = Matrix([a0, a1, a2])

        def rhs(x):
            z = pi / 2 * (x[0]**2 + x[1]**2 + x[2]**2)
            return (+2 * pi * (1.5 * sin(z) + z * cos(z)) -
                    a0 * pi * x[0] * sin(z) - a1 * pi * x[1] * sin(z) -
                    a2 * pi * x[2] * sin(z))

        out = integrate(lambda x: -n_dot_grad(u(x)) + n_dot(a) * u(x),
                        dS) - integrate(rhs, dV)

        return out
예제 #6
0
    def apply(self, u):
        a0 = 2
        a1 = 1
        a2 = 3
        a = Matrix([a0, a1, a2])

        def rhs(x):
            z = pi / 2 * (x[0] ** 2 + x[1] ** 2 + x[2] ** 2)
            return (
                +2 * pi * (1.5 * sin(z) + z * cos(z))
                - a0 * pi * x[0] * sin(z)
                - a1 * pi * x[1] * sin(z)
                - a2 * pi * x[2] * sin(z)
            )

        out = integrate(lambda x: -n_dot_grad(u(x)) + n_dot(a) * u(x), dS) - integrate(
            rhs, dV
        )

        return out
예제 #7
0
 def apply(self, u):
     a = numpy.array([2, 1, 0])
     return integrate(lambda x: -n_dot_grad(u(x)) + n_dot(a) * u(x),
                      dS) - integrate(lambda x: 1.0, dV)
예제 #8
0
 def apply(self, u):
     a = numpy.array([2, 1, 0])
     return integrate(
         lambda x: -n_dot_grad(u(x)) + n_dot(a) * u(x), dS
     ) - integrate(lambda x: 1.0, dV)