Esempio n. 1
0
def rotate(grid, alignment=p.n_subs, trend=p.n_shel, bias=p.n_bias):
    ''' grid-based molecule orientation rotator '''
    if is_top(grid) or is_bot(grid):
        grid.n = np.array(alignment)
    elif is_osh(grid):
        grid.n = envelope(grid, trend)
    elif is_ish(grid):
        grid.n = envelope(grid, trend - u.cartesian(bias))
    else:
        grid.n = np.array(alignment)  # bulk initial condition
Esempio n. 2
0
 def __init__(self,
              position=np.empty(3),
              orientation=np.random.randn(3),
              order_degree=0.5,
              biaxiality=0):
     self._r = np.array(position)
     self._n = u.cartesian(np.array(orientation))
     self._S = order_degree
     self._P = biaxiality
     self._Q = np.empty((3, 3))
     self._h = np.empty((3, 3))
Esempio n. 3
0
def evolute(mesh,
            L=p.L,
            A=p.A,
            B=p.B,
            C=p.C,
            W_subs=p.W_sub,
            W_shel=p.W_she,
            dt=p.dt,
            gamma=p.gamma):
    lap_Qs = laplacian(mesh)
    grad_Qs = gradient(mesh)

    for x in range(p.x_nog):
        for y in range(p.y_nog):
            for z in range(p.z_nog):
                grid = mesh[x, y, z]
                lap_Q = lap_Qs[x, y, z]
                grad_Q = grad_Qs[x, y, z]

                if c.is_top(grid) or c.is_bot(grid):  # h_surf of substrate
                    Q_bound = Q_tensor(p.n_subs, p.S_subs)
                    grid.h = h_surf(grid.Q,
                                    grad_Q,
                                    Q_bound=Q_bound,
                                    surf_normal=np.array([0, 0, 1]),
                                    W=W_subs)
                elif c.is_osh(grid) or c.is_ish(grid):  # h_surf of shell
                    Q_bound = Q_tensor(c.envelope(p.n_shel), p.S_subs)
                    grid.h = h_surf(grid.Q,
                                    grad_Q,
                                    Q_bound=Q_bound,
                                    surf_normal=u.cartesian(grid.r),
                                    W=W_shel)
                else:  # h_bulk
                    grid.h = h_bulk(grid.Q, lap_Q)
                grid.Q += grid.h * dt / gamma - np.trace(
                    grid.Q) * np.eye(3) / 3  # EL modification
Esempio n. 4
0
 def n(self, value):
     if 2 <= len(value) <= 3:
         self._n = u.cartesian(np.array(value))
     else:
         raise ValueError
Esempio n. 5
0
def envelope(grid, trend=p.n_shel):
    ''' calculate the orientation around the sphere under a special arrangement '''
    N = u.cartesian(trend)
    r = u.cartesian(grid.r)
    return N - np.dot(N, r) * r