CellStepper.h 1.24 KB
Newer Older
1 2
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
3 4 5 6
// Copyright (c) 2008 The Regents of the University of California
//
// This file is part of Qbox
//
Francois Gygi committed
7 8
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
Francois Gygi committed
9 10 11 12 13 14
// 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/>.
//
////////////////////////////////////////////////////////////////////////////////
//
15 16 17 18 19 20 21 22 23 24 25 26 27
// CellStepper.h:
//
////////////////////////////////////////////////////////////////////////////////

#ifndef CELLSTEPPER_H
#define CELLSTEPPER_H

#include "Sample.h"
#include <valarray>

class CellStepper
{
  protected:
28

29 30 31 32
  Sample& s_;
  AtomSet& atoms_;
  double ekin_;
  UnitCell cellp;
33
  std::vector<double> u_, up_;
34 35

  public:
36

37
  CellStepper (Sample& s) : s_(s), atoms_(s.atoms), ekin_(0.0) {}
38

39 40
  virtual void compute_new_cell(double e0,const std::valarray<double>& sigma,
    const std::vector<std::vector< double> >& f0) = 0;
Francois Gygi committed
41
  void enforce_constraints(double* u);
42
  virtual void update_cell(void) = 0;
43

44 45 46 47
  double ekin(void) const { return ekin_; }
  virtual ~CellStepper() {}
};
#endif