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
40d813ed
Commit
40d813ed
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Softened gravity in the interactions
parent
b11b3ea6
No related branches found
No related tags found
2 merge requests
!212
Gravity infrastructure
,
!172
[WIP] Self gravity (Barnes-Hut version)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gravity/Default/gravity.h
+3
-1
3 additions, 1 deletion
src/gravity/Default/gravity.h
src/gravity/Default/gravity_iact.h
+8
-9
8 additions, 9 deletions
src/gravity/Default/gravity_iact.h
with
11 additions
and
10 deletions
src/gravity/Default/gravity.h
+
3
−
1
View file @
40d813ed
...
...
@@ -76,7 +76,9 @@ gravity_compute_timestep_self(const struct phys_const* const phys_const,
* @param gp The particle to act upon
*/
__attribute__
((
always_inline
))
INLINE
static
void
gravity_first_init_gpart
(
struct
gpart
*
gp
)
{}
struct
gpart
*
gp
)
{
gp
->
epsilon
=
0
.
1
;
// MATTHIEU
}
/**
* @brief Prepares a g-particle for the gravity calculation
...
...
This diff is collapsed.
Click to expand it.
src/gravity/Default/gravity_iact.h
+
8
−
9
View file @
40d813ed
...
...
@@ -47,31 +47,30 @@ __attribute__((always_inline)) INLINE static void runner_iact_grav_pp(
const
float
uj
=
r
*
hj_inv
;
float
fi
,
fj
,
W
;
if
(
r
>=
hi
)
{
if
(
r
>=
hi
)
{
/* Get Newtonian graavity */
fi
=
mj
*
ir
*
ir
*
ir
;
}
else
{
/* Get softened gravity */
kernel_grav_eval
(
ui
,
&
W
);
fi
=
mj
*
hi_inv3
*
W
;
}
if
(
r
>=
hj
)
{
if
(
r
>=
hj
)
{
/* Get Newtonian graavity */
fj
=
mi
*
ir
*
ir
*
ir
;
}
else
{
/* Get softened gravity */
kernel_grav_eval
(
uj
,
&
W
);
fj
=
mi
*
hj_inv3
*
W
;
}
const
float
fidx
[
3
]
=
{
fi
*
dx
[
0
],
fi
*
dx
[
1
],
fi
*
dx
[
2
]};
gpi
->
a_grav
[
0
]
-=
fidx
[
0
];
gpi
->
a_grav
[
1
]
-=
fidx
[
1
];
...
...
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