Skip to content

Commit

Permalink
Added the ability to display yaehmop input
Browse files Browse the repository at this point in the history
Added a checkbox in each dialog to allow yaehmop
input to be displayed. It pops up in a text box if
the checkbox is checked.
  • Loading branch information
psavery committed Apr 1, 2018
1 parent 8838e9e commit 140b268
Show file tree
Hide file tree
Showing 14 changed files with 196 additions and 73 deletions.
3 changes: 3 additions & 0 deletions libavogadro/src/extensions/yaehmop/yaehmopbanddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ namespace Avogadro {

bool YaehmopBandDialog::getUserOptions(Molecule* mol, size_t& numKPoints,
QString& kPointInfo,
bool& displayYaehmopInput,
bool& displayBandData, bool& limitY,
double& minY, double& maxY,
bool& plotFermi, double& fermi,
bool& zeroFermi,
unsigned short& numDimensions)
{
m_ui->spin_numKPoints->setValue(numKPoints);
m_ui->cb_displayYaehmopInput->setChecked(displayYaehmopInput);
m_ui->cb_displayBandData->setChecked(displayBandData);
m_ui->cb_limitY->setChecked(limitY);
m_ui->spin_minY->setValue(minY);
Expand Down Expand Up @@ -97,6 +99,7 @@ namespace Avogadro {
numKPoints = numKPointsVal;
kPointInfo = text;
displayBandData = m_ui->cb_displayBandData->isChecked();
displayYaehmopInput = m_ui->cb_displayYaehmopInput->isChecked();
limitY = m_ui->cb_limitY->isChecked();
minY = m_ui->spin_minY->value();
maxY = m_ui->spin_maxY->value();
Expand Down
3 changes: 2 additions & 1 deletion libavogadro/src/extensions/yaehmop/yaehmopbanddialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class YaehmopBandDialog : public QDialog
// If the user checks the box to display band data, displayBandData
// will be set to be true
bool getUserOptions(Molecule* mol, size_t& numKPoints,
QString& kPointInfo, bool& displayBandData,
QString& kPointInfo, bool& displayYaehmopInput,
bool& displayBandData,
bool& limitY, double& minY, double& maxY, bool& plotFermi,
double& fermi, bool& zeroFermi,
unsigned short& numDimensions);
Expand Down
10 changes: 9 additions & 1 deletion libavogadro/src/extensions/yaehmop/yaehmopbanddialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>599</width>
<height>368</height>
<height>393</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -224,11 +224,19 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QCheckBox" name="cb_displayYaehmopInput">
<property name="text">
<string>Display Yaehmop Input?</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
<tabstop>spin_numKPoints</tabstop>
<tabstop>edit_specialKPoints</tabstop>
<tabstop>cb_displayYaehmopInput</tabstop>
<tabstop>cb_displayBandData</tabstop>
<tabstop>cb_limitY</tabstop>
<tabstop>spin_minY</tabstop>
Expand Down
3 changes: 3 additions & 0 deletions libavogadro/src/extensions/yaehmop/yaehmopcoopdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ namespace Avogadro {
size_t& numKPoints,
QString& kPoints,
QString& coops,
bool& displayYaehmopInput,
bool& displayData,
bool& useSmoothing,
double& stepE,
Expand All @@ -62,6 +63,7 @@ namespace Avogadro {
m_ui->spin_numValElectrons->setValue(numValElectrons);
m_ui->edit_kpoints->setText(kPoints);
m_ui->edit_coops->setText(coops);
m_ui->cb_displayYaehmopInput->setChecked(displayYaehmopInput);
m_ui->cb_displayData->setChecked(displayData);
m_ui->cb_useSmoothing->setChecked(useSmoothing);
m_ui->spin_energyStep->setValue(stepE);
Expand Down Expand Up @@ -242,6 +244,7 @@ namespace Avogadro {
numKPoints = numKPointsVal;
kPoints = lines.join("\n");
coops = coopList.join("\n");
displayYaehmopInput = m_ui->cb_displayYaehmopInput->isChecked();
displayData = m_ui->cb_displayData->isChecked();
useSmoothing = m_ui->cb_useSmoothing->isChecked();
if (useSmoothing) {
Expand Down
2 changes: 1 addition & 1 deletion libavogadro/src/extensions/yaehmop/yaehmopcoopdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class YaehmopCOOPDialog : public QDialog
bool getUserOptions(YaehmopExtension* yext,
size_t& numValElectrons, size_t& numKPoints,
QString& kPoints, QString& projections,
bool& displayData,
bool& displayYaehmopInput, bool& displayData,
bool& useSmoothing, double& stepE,
double& broadening, bool& limitY,
double& minY, double& maxY, bool& zeroFermi,
Expand Down
54 changes: 31 additions & 23 deletions libavogadro/src/extensions/yaehmop/yaehmopcoopdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<x>0</x>
<y>0</y>
<width>566</width>
<height>559</height>
<height>568</height>
</rect>
</property>
<property name="windowTitle">
<string>Yaehmop Crystal COOP</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="18" column="2">
<item row="19" column="2">
<widget class="QLabel" name="label_6">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The number of periodic dimensions.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If this is set to 1, the material will be periodic only along the A vector of the crystal.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If this is set to 2, the material will be periodic along both the A and B vectors of the crystal.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If this is set to 3, the material will be periodic along the A, B, and C vectors of the crystal.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -27,7 +27,7 @@
</property>
</widget>
</item>
<item row="18" column="3">
<item row="19" column="3">
<widget class="QSpinBox" name="spin_numDim">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The number of periodic dimensions.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If this is set to 1, the material will be periodic only along the A vector of the crystal.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If this is set to 2, the material will be periodic along both the A and B vectors of the crystal.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;If this is set to 3, the material will be periodic along the A, B, and C vectors of the crystal.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand Down Expand Up @@ -60,7 +60,7 @@
</property>
</widget>
</item>
<item row="9" column="2" colspan="2">
<item row="10" column="2" colspan="2">
<widget class="QCheckBox" name="cb_displayData">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Whether or not to display the density of states data in a&lt;/p&gt;&lt;p&gt;pop-up box after the calculation finishes.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Data may be copied and pasted into a separate file.&lt;/p&gt;&lt;p&gt;Default: off&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand Down Expand Up @@ -98,16 +98,6 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<widget class="QPushButton" name="push_viewOrbitalNumbers">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Display the numberings for the different orbitals in this system.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Warning: if you set a parameters file to be one that includes unoccupied orbitals, these orbital numberings may be off, and you may need to number them manually.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>View Orbital Numbers...</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="layoutDirection">
Expand All @@ -131,7 +121,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="12" column="2" colspan="2">
<item row="13" column="2" colspan="2">
<widget class="QDoubleSpinBox" name="spin_energyStep">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The energy step size for Gaussian smoothing. &lt;/p&gt;&lt;p&gt;Default: 0.1&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand Down Expand Up @@ -191,7 +181,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="12" column="0" colspan="2">
<item row="13" column="0" colspan="2">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Energy step size:</string>
Expand All @@ -201,7 +191,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="10" column="2" colspan="2">
<item row="11" column="2" colspan="2">
<widget class="QCheckBox" name="cb_useSmoothing">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Whether or not to use Gaussian smoothing to smooth the data.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Smoothing is typically performed for density of states data.&lt;/p&gt;&lt;p&gt;Default: on&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -214,7 +204,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="13" column="2" colspan="2">
<item row="14" column="2" colspan="2">
<widget class="QDoubleSpinBox" name="spin_broadening">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Gaussian broadening for Gaussian smoothing. The Gaussian broadening is the standard deviation.&lt;/p&gt;&lt;p&gt;Default: 0.1&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -239,7 +229,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="13" column="0" colspan="2">
<item row="14" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Gaussian broadening:</string>
Expand All @@ -249,7 +239,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="14" column="2" colspan="2">
<item row="15" column="2" colspan="2">
<widget class="QCheckBox" name="cb_limitY">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Limit the y-range?&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Default: off&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -259,7 +249,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="17" column="2" colspan="2">
<item row="18" column="2" colspan="2">
<widget class="QDoubleSpinBox" name="spin_maxY">
<property name="enabled">
<bool>false</bool>
Expand All @@ -281,7 +271,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="17" column="0" colspan="2">
<item row="18" column="0" colspan="2">
<widget class="QDoubleSpinBox" name="spin_minY">
<property name="enabled">
<bool>false</bool>
Expand All @@ -303,7 +293,7 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="19" column="0" colspan="4">
<item row="20" column="0" colspan="4">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand All @@ -313,6 +303,23 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QCheckBox" name="cb_displayYaehmopInput">
<property name="text">
<string>Display Yaehmop Input?</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<widget class="QPushButton" name="push_viewOrbitalNumbers">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Display the numberings for the different orbitals in this system.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;Warning: if you set a parameters file to be one that includes unoccupied orbitals, these orbital numberings may be off, and you may need to number them manually.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>View Orbital Numbers...</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>
Expand All @@ -322,6 +329,7 @@ p, li { white-space: pre-wrap; }
<tabstop>push_viewAtomNumbers</tabstop>
<tabstop>cb_zeroFermi</tabstop>
<tabstop>push_viewOrbitalNumbers</tabstop>
<tabstop>cb_displayYaehmopInput</tabstop>
<tabstop>cb_displayData</tabstop>
<tabstop>cb_useSmoothing</tabstop>
<tabstop>spin_energyStep</tabstop>
Expand Down
Loading

0 comments on commit 140b268

Please sign in to comment.