Ejemplo n.º 1
0
def showData(file,units):

    print "------------Simulation datas:------------"
                
    print 'Number of atoms : ' +  str(file.getNatom())        
    
    print 'Step: ' + str(file.getNbTime())
                
                               
    E_tot = units['Energy'][1] *  Math.average(file.getE_Tot())
    deviation = file.getStandardDeviation(units['Energy'][1] * file.getE_Tot(), E_tot)        
    print 'Total Energy ('+ str(units['Energy'][0]) +"): " + displayData(E_tot,deviation)
        
        
    Vol = units['Volume'][1] * Math.average(file.getVol())
    print 'Volume ('+str(units['Volume'][0])+'): ' + str("%.4g" % Vol)

    
    Temp = file.getTemp()        
    ATemp =  Math.average(Temp) - units['Temperature'][1]        
    deviation = file.getStandardDeviation( Temp - units['Temperature'][1] , ATemp)
    print 'Temperature ('+str(units['Temperature'][0])+"): " + displayData(ATemp,deviation)
        
                
                       
    Press =  Math.average(file.getPress() ) * units['Pressure'][1]
    deviation = file.getStandardDeviation(units['Pressure'][1] * file.getPress(), Press)
    print 'Pressure ('+str(units['Pressure'][0])+"): "  + displayData(Press,deviation)    
    
    print "initial step :  " + str(file.getNi())
    print "final   step :  " + str(file.getNf())
    print "-----------------------------------------"
Ejemplo n.º 2
0
    def updateLabel(self):
        self.lbl4.setText("Total Energy (" + str(self.units['Energy'][0]) +
                          "): ")
        E_tot = self.units['Energy'][1] * Math.average(self.file1.getE_Tot())
        deviation = Math.standard_deviation(
            self.units['Energy'][1] * self.file1.getE_Tot(), E_tot)
        self.lblE_tot.setText(self.displayData(E_tot, deviation))

        self.lbl5.setText("Volume (" + str(self.units['Volume'][0]) + "): ")
        Vol = self.units['Volume'][1] * Math.average(self.file1.getVol())
        deviation = Math.standard_deviation(
            self.units['Volume'][1] * self.file1.getVol(), Vol)
        self.lblVol.setText(self.displayData(Vol, deviation))

        self.lbl6.setText("Temperature (" + str(self.units['Temperature'][0]) +
                          "): ")
        Temp = self.file1.getTemp()
        ATemp = Math.average(Temp) - self.units['Temperature'][1]
        deviation = Math.standard_deviation(
            Temp - self.units['Temperature'][1], ATemp)
        self.lblTemp.setText(self.displayData(ATemp, deviation))

        self.lbl7.setText("Pressure (" + str(self.units['Pressure'][0]) +
                          "): ")
        Press = Math.average(self.file1.getPress()) * self.units['Pressure'][1]
        deviation = Math.standard_deviation(
            self.units['Pressure'][1] * self.file1.getPress(), Press)
        self.lblPress.setText(self.displayData(Press, deviation))
Ejemplo n.º 3
0
    def updateLabel(self):
        E_tot = self.units['Energy'][1] * Math.average(self.file1.getE_Tot())
        deviation = self.file1.getStandardDeviation(
            self.units['Energy'][1] * self.file1.getE_Tot(), E_tot)
        strETOT = self.displayData(E_tot, deviation)

        vol = self.units['Volume'][1] * Math.average(self.file1.getVol())
        deviation = self.file1.getStandardDeviation(
            self.units['Volume'][1] * self.file1.getVol(), vol)
        strVol = self.displayData(vol, deviation)

        Temp = self.file1.getTemp()
        ATemp = Math.average(Temp) - self.units['Temperature'][1]
        deviation = Math.standard_deviation(
            Temp - self.units['Temperature'][1], ATemp)
        strTemp = self.displayData(ATemp, deviation)

        Press = Math.average(self.file1.getPress()) * self.units['Pressure'][1]
        deviation = Math.standard_deviation(
            self.units['Pressure'][1] * self.file1.getPress(), Press)
        strPress = self.displayData(Press, deviation)

        self.lbl4.setText("Total Energy (" + str(self.units['Energy'][0]) +
                          "): " + strETOT)
        self.lbl5.setText("Volume (" + str(self.units['Volume'][0]) + "): " +
                          strVol)
        self.lbl6.setText("Temperature (" + str(self.units['Temperature'][0]) +
                          ")  : " + strTemp)
        self.lbl7.setText("Pressure (" + str(self.units['Pressure'][0]) +
                          ")    : " + strPress)
Ejemplo n.º 4
0
    def __init__(self, pfile, punits, parent = None):

        self.file1 = pfile
        self.ni = self.file1.getNi()#Departure of the dataset
        self.nf = self.file1.getNf()#End of the dataset
        self.units = punits #Dictionary with the units ans the conversion
        
        QtGui.QWidget.__init__(self, parent)
        self.layout = QtGui.QGridLayout()
        self.setLayout(self.layout)
                
        self.box2 = QtGui.QGroupBox("Simulation data:")
        self.box2layout = QtGui.QGridLayout()
        self.box2.setLayout(self.box2layout)        

        E_tot = self.units['Energy'][1] * Math.average(self.file1.getE_Tot())
        deviation = self.file1.getStandardDeviation(self.units['Energy'][1] *self.file1.getE_Tot(), E_tot)      
        strETOT = self.displayData(E_tot,deviation)

        vol = self.units['Volume'][1] * Math.average(self.file1.getVol())
        deviation = self.file1.getStandardDeviation(self.units['Volume'][1] *self.file1.getVol(), vol)        
        strVol = self.displayData(vol,deviation)

        Temp = self.file1.getTemp()        
        ATemp = Math.average(Temp) - self.units['Temperature'][1]        
        deviation = Math.standard_deviation( Temp - self.units['Temperature'][1] , ATemp)
        strTemp = self.displayData(ATemp,deviation)

        Press = Math.average( self.file1.getPress() ) * self.units['Pressure'][1]
        deviation = Math.standard_deviation(self.units['Pressure'][1] * self.file1.getPress(), Press)
        strPress = self.displayData(Press,deviation)

        self.lbl1 = QtGui.QLabel("Number of cell(s)  : "+str(self.file1.getNImage()), self)
        self.lbl2 = QtGui.QLabel("Number of atoms  : "+str(self.file1.getNatom()), self)
        self.lbl3 = QtGui.QLabel("Number of steps  : "+str(self.file1.getNbTime()), self)
        self.lbl4 = QtGui.QLabel("Total Energy ("+str(self.units['Energy'][0])+"): "+strETOT, self)                
        self.lbl5 = QtGui.QLabel("Volume ("+str(self.units['Volume'][0])+"): "+strVol, self)
        self.lbl6 = QtGui.QLabel("Temperature ("+str(self.units['Temperature'][0])+")  : "+strTemp, self)
        self.lbl7 = QtGui.QLabel("Pressure ("+str(self.units['Pressure'][0])+")    : "+strPress, self)        

        self.lbl1.setFixedWidth(300)
        self.lbl2.setFixedWidth(300)
        self.lbl3.setFixedWidth(300)
        self.lbl4.setFixedWidth(300)
        self.lbl5.setFixedWidth(300)
        self.lbl6.setFixedWidth(300)
        self.lbl7.setFixedWidth(300)
                
        self.box2layout.addWidget(self.lbl1,1,0)
        self.box2layout.addWidget(self.lbl2,2,0)
        self.box2layout.addWidget(self.lbl3,3,0)
        self.box2layout.addWidget(self.lbl4,4,0)
        self.box2layout.addWidget(self.lbl5,5,0)
        self.box2layout.addWidget(self.lbl6,6,0)
        self.box2layout.addWidget(self.lbl7,7,0)

        self.box3 = QtGui.QGroupBox("Option")
        self.box3layout = QtGui.QGridLayout()
        self.box3.setLayout(self.box3layout)
        
        self.lbl3_1 = QtGui.QLabel('Choose the initial and final step\nfor the molecular dynamics :')
        self.lbl3_1.setFixedSize(300,50)
        self.lblni = QtGui.QLabel('initial step')
        self.lblnf = QtGui.QLabel('final step')
        self.sbni = QtGui.QSpinBox()
        self.sbnf = QtGui.QSpinBox()
        self.sbni.setMaximum(self.file1.getNbTime())
        self.sbnf.setMaximum(self.file1.getNbTime()) 
        self.sbni.setMinimum(1)
        self.sbnf.setMinimum(1) 
        self.sbni.setFixedSize(150,20)
        self.sbnf.setFixedSize(150,20)
        self.sbni.setValue(self.ni)
        self.sbnf.setValue(self.nf)
        self.connect(self.sbni,QtCore.SIGNAL('keyPressed'),self.verifStep)
        self.connect(self.sbnf,QtCore.SIGNAL('keyPressed'),self.verifStep)

        self.pbok = QtGui.QPushButton("update")
        self.pbok.setFixedSize(100,20)
        self.connect(self.pbok,QtCore.SIGNAL("clicked()"),self.updateStep)
        
        self.box3layout.addWidget(self.lbl3_1, 1, 0, 1, 2,QtCore.Qt.AlignCenter)
        self.box3layout.addWidget(self.lblni, 2, 0, 1, 1,QtCore.Qt.AlignCenter)
        self.box3layout.addWidget(self.sbni, 2, 1, 1, 1,QtCore.Qt.AlignCenter)
        self.box3layout.addWidget(self.lblnf, 3, 0, 1, 1,QtCore.Qt.AlignCenter)
        self.box3layout.addWidget(self.sbnf, 3, 1, 1 , 1,QtCore.Qt.AlignCenter)
        self.box3layout.addWidget(self.pbok, 4, 0,1,2,QtCore.Qt.AlignCenter)
        
        
        self.box4 = QtGui.QGroupBox("Graphics")
        self.box4layout = QtGui.QGridLayout()
        self.box4.setLayout(self.box4layout)

        self.potentialEnergy = QtGui.QPushButton('Potential Energy', self)
        self.potentialEnergy.setStatusTip('Show graphic of  Potential energy')
        
        self.connect(self.potentialEnergy, QtCore.SIGNAL('clicked()'), self.showPotentialEnergy)

        self.totalEnergy = QtGui.QPushButton('Total Energy', self)
        self.totalEnergy.setStatusTip('Show graphic of total energy')
        self.connect(self.totalEnergy, QtCore.SIGNAL('clicked()'), self.showTotalEnergy)

        self.kineticEnergy = QtGui.QPushButton('Kinetic Energy', self)
        self.kineticEnergy.setStatusTip('Show graphic of kinetic energy')
        self.connect(self.kineticEnergy, QtCore.SIGNAL('clicked()'), self.showKineticEnergy)
        
        self.temperature = QtGui.QPushButton('Temperature', self)
        self.temperature.setStatusTip('Show graphic of temperature')
        self.connect(self.temperature, QtCore.SIGNAL('clicked()'), self.showTemperature)
        
        self.pressure = QtGui.QPushButton('Pressure', self)
        self.pressure.setStatusTip('Show graphic of pressure')
        self.connect(self.pressure, QtCore.SIGNAL('clicked()'), self.showPressure)

        self.stress = QtGui.QPushButton('Stress', self)
        self.stress.setStatusTip('Show graphic of stress')
        self.connect(self.stress, QtCore.SIGNAL('clicked()'), self.showStress)

        self.volume = QtGui.QPushButton('Volume', self)
        self.volume.setStatusTip('Show graphic of volume')
        self.connect(self.volume, QtCore.SIGNAL('clicked()'), self.showVolume)


        self.acell = QtGui.QPushButton('Cell', self)
        self.acell.setStatusTip('Show graphic of cell')
        self.connect(self.acell, QtCore.SIGNAL('clicked()'), self.showAcell)


        self.angles = QtGui.QPushButton('Angles', self)
        self.angles.setStatusTip('Show graphic of Angles')
        self.connect(self.angles, QtCore.SIGNAL('clicked()'), self.showAngles)

        
        self.VAF = QtGui.QPushButton('VACF', self)
        self.VAF.setStatusTip('Show graphic of Velocity autocorrelation function')
#        self.connect(self.VAF, QtCore.SIGNAL('clicked()'), self.showVAF)        
        
        self.DOS = QtGui.QPushButton('VDOS', self)
        self.DOS.setStatusTip('Show graphic of Vibrational Density Of States')
#        self.connect(self.DOS, QtCore.SIGNAL('clicked()'), self.showDOS)
                        
        self.RDF = QtGui.QPushButton('Topology', self)
        self.RDF.setStatusTip('Show graphic of Radial Distribution Function')
#        self.connect(self.RDF, QtCore.SIGNAL('clicked()'), self.showRDF)        
                
        self.position = QtGui.QPushButton('Positions', self)
        self.position.setStatusTip('Show positions of all the particules for all the step in 2D ')
#        self.connect(self.position, QtCore.SIGNAL('clicked()'), self.showPosition)

        self.MSD = QtGui.QPushButton('MSD(beta)', self)
        self.MSD.setStatusTip('Show graphic of Means Squared Displacement(beta)')
#        self.connect(self.MSD, QtCore.SIGNAL('clicked()'), self.showMSD)        

        self.netcdf = QtGui.QPushButton('save netcdf', self)
        self.netcdf.setStatusTip('Save molecular dynamics in necdf format')
#        self.connect(self.netcdf, QtCore.SIGNAL('clicked()'), self.showNetcdf)

        self.xyz = QtGui.QPushButton('save .xyz', self)
        self.xyz.setStatusTip('Save position in .xyz format')
        self.connect(self.xyz, QtCore.SIGNAL('clicked()'), self.showExport)
        
        self.box4layout.addWidget(self.potentialEnergy,1,0)
        self.box4layout.addWidget(self.totalEnergy,1,1)
        self.box4layout.addWidget(self.kineticEnergy ,1,2)
        self.box4layout.addWidget(self.temperature,1,3)
        self.box4layout.addWidget(self.pressure,1,4)
        self.box4layout.addWidget(self.stress,1,5)
        self.box4layout.addWidget(self.volume,2,0)
        self.box4layout.addWidget(self.acell,2,1)
        self.box4layout.addWidget(self.angles,2,2)
        self.box4layout.addWidget(self.VAF,3,0)
        self.box4layout.addWidget(self.DOS,3,1)
        self.box4layout.addWidget(self.RDF,3,2)
        self.box4layout.addWidget(self.MSD,3,3)
        self.box4layout.addWidget(self.position,2,3)
        self.box4layout.addWidget(self.netcdf,2,5)
        self.box4layout.addWidget(self.xyz,3,5)
        self.layout.addWidget(self.box2,1,0,5,1)
        self.layout.addWidget(self.box3,1,1,5,1)
        self.layout.addWidget(self.box4,6,0,1,2)