1 /* -*- c++ -*- ---------------------------------------------------------- 2 LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 3 https://www.lammps.org/, Sandia National Laboratories 4 Steve Plimpton, sjplimp@sandia.gov 5 6 Copyright (2003) Sandia Corporation. Under the terms of Contract 7 DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains 8 certain rights in this software. This software is distributed under 9 the GNU General Public License. 10 11 See the README file in the top-level LAMMPS directory. 12 ------------------------------------------------------------------------- */ 13 14 #ifdef ATOM_CLASS 15 // clang-format off 16 AtomStyle(body,AtomVecBody); 17 // clang-format on 18 #else 19 20 #ifndef LMP_ATOM_VEC_BODY_H 21 #define LMP_ATOM_VEC_BODY_H 22 23 #include "atom_vec.h" 24 25 namespace LAMMPS_NS { 26 27 class AtomVecBody : public AtomVec { 28 public: 29 class Body *bptr; 30 31 struct Bonus { 32 double quat[4]; 33 double inertia[3]; 34 int ninteger, ndouble; 35 int iindex, dindex; 36 int *ivalue; 37 double *dvalue; 38 int ilocal; 39 }; 40 struct Bonus *bonus; 41 42 AtomVecBody(class LAMMPS *); 43 ~AtomVecBody(); 44 void process_args(int, char **); 45 46 void grow_pointers(); 47 void copy_bonus(int, int, int); 48 void clear_bonus(); 49 int pack_comm_bonus(int, int *, double *); 50 void unpack_comm_bonus(int, int, double *); 51 int pack_border_bonus(int, int *, double *); 52 int unpack_border_bonus(int, int, double *); 53 int pack_exchange_bonus(int, double *); 54 int unpack_exchange_bonus(int, double *); 55 int size_restart_bonus(); 56 int pack_restart_bonus(int, double *); 57 int unpack_restart_bonus(int, double *); 58 void data_body(int, int, int, int *, double *); 59 double memory_usage_bonus(); 60 61 void create_atom_post(int); 62 void data_atom_post(int); 63 void pack_data_pre(int); 64 void pack_data_post(int); 65 66 int pack_data_bonus(double *, int); 67 void write_data_bonus(FILE *, int, double *, int); 68 69 // methods used by other classes to query/set body info 70 71 double radius_body(int, int, int *, double *); 72 void set_quat(int, double *); 73 74 int nlocal_bonus; 75 76 private: 77 int *body; 78 double *rmass, *radius; 79 double **angmom; 80 81 int nghost_bonus, nmax_bonus; 82 int intdoubleratio; // sizeof(double) / sizeof(int) 83 int body_flag; 84 85 MyPoolChunk<int> *icp; 86 MyPoolChunk<double> *dcp; 87 88 void grow_bonus(); 89 void copy_bonus_all(int, int); 90 // check(int); 91 }; 92 93 } // namespace LAMMPS_NS 94 95 #endif 96 #endif 97 98 /* ERROR/WARNING messages: 99 100 E: Internal error in atom_style body 101 102 This error should not occur. Contact the developers. 103 104 E: Invalid atom_style body command 105 106 No body style argument was provided. 107 108 E: Unrecognized body style 109 110 The choice of body style is unknown. 111 112 E: Per-processor system is too big 113 114 The number of owned atoms plus ghost atoms on a single 115 processor must fit in 32-bit integer. 116 117 E: Invalid atom type in Atoms section of data file 118 119 Atom types must range from 1 to specified # of types. 120 121 E: Invalid density in Atoms section of data file 122 123 Density value cannot be <= 0.0. 124 125 E: Assigning body parameters to non-body atom 126 127 Self-explanatory. 128 129 E: Assigning quat to non-body atom 130 131 Self-explanatory. 132 133 */ 134