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 FIX_CLASS 15 // clang-format off 16 FixStyle(lb/rigid/pc/sphere,FixLbRigidPCSphere); 17 // clang-format on 18 #else 19 20 #ifndef LMP_FIX_LB_RIGID_PC_SPHERE_H 21 #define LMP_FIX_LB_RIGID_PC_SPHERE_H 22 23 #include "fix.h" 24 25 namespace LAMMPS_NS { 26 27 class FixLbRigidPCSphere : public Fix { 28 public: 29 FixLbRigidPCSphere(class LAMMPS *, int, char **); 30 virtual ~FixLbRigidPCSphere(); 31 virtual int setmask(); 32 virtual void init(); 33 virtual void setup(int); 34 virtual void initial_integrate(int); 35 virtual void final_integrate(); 36 virtual double compute_scalar(); 37 38 double memory_usage(); 39 void grow_arrays(int); 40 void copy_arrays(int, int, int); 41 void set_arrays(int); 42 int pack_exchange(int, double *); 43 int unpack_exchange(int, double *); 44 45 void pre_neighbor(); 46 int dof(int); 47 void reset_dt(); 48 double compute_array(int, int); 49 50 private: 51 double **up; 52 double **up_old; 53 double *Gamma_MD; 54 double expminusdttimesgamma, DMDcoeff; 55 double expminusdttimesgammadiv2; 56 double force_factor, torque_factor; 57 58 double dtv, dtf; 59 60 int nbody; // # of rigid bodies 61 int *nrigid; // # of atoms in each rigid body 62 int *nrigid_shell; 63 double *masstotal; // total mass of each rigid body 64 double *masstotal_shell; 65 double *sphereradius; 66 double **xcm; // coords of center-of-mass of each rigid body 67 double **xcm_old; 68 double **vcm; // velocity of center-of-mass of each 69 double **ucm; 70 double **ucm_old; 71 double **fcm; // force on center-of-mass of each 72 double **fcm_old; 73 double **fcm_fluid; 74 double **omega; // angular momentum of each in space coords 75 double **torque; // torque on each rigid body in space coords 76 double **torque_old; 77 double **torque_fluid; 78 double **torque_fluid_old; 79 double **rotate; 80 imageint *imagebody; // image flags of xcm of each rigid body 81 double **fflag; // flag for on/off of center-of-mass force 82 double **tflag; // flag for on/off of center-of-mass torque 83 84 int *body; // which body each atom is part of (-1 if none) 85 86 double **sum, **all; // work vectors for each rigid body 87 int **remapflag; // PBC remap flags for each rigid body 88 89 double tfactor; // scale factor on temperature of rigid bodies 90 91 int inner_nodes; // ==1 if certain particle are inside the rigid 92 // body and should not interact with the fluid. 93 // ==0 otherwise. 94 int igroupinner; // specifies the particles which are inside the 95 // spherical rigid body, and do not interact with 96 // the fluid. 97 98 void set_xv(); 99 void set_v(); 100 101 void compute_up(); 102 103 class FixLbFluid *fix_lb_fluid; 104 }; 105 106 } // namespace LAMMPS_NS 107 108 #endif 109 #endif 110