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
d3331ea8
Commit
d3331ea8
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Make use of the Plummer conversion constant for the time-step as well.
parent
9610ab37
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!516
More cosmology work
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gravity/Default/gravity.h
+2
-2
2 additions, 2 deletions
src/gravity/Default/gravity.h
src/kernel_gravity.h
+1
-0
1 addition, 0 deletions
src/kernel_gravity.h
with
3 additions
and
2 deletions
src/gravity/Default/gravity.h
+
2
−
2
View file @
d3331ea8
...
@@ -107,8 +107,8 @@ gravity_compute_timestep_self(const struct gpart* const gp,
...
@@ -107,8 +107,8 @@ gravity_compute_timestep_self(const struct gpart* const gp,
const
float
epsilon
=
gravity_get_softening
(
gp
,
grav_props
);
const
float
epsilon
=
gravity_get_softening
(
gp
,
grav_props
);
/* Note that 0.66666667 = 2. (from Gadget) / 3. (Plummer softening) */
/* Note that 0.66666667 = 2. (from Gadget) / 3. (Plummer softening) */
const
float
dt
=
const
float
dt
=
sqrtf
(
2
.
*
kernel_gravity_softening_plummer_equivalent_inv
*
sqrtf
(
0
.
66666667
f
*
cosmo
->
a
*
grav_props
->
eta
*
epsilon
*
ac_inv
);
cosmo
->
a
*
grav_props
->
eta
*
epsilon
*
ac_inv
);
return
dt
;
return
dt
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/kernel_gravity.h
+
1
−
0
View file @
d3331ea8
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
/*! Conversion factor between Plummer softening and internal softening */
/*! Conversion factor between Plummer softening and internal softening */
#define kernel_gravity_softening_plummer_equivalent 3.
#define kernel_gravity_softening_plummer_equivalent 3.
#define kernel_gravity_softening_plummer_equivalent_inv (1. / 3.)
/**
/**
* @brief Computes the gravity softening function for potential.
* @brief Computes the gravity softening function for potential.
...
...
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