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

Go to the source code of this file.

Macros

#define DEFINE_GLOBALS
 

Functions

void Init ()
 
void SetupJob ()
 
void EvalSpacetimeCorr ()
 
void Trajectory ()
 
void DumpState ()
 
void ComputeForcesCells ()
 
void ApplyBoundaryCond ()
 
void EvalProps ()
 
void AccumProps (int icode)
 
void PrintSummary ()
 
void PrintVrms ()
 
void VelocityVerletStep (int icode)
 
void ApplyForce ()
 
void ApplyLeesEdwardsBoundaryCond ()
 
void PrintStress ()
 
void Close ()
 
void PrintMomentum ()
 
void DisplaceAtoms ()
 
void DumpRestart ()
 
bool HaltConditionCheck (double value)
 
void EvalCom ()
 
void PrintCom ()
 
void EvalVrms ()
 
void EvalUnwrap ()
 
void DumpBonds ()
 
void DumpPairs ()
 
void WriteBinaryRestart ()
 
void PrintForceSum ()
 
int main (int argc, char **argv)
 

Variables

char * prefix = NULL
 

Macro Definition Documentation

◆ DEFINE_GLOBALS

#define DEFINE_GLOBALS

Definition at line 7 of file main.c.

Function Documentation

◆ AccumProps()

void AccumProps ( int icode)

Definition at line 25 of file AccumProps.c.

25 {
26 if(icode == 0){
29 sPressure = ssPressure = 0.;
30 sTotEnergy = ssTotEnergy = 0.;
31 svirSum = 0.;
32 }else if(icode == 1){
41 svirSum += virSum;
42 }else if(icode == 2){
52 } }
double totEnergy
Definition global.h:20
double ssPotEnergy
Definition global.h:22
double kinEnergy
Definition global.h:20
double ssPressure
Definition global.h:22
double sTotEnergy
Definition global.h:22
double ssKinEnergy
Definition global.h:22
#define Sqr(x)
Definition global.h:14
int stepAvg
Definition global.h:24
double svirSum
Definition global.h:21
double potEnergy
Definition global.h:20
double virSum
Definition global.h:21
double sPotEnergy
Definition global.h:21
double sKinEnergy
Definition global.h:21
double pressure
Definition global.h:21
double sPressure
Definition global.h:22
double ssTotEnergy
Definition global.h:22

◆ ApplyBoundaryCond()

void ApplyBoundaryCond ( )

Definition at line 27 of file ApplyBoundaryCond.c.

27 {
28 int n;
29 for(n = 1 ; n <= nAtom ; n ++){
30 if(strcmp(xBoundary, "p") == 0 && strcmp(yBoundary, "p") == 0){ // P.B.C along x and y axis
31 rx[n] -= region[1]*rint(rx[n]/region[1]);
32 ry[n] -= region[2]*rint(ry[n]/region[2]);
33 } else if (strcmp(xBoundary, "r") == 0 && strcmp(yBoundary, "r") == 0){ //R.B.C. along x and y axis
34 if((rx[n] + atomRadius[n]) >= regionH[1]){
35 rx[n] = 0.999999*regionH[1] - atomRadius[n]; vx[n] = -vx[n] ;
36 }if((rx[n]-atomRadius[n]) < -regionH[1]){
37 rx[n] = -0.999999*regionH[1] + atomRadius[n]; vx[n] = -vx[n] ;
38 }
39 if((ry[n] + atomRadius[n])>= regionH[2]){
40 ry[n] = 0.999999*regionH[2] - atomRadius[n]; vy[n] = -vy[n] ;
41 }if((ry[n]-atomRadius[n]) < -regionH[2]){
42 ry[n] = -0.999999*regionH[2] + atomRadius[n]; vy[n] = -vy[n] ;
43 }}
44 else if (strcmp(xBoundary, "p") == 0 && strcmp(yBoundary, "r") == 0){ //P.B.C. along x and R.B.C along y axis
45 rx[n] -= region[1]*rint(rx[n]/region[1]);
46 if((ry[n] + atomRadius[n]) >= regionH[2]){
47 ry[n] = 0.999999*regionH[2] - atomRadius[n]; vy[n] = -vy[n] ;
48 }if((ry[n] - atomRadius[n]) < -regionH[2]){
49 ry[n] = -0.999999*regionH[2] + atomRadius[n]; vy[n] = -vy[n] ;
50 }}
51 else if(strcmp(xBoundary, "r") == 0 && strcmp(yBoundary, "p") == 0){ //R.B.C. along x and P.B.C along y axis
52 if((rx[n] + atomRadius[n]) >= regionH[1]){
53 rx[n] = 0.999999*regionH[1] - atomRadius[n]; vx[n] = -vx[n] ;
54 }if((rx[n] - atomRadius[n]) < -regionH[1]){
55 rx[n] = -0.999999*regionH[1] + atomRadius[n]; vx[n] = -vx[n] ;
56 }
57 ry[n] -= region[2]*rint(ry[n]/region[2]);
58 } else {
59 // Print error message and exit the program
60 fprintf(fpresult, "Error: Invalid boundary configuration: '%s %s'\n", xBoundary, yBoundary);
61 exit(EXIT_FAILURE); // Exit with failure status
62 }
63 }
64}
int nAtom
Definition global.h:24
double region[2+1]
char yBoundary[10]
Definition global.h:68
double * vx
Definition global.h:17
FILE * fpresult
double * rx
double * atomRadius
char xBoundary[10]
double * vy
Definition global.h:17
double regionH[2+1]
Definition global.h:20
double * ry
Definition global.h:17

References atomRadius, fpresult, nAtom, region, regionH, rx, ry, vx, vy, xBoundary, and yBoundary.

Referenced by main().

+ Here is the caller graph for this function:

◆ ApplyForce()

void ApplyForce ( )

Definition at line 25 of file ApplyForce.c.

25 {
26 int n;
27 double lx;
28 lx = regionH[1];
29 fyExtern = (FyBylx * lx)/nAtomBlock;
32
33 for(n = 1; n <= nAtom; n ++){
34 if(molID[n] == 2){
35 fx[n] += fxExtern;
36 fy[n] -= fyExtern;
37} } }
double FyBylx
Definition global.h:53
int nAtomBlock
Definition global.h:76
int * molID
double * fy
Definition global.h:17
double fyExtern
Definition global.h:53
double forceSumyExtern
Definition global.h:53
double fxByfy
Definition global.h:53
double fxExtern
double forceSumxExtern
Definition global.h:53
double * fx
Definition global.h:17

References forceSumxExtern, forceSumyExtern, fx, fxByfy, fxExtern, fy, FyBylx, fyExtern, molID, nAtom, nAtomBlock, and regionH.

Referenced by main().

+ Here is the caller graph for this function:

◆ ApplyLeesEdwardsBoundaryCond()

void ApplyLeesEdwardsBoundaryCond ( )

Definition at line 25 of file ApplyLeesEdwardsBoundaryCond.c.

25 {
26 int n;
27 for (n = 1; n <= nAtom; n++) {
28//PBC along x-direction
29 if(rx[n] >= regionH[1])
30 rx[n] -= region[1];
31 else if(rx[n] < -regionH[1])
32 rx[n] += region[1];
33
34//LEBC along y-direction
35 if(ry[n] >= regionH[2]){
37 if(rx[n] < -regionH[1]) rx[n] += region[1];
38 //vx[n] -= shearVelocity;
39 ry[n] -= region[2];
40 }else if(ry[n] < -regionH[2]){
42 if(rx[n] >= regionH[1]) rx[n] -= region[1];
43 //vx[n] += shearVelocity;
44 ry[n] += region[2];
45 }
46 }
47}
double shearDisplacement

References nAtom, region, regionH, rx, ry, and shearDisplacement.

◆ Close()

void Close ( )

Definition at line 25 of file Close.c.

25 {
26 int n;
27 free(rx); free(ry); free(vx); free(vy); free(ax); free(ay); free(fx); free(fy);
28 free(fax);
29 free(fay);
30 free(cellList);
31
32 free(atomID); free(atomType); free(atomRadius); free(atomMass);
33 free(speed);
34 free(atom1); free(atom2); free(BondID);
35 free(BondType); free(kb); free(ro);
36 free(ImageX); free(ImageY); free(rxUnwrap); free(ryUnwrap);
37 free(atomIDInterface);
38 free(PairID); free(Pairatom1); free(Pairatom2);
39 free(PairXij); free(PairYij);
40 free(molID);
41
42 for (n = 0; n <= nAtom; n++) {
43 free(isBonded[n]);
44 }
45 free(isBonded);
46
47 for (n = 0; n <= nBuffCorr; n++){
48 free(cfOrg[n]);
49 free(spacetimeCorr[n]);
50 }
51 free(cfOrg);
52 free(spacetimeCorr);
53 free(cfVal);
54 free(indexCorr);
55 free(spacetimeCorrAv);
56
57 free(indexAcf);
58 free(viscAcfOrg);
59 free(viscAcfAv);
60 for(n = 0 ; n <= nBuffAcf ; n ++)
61 free(viscAcf[n]);
62 free(viscAcf);
63
64 }
double * viscAcfAv
Definition global.h:99
int * BondID
double * atomMass
double * spacetimeCorrAv
Definition global.h:94
int * atom2
Definition global.h:36
double * fay
Definition global.h:85
int * BondType
Definition global.h:37
double * speed
int ** isBonded
int nBuffAcf
Definition global.h:100
double ** spacetimeCorr
Definition global.h:94
int * cellList
double * ay
Definition global.h:17
int * indexCorr
int * ImageX
int * ImageY
Definition global.h:50
double * indexAcf
double * ro
Definition global.h:38
int * atomIDInterface
int * atom1
double * ax
Definition global.h:17
double * kb
double ** viscAcf
Definition global.h:99
int * PairID
double * viscAcfOrg
Definition global.h:99
double * PairXij
double * ryUnwrap
Definition global.h:51
int nBuffCorr
Definition global.h:95
int * Pairatom2
Definition global.h:63
double ** cfOrg
double * PairYij
Definition global.h:64
int * atomType
double * rxUnwrap
double * cfVal
Definition global.h:94
int * atomID
int * Pairatom1
Definition global.h:63
double * fax

References atom1, atom2, atomID, atomIDInterface, atomMass, atomRadius, atomType, ax, ay, BondID, BondType, cellList, cfOrg, cfVal, fax, fay, fx, fy, ImageX, ImageY, indexAcf, indexCorr, isBonded, kb, molID, nAtom, nBuffAcf, nBuffCorr, Pairatom1, Pairatom2, PairID, PairXij, PairYij, ro, rx, rxUnwrap, ry, ryUnwrap, spacetimeCorr, spacetimeCorrAv, speed, viscAcf, viscAcfAv, viscAcfOrg, vx, and vy.

Referenced by main().

+ Here is the caller graph for this function:

◆ ComputeForcesCells()

void ComputeForcesCells ( )

Definition at line 25 of file ComputeForcesCells.c.

25 {
26 double dr[NDIM+1], invWid[NDIM+1], shift[NDIM+1], f, fcVal, rr, ri, r, uVal;
27 int c, I, J, m1, m1X, m1Y, m2, m2X, m2Y, n, offset;
28 int iofX[] = {0, 0, 1, 1, 0, -1, -1, -1, 0, 1},
29 iofY[] = {0, 0, 0, 1 ,1, 1, 0, -1, -1, -1};
30
31 invWid[1] = cells[1]/region[1];
32 invWid[2] = cells[2]/region[2];
33
34 for(n = nAtom+1; n <= nAtom+cells[1]*cells[2] ; n++)
35 cellList[n] = 0;
36
37 for(n = 1 ; n <= nAtom ; n ++){
38 c = ((int)((ry[n] + regionH[2])*invWid[2]))*cells[1] + (int)((rx[n]+regionH[1])*invWid[1]) + nAtom+ 1;
39 cellList[n] = cellList[c];
40 cellList[c] = n;
41 }
42
43 for(n = 1 ; n <= nAtom ; n ++){
44 ax[n] = 0.;
45 ay[n] = 0.;
46 }
47
48 uSum = 0.0 ;
49 virSum = 0.0;
50 rfAtom = 0.0;
51 RadiusIJ = 0.0;
52
53 gamman = 1.0;
54 double vr[NDIM+1], fd, fdVal, rrinv;
55 rrinv = 0.0;
56 fd = 0.0;
57 fdVal = 0.0;
58
59 int start = 1 + rank*(cells[2]/size);
60 int end = (rank+1)*(cells[2]/size);
61
62 for(m1Y = start ; m1Y <= end ; m1Y ++){
63 for(m1X = 1 ; m1X <= cells[1] ; m1X ++){
64 m1 = (m1Y-1) * cells[1] + m1X + nAtom;
65 for(offset = 1 ; offset <= 9 ; offset ++){
66 m2X = m1X + iofX[offset]; shift[1] = 0.;
67 if(m2X > cells[1]){
68 m2X = 1; shift[1] = region[1];
69 }else if(m2X == 0){
70 m2X = cells[1]; shift[1] = -region[1];
71 }
72 m2Y = m1Y + iofY[offset]; shift[2] = 0.;
73 if(m2Y > cells[2]){
74 m2Y = 1; shift[2] = region[2];
75 }else if(m2Y == 0){
76 m2Y = cells[2]; shift[2] = -region[2];
77 }
78 m2 = (m2Y-1)*cells[1] + m2X + nAtom;
79 I = cellList[m1];
80 while(I > 0){
81 J = cellList[m2];
82 while(J > 0){
83 if(m1 == m2 && J != I && (atomRadius[I] > 0. && atomRadius[J] > 0.)){
84 dr[1] = rx[I] - rx[J] - shift[1];
85 dr[2] = ry[I] - ry[J] - shift[2];
86 rr = Sqr(dr[1]) + Sqr(dr[2]);
89 if(rr < SqrRadiusIJ){
90 r = sqrt(rr);
91 ri = 1.0/r;
92 rrinv = 1.0/rr;
93 vr[1] = vx[I] - vx[J];
94 vr[2] = vy[I] - vy[J];
96 uVal = Sqr(1.0 - r * RadiusIJInv);
97 fcVal = 2.0 * RadiusIJInv * (1.0 - r * RadiusIJInv) *ri;
98 fdVal = -gamman * (vr[1]*dr[1] + vr[2]*dr[2]) * rrinv; //disc-disc drag
99
100 f = fcVal * dr[1];
101 fd = fdVal * dr[1];
102 ax[I] += (f + fd);
103 discDragx[I] += fd; //disc-disc drag
104
105 f = fcVal * dr[2];
106 fd = fdVal * dr[2];
107 ay[I] += (f + fd);
108 discDragy[I] += fd; //disc-disc drag
109
110 uSum += 0.5 * uVal;
111 virSum += 0.5 * fcVal * rr;
112 rfAtom += 0.5 * dr[1] * fcVal * dr[2];
113 }
114 }else if(m1 != m2 && (atomRadius[I] > 0. && atomRadius[J] > 0.)){
115 dr[1] = rx[I] - rx[J] - shift[1];
116 dr[2] = ry[I] - ry[J] - shift[2];
117 rr = Sqr(dr[1]) + Sqr(dr[2]);
120 if(rr < SqrRadiusIJ){
121 r = sqrt(rr);
122 ri = 1.0/r;
123 rrinv = 1.0/r;
124 vr[1] = vx[I] - vx[J];
125 vr[2] = vy[I] - vy[J];
126 RadiusIJInv = 1.0/RadiusIJ;
127 uVal = Sqr(1.0 - r * RadiusIJInv);
128 fcVal = 2.0 * RadiusIJInv * (1.0 - r * RadiusIJInv) *ri;
129 fdVal = -gamman * (vr[1]*dr[1] + vr[2]*dr[2]) * rrinv; //disc-disc drag
130
131 f = fcVal * dr[1];
132 fd = fdVal * dr[1];
133 ax[I] += (f + fd);
134 discDragx[I] += fd; //disc-disc drag
135
136 f = fcVal * dr[2];
137 fd = fdVal * dr[2];
138 ay[I] += (f + fd);
139 discDragy[I] += fd; //disc-disc drag
140
141 uSum += 0.5 * uVal;
142 virSum += 0.5 * fcVal * rr;
143 rfAtom += 0.5 * dr[1] * fcVal * dr[2];
144 }
145 }
146 J = cellList[J];
147 }
148 I = cellList[I];
149 }
150 }
151 }
152 }
153}
double * discDragy
Definition global.h:42
int cells[2+1]
Definition global.h:83
#define NDIM
Definition global.h:13
double rfAtom
int size
Definition global.h:84
double RadiusIJInv
Definition global.h:27
double gamman
double SqrRadiusIJ
Definition global.h:27
double RadiusIJ
int rank
double uSum
Definition global.h:21
double * discDragx

References atomRadius, ax, ay, cellList, cells, discDragx, discDragy, gamman, nAtom, NDIM, RadiusIJ, RadiusIJInv, rank, region, regionH, rfAtom, rx, ry, size, Sqr, SqrRadiusIJ, uSum, virSum, vx, and vy.

◆ DisplaceAtoms()

void DisplaceAtoms ( )

Definition at line 25 of file DisplaceAtoms.c.

25 {
26 int n;
27 for(n = 1; n <= nAtom; n ++){
28 if(molID[n] == 2){
29 rx[n] += DeltaX;
30 ry[n] += DeltaY;
31} } }
double DeltaY
double DeltaX
Definition global.h:49

References DeltaX, DeltaY, molID, nAtom, rx, and ry.

Referenced by main().

+ Here is the caller graph for this function:

◆ DumpBonds()

void DumpBonds ( )

Definition at line 24 of file DumpBonds.c.

24 {
25 int n;
26 //Trajectory file in LAMMPS dump format for OVITO visualization
27 fprintf(fpbond, "ITEM: TIMESTEP\n");
28 fprintf(fpbond, "%lf\n",timeNow);
29 fprintf(fpbond, "ITEM: NUMBER OF ENTRIES\n");
30 fprintf(fpbond, "%d\n",nBond);
31 fprintf(fpbond, "ITEM: BOX BOUNDS pp ff pp\n");
32 fprintf(fpbond, "%lf %lf xlo xhi\n", -regionH[1], regionH[1]);
33 fprintf(fpbond, "%lf %lf ylo yhi\n", -regionH[2], regionH[2]);
34 fprintf(fpbond, "%lf %lf zlo zhi\n", -0.1, 0.1);
35 fprintf(fpbond, "ITEM: ENTRIES BondID, BondType, atom1 atom2 BondLength BondLengthEqul nodeDragx1 nodeDragy1\n");
36
37 for(n=1; n<=nBond; n++)
38 fprintf(fpbond, "%d %d %d %d %0.16lf %0.16lf %0.16lf %0.16lf\n", BondID[n], BondType[n], atom1[n], atom2[n],
39 BondLength[n], ro[n], nodeDragx[atom1[n]], nodeDragy[atom1[n]]);
40 }
double * BondLength
Definition global.h:39
FILE * fpbond
int nBond
double * nodeDragy
Definition global.h:42
double timeNow
Definition global.h:20
double * nodeDragx
Definition global.h:42

References atom1, atom2, BondID, BondLength, BondType, fpbond, nBond, nodeDragx, nodeDragy, regionH, ro, and timeNow.

Referenced by main().

+ Here is the caller graph for this function:

◆ DumpPairs()

void DumpPairs ( )

Definition at line 25 of file DumpPairs.c.

25 {
26 int n;
27 //Trajectory file in LAMMPS dump format for OVITO visualization
28 fprintf(fppair, "ITEM: TIMESTEP\n");
29 fprintf(fppair, "%lf\n",timeNow);
30 fprintf(fppair, "ITEM: NUMBER OF ENTRIES\n");
31 fprintf(fppair, "%d\n",nPairActive);
32 fprintf(fppair, "ITEM: BOX BOUNDS pp ff pp\n");
33 fprintf(fppair, "%lf %lf xlo xhi\n", -regionH[1], regionH[1]);
34 fprintf(fppair, "%lf %lf ylo yhi\n", -regionH[2], regionH[2]);
35 fprintf(fppair, "%lf %lf zlo zhi\n", -0.1, 0.1);
36 fprintf(fppair, "ITEM: ENTRIES index, atom1 atom2 xij yij discDragx1 discDragy1\n");
37
38 for(n=1; n<=nPairActive; n++)
39 fprintf(fppair, "%d %d %d %0.16lf %0.16lf %0.16lf %0.16lf\n", PairID[n], Pairatom1[n], Pairatom2[n],
40 PairXij[n], PairYij[n], discDragx[n], discDragy[n]);
41
42 }
int nPairActive
Definition global.h:62
FILE * fppair

References discDragx, discDragy, fppair, nPairActive, Pairatom1, Pairatom2, PairID, PairXij, PairYij, regionH, and timeNow.

Referenced by main().

+ Here is the caller graph for this function:

◆ 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 nBondType
Definition global.h:35
int nAtomType
char * prefix
Definition main.c:13

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:

◆ DumpState()

void DumpState ( )

Definition at line 25 of file DumpState.c.

25 {
26 char DUMP[256];
27 FILE *fpDUMP;
28 sprintf(DUMP, "%s.STATE", 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, "ITEM: TIMESTEP\n");
36 fprintf(fpDUMP, "%lf\n",timeNow);
37 fprintf(fpDUMP, "ITEM: NUMBER OF ATOMS\n");
38 fprintf(fpDUMP, "%d\n",nAtom);
39 fprintf(fpDUMP, "ITEM: BOX BOUNDS pp pp pp\n");
40 fprintf(fpDUMP, "%lf %lf xlo xhi\n", -regionH[1], regionH[1]);
41 fprintf(fpDUMP, "%lf %lf ylo yhi\n", -regionH[2], regionH[2]);
42 fprintf(fpDUMP, "%lf %lf zlo zhi\n", -0.1, 0.1);
43 fprintf(fpDUMP, "ITEM: ATOMS id mol type radius x y vx vy fx fy\n");
44 int n;
45 for (n = 1; n <= nAtom; n++) {
46 fprintf(fpDUMP, "%d\t %d\t %d\t %0.2lf\t %0.16lf\t %0.16lf\t %0.16lf\t %0.16lf\t %0.16lf\t %0.16lf\n",
47 atomID[n], molID[n], atomType[n], atomRadius[n], rx[n], ry[n], vx[n], vy[n], ax[n], ay[n]);
48 }
49 fclose(fpDUMP);
50}

References atomID, atomRadius, atomType, ax, ay, molID, nAtom, prefix, regionH, rx, ry, timeNow, vx, and vy.

Referenced by main().

+ Here is the caller graph for this function:

◆ EvalCom()

void EvalCom ( )

Definition at line 27 of file EvalCom.c.

27 {
28 int n;
29 ComX = 0.0; ComY = 0.0; ComXRatio = 0.0; ComYRatio = 0.0;
30 TotalMass = 0.0;
31
32 for(n=1; n<=nAtom; n++){
33 if(molID[n] == 2){
34 ComX += atomMass[n] * rxUnwrap[n];
35 ComY += atomMass[n] * ryUnwrap[n];
36 TotalMass += atomMass[n];
37 } }
38
41
42 if(timeNow == 0.0){
43 ComX0 = ComX; ComY0 = ComY;
44 }
46 }
double ComYRatio
Definition global.h:47
double ComY
Definition global.h:47
double ComXRatio
Definition global.h:47
double ComX0
Definition global.h:47
double ComY0
Definition global.h:47
double TotalMass
Definition global.h:32
double ComX

References atomMass, ComX, ComX0, ComXRatio, ComY, ComY0, ComYRatio, molID, nAtom, rxUnwrap, ryUnwrap, timeNow, and TotalMass.

Referenced by main().

+ Here is the caller graph for this function:

◆ EvalProps()

void EvalProps ( )

Definition at line 26 of file EvalProps.c.

26 {
27 double v;
28 int n;
29 double atomMassn;
30 double KineEnrXSum, KineEnrYSum;
31 virSum = 0.0;
32 vSumX = 0.0; vSumY = 0.0; vSum = 0.0; vvSum = 0.0;
33 KineEnrXSum = 0.0; KineEnrYSum = 0.0;
34
35 for (n = 1; n <= nAtom; n++) {
36 // Initialize v with a default value to avoid "uninitialized" warning.
37 v = 0.0;
38 atomMassn = atomMass[n];
39 // X direction velocity
40 if (strcmp(solver, "Verlet") == 0) {
41 v = vx[n];
42 } else if (strcmp(solver, "LeapFrog") == 0) {
43 v = vx[n] - 0.5 * deltaT * ax[n];
44 }
45 vSum += v;
46 vvSum += Sqr(v);
47 KineEnrXSum += 0.5 * atomMassn * Sqr(v);
48 vSumX += v;
49 // Y direction velocity
50 if (strcmp(solver, "Verlet") == 0) {
51 v = vy[n];
52 } else if (strcmp(solver, "LeapFrog") == 0) {
53 v = vy[n] - 0.5 * deltaT * ay[n];
54 }
55 vSum += v;
56 vSumY += v;
57 vvSum += Sqr(v);
58 KineEnrYSum += 0.5 * atomMassn * Sqr(v);
59 }
60
61 kinEnergy = (KineEnrXSum + KineEnrYSum) / nAtom ;
63 BondEnergyPerAtom = TotalBondEnergy / (0.5*nAtom); //Factor of 0.5 since each atom has one half the bond energy
70 pressure = density * (vvSum + virSum) / (nAtom * NDIM);
71
72}
double virSumBond
double virSumPairyy
Definition global.h:88
double virSumyy
Definition global.h:90
double virSumPair
Definition global.h:88
double uSumPairPerAtom
Definition global.h:88
double virSumxy
Definition global.h:90
double virSumPairxx
Definition global.h:88
double vvSum
Definition global.h:21
double virSumBondxy
Definition global.h:89
double vSum
Definition global.h:21
double density
Definition global.h:20
double vSumY
Definition global.h:21
double deltaT
Definition global.h:20
double uSumPair
double BondEnergyPerAtom
Definition global.h:40
double virSumBondxx
Definition global.h:89
char solver[128]
double TotalBondEnergy
double virSumxx
double vSumX
Definition global.h:21
double virSumBondyy
Definition global.h:89
double virSumPairxy
Definition global.h:88

References atomMass, ax, ay, BondEnergyPerAtom, deltaT, density, kinEnergy, nAtom, NDIM, potEnergy, pressure, solver, Sqr, TotalBondEnergy, totEnergy, uSumPair, uSumPairPerAtom, virSum, virSumBond, virSumBondxx, virSumBondxy, virSumBondyy, virSumPair, virSumPairxx, virSumPairxy, virSumPairyy, virSumxx, virSumxy, virSumyy, vSum, vSumX, vSumY, vvSum, vx, and vy.

Referenced by main().

+ Here is the caller graph for this function:

◆ EvalSpacetimeCorr()

void EvalSpacetimeCorr ( )

Definition at line 26 of file EvalSpacetimeCorr.c.

26 {
27 real cosV=0., cosV0=0., cosV1=0., cosV2=0., sinV=0., sinV1=0., sinV2=0.;
28 real COSA, SINA, COSV, SINV;
29 int j, m, n, nb, ni, nv;
30 real kMin = 2. * M_PI / region[1];
31 real kMax = M_PI;
32 real deltaK = (kMax - kMin) / nFunCorr;
33
34 for (j = 1; j <= 2*nFunCorr; j++)
35 cfVal[j] = 0.;
36
37 for (n = 1; n <= nAtom; n++){
38 j = 1;
39 COSA = cos(kMin*rx[n]);
40 SINA = sin(kMin*rx[n]);
41 for (m = 1; m <= nFunCorr; m++){
42 if(m == 1){
43 cosV = cos(deltaK*rx[n]);
44 sinV = sin(deltaK*rx[n]);
45 cosV0 = cosV;
46 }else if(m == 2){
47 cosV1 = cosV;
48 sinV1 = sinV;
49 cosV = 2.*cosV0*cosV1-1;
50 sinV = 2.*cosV0*sinV1;
51 }else{
52 cosV2 = cosV1;
53 sinV2 = sinV1;
54 cosV1 = cosV;
55 sinV1 = sinV;
56 cosV = 2.*cosV0*cosV1-cosV2;
57 sinV = 2.*cosV0*sinV1-sinV2;
58 }
59 COSV = COSA*cosV - SINA*sinV;
60 SINV = SINA*cosV + COSA*sinV;
61 cfVal[j] += COSV;
62 cfVal[j+1] += SINV;
63 j += 2;
64 }
65 }
66
67 for (nb = 1; nb <= nBuffCorr; nb++){
68 indexCorr[nb] += 1;
69 if (indexCorr[nb] <= 0) continue;
70 ni = nFunCorr * (indexCorr[nb] - 1);
71 if (indexCorr[nb] == 1){
72 for (j = 1; j <= 2*nFunCorr; j++)
73 cfOrg[nb][j] = cfVal[j];
74 }
75
76 for (j = 1; j <= nFunCorr; j++)
77 spacetimeCorr[nb][ni + j] = 0.;
78
79 j = 1;
80 for (m = 1; m <= nFunCorr; m++){
81 nv = m + ni;
82 spacetimeCorr[nb][nv] += cfVal[j] * cfOrg[nb][j] + cfVal[j + 1] * cfOrg[nb][j + 1];
83 j += 2;
84 }
85
86 }
87
88 // ACCUMULATE SPACETIME CORRELATIONS
89 for (nb = 1; nb <= nBuffCorr; nb++){
90 if (indexCorr[nb] == nValCorr){
91 for (j = 1; j <= nFunCorr*nValCorr; j++)
92 spacetimeCorrAv[j] += spacetimeCorr[nb][j];
93 indexCorr[nb] = 0.;
94 countCorrAv ++;
96 for (j = 1; j <= nFunCorr*nValCorr; j++)
98 fprintf(fpdnsty,"NDIM %d\n", NDIM);
99 fprintf(fpdnsty,"nAtom %d\n", nAtom);
100 fprintf(fpdnsty,"region %lf\n", region[1]);
101 fprintf(fpdnsty,"nFunCorr %d\n", nFunCorr);
102 fprintf(fpdnsty,"limitCorrAv %d\n", limitCorrAv);
103 fprintf(fpdnsty,"stepCorr %d\n", stepCorr);
104 fprintf(fpdnsty,"nValCorr %d\n", nValCorr);
105 fprintf(fpdnsty,"deltaT %lf\n", deltaT);
106 real tVal;
107 for (n = 1; n <= nValCorr; n++){
108 tVal = (n-1)*stepCorr*deltaT;
109 fprintf (fpdnsty, "%e\t", tVal);
110 int nn = nFunCorr*(n-1);
111 for (j = 1; j <= nFunCorr; j ++)
112 fprintf (fpdnsty, "%e\t", spacetimeCorrAv[nn + j]);
113 fprintf (fpdnsty, "\n");
114 }
115
116 countCorrAv = 0.;
117 for (j = 1; j <= nFunCorr*nValCorr; j++)
118 spacetimeCorrAv[j] = 0.;
119 }
120 }
121 }
122}
int limitCorrAv
Definition global.h:95
double real
Definition global.h:11
int countCorrAv
Definition global.h:95
int nValCorr
Definition global.h:95
FILE * fpdnsty
int stepCorr
Definition global.h:95
int nFunCorr
Definition global.h:95

References cfOrg, cfVal, countCorrAv, deltaT, fpdnsty, indexCorr, limitCorrAv, nAtom, nBuffCorr, NDIM, nFunCorr, nValCorr, region, rx, spacetimeCorr, spacetimeCorrAv, and stepCorr.

◆ EvalUnwrap()

void EvalUnwrap ( )

Definition at line 27 of file EvalUnwrap.c.

27 {
28 int n;
29 for (n = 1; n <= nAtom; n++) {
30 rxUnwrap[n] = rx[n] + ImageX[n] * region[1];
31 ryUnwrap[n] = ry[n] + ImageY[n] * region[2];
32 }
33}

References ImageX, ImageY, nAtom, region, rx, rxUnwrap, ry, and ryUnwrap.

Referenced by main().

+ Here is the caller graph for this function:

◆ EvalVrms()

void EvalVrms ( )

Definition at line 27 of file EvalVrms.c.

27 {
28 int n;
29 VSqr = 0.0;
30 VMeanSqr = 0.0;
31 VRootMeanSqr = 0.0;
32
33 for(n = 1 ; n <= nAtom ; n ++){
34 VSqr += Sqr(vx[n]) + Sqr(vy[n]);
35 }
37 VRootMeanSqr = sqrt(VMeanSqr);
38 }
double VMeanSqr
Definition global.h:46
double VRootMeanSqr
Definition global.h:46
double VSqr

References nAtom, Sqr, VMeanSqr, VRootMeanSqr, VSqr, vx, and vy.

Referenced by main().

+ Here is the caller graph for this function:

◆ HaltConditionCheck()

bool HaltConditionCheck ( double value)

Definition at line 27 of file Halt.c.

27 {
28
29 if(value <= HaltCondition && value != 0) {
30 printf("Halt condition met at step = %d with Vrms = %.16f\n", stepCount, value);
31 fprintf(fpresult, "Halt condition met at step = %d with Vrms = %.16f\n", stepCount, value);
32 fprintf(fpresult, "Final thermodynamic values:\n");
33 fprintf(fpresult, "%0.4lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\n",
35 return true; // Signal that the halt condition is met
36 }
37 return false; // Halt condition not met
38}
double HaltCondition
int stepCount
Definition global.h:24

References BondEnergyPerAtom, fpresult, HaltCondition, kinEnergy, potEnergy, pressure, stepCount, timeNow, totEnergy, uSumPairPerAtom, virSum, and vSum.

Referenced by main().

+ Here is the caller graph for this function:

◆ Init()

void Init ( )

Definition at line 31 of file Init.c.

31 {
32 char dummy[128];
33
34 // Always read input parameters
35 FILE *fp = fopen("input-data", "r");
36 if(!fp) {
37 perror("input-data");
38 exit(EXIT_FAILURE);
39 }
40
41 fscanf(fp, "%s %s", mode, inputConfig); // config type + filename
42 fscanf(fp, "%s %s", dummy, solver);
43 fscanf(fp, "%s %s %s", dummy, xBoundary, yBoundary);
44 fscanf(fp, "%s %d", dummy, &DampFlag);
45 fscanf(fp, "%s %d", dummy, &freezeAtomType);
46 fscanf(fp, "%s %lf", dummy, &rCut);
47 fscanf(fp, "%s %lf", dummy, &Kn);
48 fscanf(fp, "%s %lf", dummy, &mass);
49 fscanf(fp, "%s %lf", dummy, &gamman);
50 fscanf(fp, "%s %lf", dummy, &kappa);
51 fscanf(fp, "%s %lf", dummy, &deltaT);
52 fscanf(fp, "%s %lf", dummy, &strain);
53 fscanf(fp, "%s %lf", dummy, &FyBylx);
54 fscanf(fp, "%s %lf", dummy, &fxByfy);
55 fscanf(fp, "%s %lf", dummy, &DeltaY);
56 fscanf(fp, "%s %lf", dummy, &DeltaX);
57 fscanf(fp, "%s %lf", dummy, &HaltCondition);
58 fscanf(fp, "%s %d", dummy, &stepAvg);
59 fscanf(fp, "%s %d", dummy, &stepEquil);
60 fscanf(fp, "%s %d", dummy, &stepLimit);
61 fscanf(fp, "%s %d", dummy, &stepDump);
62 fscanf(fp, "%s %d", dummy, &stepTraj);
63 fscanf(fp, "%s %d", dummy, &limitCorrAv);
64 fscanf(fp, "%s %d", dummy, &nBuffCorr);
65 fscanf(fp, "%s %d", dummy, &nFunCorr);
66 fscanf(fp, "%s %d", dummy, &nValCorr);
67 fscanf(fp, "%s %d", dummy, &stepCorr);
68 fscanf(fp, "%s %d", dummy, &limitAcfAv);
69 fscanf(fp, "%s %d", dummy, &nBuffAcf);
70 fscanf(fp, "%s %d", dummy, &nValAcf);
71 fscanf(fp, "%s %d", dummy, &stepAcf);
72 fscanf(fp, "%s %lf", dummy, &rangeRdf);
73 fscanf(fp, "%s %d", dummy, &limitRdf);
74 fscanf(fp, "%s %d", dummy, &sizeHistRdf);
75 fscanf(fp, "%s %d", dummy, &stepRdf);
76 fclose(fp);
77
78 int useBinaryRestart = 0;
79 if(strcmp(mode, "read_restart") == 0) {
80 useBinaryRestart = 1;
81 } else if (strcmp(mode, "read_data") != 0) {
82 fprintf(stderr, "ERROR: First line of input-data must be 'read_data' or 'read_restart'\n");
83 exit(0);
84 }
85
86 //Conditionally read binary config
87 if(useBinaryRestart) {
88 ReadBinaryRestart(inputConfig); // uses global prefix + config file
89 printf(">>> Binary restart loaded from %s <<<\n", inputConfig);
90 printf(">>> Restarting simulation from time = %.8lf <<<\n", timeNow);
91 return; //Exiting from Init() from here
92 }
93
94 FILE *fpSTATE;
95 if((fpSTATE = fopen(inputConfig,"r"))==NULL){
96 printf("Error occurred: Could not open STATE file\n Exiting now..\n");
97 exit(0);
98 }
99
100 if(fscanf(fpSTATE, "%s %lf", dummy, &timeNow) != 2 || strcmp(dummy, "timeNow") != 0) {
101 fprintf(stderr, "ERROR [%s:%d:%s]: Expected 'timeNow <value>' as the first line in the config file.\n",
102 __FILE__, __LINE__, __func__);
103 exit(EXIT_FAILURE);
104 }
105
106 if(timeNow == 0.0) {
107 printf(">>> Running from time = 0.0: Beginning of the simulation\n");
108 stepCount = 0;
109 }
110
111 fscanf(fpSTATE, "%s %d", dummy, &nAtom);
112 fscanf(fpSTATE, "%s %d", dummy, &nBond);
113 fscanf(fpSTATE, "%s %d", dummy, &nAtomType);
114 fscanf(fpSTATE, "%s %d", dummy, &nBondType);
115 fscanf(fpSTATE, "%s %lf", dummy, &region[1]);
116 fscanf(fpSTATE, "%s %lf", dummy, &region[2]);
117
118 if(timeNow == 0.0) region[2] *= 1.5; //Remove this when put on GitHub
119
120 density = nAtom/(region[1]*region[2]);
121 cells[1] = region[1] / rCut;
122 cells[2] = region[2] / rCut;
123 cellList = (int*)malloc((nAtom + cells[1] * cells[2] + 1) * sizeof(int));
124 regionH[1] = 0.5*region[1];
125 regionH[2] = 0.5*region[2];
126
127 //strain information
131 int n;
132
133 rx = (double*)malloc((nAtom + 1) * sizeof(double));
134 ry = (double*)malloc((nAtom + 1) * sizeof(double));
135 vx = (double*)malloc((nAtom + 1) * sizeof(double));
136 vy = (double*)malloc((nAtom + 1) * sizeof(double));
137 ax = (double*)malloc((nAtom + 1) * sizeof(double));
138 ay = (double*)malloc((nAtom + 1) * sizeof(double));
139 fx = (double*)malloc((nAtom + 1) * sizeof(double));
140 fy = (double*)malloc((nAtom + 1) * sizeof(double));
141 fax = (double*)malloc((nAtom + 1) * sizeof(double));
142 fay = (double*)malloc((nAtom + 1) * sizeof(double));
143 atomID = (int*)malloc((nAtom+1) * sizeof(int));
144 atomType = (int*)malloc((nAtom+1) * sizeof(int));
145 atomRadius = (double*)malloc((nAtom + 1) * sizeof(double));
146 atomMass = (double*)malloc((nAtom + 1) * sizeof(double));
147 speed = (double*)malloc((nAtom + 1) * sizeof(double));
148 discDragx = (double*)malloc((nAtom + 1) * sizeof(double));
149 discDragy = (double*)malloc((nAtom + 1) * sizeof(double));
150 molID = (int*)malloc((nAtom+1) * sizeof(int));
151
152 BondID = (int*)malloc((nBond+1)*sizeof(int));
153 BondType = (int*)malloc((nBond+1)*sizeof(int));
154 atom1 = (int*)malloc((nBond+1)*sizeof(int));
155 atom2 = (int*)malloc((nBond+1)*sizeof(int));
156 kb = (double*)malloc((nBond+1)*sizeof(double));
157 ro = (double*)malloc((nBond+1)*sizeof(double));
158 BondEnergy = (double*)malloc((nBond+1)*sizeof(double));
159 BondLength =(double*)malloc((nBond+1)*sizeof(double));
160 nodeDragx = (double*)malloc((nAtom + 1) * sizeof(double));
161 nodeDragy = (double*)malloc((nAtom + 1) * sizeof(double));
162 rxUnwrap = (double*)malloc((nAtom + 1) * sizeof(double));
163 ryUnwrap = (double*)malloc((nAtom + 1) * sizeof(double));
164 ImageX = (int*)malloc((nAtom+1) * sizeof(int));
165 ImageY = (int*)malloc((nAtom+1) * sizeof(int));
166
167
168 for(n = 1; n <= nAtom; n ++){
169 atomMass[n] = mass;
170 }
171
172 fscanf(fpSTATE, "%s\n", dummy);
173 for(n = 1; n <= nAtom; n ++)
174 fscanf(fpSTATE, "%d %d %d %lf %lf %lf %lf %lf\n", &atomID[n], &molID[n], &atomType[n], &atomRadius[n], &rx[n], &ry[n], &vx[n], &vy[n]);
175
176
177 fscanf(fpSTATE, "%s\n", dummy);
178 for(n=1; n<=nBond; n++)
179 fscanf(fpSTATE, "%d %d %d %d %lf %lf\n", &BondID[n], &BondType[n], &atom1[n], &atom2[n], &kb[n], &ro[n]);
180
181 fclose(fpSTATE);
182
183 //2D-List of bonded atoms. This is used to remove pair interaction
184 //calculation for the bonded atoms
185 isBonded = (int**)malloc((nAtom + 1) * sizeof(int*));
186 for (int i = 0; i <= nAtom; i++) {
187 isBonded[i] = (int*)malloc((nAtom + 1) * sizeof(int));
188 for (int j = 0; j <= nAtom; j++) {
189 isBonded[i][j] = 0;
190 }
191 }
192
193 for (n = 1; n <= nBond; n++) {
194 int i = atom1[n];
195 int j = atom2[n];
196 isBonded[i][j] = 1;
197 isBonded[j][i] = 1; // symmetric
198}
199
200 // List the interface atoms
201 nAtomInterface = 0;
202 nAtomBlock = 0;
203 nDiscInterface = 0;
204 bigDiameter = 2.8;
206
207 for(n = 1; n <= nAtom; n++){
208 if(fabs(ry[n]) < InterfaceWidth){
210 }
211 if(molID[n] == 2){
212 nAtomBlock++;
213 }
214 if(atomRadius[n] != 0.0){
216 } }
217
218
219 int BondPairInteract;
220 BondPairInteract = 0;
221 int m;
222 if(BondPairInteract == 1){
223 atomIDInterface = (int *)malloc((nAtomInterface+1)*sizeof(int));
224 m = 1;
225 for(n=1; n<=nAtom; n++){
226 if(fabs(ry[n]) < InterfaceWidth){
227 atomIDInterface[m] = atomID[n];
228 m++;
229 } } }
230 else if(BondPairInteract == 0){
232 atomIDInterface = (int *)malloc((nAtomInterface+1)*sizeof(int));
233 m = 1;
234 for(n=1; n<=nAtom; n++){
235 if(atomRadius[n] != 0.0){
236 atomIDInterface[m] = atomID[n];
237 m++;
238 } } }
239
241 PairID = (int*)malloc((nPairTotal+1) * sizeof(int));
242 Pairatom1 = (int*)malloc((nPairTotal+1) * sizeof(int));
243 Pairatom2 = (int*)malloc((nPairTotal+1) * sizeof(int));
244 PairXij = (double*)malloc((nPairTotal+1) * sizeof(double));
245 PairYij = (double*)malloc((nPairTotal+1) * sizeof(double));
246
247 fprintf(fpresult, "------------------------------------\n");
248 fprintf(fpresult, "-------PARAMETERS-----------\n");
249 fprintf(fpresult, "------------------------------------\n");
250 fprintf(fpresult, "nAtom\t\t\t%d\n", nAtom);
251 fprintf(fpresult, "nBond\t\t\t%d\n", nBond);
252 fprintf(fpresult, "nAtomType\t\t%d\n", nAtomType);
253 fprintf(fpresult, "nBondType\t\t%d\n", nBondType);
254 fprintf(fpresult, "nAtomBlock\t\t%d\n", nAtomBlock);
255 fprintf(fpresult, "nAtomInterface\t\t%d\n", nAtomInterface);
256 fprintf(fpresult, "nDiscInterface\t\t%d\n", nDiscInterface);
257 fprintf(fpresult, "mass\t\t\t%0.6g\n", mass);
258 fprintf(fpresult, "gamman\t\t\t%0.6g\n", gamman);
259 fprintf(fpresult, "strain\t\t\t%0.6g\n", strain);
260 fprintf(fpresult, "strainRate\t\t%0.6g\n", strainRate);
261 fprintf(fpresult, "FyBylx\t\t\t%0.6g\n", FyBylx);
262 fprintf(fpresult, "fxByfy\t\t\t%0.6g\n", fxByfy);
263 fprintf(fpresult, "DeltaY\t\t\t%0.6g\n", DeltaY);
264 fprintf(fpresult, "DeltaX\t\t\t%0.6g\n", DeltaX);
265 fprintf(fpresult, "HaltCondition\t\t%0.6g\n", HaltCondition);
266 fprintf(fpresult, "kappa\t\t\t%g\n", kappa);
267 fprintf(fpresult, "density\t\t\t%g\n", density);
268 fprintf(fpresult, "rCut\t\t\t%g\n", rCut);
269 fprintf(fpresult, "deltaT\t\t\t%g\n", deltaT);
270 fprintf(fpresult, "stepEquil\t\t%d\n", stepEquil);
271 fprintf(fpresult, "stepLimit\t\t%d\n", stepLimit);
272 fprintf(fpresult, "region[1]\t\t%0.16lf\n", region[1]);
273 fprintf(fpresult, "region[2]\t\t%0.16lf\n", region[2]);
274 fprintf(fpresult, "cells[1]\t\t%d\n", cells[1]);
275 fprintf(fpresult, "cells[2]\t\t%d\n", cells[2]);
276 fprintf(fpresult, "solver\t\t\t%s\n", solver);
277 fprintf(fpresult, "boundary\t\t%s %s\n", xBoundary, yBoundary);
278 fprintf(fpresult, "DampFlag\t\t%d\n", DampFlag);
279 fprintf(fpresult, "------------------------------------\n");
280 fprintf(fpresult, "#TimeNow TotalMomentum PotEngyPerAtom KinEngyPerAtom TotEngyPerAtom PairEnergyPerAtom BondEnergyPerAtom Press VirialSum\n");
281 fprintf(fpvrms, "#timeNow\tVrms \n");
282 fprintf(fpcom, "#timeNow\tComX\tComY\n");
283 fprintf(fpforce, "#timeNow\tforceSumxAtomType1\tforceSumyAtomType1\tforceSumxAtomType2\tforceSumyAtomType2\tforceSumxAtomType3\tforceSumyAtomType3\tforceSumxAtomType4\tforceSumyAtomType4\tforceSumxAtomType5\tforceSumyAtomType5\tforceSumxExtern\tforceSumyExtern\n");
284
285/* //Uncomment the following as per your acquirement
286 fprintf(fpstress, "strain %lf\n", strain);
287 fprintf(fpstress, "region[1] %lf\n", region[1]);
288 fprintf(fpstress, "region[2] %lf\n", region[2]);
289 fprintf(fpstress, "#timeNow virSumxx virSumyy virSumxy pressure\n");
290 fprintf(fpmomentum, "#timeNow Px Py\n");
291*/
292
293 if((strcmp(xBoundary, "p") != 0 && strcmp(xBoundary, "r") != 0) ||
294 (strcmp(yBoundary, "p") != 0 && strcmp(yBoundary, "r") != 0)) {
295 fprintf(fpresult, "Error: Invalid boundary value detected: '%s %s'. Only 'p' or 'r' are allowed.\n", xBoundary, yBoundary);
296 exit(EXIT_FAILURE); // Exit with failure status
297 }
298
299}
void ReadBinaryRestart(const char *filename)
double kappa
Definition global.h:21
double rCut
Definition global.h:21
int nDiscInterface
Definition global.h:76
int nPairTotal
double mass
int stepTraj
Definition global.h:24
double Kn
int limitRdf
Definition global.h:104
double InterfaceWidth
double strain
int nValAcf
int stepRdf
Definition global.h:104
int stepLimit
Definition global.h:24
int stepAcf
Definition global.h:100
int nAtomInterface
int freezeAtomType
FILE * fpforce
double shearVelocity
Definition global.h:45
double * BondEnergy
double bigDiameter
Definition global.h:75
int stepEquil
Definition global.h:24
FILE * fpvrms
int DampFlag
int limitAcfAv
Definition global.h:100
char mode[64]
FILE * fpcom
int sizeHistRdf
Definition global.h:104
char inputConfig[128]
Definition global.h:58
double rangeRdf
Definition global.h:103
double strainRate
Definition global.h:44
int stepDump
Definition global.h:24

References atom1, atom2, atomID, atomIDInterface, atomMass, atomRadius, atomType, ax, ay, bigDiameter, BondEnergy, BondID, BondLength, BondType, cellList, cells, DampFlag, deltaT, DeltaX, DeltaY, density, discDragx, discDragy, fax, fay, fpcom, fpforce, fpresult, fpvrms, freezeAtomType, fx, fxByfy, fy, FyBylx, gamman, HaltCondition, ImageX, ImageY, inputConfig, InterfaceWidth, isBonded, kappa, kb, Kn, limitAcfAv, limitCorrAv, limitRdf, mass, mode, molID, nAtom, nAtomBlock, nAtomInterface, nAtomType, nBond, nBondType, nBuffAcf, nBuffCorr, nDiscInterface, nFunCorr, nodeDragx, nodeDragy, nPairTotal, nValAcf, nValCorr, Pairatom1, Pairatom2, PairID, PairXij, PairYij, rangeRdf, rCut, ReadBinaryRestart(), region, regionH, ro, rx, rxUnwrap, ry, ryUnwrap, shearDisplacement, shearVelocity, sizeHistRdf, solver, speed, stepAcf, stepAvg, stepCorr, stepCount, stepDump, stepEquil, stepLimit, stepRdf, stepTraj, strain, strainRate, timeNow, vx, vy, xBoundary, and yBoundary.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ main()

int main ( int argc,
char ** argv )

Definition at line 43 of file main.c.

43 {
44 time_t t1 = 0, t2;
45 if (argc < 2) {
46 fprintf(stderr, "Usage: %s <output_prefix>\n", argv[0]);
47 return 1;
48 }
49
50 int prefix_size = snprintf(NULL, 0, "../output/%s", argv[1]) + 1; // +1 for the null terminator
51 prefix = malloc(prefix_size);
52 if(prefix == NULL) {
53 fprintf(stderr, "Memory allocation failed\n");
54 return 1;
55 }
56
57 // Write the formatted string into the allocated space
58 snprintf(prefix, prefix_size, "../output/%s", argv[1]);
59 sprintf(result, "%s.result", prefix);
60 fpresult = fopen(result, "w");
61 sprintf(xyz, "%s.xyz", prefix);
62 fpxyz = fopen(xyz, "w");
63 sprintf(vrms, "%s.vrms", prefix);
64 fpvrms = fopen(vrms, "w");
65 sprintf(bond, "%s.bond", prefix);
66 fpbond = fopen(bond, "w");
67 sprintf(com, "%s.com", prefix);
68 fpcom = fopen(com, "w");
69 sprintf(pair, "%s.pair", prefix);
70 fppair = fopen(pair, "w");
71 sprintf(force, "%s.force", prefix);
72 fpforce = fopen(force, "w");
73
74 /* //Uncomment the following as per your acquirement
75 sprintf(dnsty, "%s.curr-dnsty", prefix);
76 fpdnsty = fopen(dnsty, "w");
77 sprintf(visc, "%s.viscosity", prefix);
78 fpvisc = fopen(visc, "w");
79 sprintf(rdf, "%s.rdf", prefix);
80 fprdf = fopen(rdf, "w");
81 sprintf(stress, "%s.stress", prefix);
82 fpstress = fopen(stress, "w");
83 sprintf(momentum, "%s.momentum", prefix);
84 fpmomentum = fopen(momentum, "w");
85 */
86
87 Init();
88 SetupJob();
89 t1 = time(NULL);
90 moreCycles = 1;
91 if(stepCount >= 0) {
92 if (timeNow == 0.0) {
93 printf(">>> Run type: Fresh simulation <<<\n");
97 ApplyForce();
98 } else {
99 printf(">>> Run type: Restart simulation <<<\n");
100 }
101 DumpBonds();
102 DumpPairs();
103 Trajectory();
104 EvalUnwrap();
106 EvalProps();
107 EvalVrms();
108 EvalCom();
109 PrintVrms();
110 PrintCom();
111 PrintSummary();
113 }
114
115//Here starts the main loop of the program
116 while(moreCycles){
117 if(stepLimit == 0){
118 printf("Error occured: stepLimit must be > 0\n");
119 printf("Exiting now ...\n");
120 exit(0);
121 }
122
123 stepCount ++;
124 timeNow += deltaT ; //stepCount * deltaT; //for adaptive step size: timeNow += deltaT
125
127 EvalUnwrap();
131 ApplyForce();
134 EvalProps();
135 EvalVrms();
136 EvalCom();
137 if(stepCount % stepAvg == 0){
138 PrintSummary();
139 PrintVrms();
140 PrintCom();
142 }
143 if(stepCount % stepTraj == 0){
144 Trajectory();
145 DumpBonds();
146 DumpPairs();
147 }
148 if(stepCount % stepDump == 0){
149 DumpRestart(); // Save the current state for input
150 DumpState(); // Save the current state for config
152 }
154 DumpRestart(); // Save the current state for input
155 DumpState(); // Save the current state for config
157 break; // Exit the loop when the halt condition is met
158 }
159
160 moreCycles ++;
161 if(moreCycles >= stepLimit)
162 moreCycles = 0;
163 }
164
165
166 t2 = time(NULL);
167 fprintf(fpresult, "#Execution time %lf secs\n", difftime(t2,t1));
168 fprintf(fpresult, "#Execution speed %lf steps per secs\n", stepLimit/difftime(t2,t1));
169 printf(">>> Simulation run completed <<<\n");
170 printf(">>> Execution time %lf secs <<<\n", difftime(t2,t1));
171 printf(">>> Execution speed %lf steps per secs <<< \n", stepLimit/difftime(t2,t1));
172
173 fclose(fpresult);
174 fclose(fpxyz);
175 fclose(fpvrms);
176 fclose(fpbond);
177 fclose(fppair);
178 fclose(fpcom);
179 fclose(fpforce);
180
181/*//Uncomment the following as per your acquirement
182 fclose(fpdnsty);
183 fclose(fpvisc);
184 fclose(fprdf);
185 fclose(fpstress);
186 fclose(fpmomentum);
187*/
188
189 free(prefix);
190 Close();
191 return 0;
192}
void ComputeBondForce()
void ComputePairForce(int normFlag)
int moreCycles
Definition global.h:24
FILE * fpxyz
char vrms[256]
char pair[256]
char xyz[256]
char com[256]
char force[256]
char result[250]
char bond[256]
void Trajectory()
Definition Trajectory.c:25
void EvalUnwrap()
Definition EvalUnwrap.c:27
void Init()
Definition Init.c:31
void VelocityVerletStep(int icode)
void EvalProps()
Definition EvalProps.c:26
void EvalVrms()
Definition EvalVrms.c:27
void PrintForceSum()
void DisplaceAtoms()
void ApplyBoundaryCond()
void WriteBinaryRestart()
void DumpState()
Definition DumpState.c:25
void EvalCom()
Definition EvalCom.c:27
void Close()
Definition Close.c:25
void DumpPairs()
Definition DumpPairs.c:25
void PrintSummary()
void SetupJob()
Definition SetupJob.c:27
void DumpBonds()
Definition DumpBonds.c:24
void DumpRestart()
Definition DumpRestart.c:25
void PrintCom()
Definition PrintCom.c:28
void ApplyForce()
Definition ApplyForce.c:25
void PrintVrms()
Definition PrintVrms.c:27
bool HaltConditionCheck(double value)
Definition Halt.c:27

References ApplyBoundaryCond(), ApplyForce(), bond, Close(), com, ComputeBondForce(), ComputePairForce(), deltaT, DisplaceAtoms(), DumpBonds(), DumpPairs(), DumpRestart(), DumpState(), EvalCom(), EvalProps(), EvalUnwrap(), EvalVrms(), force, fpbond, fpcom, fpforce, fppair, fpresult, fpvrms, fpxyz, HaltConditionCheck(), Init(), moreCycles, pair, prefix, PrintCom(), PrintForceSum(), PrintSummary(), PrintVrms(), result, SetupJob(), stepAvg, stepCount, stepDump, stepLimit, stepTraj, timeNow, Trajectory(), VelocityVerletStep(), vrms, VRootMeanSqr, WriteBinaryRestart(), and xyz.

+ Here is the call graph for this function:

◆ PrintCom()

void PrintCom ( )

Definition at line 28 of file PrintCom.c.

28 {
29 fprintf(fpcom, "%0.4lf\t%0.16lf\t%0.16lf\n", timeNow, ComX, ComY);
30 fflush(fpcom);
31 }

References ComX, ComY, fpcom, and timeNow.

Referenced by main().

+ Here is the caller graph for this function:

◆ PrintForceSum()

void PrintForceSum ( )

Definition at line 28 of file PrintForceSum.c.

28 {
29 int n;
30 double forceSumxAtomType1, forceSumxAtomType2, forceSumxAtomType3, forceSumxAtomType4, forceSumxAtomType5;
31 double forceSumyAtomType1, forceSumyAtomType2, forceSumyAtomType3, forceSumyAtomType4, forceSumyAtomType5;
32
33 forceSumxAtomType1 = 0.0; forceSumyAtomType1 = 0.0;
34 forceSumxAtomType2 = 0.0; forceSumyAtomType2 = 0.0;
35 forceSumxAtomType3 = 0.0; forceSumyAtomType3 = 0.0;
36 forceSumxAtomType4 = 0.0; forceSumyAtomType4 = 0.0;
37 forceSumxAtomType5 = 0.0; forceSumyAtomType5 = 0.0;
38
39
40 for(n = 1; n <= nAtom; n++){
41 if(atomType[n] == 1){
42 forceSumxAtomType1 += fx[n];
43 forceSumyAtomType1 += fy[n];
44 } else if(atomType[n] == 2){
45 forceSumxAtomType2 += fx[n];
46 forceSumyAtomType2 += fy[n];
47 } else if(atomType[n] == 3){
48 forceSumxAtomType3 += fx[n];
49 forceSumyAtomType3 += fy[n];
50 } else if(atomType[n] == 4){
51 forceSumxAtomType4 += fx[n];
52 forceSumyAtomType4 += fy[n];
53 } else if(atomType[n] == 5){
54 forceSumxAtomType5 += fx[n];
55 forceSumyAtomType5 += fy[n];
56 }
57 }
58
59 fprintf(fpforce, "%0.4lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16f\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16f\t%0.16f\n", timeNow,
60 forceSumxAtomType1, forceSumyAtomType1,
61 forceSumxAtomType2, forceSumyAtomType2,
62 forceSumxAtomType3, forceSumyAtomType3,
63 forceSumxAtomType4, forceSumyAtomType4,
64 forceSumxAtomType5, forceSumyAtomType5,
66 fflush(fpforce);
67 }

References atomType, forceSumxExtern, forceSumyExtern, fpforce, fx, fy, nAtom, and timeNow.

Referenced by main().

+ Here is the caller graph for this function:

◆ PrintMomentum()

void PrintMomentum ( )

Definition at line 25 of file PrintMomentum.c.

25 {
26 fprintf(fpmomentum, "%0.4lf\t%0.16lf\t%0.16lf\n", timeNow, vSumX, vSumY);
27 fflush(fpmomentum);
28}
FILE * fpmomentum

References fpmomentum, timeNow, vSumX, and vSumY.

◆ PrintStress()

void PrintStress ( )

Definition at line 25 of file PrintStress.c.

25 {
26 fprintf(fpstress, "%0.4lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\n", timeNow, virSumxx, virSumyy, virSumxy, pressure);
27 fflush(fpstress);
28}
FILE * fpstress

References fpstress, pressure, timeNow, virSumxx, virSumxy, and virSumyy.

◆ PrintSummary()

void PrintSummary ( )

Definition at line 25 of file PrintSummary.c.

25 {
26 fprintf(fpresult, "%0.4lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\t%0.16lf\n",
28 fflush(fpresult);
29}

References BondEnergyPerAtom, fpresult, kinEnergy, potEnergy, pressure, timeNow, totEnergy, uSumPairPerAtom, virSum, and vSum.

Referenced by main().

+ Here is the caller graph for this function:

◆ PrintVrms()

void PrintVrms ( )

Definition at line 27 of file PrintVrms.c.

27 {
28 fprintf(fpvrms, "%0.4lf\t%0.16lf\n", timeNow, VRootMeanSqr);
29 fflush(fpvrms);
30}

References fpvrms, timeNow, and VRootMeanSqr.

Referenced by main().

+ Here is the caller graph for this function:

◆ SetupJob()

void SetupJob ( )

Definition at line 27 of file SetupJob.c.

27 {
29 AccumProps(0);
30 InitVacf();
31 // INITIALISE SPACETIME CORRELATIONS
32 int n;
33 for (n = 1; n <= nBuffCorr; n++)
34 indexCorr[n] = -(n - 1)*nValCorr/nBuffCorr;
35
36 countCorrAv = 0.;
37
38 for (n = 1; n <= nFunCorr*nValCorr; n++)
39 spacetimeCorrAv[n] = 0.;
40
41 //RDF
42 countRdf = 0;
43}
void AllocArrays()
Definition AllocArrays.c:25
void AccumProps(int icode)
Definition AccumProps.c:25
void InitVacf()
Definition InitVacf.c:26
int countRdf

References AccumProps(), AllocArrays(), countCorrAv, countRdf, indexCorr, InitVacf(), nBuffCorr, nFunCorr, nValCorr, and spacetimeCorrAv.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Trajectory()

void Trajectory ( )

Definition at line 25 of file Trajectory.c.

25 {
26 int n;
27 //Trajectory file in LAMMPS dump format for OVITO visualization
28 fprintf(fpxyz, "ITEM: TIMESTEP\n");
29 fprintf(fpxyz, "%lf\n",timeNow);
30 fprintf(fpxyz, "ITEM: NUMBER OF ATOMS\n");
31 fprintf(fpxyz, "%d\n",nAtom);
32 fprintf(fpxyz, "ITEM: BOX BOUNDS pp ff pp\n");
33 fprintf(fpxyz, "%lf %lf xlo xhi\n", -regionH[1], regionH[1]);
34 fprintf(fpxyz, "%lf %lf ylo yhi\n", -regionH[2], regionH[2]);
35 fprintf(fpxyz, "%lf %lf zlo zhi\n", -0.1, 0.1);
36 fprintf(fpxyz, "ITEM: ATOMS id mol type radius x y vx vy fx fy\n");
37 for(n=1; n<=nAtom; n++)
38 fprintf(fpxyz, "%d\t %d\t %d\t %0.2lf\t %0.16lf\t %0.16lf\t %0.16lf\t %0.16lf\t %0.16lf\t %0.16lf\n",
39 atomID[n], molID[n], atomType[n], atomRadius[n], rx[n], ry[n], vx[n], vy[n], fx[n], fy[n]);
40}

References atomID, atomRadius, atomType, fpxyz, fx, fy, molID, nAtom, regionH, rx, ry, timeNow, vx, and vy.

Referenced by main().

+ Here is the caller graph for this function:

◆ VelocityVerletStep()

void VelocityVerletStep ( int icode)

Definition at line 26 of file VelocityVerletStep.c.

26 {
27int n;
28double atomMassi;
29
30 if(icode == 1){
31 for (n= 1; n <= nAtom; n++) {
32 if(atomType[n] != freezeAtomType){
33 atomMassi = 1./atomMass[n];
34 ax[n] = fx[n] * atomMassi; ay[n] = fy[n] * atomMassi;
35 vx[n] += ax[n] * 0.5 * deltaT;
36 vy[n] += ay[n] * 0.5 * deltaT;
37 rx[n] += vx[n] * deltaT;
38 ry[n] += vy[n] * deltaT;
39 }
40 //Calculating the image flags here
41 if (rx[n] >= regionH[1]) {
42 rx[n] -= region[1];
43 ImageX[n]++;
44 } else if (rx[n] < -regionH[1]) {
45 rx[n] += region[1];
46 ImageX[n]--;
47 }
48 if (ry[n] >= regionH[2]) {
49 ry[n] -= region[2];
50 ImageY[n]++;
51 } else if (ry[n] < -regionH[2]) {
52 ry[n] += region[2];
53 ImageY[n]--;
54 } } }
55 else if(icode == 2){
56 for(n = 1; n <= nAtom; n++) {
57 if(atomType[n] != freezeAtomType){
58 atomMassi = 1./atomMass[n];
59 ax[n] = fx[n] * atomMassi; ay[n] = fy[n] * atomMassi;
60 vx[n] += ax[n] * 0.5 * deltaT;
61 vy[n] += ay[n] * 0.5 * deltaT;
62} } } }

References atomMass, atomType, ax, ay, deltaT, freezeAtomType, fx, fy, ImageX, ImageY, nAtom, region, regionH, rx, ry, vx, and vy.

Referenced by main().

+ Here is the caller graph for this function:

◆ WriteBinaryRestart()

void WriteBinaryRestart ( )

Definition at line 60 of file WriteRestartBinary.c.

60 {
61 RestartHeader hdr = {
62 .magic = "LAMINA",
63 .version = 1.0,
64 .timeNow = timeNow,
65 .nAtom = nAtom,
66 .nBond = nBond,
67 .nAtomType = nAtomType,
68 .nBondType = nBondType,
69 .regionX = region[1],
70 .regionY = region[2],
71 .nAtomInterface = nAtomInterface,
72 .nAtomBlock = nAtomBlock,
73 .nDiscInterface = nDiscInterface,
74 .bigDiameter = bigDiameter,
75 .InterfaceWidth = InterfaceWidth,
76 .nPairActive = nPairActive,
77 .nPairTotal = nPairTotal,
78 .uSumPair = uSumPair,
79 .virSumPair = virSumPair,
80 .virSumPairxx = virSumPairxx,
81 .virSumPairyy = virSumPairyy,
82 .virSumPairxy = virSumPairxy,
83 .TotalBondEnergy = TotalBondEnergy,
84 .virSumBond = virSumBond,
85 .virSumBondxx = virSumBondxx,
86 .virSumBondyy = virSumBondyy,
87 .virSumBondxy = virSumBondxy,
88 .stepCount = stepCount,
89 .forceSumxExtern = forceSumxExtern,
90 .forceSumyExtern = forceSumyExtern
91 };
92
93 char DUMP[256];
94 FILE *fp;
95 sprintf(DUMP, "%s.bin", prefix); // Produces e.g. "../output/test.bin"
96 fp = fopen(DUMP, "wb");
97 if (!fp) {
98 fprintf(stderr, "Error opening binary restart file %s for writing\n", DUMP);
99 exit(EXIT_FAILURE);
100 }
101
102 //Here we are writing the data to binary file
103 fwrite(&hdr, sizeof(RestartHeader), 1, fp);
104 fwrite(&atomID[1], sizeof(int), nAtom, fp);
105 fwrite(&molID[1], sizeof(int), nAtom, fp);
106 fwrite(&atomType[1], sizeof(int), nAtom, fp);
107 fwrite(&atomRadius[1], sizeof(double), nAtom, fp);
108 fwrite(&rx[1], sizeof(double), nAtom, fp);
109 fwrite(&ry[1], sizeof(double), nAtom, fp);
110 fwrite(&vx[1], sizeof(double), nAtom, fp);
111 fwrite(&vy[1], sizeof(double), nAtom, fp);
112 fwrite(&ax[1], sizeof(double), nAtom, fp);
113 fwrite(&ay[1], sizeof(double), nAtom, fp);
114 fwrite(&fx[1], sizeof(double), nAtom, fp);
115 fwrite(&fy[1], sizeof(double), nAtom, fp);
116 fwrite(&atomMass[1], sizeof(double), nAtom, fp);
117 fwrite(&discDragx[1], sizeof(double), nAtom, fp);
118 fwrite(&discDragy[1], sizeof(double), nAtom, fp);
119 fwrite(&atomIDInterface[1], sizeof(int), nAtomInterface, fp);
120
121 fwrite(&BondID[1], sizeof(int), nBond, fp);
122 fwrite(&BondType[1], sizeof(int), nBond, fp);
123 fwrite(&atom1[1], sizeof(int), nBond, fp);
124 fwrite(&atom2[1], sizeof(int), nBond, fp);
125 fwrite(&kb[1], sizeof(double), nBond, fp);
126 fwrite(&ro[1], sizeof(double), nBond, fp);
127 fwrite(&BondEnergy[1], sizeof(double), nBond, fp);
128 fwrite(&BondLength[1], sizeof(double), nBond, fp);
129 fwrite(&nodeDragx[1], sizeof(double), nAtom, fp);
130 fwrite(&nodeDragy[1], sizeof(double), nAtom, fp);
131 fwrite(&rxUnwrap[1], sizeof(double), nAtom, fp);
132 fwrite(&ryUnwrap[1], sizeof(double), nAtom, fp);
133 fwrite(&ImageX[1], sizeof(int), nAtom, fp);
134 fwrite(&ImageY[1], sizeof(int), nAtom, fp);
135
136 fwrite(&PairID[1], sizeof(int), nPairActive, fp);
137 fwrite(&Pairatom1[1], sizeof(int), nPairActive, fp);
138 fwrite(&Pairatom2[1], sizeof(int), nPairActive, fp);
139 fwrite(&PairXij[1], sizeof(double), nPairActive, fp);
140 fwrite(&PairYij[1], sizeof(double), nPairActive, fp);
141
142 fclose(fp);
143}

References atom1, atom2, atomID, atomIDInterface, atomMass, atomRadius, atomType, ax, ay, bigDiameter, BondEnergy, BondID, BondLength, BondType, discDragx, discDragy, forceSumxExtern, forceSumyExtern, fx, fy, ImageX, ImageY, InterfaceWidth, kb, molID, nAtom, nAtomBlock, nAtomInterface, nAtomType, nBond, nBondType, nDiscInterface, nodeDragx, nodeDragy, nPairActive, nPairTotal, Pairatom1, Pairatom2, PairID, PairXij, PairYij, prefix, region, ro, rx, rxUnwrap, ry, ryUnwrap, stepCount, timeNow, TotalBondEnergy, uSumPair, virSumBond, virSumBondxx, virSumBondxy, virSumBondyy, virSumPair, virSumPairxx, virSumPairxy, virSumPairyy, vx, and vy.

Referenced by main().

+ Here is the caller graph for this function:

Variable Documentation

◆ prefix

char* prefix = NULL

Definition at line 13 of file main.c.

Referenced by DumpRestart(), DumpState(), main(), and WriteBinaryRestart().