Lemina
A molecular dynamics package for network, granular material and point particles with a range of interaction potential.
Loading...
Searching...
No Matches
AccumVacf.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
#include<stdio.h>
22
#include"
global.h
"
23
24
double
Integrate
(
double
*,
int
);
25
void
PrintVacf
();
26
void
ZeroVacf
();
27
void
AccumVacf
(){
28
double
fac;
29
int
j, nb;
30
for
(nb = 1 ; nb <=
nBuffAcf
; nb ++){
31
if
(
indexAcf
[nb] ==
nValAcf
){
32
for
(j = 1 ; j <=
nValAcf
; j ++){
33
viscAcfAv
[j] +=
viscAcf
[nb][j];
34
}
35
indexAcf
[nb] = 0;
36
countAcfAv
++;
37
if
(
countAcfAv
==
limitAcfAv
){
38
fac = 1./(
kinEnergy
*
region
[1]*
region
[2]*
limitAcfAv
);
39
viscAcfInt
= fac*
stepAcf
*
deltaT
*
Integrate
(
viscAcfAv
,
nValAcf
);
40
PrintVacf
();
41
ZeroVacf
();
42
} } } }
43
PrintVacf
void PrintVacf()
Definition
PrintVacf.c:25
Integrate
double Integrate(double *, int)
Definition
Integrate.c:25
AccumVacf
void AccumVacf()
Definition
AccumVacf.c:27
ZeroVacf
void ZeroVacf()
Definition
ZeroVacf.c:25
global.h
viscAcfAv
double * viscAcfAv
Definition
global.h:99
viscAcfInt
double viscAcfInt
Definition
global.h:99
region
double region[2+1]
kinEnergy
double kinEnergy
Definition
global.h:20
nValAcf
int nValAcf
nBuffAcf
int nBuffAcf
Definition
global.h:100
stepAcf
int stepAcf
Definition
global.h:100
indexAcf
double * indexAcf
deltaT
double deltaT
Definition
global.h:20
viscAcf
double ** viscAcf
Definition
global.h:99
limitAcfAv
int limitAcfAv
Definition
global.h:100
countAcfAv
int countAcfAv
Definition
global.h:100
source
AccumVacf.c
Generated by
1.13.2