Lemina
A molecular dynamics package for network, granular material and point particles with a range of interaction potential.
Loading...
Searching...
No Matches
EvalVacf.c
Go to the documentation of this file.
1
/*
2
* This file is part of Lamina.
3
*
4
* Lamina is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* Lamina is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with Lamina. If not, see <https://www.gnu.org/licenses/>.
16
17
Copyright (C) 2025 Harish Charan, University of Durham, UK
18
19
*/
20
21
22
#include<stdio.h>
23
#include"
global.h
"
24
25
void
AccumVacf
();
26
void
EvalVacf
(){
27
int
n, nb, ni;
28
double
viscVec = 0.;
29
double
v[3];
30
for
(n = 1 ; n <=
nAtom
; n ++){
31
v[1] =
vx
[n] - 0.5*
ax
[n]*
deltaT
;
32
v[2] =
vy
[n] - 0.5*
ay
[n]*
deltaT
;
33
viscVec += v[1]*v[2];
34
}
35
viscVec +=
rfAtom
;
36
for
(nb = 1 ; nb <=
nBuffAcf
; nb ++){
37
indexAcf
[nb] ++;
38
if
(
indexAcf
[nb] <= 0)
continue
;
39
if
(
indexAcf
[nb] == 1){
40
viscAcfOrg
[nb] = viscVec;
41
}
42
ni =
indexAcf
[nb];
43
viscAcf
[nb][ni] =
viscAcfOrg
[nb]*viscVec;
44
}
45
AccumVacf
();
46
}
EvalVacf
void EvalVacf()
Definition
EvalVacf.c:26
AccumVacf
void AccumVacf()
Definition
AccumVacf.c:27
global.h
nAtom
int nAtom
Definition
global.h:24
rfAtom
double rfAtom
nBuffAcf
int nBuffAcf
Definition
global.h:100
ay
double * ay
Definition
global.h:17
vx
double * vx
Definition
global.h:17
indexAcf
double * indexAcf
deltaT
double deltaT
Definition
global.h:20
ax
double * ax
Definition
global.h:17
viscAcf
double ** viscAcf
Definition
global.h:99
viscAcfOrg
double * viscAcfOrg
Definition
global.h:99
vy
double * vy
Definition
global.h:17
source
EvalVacf.c
Generated by
1.13.2