Lemina
A molecular dynamics package for network, granular material and point particles with a range of interaction potential.
Loading...
Searching...
No Matches
ApplyForce.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<stdlib.h>
23
#include"
global.h
"
24
25
void
ApplyForce
(){
26
int
n;
27
double
lx;
28
lx =
regionH
[1];
29
fyExtern
= (
FyBylx
* lx)/
nAtomBlock
;
30
fxExtern
=
fxByfy
*
fyExtern
;
31
forceSumxExtern
=
fxExtern
*
nAtomBlock
;
forceSumyExtern
=
fyExtern
*
nAtomBlock
;
32
33
for
(n = 1; n <=
nAtom
; n ++){
34
if
(
molID
[n] == 2){
35
fx
[n] +=
fxExtern
;
36
fy
[n] -=
fyExtern
;
37
} } }
ApplyForce
void ApplyForce()
Definition
ApplyForce.c:25
global.h
nAtom
int nAtom
Definition
global.h:24
FyBylx
double FyBylx
Definition
global.h:53
nAtomBlock
int nAtomBlock
Definition
global.h:76
molID
int * molID
fy
double * fy
Definition
global.h:17
fyExtern
double fyExtern
Definition
global.h:53
forceSumyExtern
double forceSumyExtern
Definition
global.h:53
fxByfy
double fxByfy
Definition
global.h:53
regionH
double regionH[2+1]
Definition
global.h:20
fxExtern
double fxExtern
forceSumxExtern
double forceSumxExtern
Definition
global.h:53
fx
double * fx
Definition
global.h:17
source
ApplyForce.c
Generated by
1.13.2