git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1840 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -119,6 +119,15 @@ void Compute::modify_params(int narg, char **arg)
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
reset extra_dof to its default value
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Compute::reset_extra_dof()
|
||||
{
|
||||
extra_dof = domain->dimension;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
add ntimestep to list of timesteps the compute will be called on
|
||||
do not add if already in list
|
||||
|
||||
@ -64,6 +64,8 @@ class Compute : protected Pointers {
|
||||
Compute(class LAMMPS *, int, char **);
|
||||
virtual ~Compute();
|
||||
void modify_params(int, char **);
|
||||
void reset_extra_dof();
|
||||
|
||||
virtual void init() = 0;
|
||||
virtual void init_list(int, class NeighList *) {}
|
||||
virtual double compute_scalar() {return 0.0;}
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
#include "pair.h"
|
||||
#include "min.h"
|
||||
#include "modify.h"
|
||||
#include "compute.h"
|
||||
#include "bond.h"
|
||||
#include "angle.h"
|
||||
#include "dihedral.h"
|
||||
@ -802,6 +803,14 @@ void Input::dimension()
|
||||
if (domain->box_exist)
|
||||
error->all("Dimension command after simulation box is defined");
|
||||
domain->dimension = atoi(arg[0]);
|
||||
if (domain->dimension != 2 && domain->dimension != 3)
|
||||
error->all("Illegal dimension command");
|
||||
|
||||
// must reset default extra_dof of all computes
|
||||
// since some were created before dimension command is encountered
|
||||
|
||||
for (int i = 0; i < modify->ncompute; i++)
|
||||
modify->compute[i]->reset_extra_dof();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user