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
49a0a67c
Commit
49a0a67c
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Removed the cell_is_neighbour() function.
parent
8ccba960
No related branches found
No related tags found
1 merge request
!333
Gravity multi dt
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cell.c
+2
-30
2 additions, 30 deletions
src/cell.c
src/cell.h
+0
-2
0 additions, 2 deletions
src/cell.h
src/gravity_properties.c
+4
-2
4 additions, 2 deletions
src/gravity_properties.c
with
6 additions
and
34 deletions
src/cell.c
+
2
−
30
View file @
49a0a67c
...
@@ -1102,36 +1102,6 @@ void cell_reset_task_counters(struct cell *c) {
...
@@ -1102,36 +1102,6 @@ void cell_reset_task_counters(struct cell *c) {
#endif
#endif
}
}
/**
* @brief Checks whether the cells are direct neighbours ot not. Both cells have
* to be of the same size
*
* @param ci First #cell.
* @param cj Second #cell.
*
* @todo Deal with periodicity.
*/
int
cell_are_neighbours
(
const
struct
cell
*
restrict
ci
,
const
struct
cell
*
restrict
cj
)
{
#ifdef SWIFT_DEBUG_CHECKS
if
(
ci
->
width
[
0
]
!=
cj
->
width
[
0
])
error
(
"Cells of different size !"
);
#endif
/* Maximum allowed distance */
const
double
min_dist
=
1
.
2
*
ci
->
width
[
0
];
/* 1.2 accounts for rounding errors */
/* (Manhattan) Distance between the cells */
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
const
double
center_i
=
ci
->
loc
[
k
];
const
double
center_j
=
cj
->
loc
[
k
];
if
(
fabs
(
center_i
-
center_j
)
>
min_dist
)
return
0
;
}
return
1
;
}
/**
/**
* @brief Computes the multi-pole brutally and compare to the
* @brief Computes the multi-pole brutally and compare to the
* recursively computed one.
* recursively computed one.
...
@@ -1145,6 +1115,8 @@ void cell_check_multipole(struct cell *c, void *data) {
...
@@ -1145,6 +1115,8 @@ void cell_check_multipole(struct cell *c, void *data) {
struct
gravity_tensors
ma
;
struct
gravity_tensors
ma
;
const
double
tolerance
=
1e-3
;
/* Relative */
const
double
tolerance
=
1e-3
;
/* Relative */
return
;
/* First recurse */
/* First recurse */
if
(
c
->
split
)
if
(
c
->
split
)
for
(
int
k
=
0
;
k
<
8
;
k
++
)
for
(
int
k
=
0
;
k
<
8
;
k
++
)
...
...
This diff is collapsed.
Click to expand it.
src/cell.h
+
0
−
2
View file @
49a0a67c
...
@@ -351,8 +351,6 @@ int cell_link_gparts(struct cell *c, struct gpart *gparts);
...
@@ -351,8 +351,6 @@ int cell_link_gparts(struct cell *c, struct gpart *gparts);
int
cell_link_sparts
(
struct
cell
*
c
,
struct
spart
*
sparts
);
int
cell_link_sparts
(
struct
cell
*
c
,
struct
spart
*
sparts
);
void
cell_convert_hydro
(
struct
cell
*
c
,
void
*
data
);
void
cell_convert_hydro
(
struct
cell
*
c
,
void
*
data
);
void
cell_clean_links
(
struct
cell
*
c
,
void
*
data
);
void
cell_clean_links
(
struct
cell
*
c
,
void
*
data
);
int
cell_are_neighbours
(
const
struct
cell
*
restrict
ci
,
const
struct
cell
*
restrict
cj
);
void
cell_check_multipole
(
struct
cell
*
c
,
void
*
data
);
void
cell_check_multipole
(
struct
cell
*
c
,
void
*
data
);
void
cell_clean
(
struct
cell
*
c
);
void
cell_clean
(
struct
cell
*
c
);
void
cell_check_particle_drift_point
(
struct
cell
*
c
,
void
*
data
);
void
cell_check_particle_drift_point
(
struct
cell
*
c
,
void
*
data
);
...
...
This diff is collapsed.
Click to expand it.
src/gravity_properties.c
+
4
−
2
View file @
49a0a67c
...
@@ -59,7 +59,8 @@ void gravity_props_init(struct gravity_props *p,
...
@@ -59,7 +59,8 @@ void gravity_props_init(struct gravity_props *p,
void
gravity_props_print
(
const
struct
gravity_props
*
p
)
{
void
gravity_props_print
(
const
struct
gravity_props
*
p
)
{
message
(
"Self-gravity scheme: FMM-MM"
);
message
(
"Self-gravity scheme: FMM-MM with m-poles of order %d"
,
SELF_GRAVITY_MULTIPOLE_ORDER
);
message
(
"Self-gravity time integration: eta=%.4f"
,
p
->
eta
);
message
(
"Self-gravity time integration: eta=%.4f"
,
p
->
eta
);
...
@@ -68,7 +69,7 @@ void gravity_props_print(const struct gravity_props *p) {
...
@@ -68,7 +69,7 @@ void gravity_props_print(const struct gravity_props *p) {
message
(
"Self-gravity softening: epsilon=%.4f"
,
p
->
epsilon
);
message
(
"Self-gravity softening: epsilon=%.4f"
,
p
->
epsilon
);
if
(
p
->
a_smooth
!=
gravity_props_default_a_smooth
)
if
(
p
->
a_smooth
!=
gravity_props_default_a_smooth
)
message
(
"Self-gravity smoothing-scale: a_smooth=%f"
,
p
->
a_smooth
);
message
(
"Self-gravity
MM
smoothing-scale: a_smooth=%f"
,
p
->
a_smooth
);
if
(
p
->
r_cut
!=
gravity_props_default_r_cut
)
if
(
p
->
r_cut
!=
gravity_props_default_r_cut
)
message
(
"Self-gravity MM cut-off: r_cut=%f"
,
p
->
r_cut
);
message
(
"Self-gravity MM cut-off: r_cut=%f"
,
p
->
r_cut
);
...
@@ -81,6 +82,7 @@ void gravity_props_print_snapshot(hid_t h_grpgrav,
...
@@ -81,6 +82,7 @@ void gravity_props_print_snapshot(hid_t h_grpgrav,
io_write_attribute_f
(
h_grpgrav
,
"Time integration eta"
,
p
->
eta
);
io_write_attribute_f
(
h_grpgrav
,
"Time integration eta"
,
p
->
eta
);
io_write_attribute_f
(
h_grpgrav
,
"Softening length"
,
p
->
epsilon
);
io_write_attribute_f
(
h_grpgrav
,
"Softening length"
,
p
->
epsilon
);
io_write_attribute_f
(
h_grpgrav
,
"Opening angle"
,
p
->
theta_crit
);
io_write_attribute_f
(
h_grpgrav
,
"Opening angle"
,
p
->
theta_crit
);
io_write_attribute_d
(
h_grpgrav
,
"MM order"
,
SELF_GRAVITY_MULTIPOLE_ORDER
);
io_write_attribute_f
(
h_grpgrav
,
"MM a_smooth"
,
p
->
a_smooth
);
io_write_attribute_f
(
h_grpgrav
,
"MM a_smooth"
,
p
->
a_smooth
);
io_write_attribute_f
(
h_grpgrav
,
"MM r_cut"
,
p
->
r_cut
);
io_write_attribute_f
(
h_grpgrav
,
"MM r_cut"
,
p
->
r_cut
);
}
}
...
...
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