Commit 30e2c3e8 by Francois Gygi

polarization_type variable


git-svn-id: http://qboxcode.org/svn/qb/branches/efield@1581 cba15fb0-1239-40c8-b417-11db7ca47a34
parent ac4bf5d8
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014 The Regents of the University of California
//
// This file is part of Qbox
//
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
// PolarizationType.h
//
////////////////////////////////////////////////////////////////////////////////
#ifndef POLARIZATION_TYPE_H
#define POLARIZATION_TYPE_H
#include<iostream>
#include<iomanip>
#include<sstream>
#include "Sample.h"
class PolarizationType : public Var
{
Sample *s;
public:
char *name ( void ) const { return "polarization_type"; };
int set ( int argc, char **argv )
{
if ( argc != 2 )
{
if ( ui->onpe0() )
cout << " polarization_type takes only one value" << endl;
return 1;
}
string v = argv[1];
if ( v == "MLWF" || v == "MLWF_REF" || v == "BERRY" )
s->ctrl.polarization_type = v;
else
{
if ( ui->onpe0() )
cout << " polarization_type must be MLWF, MLWF_REF or BERRY" << endl;
return 1;
}
return 0;
}
string print (void) const
{
ostringstream st;
st.setf(ios::left,ios::adjustfield);
st << setw(10) << name() << " = ";
st.setf(ios::right,ios::adjustfield);
st << s->ctrl.polarization_type;
return st.str();
}
PolarizationType(Sample *sample) : s(sample)
{
s->ctrl.polarization_type = "MLWF";
}
};
#endif
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