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
0ddb59fc
Commit
0ddb59fc
authored
Aug 05, 2016
by
Matthieu Schaller
Browse files
Don't use the self-gravity time-step criterion yet as we don't have appropriate softening lenghts
parent
1aa5f450
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/task.c
View file @
0ddb59fc
...
...
@@ -43,6 +43,7 @@
/* Local headers. */
#include
"atomic.h"
#include
"error.h"
#include
"inline.h"
#include
"lock.h"
/* Task type names. */
...
...
@@ -59,8 +60,11 @@ const char *subtaskID_names[task_type_count] = {"none", "density", "force",
/**
* @brief Computes the overlap between the parts array of two given cells.
*/
size_t
task_cell_overlap_part
(
const
struct
cell
*
ci
,
const
struct
cell
*
cj
)
{
__attribute__
((
always_inline
))
INLINE
static
size_t
task_cell_overlap_part
(
const
struct
cell
*
ci
,
const
struct
cell
*
cj
)
{
if
(
ci
==
NULL
||
cj
==
NULL
)
return
0
;
if
(
ci
->
parts
<=
cj
->
parts
&&
ci
->
parts
+
ci
->
count
>=
cj
->
parts
+
cj
->
count
)
{
return
cj
->
count
;
...
...
@@ -68,14 +72,18 @@ size_t task_cell_overlap_part(const struct cell *ci, const struct cell *cj) {
cj
->
parts
+
cj
->
count
>=
ci
->
parts
+
ci
->
count
)
{
return
ci
->
count
;
}
return
0
;
}
/**
* @brief Computes the overlap between the gparts array of two given cells.
*/
size_t
task_cell_overlap_gpart
(
const
struct
cell
*
ci
,
const
struct
cell
*
cj
)
{
__attribute__
((
always_inline
))
INLINE
static
size_t
task_cell_overlap_gpart
(
const
struct
cell
*
ci
,
const
struct
cell
*
cj
)
{
if
(
ci
==
NULL
||
cj
==
NULL
)
return
0
;
if
(
ci
->
gparts
<=
cj
->
gparts
&&
ci
->
gparts
+
ci
->
gcount
>=
cj
->
gparts
+
cj
->
gcount
)
{
return
cj
->
gcount
;
...
...
@@ -83,6 +91,7 @@ size_t task_cell_overlap_gpart(const struct cell *ci, const struct cell *cj) {
cj
->
gparts
+
cj
->
gcount
>=
ci
->
gparts
+
ci
->
gcount
)
{
return
ci
->
gcount
;
}
return
0
;
}
...
...
@@ -91,7 +100,8 @@ size_t task_cell_overlap_gpart(const struct cell *ci, const struct cell *cj) {
*
* @param t The #task.
*/
enum
task_actions
task_acts_on
(
const
struct
task
*
t
)
{
__attribute__
((
always_inline
))
INLINE
static
enum
task_actions
task_acts_on
(
const
struct
task
*
t
)
{
switch
(
t
->
type
)
{
...
...
src/task.h
View file @
0ddb59fc
...
...
@@ -112,6 +112,5 @@ int task_lock(struct task *t);
void
task_print_mask
(
unsigned
int
mask
);
void
task_print_submask
(
unsigned
int
submask
);
void
task_do_rewait
(
struct
task
*
t
);
enum
task_actions
task_acts_on
(
const
struct
task
*
t
);
#endif
/* SWIFT_TASK_H */
src/timestep.h
View file @
0ddb59fc
...
...
@@ -106,8 +106,9 @@ __attribute__((always_inline)) INLINE static int get_part_timestep(
const
float
new_dt_external
=
gravity_compute_timestep_external
(
e
->
external_potential
,
e
->
physical_constants
,
p
->
gpart
);
const
float
new_dt_self
=
gravity_compute_timestep_self
(
e
->
physical_constants
,
p
->
gpart
);
/* const float new_dt_self = */
/* gravity_compute_timestep_self(e->physical_constants, p->gpart); */
const
float
new_dt_self
=
FLT_MAX
;
// MATTHIEU
new_dt_grav
=
fminf
(
new_dt_external
,
new_dt_self
);
}
...
...
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