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
1c99b529
Commit
1c99b529
authored
9 years ago
by
Pedro Gonnet
Browse files
Options
Downloads
Patches
Plain Diff
first batch of fixes in space.c.
parent
1802f8f5
No related branches found
No related tags found
2 merge requests
!136
Master
,
!123
Local variable cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/space.c
+5
-5
5 additions, 5 deletions
src/space.c
with
5 additions
and
5 deletions
src/space.c
+
5
−
5
View file @
1c99b529
...
...
@@ -113,15 +113,15 @@ int space_getsid(struct space *s, struct cell **ci, struct cell **cj,
/* Get the sorting index. */
int
sid
=
0
;
for
(
k
=
0
;
k
<
3
;
k
++
)
for
(
int
k
=
0
;
k
<
3
;
k
++
)
sid
=
3
*
sid
+
((
dx
[
k
]
<
0
.
0
)
?
0
:
((
dx
[
k
]
>
0
.
0
)
?
2
:
1
));
/* Switch the cells around? */
if
(
runner_flip
[
sid
])
{
cons
t
cell
*
temp
=
*
ci
;
struc
t
cell
*
temp
=
*
ci
;
*
ci
=
*
cj
;
*
cj
=
temp
;
for
(
k
=
0
;
k
<
3
;
k
++
)
shift
[
k
]
=
-
shift
[
k
];
for
(
int
k
=
0
;
k
<
3
;
k
++
)
shift
[
k
]
=
-
shift
[
k
];
}
sid
=
sortlistID
[
sid
];
...
...
@@ -187,7 +187,7 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
if
(
verbose
)
message
(
"h_max is %.3e (cell_max=%.3e)."
,
h_max
,
cell_max
);
/* Get the new putative cell dimensions. */
int
cdim
[
3
]
int
cdim
[
3
]
;
for
(
int
k
=
0
;
k
<
3
;
k
++
)
cdim
[
k
]
=
floor
(
s
->
dim
[
k
]
/
fmax
(
h_max
*
kernel_gamma
*
space_stretch
,
cell_max
));
...
...
@@ -233,7 +233,7 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
s
->
nr_cells
*
sizeof
(
struct
cell
))
!=
0
)
error
(
"Failed to allocate cells."
);
bzero
(
s
->
cells
,
s
->
nr_cells
*
sizeof
(
struct
cell
));
for
(
k
=
0
;
k
<
s
->
nr_cells
;
k
++
)
for
(
int
k
=
0
;
k
<
s
->
nr_cells
;
k
++
)
if
(
lock_init
(
&
s
->
cells
[
k
].
lock
)
!=
0
)
error
(
"Failed to init spinlock."
);
/* Set the cell location and sizes. */
...
...
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