Repository navigation
Expand file tree
/
Copy pathmain.c
More file actions
93 lines (75 loc) · 2.52 KB
/
Copy pathmain.c
File metadata and controls
93 lines (75 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#include "Ce_MPS.h"
int main(int argc, char* argv[]){
int result = 0, shape = NORMAL;
asym = OFF;
while((result = getopt(argc, argv, "hs:y")) != -1){
switch(result){
case 'h': // help
printf("Usage: By adding options below, you can change the shape and the color of cell.\n");
printf(" -s [shape] : (shape = normal, square, rectangle, triangle, circle, vshape, lshape)\n");
printf(" (default: normal)\n");
printf(" -y: asymmetry division (shape is Normal when asymmetry)\n");
exit(0);
case 's': // shape
if(strcmp(optarg, "normal") == 0){
shape = NORMAL;
} else if(strcmp(optarg, "square") == 0){
shape = SQUARE;
} else if(strcmp(optarg, "rectangle") == 0){
shape = RECTANGLE;
} else if(strcmp(optarg, "triangle") == 0){
shape = TRIANGLE;
} else if(strcmp(optarg, "circle") == 0){
shape = CIRCLE;
} else if(strcmp(optarg, "vshape") == 0){
shape = VSHAPE;
} else if(strcmp(optarg, "lshape") == 0){
shape = VSHAPE_2;
} else{
printf("Incorrect shape specification (shape = normal, square, rectangle, triangle, circle, vshape, lshape)\n");
exit(1);
}
break;
case 'y': // asymmetry division
asym = ON;
shape = NORMAL;
break;
default: // other case
printf("Usage: By adding options below, you can change the shape and the color of cell.\n");
printf(" -s [shape] : (shape = normal, square, rectangle, triangle, circle, vshape, lshape)\n");
printf(" (default: normal)\n");
printf(" -y: asymmetry division (shape is Normal when asymmetry)\n");
exit(1);
}
}
printf("\n*** START PARTICLE-SIMULATION! ***\n");
makeOutputDir();
mallocVariables();
initialize_Position_and_Velocity(shape);
printf("Finish initializing : Num of Particles = %d\n", Num_of_Particles);
initializeBucket();
writeInitialData();
calc_ConstantParam();
if(DEBUG != ON){
inputAdjacentParticle(argv[argc-1]);
replacePointNum();
searchAdjacentTriangle();
// outputForGnuplot();
}
printf("Loop START!!!\n");
mainSimulation();
printf("Loop END!!!\n");
if(OUTPUT_CSV == ON){
writePointData();
}
if(OUTPUT_MEM_CSV == ON){
writeMembraneData();
}
writeData();
writeSetting(0);
printf("*** END ***\n");
sendNotification();
freeVariables();
freeBucket();
return 0;
}