Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88130351
dummy.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Oct 16, 23:20
Size
1 KB
Mime Type
text/x-c
Expires
Fri, Oct 18, 23:20 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
21720160
Attached To
rLAMMPS lammps
dummy.c
View Options
/* program to generate dummy data set */
/* Mike Uttormark 7/16/92 */
/* Sandia Nat'l Labs 1421 */
/* On leave from University of Wisconsin--Madison */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#define RANGE 5.0
#define STEPS 2000
#define PI 3.14159
#define S 50
#ifdef MISSINGDEFS
int printf(char *, ...);
#endif
int main(int argc, char **argv);
int main(int argc, char **argv)
{
int i, j, step, npart;
int nsteps;
if (argc < 2)
nsteps = STEPS;
else
nsteps = atoi(argv[1]);
if (argc < 3)
npart = 1;
else
npart = atoi(argv[2]);
for(step = 0; step < nsteps; step++) {
printf("ITEM: TIME\n%g\n", (float) step);
if (step == 0) {
printf("ITEM: BOUNDS\n");
for (i = 3; i; i--)
printf("%g, %g\n", -RANGE, RANGE);
}
printf("ITEM: POSITIONS\n");
for( j = 0; j < npart; j++)
printf("%i, %i, %g, %g, %g\n",
j+1,
1 + j%4,
RANGE*sin(2*PI*(step+j)/S),
RANGE*cos(0.25*PI*(step+j)/S),
RANGE*sin(5*PI*(step+j)/S));
if (npart > 1) {
printf("ITEM: BONDS\n");
for ( j = 0; j < npart-1; j++)
printf("%i %i %i\n", 1 + j%4, j+1, j+2);
}
}
}
Event Timeline
Log In to Comment