Lemina
A molecular dynamics package for network, granular material and point particles with a range of interaction potential.
 
Loading...
Searching...
No Matches
DumpRestart.c File Reference
#include <stdio.h>
#include "global.h"
+ Include dependency graph for DumpRestart.c:

Go to the source code of this file.

Functions

void DumpRestart ()
 

Function Documentation

◆ DumpRestart()

void DumpRestart ( )

Definition at line 25 of file DumpRestart.c.

25 {
26 char DUMP[256];
27 FILE *fpDUMP;
28 sprintf(DUMP, "%s.Restart", prefix);
29 fpDUMP = fopen(DUMP, "w");
30 if(fpDUMP == NULL) {
31 fprintf(stderr, "Error opening file %s for writing\n", DUMP);
32 return;
33 }
34
35 fprintf(fpDUMP, "timeNow %lf\n", timeNow);
36 fprintf(fpDUMP, "nAtom %d\n", nAtom);
37 fprintf(fpDUMP, "nBond %d\n", nBond);
38 fprintf(fpDUMP, "nAtomType %d\n", nAtomType);
39 fprintf(fpDUMP, "nBondType %d\n", nBondType);
40 fprintf(fpDUMP, "region[1] %0.16lf\n", region[1]);
41 fprintf(fpDUMP, "region[2] %0.16lf\n", region[2]);
42
43 int n;
44 fprintf(fpDUMP, "Atoms\n");
45 for(n = 1; n <= nAtom; n ++)
46 fprintf(fpDUMP, "%d %d %d %0.2lf %0.16lf %0.16lf %0.16lf %0.16lf\n", atomID[n], molID[n], atomType[n], atomRadius[n], rx[n], ry[n], vx[n], vy[n]);
47
48
49 fprintf(fpDUMP, "Bonds\n");
50 for(n=1; n<=nBond; n++)
51 fprintf(fpDUMP, "%d %d %d %d %0.2lf %0.16lf\n", BondID[n], BondType[n], atom1[n], atom2[n], kb[n], ro[n]);
52
53 fclose(fpDUMP);
54}
int nAtom
Definition global.h:24
int * BondID
int * atom2
Definition global.h:36
int * BondType
Definition global.h:37
int nBondType
Definition global.h:35
int nAtomType
double region[2+1]
int * molID
double * vx
Definition global.h:17
double * ro
Definition global.h:38
int * atom1
double * rx
int nBond
double * kb
double * atomRadius
double timeNow
Definition global.h:20
char * prefix
Definition main.c:13
int * atomType
double * vy
Definition global.h:17
int * atomID
double * ry
Definition global.h:17

References atom1, atom2, atomID, atomRadius, atomType, BondID, BondType, kb, molID, nAtom, nAtomType, nBond, nBondType, prefix, region, ro, rx, ry, timeNow, vx, and vy.

Referenced by main().

+ Here is the caller graph for this function: