Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vladislav Perepelkin
hppca
Commits
323f2460
Commit
323f2460
authored
Nov 07, 2016
by
Vladislav Perepelkin
Browse files
added instruction
parent
9e226d14
Changes
4
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
323f2460
...
...
@@ -7,7 +7,7 @@ run: hpprp FORCE
./hpprp
hpprp
:
hpprp.c config.c collide.c
g++
-fopenmp
-O3
hpprp.c
-o
hpprp
-lrt
-Wall
-pg
g++
-fopenmp
-O3
hpprp.c
-o
hpprp
-lrt
-Wall
collide.c
:
rules.txt scripts/rules_gen.py
python scripts/rules_gen.py rules.txt collide.c
...
...
README.txt
0 → 100644
View file @
323f2460
Задание таблицы переходов: в файле rules.txt
Задание источников: в файле config.c
Запуск программы: make
Выходные результаты: в папках density, move и rest. Строятся файлы для Excel, картинки *.png и видеоролик *.avi
hpprp.c
View file @
323f2460
...
...
@@ -25,6 +25,17 @@ void fill(int i0, int j0, int i1, int j1,
#include "config.c"
#include "collide.c"
void
sources
(
int
iter
)
{
/* Moved to init
if (iter==0) {
fill(0, WIDTH/2-10, HEIGHT, WIDTH/2+10, // area
1.0, 1.0, 1.0, 1.0, // move
0.75, 0.0, 0.0, 0.0); // rest
}
*/
}
inline
int
get_move
(
char
cell
)
{
int
mass
=
0
;
...
...
@@ -122,9 +133,9 @@ void save(int iter)
double
square
=
(
AVERAGING_RADIUS
*
2
+
1
)
*
(
AVERAGING_RADIUS
*
2
+
1
);
double
*
old_density
=
0
,
*
old_move
=
0
,
*
old_rest
=
0
;
sprintf
(
density_path
,
"density/%06d.
txt
"
,
iter
);
sprintf
(
move_path
,
"move/%06d.
txt
"
,
iter
);
sprintf
(
rest_path
,
"rest/%06d.
txt
"
,
iter
);
sprintf
(
density_path
,
"density/%06d.
xls
"
,
iter
);
sprintf
(
move_path
,
"move/%06d.
xls
"
,
iter
);
sprintf
(
rest_path
,
"rest/%06d.
xls
"
,
iter
);
if
(
ensemble
>
0
)
{
...
...
scripts/rules.txt.example
View file @
323f2460
5
10
16
5
0.33333
0.33333
0.33334
10
0.33333
0.33333
0.33334
16
0.3333
3
0.33333
0.3333
4
5
10
16
5
0.33333
0.33333
0.33334
10
0.33333
0.33333
0.33334
16
0.3333
4
0.33333
0.3333
3
15 21
26
15
0.33333
0.33333
0.33334
21
0.33333
0.33333
0.33334
26
0.33333
0.33333
0.33334
15 21
26
15
0.33333
0.33333
0.33334
21
0.33333
0.33333
0.33334
26
0.33333
0.33333
0.33334
7
18
7
0.1
0.
9
18
0.9
0.
1
7
18
7
0.9
0.
1
18
0.1
0.
9
11
17
11
0.9
0.
1
17
0.1
0.
9
11
17
11
0.1
0.
9
17
0.9
0.
1
13
24
13
0.1
0.
9
24
0.9
0.
1
13
24
13
0.9
0.
1
24
0.1
0.
9
14
20
14
0.9
0.
1
20
0.1
0.
9
14
20
14
0.1
0.
9
20
0.9
0.
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment