Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
52507e8b
Commit
52507e8b
authored
Oct 09, 2017
by
James Willis
Browse files
Pad cache smoothing lengths with sensible values proportional to the cell.
parent
a0a916ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cache.h
View file @
52507e8b
...
...
@@ -398,13 +398,14 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
const
float
pos_padded
[
3
]
=
{
-
(
2
.
*
ci
->
width
[
0
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
1
]
+
max_dx
),
-
(
2
.
*
ci
->
width
[
2
]
+
max_dx
)};
const
float
h_padded
=
ci
->
parts
[
0
].
h
;
for
(
int
i
=
ci
->
count
-
first_pi_align
;
i
<
ci
->
count
-
first_pi_align
+
VEC_SIZE
;
i
++
)
{
x
[
i
]
=
pos_padded
[
0
];
y
[
i
]
=
pos_padded
[
1
];
z
[
i
]
=
pos_padded
[
2
];
h
[
i
]
=
1
.
f
;
h
[
i
]
=
h_padded
;
m
[
i
]
=
1
.
f
;
vx
[
i
]
=
1
.
f
;
...
...
@@ -470,11 +471,13 @@ __attribute__((always_inline)) INLINE void cache_read_two_partial_cells_sorted(
const
float
pos_padded_j
[
3
]
=
{
-
(
2
.
*
cj
->
width
[
0
]
+
max_dx
),
-
(
2
.
*
cj
->
width
[
1
]
+
max_dx
),
-
(
2
.
*
cj
->
width
[
2
]
+
max_dx
)};
const
float
h_padded_j
=
cj
->
parts
[
0
].
h
;
for
(
int
i
=
last_pj_align
+
1
;
i
<
last_pj_align
+
1
+
VEC_SIZE
;
i
++
)
{
xj
[
i
]
=
pos_padded_j
[
0
];
yj
[
i
]
=
pos_padded_j
[
1
];
zj
[
i
]
=
pos_padded_j
[
2
];
hj
[
i
]
=
1
.
f
;
hj
[
i
]
=
h_padded_j
;
mj
[
i
]
=
1
.
f
;
vxj
[
i
]
=
1
.
f
;
vyj
[
i
]
=
1
.
f
;
...
...
Write
Preview
Supports
Markdown
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