2006-09-28 03:51:33 +08:00
|
|
|
/* ----------------------------------------------------------------------
|
|
|
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
2007-01-30 08:22:05 +08:00
|
|
|
http://lammps.sandia.gov, Sandia National Laboratories
|
|
|
|
Steve Plimpton, sjplimp@sandia.gov
|
2006-09-28 03:51:33 +08:00
|
|
|
|
|
|
|
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
|
|
|
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
|
|
|
certain rights in this software. This software is distributed under
|
|
|
|
the GNU General Public License.
|
|
|
|
|
|
|
|
See the README file in the top-level LAMMPS directory.
|
|
|
|
------------------------------------------------------------------------- */
|
|
|
|
|
2010-01-12 09:37:48 +08:00
|
|
|
#ifndef LMP_GROUP_H
|
|
|
|
#define LMP_GROUP_H
|
2006-09-28 03:51:33 +08:00
|
|
|
|
|
|
|
#include "stdio.h"
|
2007-01-30 08:22:05 +08:00
|
|
|
#include "pointers.h"
|
2006-09-28 03:51:33 +08:00
|
|
|
|
2007-01-30 08:22:05 +08:00
|
|
|
namespace LAMMPS_NS {
|
|
|
|
|
|
|
|
class Group : protected Pointers {
|
2006-09-28 03:51:33 +08:00
|
|
|
public:
|
2009-08-29 04:28:23 +08:00
|
|
|
int ngroup; // # of defined groups
|
2006-09-28 03:51:33 +08:00
|
|
|
char **names; // name of each group
|
|
|
|
int *bitmask; // one-bit mask for each group
|
2009-08-29 04:28:23 +08:00
|
|
|
int *inversemask; // inverse mask for each group
|
2006-09-28 03:51:33 +08:00
|
|
|
|
2007-01-30 08:22:05 +08:00
|
|
|
Group(class LAMMPS *);
|
2006-09-28 03:51:33 +08:00
|
|
|
~Group();
|
|
|
|
void assign(int, char **); // assign atoms to a group
|
|
|
|
void create(char *, int *); // add flagged atoms to a group
|
2008-04-05 07:17:17 +08:00
|
|
|
int find(const char *); // lookup name in list of groups
|
2006-09-28 03:51:33 +08:00
|
|
|
void write_restart(FILE *);
|
|
|
|
void read_restart(FILE *);
|
|
|
|
|
|
|
|
double count(int); // count atoms in group
|
2009-04-29 03:46:52 +08:00
|
|
|
double count(int,int); // count atoms in group & region
|
2006-09-28 03:51:33 +08:00
|
|
|
double mass(int); // total mass of atoms in group
|
2009-04-29 03:46:52 +08:00
|
|
|
double mass(int,int);
|
2006-09-28 03:51:33 +08:00
|
|
|
double charge(int); // total charge of atoms in group
|
2009-04-29 03:46:52 +08:00
|
|
|
double charge(int,int);
|
2006-09-28 03:51:33 +08:00
|
|
|
void bounds(int, double *); // bounds of atoms in group
|
2009-04-29 03:46:52 +08:00
|
|
|
void bounds(int, double *, int);
|
2006-09-28 03:51:33 +08:00
|
|
|
void xcm(int, double, double *); // center-of-mass coords of group
|
2009-04-29 03:46:52 +08:00
|
|
|
void xcm(int, double, double *, int);
|
2006-09-28 03:51:33 +08:00
|
|
|
void vcm(int, double, double *); // center-of-mass velocity of group
|
2009-04-29 03:46:52 +08:00
|
|
|
void vcm(int, double, double *, int);
|
2007-03-23 01:05:51 +08:00
|
|
|
void fcm(int, double *); // total force on group
|
2009-04-29 03:46:52 +08:00
|
|
|
void fcm(int, double *, int);
|
2007-04-21 03:03:20 +08:00
|
|
|
double ke(int); // kinetic energy of group
|
2009-04-29 03:46:52 +08:00
|
|
|
double ke(int, int);
|
2006-09-28 03:51:33 +08:00
|
|
|
double gyration(int, double, double *); // radius-of-gyration of group
|
2009-04-29 03:46:52 +08:00
|
|
|
double gyration(int, double, double *, int);
|
2006-09-28 03:51:33 +08:00
|
|
|
void angmom(int, double *, double *); // angular momentum of group
|
2007-01-30 08:22:05 +08:00
|
|
|
void inertia(int, double *, double [3][3]); // inertia tensor
|
|
|
|
void omega(double *, double [3][3], double *); // angular velocity
|
2009-03-17 23:40:57 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
int me;
|
|
|
|
|
|
|
|
int find_unused();
|
2006-09-28 03:51:33 +08:00
|
|
|
};
|
|
|
|
|
2007-01-30 08:22:05 +08:00
|
|
|
}
|
2006-09-28 03:51:33 +08:00
|
|
|
|
2007-01-30 08:22:05 +08:00
|
|
|
#endif
|