コード例 #1
0
 def all_tau(self, x, m):
     """
     All the 4 stabilization parameters
     """
     u, p = dl.split(x)
     h2 = h_u2(self.metric, u, self.reg_norm * self.nu * self.nu)
     tau = [
         self.tau(self.nu + self.nu_t(m), u, self.metric),
         h2 * self._u_norm(u)
     ]
     return tau
コード例 #2
0
    def tau(self, nu, u, metric):
        """
        Stabilization parameter
        """
        h2 = h_u2(self.metric, u, self.reg_norm * self.nu * self.nu)
        Pe = dl.Constant(.5) * h_dot_u(metric, u,
                                       self.reg_norm * self.nu * self.nu) / nu

        num = dl.Constant(1.) + dl.exp(dl.Constant(-2.) * Pe)
        den = dl.Constant(1.) - dl.exp(dl.Constant(-2.) * Pe)

        # [0.1 0.01]* [a1] = [ coth(.1) - 1./(.1) ]
        # [1.  0.2 ]  [a2]   [ -csch(.1)^2 + 1./(.1)^2]

        a1 = dl.Constant(0.333554921691650)
        a2 = dl.Constant(-0.004435991517475)

        tau_1 = (num / den - dl.Constant(1.) / Pe) * h_over_u(
            metric, u, self.reg_norm * self.nu * self.nu)
        tau_2 = (a1 + a2 * Pe) * dl.Constant(.5) * h2 / nu

        return dl.conditional(dl.ge(Pe, .1), tau_1, tau_2)