Timothy
0.9
Tissue Modelling Framework
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Macros
main.c
Go to the documentation of this file.
1
/* **************************************************************************
2
* This file is part of Timothy
3
*
4
* Copyright (c) 2014/15 Maciej Cytowski
5
* Copyright (c) 2014/15 ICM, University of Warsaw, Poland
6
*
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
*
21
* *************************************************************************/
22
23
#include<stdio.h>
24
#include<stdlib.h>
25
#include<string.h>
26
#include<mpi.h>
27
#include<omp.h>
28
29
#include "
global.h
"
30
40
int
main
(
int
argc,
char
**argv)
41
{
42
43
MPI_Init(&argc, &argv);
44
MPI_Comm_size(MPI_COMM_WORLD, &
MPIsize
);
45
MPI_Comm_rank(MPI_COMM_WORLD, &
MPIrank
);
46
47
OMPthreads
= omp_get_max_threads();
48
49
simulationInit
(argc, argv);
50
51
for
(
step
= 0;
step
<
nsteps
;
step
++) {
52
53
if
(!(
step
%
statOutStep
))
54
printStepNum
();
55
56
decompositionExecute
();
57
treeBuild
();
58
createExportList
();
59
initCellsToGridExchange
();
60
computePotential
();
61
computePotentialGradient
();
62
63
waitCellsToGridExchange
();
64
fieldsSolve
();
65
interpolateFieldsToCells
();
66
67
if
(!(
step
% statOutStep))
68
statisticsPrint
();
69
70
if
(
simStart
)
71
simTime
+=
secondsPerStep
/ 3600.0;
/* biological process time in hours */
72
73
if
(!(
step
%
vtkOutStep
)) {
74
if
(
vtkout
)
75
ioWriteStepVTK
(
step
);
76
if
(
povout
)
77
ioWriteStepPovRay
(
step
, 0);
78
if
(
vnfout
)
79
ioWriteFields
(
step
);
80
}
81
82
updateCellPositions
();
83
updateCellStates
();
84
commCleanup
();
85
treeFree
();
86
87
if
(!(
step
%
rstOutStep
))
88
saveRstFile
();
89
}
90
91
MPI_Barrier(MPI_COMM_WORLD);
92
93
decompositionFinalize
();
94
randomStreamFree
();
95
cellsCleanup
();
96
97
if
(
MPIrank
== 0)
98
printf(
"\nEnd of simulation run.\n"
);
99
100
MPI_Finalize();
101
102
return
0;
103
}
statOutStep
int statOutStep
Definition:
global.h:214
ioWriteStepPovRay
void ioWriteStepPovRay(int step, int type)
Definition:
io.c:1978
ioWriteFields
void ioWriteFields(int step)
Definition:
io.c:1672
secondsPerStep
float secondsPerStep
Definition:
global.h:247
initCellsToGridExchange
void initCellsToGridExchange()
Definition:
interp.c:598
MPIrank
int MPIrank
Definition:
global.h:134
povout
int povout
Definition:
global.h:181
treeBuild
void treeBuild()
Definition:
tree.c:181
simStart
int simStart
Definition:
global.h:172
treeFree
void treeFree()
Definition:
tree.c:369
decompositionFinalize
void decompositionFinalize()
Definition:
domdec.c:277
vtkOutStep
int vtkOutStep
Definition:
global.h:216
MPIsize
int MPIsize
Definition:
global.h:135
commCleanup
void commCleanup()
Definition:
comm.c:156
nsteps
int nsteps
Definition:
global.h:169
waitCellsToGridExchange
void waitCellsToGridExchange()
Definition:
interp.c:613
printStepNum
void printStepNum()
Definition:
io.c:1215
saveRstFile
void saveRstFile()
Definition:
io.c:1358
global.h
contains the most important global variables, arrays and defines
randomStreamFree
void randomStreamFree()
Definition:
random.c:45
decompositionExecute
void decompositionExecute()
Definition:
domdec.c:240
updateCellPositions
void updateCellPositions()
Definition:
cells.c:504
createExportList
void createExportList()
Definition:
comm.c:64
computePotential
void computePotential()
Definition:
potential.c:287
rstOutStep
int rstOutStep
Definition:
global.h:215
vtkout
int vtkout
Definition:
global.h:180
OMPthreads
int OMPthreads
Definition:
global.h:137
step
int step
Definition:
global.h:173
cellsCleanup
void cellsCleanup()
Definition:
cells.c:434
fieldsSolve
void fieldsSolve()
Definition:
fields.c:131
statisticsPrint
void statisticsPrint()
Definition:
stats.c:153
simTime
float simTime
Definition:
global.h:175
vnfout
int vnfout
Definition:
global.h:182
updateCellStates
void updateCellStates()
Definition:
cells.c:718
ioWriteStepVTK
void ioWriteStepVTK(int step)
Definition:
io.c:1001
simulationInit
void simulationInit(int argc, char **argv)
Definition:
init.c:74
interpolateFieldsToCells
void interpolateFieldsToCells()
Definition:
interp.c:627
main
int main(int argc, char **argv)
Definition:
main.c:40
computePotentialGradient
int computePotentialGradient()
Definition:
gradient.c:183
main.c
Generated on Thu Mar 5 2015 16:34:18 for Timothy by
1.8.6