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
9c308b79
Commit
9c308b79
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Code formatting
parent
f9f00bb4
No related branches found
No related tags found
1 merge request
!217
Disk patch
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gravity/Default/gravity.h
+3
-3
3 additions, 3 deletions
src/gravity/Default/gravity.h
src/potentials.h
+4
-2
4 additions, 2 deletions
src/potentials.h
with
7 additions
and
5 deletions
src/gravity/Default/gravity.h
+
3
−
3
View file @
9c308b79
...
@@ -47,8 +47,8 @@ gravity_compute_timestep_external(const struct external_potential* potential,
...
@@ -47,8 +47,8 @@ gravity_compute_timestep_external(const struct external_potential* potential,
phys_const
,
gp
));
phys_const
,
gp
));
#endif
#endif
#ifdef EXTERNAL_POTENTIAL_DISK_PATCH
#ifdef EXTERNAL_POTENTIAL_DISK_PATCH
dt
=
dt
=
fminf
(
dt
,
fmin
(
dt
,
external_gravity_disk_patch_timestep
(
potential
,
phys_const
,
gp
));
external_gravity_disk_patch_timestep
(
potential
,
phys_const
,
gp
));
#endif
#endif
return
dt
;
return
dt
;
}
}
...
@@ -135,7 +135,7 @@ __attribute__((always_inline)) INLINE static void gravity_end_force(
...
@@ -135,7 +135,7 @@ __attribute__((always_inline)) INLINE static void gravity_end_force(
* @param gp The particle to act upon.
* @param gp The particle to act upon.
*/
*/
__attribute__
((
always_inline
))
INLINE
static
void
external_gravity
(
__attribute__
((
always_inline
))
INLINE
static
void
external_gravity
(
double
time
,
const
struct
external_potential
*
potential
,
double
time
,
const
struct
external_potential
*
potential
,
const
struct
phys_const
*
const
phys_const
,
struct
gpart
*
gp
)
{
const
struct
phys_const
*
const
phys_const
,
struct
gpart
*
gp
)
{
#ifdef EXTERNAL_POTENTIAL_POINTMASS
#ifdef EXTERNAL_POTENTIAL_POINTMASS
...
...
This diff is collapsed.
Click to expand it.
src/potentials.h
+
4
−
2
View file @
9c308b79
...
@@ -72,7 +72,8 @@ struct external_potential {
...
@@ -72,7 +72,8 @@ struct external_potential {
#ifdef EXTERNAL_POTENTIAL_DISK_PATCH
#ifdef EXTERNAL_POTENTIAL_DISK_PATCH
/**
/**
* @brief Computes the time-step from the acceleration due to a hydrostatic disk.
* @brief Computes the time-step from the acceleration due to a hydrostatic
* disk.
*
*
* See Creasey, Theuns & Bower, 2013, MNRAS, Volume 429, Issue 3, p.1922-1948
* See Creasey, Theuns & Bower, 2013, MNRAS, Volume 429, Issue 3, p.1922-1948
*
*
...
@@ -129,7 +130,8 @@ external_gravity_disk_patch_timestep(const struct external_potential* potential,
...
@@ -129,7 +130,8 @@ external_gravity_disk_patch_timestep(const struct external_potential* potential,
}
}
/**
/**
* @brief Computes the gravitational acceleration along z due to a hydrostatic disk
* @brief Computes the gravitational acceleration along z due to a hydrostatic
* disk
*
*
* See Creasey, Theuns & Bower, 2013, MNRAS, Volume 429, Issue 3, p.1922-1948
* See Creasey, Theuns & Bower, 2013, MNRAS, Volume 429, Issue 3, p.1922-1948
*
*
...
...
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