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

Go to the source code of this file.

Functions

void EvalCom ()
 

Function Documentation

◆ 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 }
int nAtom
Definition global.h:24
double ComYRatio
Definition global.h:47
double * atomMass
double ComY
Definition global.h:47
int * molID
double ComXRatio
Definition global.h:47
double ComX0
Definition global.h:47
double ComY0
Definition global.h:47
double * ryUnwrap
Definition global.h:51
double timeNow
Definition global.h:20
double * rxUnwrap
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: