Exemplo n.º 1
0
 def eval_bc(self, arg, sid):
     if sid == 0:
         if not self.no_fourier:
             r, th = domain_util.arg_to_polar_abs(self.boundary, self.a, arg, sid)
             return self.eval_expected_polar(r, th)
         else:
             return self.eval_phi0(arg)
     else:
         return 0
Exemplo n.º 2
0
    def eval_d_u_outwards(self, arg, sid):
        """
        Only for extension test.
        """
        k = self.k
        a = self.a

        r, th = domain_util.arg_to_polar_abs(self.boundary, a, arg, sid)
        x, y = r*np.cos(th), r*np.sin(th)

        grad = self.get_grad(x, y)

        if sid == 0:
            normal = self.boundary.eval_normal(th)
        elif sid == 1:
            normal = (0, 1)
        elif sid == 2:
            normal = (np.sin(a), -np.cos(a))

        return np.dot(grad, normal)
Exemplo n.º 3
0
    def eval_d_u_outwards(self, arg, sid):
        # Debug function
        # Only for true arc. At least at the moment
        k = self.k
        R = self.R
        a = self.a
        nu = self.nu

        r, th = domain_util.arg_to_polar_abs(self.boundary, a, arg, sid)

        d_u = 0

        for m in range(1, self.m_max+1):
            ac = self.fft_a_coef[m-1]
            if sid == 0:
                d_u += ac * k * jvp(m*nu, k*r, 1) * np.sin(m*nu*(th-a))
            elif sid == 1:
                d_u += ac * jv(m*nu, k*r) * m * nu * np.cos(m*nu*(th-a))
            elif sid == 2:
                d_u += -ac * jv(m*nu, k*r) * m * nu * np.cos(m*nu*(th-a))

        return d_u
Exemplo n.º 4
0
 def eval_bc(self, arg, sid):
     """
     Evaluate extended boundary condition.
     """
     r, th = domain_util.arg_to_polar_abs(self.boundary, self.a, arg, sid)
     return self.eval_expected_polar(r, th)