ConstraintSet.h 1.28 KB
Newer Older
1
2
3
4
5
////////////////////////////////////////////////////////////////////////////////
//
// ConstraintSet.h
//
////////////////////////////////////////////////////////////////////////////////
6
// $Id: ConstraintSet.h,v 1.3 2007-03-17 01:14:00 fgygi Exp $
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

#ifndef CONSTRAINTSET_H
#define CONSTRAINTSET_H

#include <vector>
#include <string>

class Atom;
class AtomSet;
class Constraint;
class Context;

class ConstraintSet
{
  private:
  
  const Context& ctxt_;
24
  std::vector<Constraint *> constraint_list;
25
26
27
28
  
  public:

  ConstraintSet(const Context& ctxt) : ctxt_(ctxt) {}
Francois Gygi's avatar
Francois Gygi committed
29
30
31
  bool define_constraint(AtomSet &atoms, int argc, char **argv);
  bool set_constraint(int argc, char **argv);
  bool delete_constraint(int argc, char **argv);
32
  void list_constraints(std::ostream &os);
33
34
  int size(void) const { return constraint_list.size(); }
  void enforce(AtomSet& atoms);
35
36
37
38
39
40
  void enforce_r(const std::vector<std::vector<double> > &r0,
                 std::vector<std::vector<double> > &rp);
  void enforce_v(const std::vector<std::vector<double> > &r0,
                 std::vector<std::vector<double> > &v0);
  void compute_forces(const std::vector<std::vector<double> > &r0,
                      const std::vector<std::vector<double> > &f);
41
42
43
44
  void update_constraints(double dt);
  void setup(AtomSet& atoms);
};
#endif