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

« back to all changes in this revision

Viewing changes to src/variable.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
27
27
  void set(char *, int, char **);
28
28
  int next(int, char **);
29
29
  int find(char *);
 
30
  void set_arrays(int);
30
31
  int equalstyle(int);
31
32
  int atomstyle(int);
32
33
  char *retrieve(char *);
33
34
  double compute_equal(int);
34
35
  double compute_equal(char *);
35
36
  void compute_atom(int, int, double *, int, int);
36
 
  int int_between_brackets(char *&, int);
 
37
  tagint int_between_brackets(char *&, int);
37
38
  double evaluate_boolean(char *);
38
39
 
 
40
  void equal_save(int, char *&);
 
41
  void equal_restore(int, char *);
 
42
  void equal_override(int, double);
 
43
 
39
44
  unsigned int data_mask(int ivar);
40
45
  unsigned int data_mask(char *str);
41
46
 
42
47
 private:
 
48
  int me;
43
49
  int nvar;                // # of defined variables
44
50
  int maxvar;              // max # of variables following lists can hold
45
51
  char **names;            // name of each variable
57
63
 
58
64
  int precedence[17];      // precedence level of math operators
59
65
                           // set length to include up to OR in enum
60
 
  int me;
61
66
 
62
67
  struct Tree {            // parse tree for atom-style variables
63
68
    double value;          // single scalar  
68
73
    int nstride;           // stride between atoms if array is a 2d array
69
74
    int selfalloc;         // 1 if array is allocated here, else 0
70
75
    int ivalue1,ivalue2;   // extra values for needed for gmask,rmask,grmask
71
 
    Tree *left,*middle,*right;    // ptrs further down tree
 
76
    int nextra;            // # of additional args beyond first 2
 
77
    Tree *first,*second;   // ptrs further down tree for first 2 args
 
78
    Tree **extra;          // ptrs further down tree for nextra args
72
79
  };
73
80
 
74
81
  void remove(int);
84
91
  int region_function(char *);
85
92
  int special_function(char *, char *, Tree **, Tree **,
86
93
                       int &, double *, int &);
87
 
  void peratom2global(int, char *, double *, int, int,
 
94
  void peratom2global(int, char *, double *, int, tagint,
88
95
                      Tree **, Tree **, int &, double *, int &);
89
96
  int is_atom_vector(char *);
90
97
  void atom_vector(char *, Tree **, Tree **, int &);
91
98
  int is_constant(char *);
92
99
  double constant(char *);
 
100
  int parse_args(char *, char **);
93
101
  char *find_next_comma(char *);
94
102
  void print_tree(Tree *, int);
95
103
};
96
104
 
97
105
class VarReader : protected Pointers {
98
106
 public:
99
 
  class FixStore *fix;
 
107
  class FixStore *fixstore;
100
108
  char *id_fix;
101
109
 
102
110
  VarReader(class LAMMPS *, char *, char *, int);