Lemina
A molecular dynamics package for network, granular material and point particles with a range of interaction potential.
 
Loading...
Searching...
No Matches
DumpBonds.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
24void DumpBonds(){
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 }
41
42
43
void DumpBonds()
Definition DumpBonds.c:24
int * BondID
int * atom2
Definition global.h:36
int * BondType
Definition global.h:37
double * ro
Definition global.h:38
double * BondLength
Definition global.h:39
int * atom1
FILE * fpbond
int nBond
double * nodeDragy
Definition global.h:42
double timeNow
Definition global.h:20
double regionH[2+1]
Definition global.h:20
double * nodeDragx
Definition global.h:42