def draw(self, coords, index):
     if self.one_frozen:
         coords = self.coords_converter.get_full_coords(coords)
     d = .4
     r = .04
     nspins = coords.size / 2
     com = sum(self.node2xyz(node) for node in self.pot.G.nodes())
     com /= nspins
     coords = coords.reshape([-1,2])
     for node in self.pot.G.nodes():
         xyz = self.node2xyz(node)
         spin2 = coords[self.pot.indices[node],:]
         spin3 = hs.make3dVector(spin2)
         x1 = xyz - 0.5 * spin3 * d - com
         x2 = xyz + 0.5 * spin3 * d - com
         draw_cone(x1, x2, rbase=r)
Example #2
0
 def draw(self, coords, index):
     if self.one_frozen:
         coords = self.coords_converter.get_full_coords(coords)
     d = .4
     r = .04
     nspins = old_div(coords.size, 2)
     com = sum(self.node2xyz(node) for node in self.pot.G.nodes())
     com /= nspins
     coords = coords.reshape([-1,2])
     for node in self.pot.G.nodes():
         xyz = self.node2xyz(node)
         spin2 = coords[self.pot.indices[node],:]
         spin3 = hs.make3dVector(spin2)
         x1 = xyz - 0.5 * spin3 * d - com
         x2 = xyz + 0.5 * spin3 * d - com
         draw_cone(x1, x2, rbase=r)
Example #3
0
    def draw(self, coords, index):
        from pele.systems._opengl_tools import draw_cone
#        if self.one_frozen:
#            coords = self.coords_converter.get_full_coords(coords)
        d = .4
        r = .04
        if self.one_frozen:
            coords = self.pot.coords_converter.get_full_coords(coords)
        nspins = coords.size
        com = sum(self.node2xyz(node) for node in self.pot.G.nodes())
        com /= nspins
        for node in self.pot.G.nodes():
            xyz = self.node2xyz(node)
            i = self.pot.indices[node]
            spin2 = angle_to_2dvector(coords[i])
            spin3 = np.zeros(3)
            spin3[:2] = spin2
            x1 = xyz - 0.5 * spin3 * d - com
            x2 = xyz + 0.5 * spin3 * d - com
            draw_cone(x1, x2, rbase=r)
Example #4
0
 def draw(self, coords, index):
     from pele.systems._opengl_tools import draw_cone
     #        if self.one_frozen:
     #            coords = self.coords_converter.get_full_coords(coords)
     d = .4
     r = .04
     if self.one_frozen:
         coords = self.pot.coords_converter.get_full_coords(coords)
     nspins = coords.size
     com = sum(self.node2xyz(node) for node in self.pot.G.nodes())
     com /= nspins
     for node in self.pot.G.nodes():
         xyz = self.node2xyz(node)
         i = self.pot.indices[node]
         spin2 = angle_to_2dvector(coords[i])
         spin3 = np.zeros(3)
         spin3[:2] = spin2
         x1 = xyz - 0.5 * spin3 * d - com
         x2 = xyz + 0.5 * spin3 * d - com
         draw_cone(x1, x2, rbase=r)