Commit 9be7620a authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@937 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 92ff0974
Loading
Loading
Loading
Loading
+49 −11
Original line number Diff line number Diff line
@@ -15,7 +15,12 @@ OBJ = $(SRC:.cpp=.o)

PACKAGE = asphere class2 colloid dipole dpd granular \
	  kspace manybody meam molecule opt poems xtc

PACKUSER = user-ackland user-ewaldn

PACKUC = $(shell perl -e 'printf("%s", uc("$(PACKAGE)"));')
PACKUSERUC = $(shell perl -e 'printf("%s", uc("$(PACKUSER)"));')

YESDIR = $(shell perl -e 'printf("%s", uc("$(@:yes-%=%)"));')
NODIR  = $(shell perl -e 'printf("%s", uc("$(@:no-%=%)"));')

@@ -31,10 +36,15 @@ help:
	@echo ''
	@echo 'make package             list available packages'
	@echo 'make package-status      status of all packages'
	@echo 'make yes-package         install a package in src dir'
	@echo 'make no-package          remove package files from src dir'
	@echo 'make yes-package         install a single package in src dir'
	@echo 'make no-package          remove a single package from src dir'
	@echo 'make yes-all             install all packages in src dir'
	@echo 'make no-all              remove all package files from src dir'
	@echo 'make no-all              remove all packages from src dir'
	@echo 'make yes-standard        install all standard packages'
	@echo 'make no-standard         remove all standard packages'
	@echo 'make yes-user            install all user packages'
	@echo 'make no-user             remove all user packages'
	@echo ''
	@echo 'make package-update      replace src files with package files'
	@echo 'make package-overwrite   replace package files with src files'
	@echo ''
@@ -86,27 +96,45 @@ makelist:
	@csh Make.csh Makefile.list

# Package management
# status =    list differences between src and package files
# update =    replace src files with newer package files
# overwrite = overwrite package files with newer src files

package:
	@echo 'Available packages:'
	@echo $(PACKAGE)
	@echo 'Standard packages:' $(PACKAGE)
	@echo ''
	@echo 'User-contributed packages:' $(PACKUSER)
	@echo ''
	@echo 'make package             list available packages'
	@echo 'make package-status      status of all packages'
	@echo 'make yes-package         install a package in src dir'
	@echo 'make no-package          remove package files from src dir'
	@echo 'make yes-package         install a single package in src dir'
	@echo 'make no-package          remove a single package from src dir'
	@echo 'make yes-all             install all packages in src dir'
	@echo 'make no-all              remove all package files from src dir'
	@echo 'make no-all              remove all packages from src dir'
	@echo 'make yes-standard        install all standard packages'
	@echo 'make no-standard         remove all standard packages'
	@echo 'make yes-user            install all user packages'
	@echo 'make no-user             remove all user packages'
	@echo ''
	@echo 'make package-update      replace src files with package files'
	@echo 'make package-overwrite   replace package files with src files'

yes-all:
	@for p in $(PACKAGE); do $(MAKE) yes-$$p; done
	@for p in $(PACKUSER); do $(MAKE) yes-$$p; done

no-all:
	@for p in $(PACKAGE); do $(MAKE) no-$$p; done
	@for p in $(PACKUSER); do $(MAKE) no-$$p; done

yes-standard:
	@for p in $(PACKAGE); do $(MAKE) yes-$$p; done

no-standard:
	@for p in $(PACKAGE); do $(MAKE) no-$$p; done

yes-user:
	@for p in $(PACKUSER); do $(MAKE) yes-$$p; done

no-user:
	@for p in $(PACKUSER); do $(MAKE) no-$$p; done

yes-%:
	@if [ ! -e $(YESDIR) ]; then \
@@ -124,11 +152,21 @@ no-%:
	  cd $(NODIR); csh -f Install.csh 0; cd ..; $(MAKE) clean-all; \
        fi;

# status = list differences between src and package files
# update = replace src files with newer package files
# overwrite = overwrite package files with newer src files

package-status:
	@for p in $(PACKUC); do csh -f Package.csh $$p status; done
	@echo ''
	@for p in $(PACKUSERUC); do csh -f Package.csh $$p status; done

package-update:
	@for p in $(PACKUC); do csh -f Package.csh $$p update; done
	@echo ''
	@for p in $(PACKUSERUC); do csh -f Package.csh $$p update; done

package-overwrite:
	@for p in $(PACKUC); do csh -f Package.csh $$p overwrite; done
	@echo ''
	@for p in $(PACKUSERUC); do csh -f Package.csh $$p overwrite; done
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
#   just longer than the other (has new stuff added)

set glob
set style = `echo $1 | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
set style = `echo $1 | sed 'y/-ABCDEFGHIJKLMNOPQRSTUVWXYZ/_abcdefghijklmnopqrstuvwxyz/'`
cd $1

if ($2 == "status") then
+8 −8
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ Atom::~Atom()
   called from input script, restart file, replicate
------------------------------------------------------------------------- */

void Atom::create_avec(char *style, int narg, char **arg)
void Atom::create_avec(const char *style, int narg, char **arg)
{
  delete [] atom_style;
  if (avec) delete avec;
@@ -232,7 +232,7 @@ void Atom::create_avec(char *style, int narg, char **arg)
   generate an AtomVec class
------------------------------------------------------------------------- */

AtomVec *Atom::new_avec(char *style, int narg, char **arg)
AtomVec *Atom::new_avec(const char *style, int narg, char **arg)
{
  if (0) return NULL;

@@ -274,7 +274,7 @@ void Atom::init()
   else return 0
------------------------------------------------------------------------- */

int Atom::style_match(char *style)
int Atom::style_match(const char *style)
{
  if (strcmp(atom_style,style) == 0) return 1;
  else if (strcmp(atom_style,"hybrid") == 0) {
@@ -602,7 +602,7 @@ int Atom::tag_consecutive()
   trim anything from '#' onward
------------------------------------------------------------------------- */

int Atom::count_words(char *line)
int Atom::count_words(const char *line)
{
  int n = strlen(line) + 1;
  char *copy = (char *) memory->smalloc(n*sizeof(char),"copy");
@@ -991,7 +991,7 @@ void Atom::allocate_type_arrays()
   called from reading of data file
------------------------------------------------------------------------- */

void Atom::set_mass(char *str)
void Atom::set_mass(const char *str)
{
  if (mass == NULL) error->all("Cannot set mass for this atom style");

@@ -1067,7 +1067,7 @@ void Atom::check_mass()
   called from reading of data file
------------------------------------------------------------------------- */

void Atom::set_shape(char *str)
void Atom::set_shape(const char *str)
{
  if (shape == NULL) error->all("Cannot set shape for this atom style");

@@ -1140,7 +1140,7 @@ void Atom::check_shape()
   called from reading of data file
------------------------------------------------------------------------- */

void Atom::set_dipole(char *str)
void Atom::set_dipole(const char *str)
{
  if (dipole == NULL) error->all("Cannot set dipole for this atom style");

@@ -1244,7 +1244,7 @@ void Atom::add_callback(int flag)
   flag = 0 for grow, 1 for restart
------------------------------------------------------------------------- */

void Atom::delete_callback(char *id, int flag)
void Atom::delete_callback(const char *id, int flag)
{
  int ifix;
  for (ifix = 0; ifix < modify->nfix; ifix++)
+9 −9
Original line number Diff line number Diff line
@@ -97,17 +97,17 @@ class Atom : protected Pointers {
  Atom(class LAMMPS *);
  ~Atom();

  void create_avec(char *, int, char **);
  class AtomVec *new_avec(char *, int, char **);
  void create_avec(const char *, int, char **);
  class AtomVec *new_avec(const char *, int, char **);
  void init();

  int style_match(char *);
  int style_match(const char *);
  void modify_params(int, char **);
  void tag_extend();
  int tag_consecutive();

  int parse_data(char *);
  int count_words(char *);
  int parse_data(const char *);
  int count_words(const char *);

  void data_atoms(int, char *);
  void data_vels(int, char *);
@@ -117,22 +117,22 @@ class Atom : protected Pointers {
  void data_impropers(int, char *);

  void allocate_type_arrays();
  void set_mass(char *);
  void set_mass(const char *);
  void set_mass(int, double);
  void set_mass(int, char **);
  void set_mass(double *);
  void check_mass();
  void set_shape(char *);
  void set_shape(const char *);
  void set_shape(int, char **);
  void set_shape(double **);
  void check_shape();
  void set_dipole(char *);
  void set_dipole(const char *);
  void set_dipole(int, char **);
  void set_dipole(double *);
  void check_dipole();

  void add_callback(int);
  void delete_callback(char *, int);
  void delete_callback(const char *, int);
  void update_callback(int);

  int memory_usage();
+4 −1
Original line number Diff line number Diff line
@@ -49,9 +49,9 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
  
  scalar_flag = vector_flag = peratom_flag = 0;
  tempflag = pressflag = 0;
  npre = 0;
  id_pre = NULL;
  comm_forward = comm_reverse = 0;
  neigh_half_once = neigh_full_once = 0;

  // set modify defaults

@@ -65,6 +65,9 @@ Compute::~Compute()
{
  delete [] id;
  delete [] style;

  for (int i = 0; i < npre; i++) delete [] id_pre[i];
  delete [] id_pre;
}

/* ---------------------------------------------------------------------- */
Loading