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
a954451b
Commit
a954451b
authored
8 years ago
by
Bert Vandenbroucke
Browse files
Options
Downloads
Patches
Plain Diff
Started implementing 2D Voronoi algorithm.
parent
fe9478bb
No related branches found
No related tags found
1 merge request
!321
1D and 2D moving mesh algorithm
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/hydro/Shadowswift/voronoi2d_algorithm.h
+15
-1
15 additions, 1 deletion
src/hydro/Shadowswift/voronoi2d_algorithm.h
with
15 additions
and
1 deletion
src/hydro/Shadowswift/voronoi2d_algorithm.h
+
15
−
1
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
...
...
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