Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
bcf70b8b
Commit
bcf70b8b
authored
12 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
add count of lowest-level cells.
Former-commit-id: e6ec27b2b732846158fc345c1d29dd77ac1b7019
parent
6fcb84cd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test.c
+24
-1
24 additions, 1 deletion
test.c
with
24 additions
and
1 deletion
test.c
+
24
−
1
View file @
bcf70b8b
...
...
@@ -108,6 +108,23 @@ void map_cells_plot ( struct cell *c , void *data ) {
} */
/**
* @brief Mapping function for neighbour count.
*/
void
map_maxdepth
(
struct
cell
*
c
,
void
*
data
)
{
int
maxdepth
=
((
int
*
)
data
)[
0
];
int
*
count
=
&
((
int
*
)
data
)[
1
];
// printf( "%e\n" , p->count );
if
(
c
->
depth
==
maxdepth
)
*
count
+=
1
;
}
/**
* @brief Mapping function for neighbour count.
*/
...
...
@@ -377,7 +394,9 @@ void pairs_single ( double *dim , struct part *__restrict__ parts , int N , int
int
main
(
int
argc
,
char
*
argv
[]
)
{
int
c
,
icount
,
j
,
k
,
N
=
100
,
periodic
=
1
,
nr_threads
=
1
,
nr_queues
=
-
1
,
runs
=
1
;
int
c
,
icount
,
j
,
k
,
N
=
100
,
periodic
=
1
;
int
nr_threads
=
1
,
nr_queues
=
-
1
,
runs
=
1
;
int
data
[
2
];
double
dim
[
3
]
=
{
1
.
0
,
1
.
0
,
1
.
0
},
shift
[
3
]
=
{
0
.
0
,
0
.
0
,
0
.
0
};
double
r_min
=
0
.
01
,
r_max
=
0
.
1
,
h_max
=
-
1
.
0
,
scaling
=
1
.
0
,
count
=
0
.
0
;
struct
part
*
parts
=
NULL
;
...
...
@@ -493,6 +512,10 @@ int main ( int argc , char *argv[] ) {
printf
(
"main: maximum depth is %d.
\n
"
,
s
.
maxdepth
);
printf
(
"main: cutoffs in [ %.3f %.3f ].
\n
"
,
s
.
r_min
,
s
.
r_max
);
fflush
(
stdout
);
data
[
0
]
=
s
.
maxdepth
;
data
[
1
]
=
0
;
space_map_cells
(
&
s
,
&
map_maxdepth
,
data
);
printf
(
"main: nr of cells at depth %i is %i.
\n
"
,
data
[
0
]
,
data
[
1
]
);
/* Dump the particle positions. */
// space_map_parts( &s , &map_dump , shift );
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment