~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to src/compute.h

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ----------------------------------------------------------------------
 
1
/* -*- c++ -*- ----------------------------------------------------------
2
2
   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
3
3
   http://lammps.sandia.gov, Sandia National Laboratories
4
4
   Steve Plimpton, sjplimp@sandia.gov
20
20
 
21
21
class Compute : protected Pointers {
22
22
 public:
 
23
  static int instance_total;     // # of Compute classes ever instantiated
 
24
 
23
25
  char *id,*style;
24
26
  int igroup,groupbit;
25
27
 
37
39
  int size_vector;          // length of global vector
38
40
  int size_array_rows;      // rows in global array
39
41
  int size_array_cols;      // columns in global array
 
42
  int size_vector_variable;      // 1 if vec length is unknown in advance
 
43
  int size_array_rows_variable;  // 1 if array rows is unknown in advance
40
44
 
41
45
  int peratom_flag;         // 0/1 if compute_peratom() function exists
42
46
  int size_peratom_cols;    // 0 = vector, N = columns in peratom array
57
61
  int pressatomflag;  // 1 if Compute calculates per-atom virial
58
62
  int peflag;         // 1 if Compute calculates PE (uses Force energies)
59
63
  int peatomflag;     // 1 if Compute calculates per-atom PE
 
64
  int create_attribute;    // 1 if compute stores attributes that need
 
65
                           // setting when a new atom is created
60
66
 
61
67
  int tempbias;       // 0/1 if Compute temp includes self/extra bias
62
68
 
97
103
  virtual void compute_array() {}
98
104
  virtual void compute_peratom() {}
99
105
  virtual void compute_local() {}
 
106
  virtual void set_arrays(int) {}
100
107
 
101
 
  virtual int pack_comm(int, int *, double *, int, int *) {return 0;}
102
 
  virtual void unpack_comm(int, int, double *) {}
 
108
  virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;}
 
109
  virtual void unpack_forward_comm(int, int, double *) {}
103
110
  virtual int pack_reverse_comm(int, int, double *) {return 0;}
104
111
  virtual void unpack_reverse_comm(int, int *, double *) {}
105
112
 
107
114
  virtual int dof_remove(int) {return 0;}
108
115
  virtual void remove_bias(int, double *) {}
109
116
  virtual void remove_bias_all() {}
 
117
  virtual void reapply_bias_all() {}
110
118
  virtual void restore_bias(int, double *) {}
111
119
  virtual void restore_bias_all() {}
112
120
 
113
121
  virtual void reset_extra_compute_fix(const char *);
114
122
 
 
123
  virtual void lock_enable() {}
 
124
  virtual void lock_disable() {}
 
125
  virtual int lock_length() {return 0;}
 
126
  virtual void lock(class Fix *, bigint, bigint) {}
 
127
  virtual void unlock(class Fix *) {}
 
128
 
115
129
  void addstep(bigint);
116
130
  int matchstep(bigint);
117
131
  void clearstep();
122
136
  virtual int unsigned data_mask_ext() {return datamask_ext;}
123
137
 
124
138
 protected:
 
139
  int instance_me;             // which Compute class instantiation I am
 
140
 
125
141
  int extra_dof;               // extra DOF for temperature computes
126
142
  int fix_dof;                 // DOF due to fixes
127
143
  int dynamic;                 // recount atoms for temperature computes
 
144
  int dynamic_user;            // user request for temp compute to be dynamic
128
145
  int thermoflag;              // 1 if include fix PE for PE computes
129
146
 
130
147
  double vbias[3];             // stored velocity bias for one atom
131
148
  double **vbiasall;           // stored velocity bias for all atoms
132
149
  int maxbias;                 // size of vbiasall array
133
150
 
134
 
  int *molmap;                 // convert molecule ID to local index
135
 
 
136
 
  int molecules_in_group(tagint &, tagint &);
137
 
 
138
151
  inline int sbmask(int j) {
139
152
    return j >> SBBITS & 3;
140
153
  }