コード例 #1
0
ファイル: QESettings.py プロジェクト: ruoitrau86/vnf
    def _setOptimField(self, director, table, form):
        "Special field: Optimization - depends on server"
        # Explain link
        visual_ = "material_simulations/espresso/link-opt"
        explLink = director.retrieveVisual(visual_, form=form)

        localdisk = FormCheckBox(name="localdisk", value=OPT_DEFAULT)

        diskgrid = QEGrid(lc.grid())
        diskgrid.addRow((localdisk, explLink))

        table.addRow(("Optimization:", diskgrid.grid()))
コード例 #2
0
ファイル: QESettings.py プロジェクト: danse-inelastic/vnf
    def _setOptimField(self, director, table, form):
        "Special field: Optimization - depends on server"
        # Explain link
        visual_     = "material_simulations/espresso/link-opt"
        explLink    = director.retrieveVisual(visual_, form=form)

        localdisk       = FormCheckBox(name="localdisk", value = OPT_DEFAULT)

        diskgrid    = QEGrid(lc.grid())
        diskgrid.addRow((localdisk, explLink))


        table.addRow(("Optimization:", diskgrid.grid()))
コード例 #3
0
    def _latticeTable(self, lp):
        "Takes lattice parameters and returns formatted table of lattice structure"
        if not self._output:  # No output
            return NONE

        table = QEGrid(lc.grid(Class="qe-table-forces"))
        table.addRow(("A", "B", "C", "cosAB", "cosAC", "cosBC"))
        table.addRow(self._fstr(lp))
        table.setRowStyle(0, "qe-table-header-left")
        return table.grid()
コード例 #4
0
ファイル: pwresult.py プロジェクト: danse-inelastic/vnf
    def stress(self):
        "Returns formatted stress"
        if not self._output:    # No output
            return NONE

        stress  = self._outputStress()
        if not stress:          # No stress in the output
            return NONE

        table    = QEGrid(lc.grid(Class="qe-table-stress"))
        for s in stress:
            table.addRow(("%.2f %.2f %.2f" % (s[0], s[1], s[2]) ))

        return table.grid()
コード例 #5
0
    def stress(self):
        "Returns formatted stress"
        if not self._output:  # No output
            return NONE

        stress = self._outputStress()
        if not stress:  # No stress in the output
            return NONE

        table = QEGrid(lc.grid(Class="qe-table-stress"))
        for s in stress:
            table.addRow(("%.2f %.2f %.2f" % (s[0], s[1], s[2])))

        return table.grid()
コード例 #6
0
ファイル: pwresult.py プロジェクト: danse-inelastic/vnf
    def _latticeTable(self, lp):
        "Takes lattice parameters and returns formatted table of lattice structure"
        if not self._output:    # No output
            return NONE

        table    = QEGrid(lc.grid(Class="qe-table-forces"))
        table.addRow(("A", "B", "C", "cosAB", "cosAC", "cosBC"))
        table.addRow(self._fstr(lp))
        table.setRowStyle(0, "qe-table-header-left")
        return table.grid()
コード例 #7
0
    def _position(self, poslist):
        "Returns formatted structure of atomic positions"
        # Example: poslist = [('a', [0, 0, 0]), ('b', [1, 1, 1])]
        if not self._output:  # No output
            return NONE

        table = QEGrid(lc.grid(Class="qe-table-forces"))
        table.addRow(("Atom", "Coordinates"))
        for pl in poslist:
            table.addRow(
                (pl[0], "%.2f, %.2f, %.2f" % (pl[1][0], pl[1][1], pl[1][2])))

        table.setRowStyle(0, "qe-table-header-left")
        return table.grid()
コード例 #8
0
    def atomicStructure(self):
        "Atom mass name: mass<number>, atom pseudo potential name: pseudo<number>"
        atoms = QEGrid(lc.grid(Class="qe-table-atomic"))
        list = self._atomsList()

        if not list:
            return NONE

        atoms.addRow(
            ("Atom", "Position (bohr)", "Mass (u)", "Pseudo-Potential"))

        for row in list:
            atoms.addRow((row[1], row[2], row[3], row[4]))

        atoms.setRowStyle(0, "qe-table-header-left")
        return atoms.grid()
コード例 #9
0
ファイル: pwresult.py プロジェクト: danse-inelastic/vnf
    def _position(self, poslist):
        "Returns formatted structure of atomic positions"
        # Example: poslist = [('a', [0, 0, 0]), ('b', [1, 1, 1])]
        if not self._output:    # No output
            return NONE

        table    = QEGrid(lc.grid(Class="qe-table-forces"))
        table.addRow(("Atom", "Coordinates"))
        for pl in poslist:
            table.addRow((pl[0], "%.2f, %.2f, %.2f" % (pl[1][0], pl[1][1], pl[1][2])))
        
        table.setRowStyle(0, "qe-table-header-left")
        return table.grid()
コード例 #10
0
    def forces(self):
        "Returns formatted force vector for each atom"
        if not self._output:  # No output
            return NONE

        forces = self._outputForces()
        if not forces:  # No forces in the output
            return NONE

        table = QEGrid(lc.grid(Class="qe-table-forces"))
        table.addRow(("Atom", "Force (Ry/bohr)"))

        for f in forces:
            table.addRow((f[1], "%.2f, %.2f, %.2f" % (f[2], f[3], f[4])))

        table.setRowStyle(0, "qe-table-header-left")
        return table.grid()
コード例 #11
0
ファイル: taskcell.py プロジェクト: danse-inelastic/vnf
    def taskInfo(self):
        table   = QEGrid(lc.grid(Class="qe-tasks-info"))
        
        if self._task:  # If task exists
            self._setTaskInfo(table)    # Main scenario
            return table.grid()


        # No task created, show link "Create New Task"
        link    = lc.link(label="Create New Task",
                          onclick = load(actor      = 'material_simulations/espresso/task-create',
                                         routine    = 'createRecord',
                                         simid      = self._simid,
                                         tasktype   = self._type,
                                         linkorder  = self._linkorder)
                         )

        table.addRow((link, ))
        #table.addRow(("or", ))                 # Keep
        #table.addRow(("Use Existing Task", ))  # Keep
        return table.grid()
コード例 #12
0
ファイル: qetasks.py プロジェクト: danse-inelastic/vnf
    def tasks(self):
        container   = ""

        simrecord   = SimulationRecord(self._director, self._simid)
        tasklist    = simrecord.taskList()

        if not tasklist:
            return container

        self._types     = simrecord.typeList()
        table           = QEGrid(lc.grid(Class="qe-tasks-table"))
        doshow          = self._showActions(tasklist)  # show "Run Task"?

        for i in range(len(tasklist)):
            rows    = self._list(doshow)
            self._setTaskCell(table, i, tasklist[i], rows)
            if doshow:
                # Special layout for action buttons (e.g. "Run Task")
                table.setCellStyle(2, i, "qe-action-task")

        return table.grid()
コード例 #13
0
ファイル: pwresult.py プロジェクト: danse-inelastic/vnf
    def atomicStructure(self):
        "Atom mass name: mass<number>, atom pseudo potential name: pseudo<number>"
        atoms       = QEGrid(lc.grid(Class="qe-table-atomic"))
        list        = self._atomsList()

        if not list:
            return NONE

        atoms.addRow(("Atom", "Position (bohr)", "Mass (u)", "Pseudo-Potential"))

        for row in list:
            atoms.addRow((row[1], row[2], row[3], row[4]))

        atoms.setRowStyle(0, "qe-table-header-left")
        return atoms.grid()
コード例 #14
0
ファイル: pwresult.py プロジェクト: danse-inelastic/vnf
    def forces(self):
        "Returns formatted force vector for each atom"
        if not self._output:    # No output
            return NONE

        forces  = self._outputForces()
        if not forces:          # No forces in the output
            return NONE
        
        table    = QEGrid(lc.grid(Class="qe-table-forces"))
        table.addRow(("Atom", "Force (Ry/bohr)"))
        
        for f in forces:
            table.addRow((f[1], "%.2f, %.2f, %.2f" % (f[2], f[3], f[4]) ))

        table.setRowStyle(0, "qe-table-header-left")
        return table.grid()
コード例 #15
0
    def taskInfo(self):
        table = QEGrid(lc.grid(Class="qe-tasks-info"))

        if self._task:  # If task exists
            self._setTaskInfo(table)  # Main scenario
            return table.grid()

        # No task created, show link "Create New Task"
        link = lc.link(label="Create New Task",
                       onclick=load(
                           actor='material_simulations/espresso/task-create',
                           routine='createRecord',
                           simid=self._simid,
                           tasktype=self._type,
                           linkorder=self._linkorder))

        table.addRow((link, ))
        #table.addRow(("or", ))                 # Keep
        #table.addRow(("Use Existing Task", ))  # Keep
        return table.grid()
コード例 #16
0
ファイル: QEAnalysis.py プロジェクト: ruoitrau86/vnf
    def _summary(self, director, section):
        "System Summary"
        section.add(lc.paragraph(text="System Summary", Class="qe-section"))
        table = QEGrid(lc.grid(Class="qe-table-analysis"))
        section.add(table.grid())

        table.addRow(("Material Type:", self._pwresult.materialType()))
        table.addRow(("Lattice Type:", self._pwresult.latticeType()))
        table.addRow(
            ("Atomic Structure:", self._pwresult.atomicStructure()
             ))  # "# Atom Position (bohr) Mass (u)  Pseudo-Potentials"
        table.addRow(("Energy Cutoff:", self._pwresult.energyCutoff()))
        table.addRow(("Density Cutoff:", self._pwresult.densityCutoff()))
        if self._pwresult.materialType(
        ) == "Metal":  # Parameters specific for metals
            table.addRow(("Smearing Type:",
                          self._pwresult.smearingType()))  # For metals only
            table.addRow(("Smearing Degree:",
                          self._pwresult.smearingDegree()))  # For metals only
        table.addRow(("K points:", self._pwresult.kPoints()))

        table.setColumnStyle(0, "qe-cell-param-analysis")
コード例 #17
0
ファイル: QEAnalysis.py プロジェクト: ruoitrau86/vnf
    def _electronStructure(self, director, section):
        "Electron Structure"

        # output exists
        section.add(lc.paragraph(text="Electron System", Class="qe-section"))
        table = QEGrid(lc.grid(Class="qe-table-analysis"))
        section.add(table.grid())

        table.addRow(('Total Energy:', self._pwresult.totalEnergy(True)))
        table.addRow(('Fermi Energy:', self._pwresult.fermiEnergy(True)))
        table.addRow(("Forces:", self._pwresult.forces()))
        table.addRow(("Stress (Ry/bohr^2):", self._pwresult.stress()))

        table.setColumnStyle(0, "qe-cell-param-analysis")