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
4e3e6da9
Commit
4e3e6da9
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Initialise the softening lengths of the gparts from the parameter file.
parent
7b65cd6d
No related branches found
No related tags found
1 merge request
!324
Gravity multi dt
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/engine.c
+7
-0
7 additions, 0 deletions
src/engine.c
src/gravity/Default/gravity.h
+12
-1
12 additions, 1 deletion
src/gravity/Default/gravity.h
with
19 additions
and
1 deletion
src/engine.c
+
7
−
0
View file @
4e3e6da9
...
...
@@ -2951,6 +2951,13 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
if
(
e
->
nodeID
==
0
)
message
(
"Computing initial gas densities."
);
/* Initialise the softening lengths */
if
(
e
->
policy
&
engine_policy_self_gravity
)
{
for
(
size_t
i
=
0
;
i
<
s
->
nr_gparts
;
++
i
)
gravity_init_softening
(
&
s
->
gparts
[
i
],
e
->
gravity_properties
);
}
/* Construct all cells and tasks to start everything */
engine_rebuild
(
e
);
...
...
This diff is collapsed.
Click to expand it.
src/gravity/Default/gravity.h
+
12
−
1
View file @
4e3e6da9
...
...
@@ -113,9 +113,20 @@ __attribute__((always_inline)) INLINE static void gravity_first_init_gpart(
struct
gpart
*
gp
)
{
gp
->
time_bin
=
0
;
gp
->
epsilon
=
0
.
1
;
// MATTHIEU
gp
->
epsilon
=
0
.
f
;
gravity_init_gpart
(
gp
);
}
/**
* @brief Initialises the softening of the g-particles
*
* @param gp The particle to act upon
*/
__attribute__
((
always_inline
))
INLINE
static
void
gravity_init_softening
(
struct
gpart
*
gp
,
const
struct
gravity_props
*
grav_props
)
{
gp
->
epsilon
=
grav_props
->
epsilon
;
}
#endif
/* SWIFT_DEFAULT_GRAVITY_H */
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