Commit 0eb6ee46 by Francois Gygi

Change variable name to polarization


git-svn-id: http://qboxcode.org/svn/qb/branches/efield@1610 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 227ec73c
......@@ -68,6 +68,6 @@ struct Control
double btHF;
D3vector e_field;
std::string polarization_type;
std::string polarization;
};
#endif
......@@ -12,12 +12,12 @@
//
////////////////////////////////////////////////////////////////////////////////
//
// PolarizationType.h
// Polarization.h
//
////////////////////////////////////////////////////////////////////////////////
#ifndef POLARIZATION_TYPE_H
#define POLARIZATION_TYPE_H
#ifndef POLARIZATION_H
#define POLARIZATION_H
#include<iostream>
#include<iomanip>
......@@ -25,34 +25,35 @@
#include "Sample.h"
class PolarizationType : public Var
class Polarization: public Var
{
Sample *s;
public:
char *name ( void ) const { return "polarization_type"; };
char *name ( void ) const { return "polarization"; };
int set ( int argc, char **argv )
{
if ( argc != 2 )
{
if ( ui->onpe0() )
cout << " polarization_type takes only one value" << endl;
cout << " polarization takes only one value" << endl;
return 1;
}
string v = argv[1];
if ( v == "MLWF" || v == "MLWF_REF" || v == "BERRY" )
s->ctrl.polarization_type = v;
if ( v == "OFF" || v == "MLWF" || v == "MLWF_REF" || v == "MLWF_REF_Q" ||
v == "BERRY" )
s->ctrl.polarization = v;
else
{
if ( ui->onpe0() )
cout << " polarization_type must be MLWF, MLWF_REF or BERRY" << endl;
cout <<
" polarization must be OFF, MLWF, MLWF_REF, MLWF_REF_Q or BERRY" << endl;
return 1;
}
return 0;
}
......@@ -62,13 +63,13 @@ class PolarizationType : public Var
st.setf(ios::left,ios::adjustfield);
st << setw(10) << name() << " = ";
st.setf(ios::right,ios::adjustfield);
st << s->ctrl.polarization_type;
st << s->ctrl.polarization;
return st.str();
}
PolarizationType(Sample *sample) : s(sample)
Polarization(Sample *sample) : s(sample)
{
s->ctrl.polarization_type = "BERRY";
s->ctrl.polarization = "OFF";
}
};
#endif
......@@ -93,7 +93,7 @@ using namespace std;
#include "Ecutprec.h"
#include "Ecuts.h"
#include "Efield.h"
#include "PolarizationType.h"
#include "Polarization.h"
#include "Emass.h"
#include "ExtStress.h"
#include "FermiTemp.h"
......@@ -303,7 +303,7 @@ int main(int argc, char **argv, char **envp)
ui.addVar(new Ecutprec(s));
ui.addVar(new Ecuts(s));
ui.addVar(new Efield(s));
ui.addVar(new PolarizationType(s));
ui.addVar(new Polarization(s));
ui.addVar(new Emass(s));
ui.addVar(new ExtStress(s));
ui.addVar(new FermiTemp(s));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment