Skip to content

Commit

Permalink
disabled nx ny nz etc. buttons for phonon view as they don't work pro…
Browse files Browse the repository at this point in the history
…perly (yet :) )
  • Loading branch information
JannickWeisshaupt committed Jun 28, 2018
1 parent 477c5c8 commit e10a8b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def __init__(self, crystal_structure,data_dictionary, parent=None):
super(MayaviPhononWindow, self).__init__(parent)

self.data_dictionary = data_dictionary
self.setWindowTitle('Phonon visualization')

self.main_widget = QtGui.QWidget(self)
self.setCentralWidget(self.main_widget)
Expand Down
11 changes: 10 additions & 1 deletion visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -1349,11 +1349,20 @@ def plot(self, scf_data):


class PhononVisualization(StructureVisualization):
view = View(Item('scene', editor=SceneEditor(scene_class=MayaviScene),
height=450, width=500, show_label=False),
Group('_','show_unitcell', 'show_bonds', 'show_atoms', orientation='horizontal'),
resizable=True, # We need this to resize with the parent widget
)

scene = Instance(MlabSceneModel, ())

def __init__(self,crystal_structure):
super(PhononVisualization,self).__init__(crystal_structure)
self.phonon_eigenvectors = None
self.mayavi_phonons = None


def plot_phonons(self,n_mode,n_k):
self.remove_phonons()
if self.phonon_eigenvectors is None:
Expand All @@ -1367,7 +1376,7 @@ def plot_phonons(self,n_mode,n_k):
mode = mode_conv.reshape(self.crystal_structure.atoms.shape[0],3)
# mode_unit = mode/np.abs(mode).max()
self.mayavi_phonons = self.scene.mlab.quiver3d(abs_coord_atoms[:,0],abs_coord_atoms[:,1],abs_coord_atoms[:,2],mode[:,0],mode[:,1],mode[:,2],figure=self.scene.mayavi_scene,
scale_factor=8,line_width=3,reset_zoom=False)
scale_factor=10,line_width=3,reset_zoom=False,colormap='viridis')
def remove_phonons(self):
if self.mayavi_phonons:
self.mayavi_phonons.remove()
Expand Down

0 comments on commit e10a8b0

Please sign in to comment.