Skip to content
GitLab
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
a954451b
Commit
a954451b
authored
Mar 13, 2017
by
Bert Vandenbroucke
Browse files
Started implementing 2D Voronoi algorithm.
parent
fe9478bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hydro/Shadowswift/voronoi2d_algorithm.h
View file @
a954451b
...
...
@@ -105,7 +105,21 @@ __attribute__((always_inline)) INLINE void voronoi_cell_init(
* @param id ID of the interacting neighbour.
*/
__attribute__
((
always_inline
))
INLINE
void
voronoi_cell_interact
(
struct
voronoi_cell
*
cell
,
float
*
dx
,
unsigned
long
long
id
)
{}
struct
voronoi_cell
*
cell
,
float
*
dx
,
unsigned
long
long
id
)
{
float
half_dx
[
2
];
float
r2
;
/* we need a vector with half the size of the vector joining generator and
neighbour, pointing to the neighbour */
half_dx
[
0
]
=
-
0
.
5
f
*
dx
[
0
];
half_dx
[
1
]
=
-
0
.
5
f
*
dx
[
1
];
/* we need the squared length of this vector */
r2
=
half_dx
[
0
]
*
half_dx
[
0
]
+
half_dx
[
1
]
*
half_dx
[
1
];
(
void
)
r2
;
}
/**
* @brief Finalize a 2D Voronoi cell
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment