1 /* ---------------------------------------------------------------------- 2 SPARTA - Stochastic PArallel Rarefied-gas Time-accurate Analyzer 3 http://sparta.sandia.gov 4 Steve Plimpton, sjplimp@sandia.gov, Michael Gallis, magalli@sandia.gov 5 Sandia National Laboratories 6 7 Copyright (2014) Sandia Corporation. Under the terms of Contract 8 DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains 9 certain rights in this software. This software is distributed under 10 the GNU General Public License. 11 12 See the README file in the top-level SPARTA directory. 13 ------------------------------------------------------------------------- */ 14 15 #ifndef SPARTA_MODIFY_H 16 #define SPARTA_MODIFY_H 17 18 #include "pointers.h" 19 #include "particle.h" 20 21 namespace SPARTA_NS { 22 23 class Modify : protected Pointers { 24 public: 25 int nfix,maxfix; 26 int n_start_of_step,n_end_of_step; 27 int n_pergrid,n_update_custom,n_gas_react,n_surf_react; 28 29 class Fix **fix; // list of fixes 30 int *fmask; // bit mask for when each fix is applied 31 32 int ncompute,maxcompute; // list of computes 33 class Compute **compute; 34 35 Modify(class SPARTA *); 36 ~Modify(); 37 void init(); 38 void setup(); 39 virtual void start_of_step(); 40 virtual void end_of_step(); 41 42 virtual int pack_grid_one(int, char *, int); 43 virtual int unpack_grid_one(int, char *); 44 virtual void copy_grid_one(int, int); 45 virtual void add_grid_one(); 46 virtual void reset_grid_count(int); 47 virtual void grid_changed(); 48 49 void add_fix(int, char **); 50 void delete_fix(const char *); 51 int find_fix(const char *); 52 53 void add_compute(int, char **); 54 void delete_compute(const char *); 55 int find_compute(const char *); 56 57 void clearstep_compute(); 58 void addstep_compute(bigint); 59 void addstep_compute_all(bigint); 60 61 void list_init_fixes(); 62 void list_init_computes(); 63 64 virtual void update_custom(int, double, double, double, double *); 65 virtual void gas_react(int); 66 virtual void surf_react(Particle::OnePart *, int &, int &); 67 68 bigint memory_usage(); 69 70 protected: 71 72 // lists of fixes to apply at different stages of timestep 73 74 int *list_start_of_step,*list_end_of_step; 75 76 int *end_of_step_every; 77 78 int *list_pergrid; // list of fixes that store per grid cell info 79 int *list_update_custom; // list of fixes with update_custom() method 80 int *list_gas_react; // list of fixes with gas_react() method 81 int *list_surf_react; // list of fixes with surf_react() method 82 83 int n_timeflag; // list of computes that store time invocation 84 int *list_timeflag; 85 86 void list_init(int, int &, int *&); 87 void list_init_end_of_step(int, int &, int *&); 88 }; 89 90 } 91 92 #endif 93 94 /* ERROR/WARNING messages: 95 96 E: Fix command before simulation box is defined 97 98 The fix command cannot be used before a read_data, read_restart, or 99 create_box command. 100 101 E: Illegal ... command 102 103 Self-explanatory. Check the input script syntax and compare to the 104 documentation for the command. You can use -echo screen as a 105 command-line option when running SPARTA to see the offending line. 106 107 E: Replacing a fix, but new style != old style 108 109 A fix ID can be used a 2nd time, but only if the style matches the 110 previous fix. In this case it is assumed you with to reset a fix's 111 parameters. This error may mean you are mistakenly re-using a fix ID 112 when you do not intend to. 113 114 E: Invalid fix style 115 116 The choice of fix style is unknown. 117 118 E: Could not find fix ID to delete 119 120 Self-explanatory. 121 122 E: Reuse of compute ID 123 124 A compute ID cannot be used twice. 125 126 E: Invalid compute style 127 128 Self-explanatory. 129 130 E: Could not find compute ID to delete 131 132 Self-explanatory. 133 134 */ 135