Commit 23ee1533 by Francois Gygi

rescale_v command


git-svn-id: http://qboxcode.org/svn/qb/trunk@776 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 8da5db71
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 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/>.
//
////////////////////////////////////////////////////////////////////////////////
//
// RescaleVCmd.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: RescaleVCmd.h,v 1.1 2010-04-16 21:41:41 fgygi Exp $
#ifndef RESCALEVCMD_H
#define RESCALEVCMD_H
#include "UserInterface.h"
#include "Sample.h"
#include <string>
#include <cstdlib>
#include <iostream>
using namespace std;
class RescaleVCmd : public Cmd
{
private:
public:
Sample *s;
RescaleVCmd(Sample *sample) : s(sample) {};
char *name(void) const { return "rescale_v"; }
char *help_msg(void) const
{
return
"\n rescale_v\n\n"
" syntax: rescale_v f\n\n"
" The rescale_v command multiplies the velocity of all atoms \n"
" by the factor f.\n\n";
}
int action(int argc, char **argv)
{
const double fac = atof(argv[1]);
s->atoms.rescale_velocities(fac);
return 0;
}
};
#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