git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6724 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
111
src/lammps.cpp
111
src/lammps.cpp
@ -58,6 +58,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
||||
int partscreenflag = 0;
|
||||
int partlogflag = 0;
|
||||
int cudaflag = -1;
|
||||
int helpflag = 0;
|
||||
suffix = NULL;
|
||||
suffix_enable = 0;
|
||||
|
||||
@ -124,6 +125,11 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
||||
strcpy(suffix,arg[iarg+1]);
|
||||
suffix_enable = 1;
|
||||
iarg += 2;
|
||||
} else if (strcmp(arg[iarg],"-help") == 0 ||
|
||||
strcmp(arg[iarg],"-h") == 0) {
|
||||
if (iarg+1 > narg) error->universe_all("Invalid command-line argument");
|
||||
helpflag = 1;
|
||||
iarg += 1;
|
||||
} else error->universe_all("Invalid command-line argument");
|
||||
}
|
||||
|
||||
@ -347,6 +353,13 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
|
||||
// allocate top-level classes
|
||||
|
||||
create();
|
||||
|
||||
// if helpflag set, print help and exit
|
||||
|
||||
if (helpflag) {
|
||||
if (me == 0) print_styles();
|
||||
error->done();
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -455,3 +468,101 @@ void LAMMPS::destroy()
|
||||
// since fixes delete callbacks in atom
|
||||
delete timer;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
for each style, print name of all child classes build into executable
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void LAMMPS::print_styles()
|
||||
{
|
||||
printf("Pair styles:\n");
|
||||
|
||||
#define PAIR_CLASS
|
||||
#define PairStyle(key,Class) printf(" %s",#key);
|
||||
#include "style_pair.h"
|
||||
#undef PAIR_CLASS
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Bond styles:\n");
|
||||
|
||||
#define BOND_CLASS
|
||||
#define BondStyle(key,Class) printf(" %s",#key);
|
||||
#include "style_bond.h"
|
||||
#undef BOND_CLASS
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Angle styles:\n");
|
||||
|
||||
#define ANGLE_CLASS
|
||||
#define AngleStyle(key,Class) printf(" %s",#key);
|
||||
#include "style_angle.h"
|
||||
#undef ANGLE_CLASS
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Dihedral styles:\n");
|
||||
|
||||
#define DIHEDRAL_CLASS
|
||||
#define DihedralStyle(key,Class) printf(" %s",#key);
|
||||
#include "style_dihedral.h"
|
||||
#undef DIHEDRAL_CLASS
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Improper styles:\n");
|
||||
|
||||
#define IMPROPER_CLASS
|
||||
#define ImproperStyle(key,Class) printf(" %s",#key);
|
||||
#include "style_improper.h"
|
||||
#undef IMPROPER_CLASS
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Fix styles:\n");
|
||||
|
||||
#define FIX_CLASS
|
||||
#define FixStyle(key,Class) printf(" %s",#key);
|
||||
#include "style_fix.h"
|
||||
#undef FIX_CLASS
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Fix styles:\n");
|
||||
|
||||
#define COMPUTE_CLASS
|
||||
#define ComputeStyle(key,Class) printf(" %s",#key);
|
||||
#include "style_compute.h"
|
||||
#undef COMPUTE_CLASS
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Commands:\n");
|
||||
|
||||
#define COMMAND_CLASS
|
||||
#define CommandStyle(key,Class) printf(" %s",#key);
|
||||
#include "style_command.h"
|
||||
#undef COMMAND_CLASS
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Region styles:\n");
|
||||
|
||||
#define REGION_CLASS
|
||||
#define RegionStyle(key,Class) printf(" %s",#key);
|
||||
#include "style_region.h"
|
||||
#undef REGION_CLASS
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Dump styles:\n");
|
||||
|
||||
#define DUMP_CLASS
|
||||
#define DumpStyle(key,Class) printf(" %s",#key);
|
||||
#include "style_dump.h"
|
||||
#undef DUMP_CLASS
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user