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
8200f3d1
Commit
8200f3d1
authored
8 years ago
by
James Willis
Browse files
Options
Downloads
Patches
Plain Diff
Remove ci location from both ci and cj particle positions to move them to the local ci frame.
parent
430c4276
No related branches found
No related tags found
1 merge request
!320
Dopair1 vectorisation merge
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cache.h
+6
-4
6 additions, 4 deletions
src/cache.h
with
6 additions
and
4 deletions
src/cache.h
+
6
−
4
View file @
8200f3d1
...
...
@@ -64,6 +64,8 @@ struct cache {
int
count
;
};
struct
cache
cj_cache
;
/* Secondary cache struct to hold a list of interactions between two
* particles.*/
struct
c2_cache
{
...
...
@@ -170,7 +172,7 @@ __attribute__((always_inline)) INLINE void cache_read_particles(
__attribute__
((
always_inline
))
INLINE
void
cache_read_two_cells
(
const
struct
cell
*
const
ci
,
const
struct
cell
*
const
cj
,
struct
cache
*
const
ci_cache
,
struct
cache
*
const
cj_cache
,
const
double
*
const
shift
)
{
/* Shift the particles positions to a local frame so single precision can be
/* Shift the particles positions to a local frame
(ci frame)
so single precision can be
* used instead of double precision. Also shift the cell ci, particles positions due to BCs but leave cell cj. */
for
(
int
i
=
0
;
i
<
ci
->
count
;
i
++
)
{
ci_cache
->
x
[
i
]
=
ci
->
parts
[
i
].
x
[
0
]
-
ci
->
loc
[
0
]
-
shift
[
0
];
...
...
@@ -185,9 +187,9 @@ __attribute__((always_inline)) INLINE void cache_read_two_cells(
}
for
(
int
i
=
0
;
i
<
cj
->
count
;
i
++
)
{
cj_cache
->
x
[
i
]
=
cj
->
parts
[
i
].
x
[
0
]
-
c
j
->
loc
[
0
];
cj_cache
->
y
[
i
]
=
cj
->
parts
[
i
].
x
[
1
]
-
c
j
->
loc
[
1
];
cj_cache
->
z
[
i
]
=
cj
->
parts
[
i
].
x
[
2
]
-
c
j
->
loc
[
2
];
cj_cache
->
x
[
i
]
=
cj
->
parts
[
i
].
x
[
0
]
-
c
i
->
loc
[
0
];
cj_cache
->
y
[
i
]
=
cj
->
parts
[
i
].
x
[
1
]
-
c
i
->
loc
[
1
];
cj_cache
->
z
[
i
]
=
cj
->
parts
[
i
].
x
[
2
]
-
c
i
->
loc
[
2
];
cj_cache
->
h
[
i
]
=
cj
->
parts
[
i
].
h
;
cj_cache
->
m
[
i
]
=
cj
->
parts
[
i
].
mass
;
...
...
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