git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@4216 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2010-06-01 16:17:48 +00:00
parent f9c9763bfd
commit 3ad6f1e88a
3 changed files with 34 additions and 0 deletions

View File

@ -20,6 +20,7 @@ FixStyle(deposit,FixDeposit)
#ifndef LMP_FIX_DEPOSIT_H
#define LMP_FIX_DEPOSIT_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {

View File

@ -40,6 +40,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
{
if (narg < 4) error->all("Illegal fix move command");
restart_global = 1;
restart_peratom = 1;
peratom_flag = 1;
size_peratom_cols = 3;
@ -795,6 +796,35 @@ double FixMove::memory_usage()
return bytes;
}
/* ----------------------------------------------------------------------
pack entire state of Fix into one write
------------------------------------------------------------------------- */
void FixMove::write_restart(FILE *fp)
{
int n = 0;
double list[1];
list[n++] = time_origin;
if (comm->me == 0) {
int size = n * sizeof(double);
fwrite(&size,sizeof(int),1,fp);
fwrite(list,sizeof(double),n,fp);
}
}
/* ----------------------------------------------------------------------
use state info from restart file to restart the Fix
------------------------------------------------------------------------- */
void FixMove::restart(char *buf)
{
int n = 0;
double *list = (double *) buf;
time_origin = static_cast<int> (list[n++]);
}
/* ----------------------------------------------------------------------
allocate atom-based array
------------------------------------------------------------------------- */

View File

@ -20,6 +20,7 @@ FixStyle(move,FixMove)
#ifndef LMP_FIX_MOVE_H
#define LMP_FIX_MOVE_H
#include "stdio.h"
#include "fix.h"
namespace LAMMPS_NS {
@ -36,6 +37,8 @@ class FixMove : public Fix {
void final_integrate_respa(int, int);
double memory_usage();
void write_restart(FILE *);
void restart(char *);
void grow_arrays(int);
void copy_arrays(int, int);
int pack_exchange(int, double *);