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
0ddb59fc
Commit
0ddb59fc
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Don't use the self-gravity time-step criterion yet as we don't have appropriate softening lenghts
parent
1aa5f450
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/task.c
+13
-3
13 additions, 3 deletions
src/task.c
src/task.h
+0
-1
0 additions, 1 deletion
src/task.h
src/timestep.h
+3
-2
3 additions, 2 deletions
src/timestep.h
with
16 additions
and
6 deletions
src/task.c
+
13
−
3
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
)
{
...
...
This diff is collapsed.
Click to expand it.
src/task.h
+
0
−
1
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 */
This diff is collapsed.
Click to expand it.
src/timestep.h
+
3
−
2
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
);
}
...
...
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