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
880d66a9
Commit
880d66a9
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Documentation of the external potentials.
parent
8d2e7c83
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/potentials.h
+21
-15
21 additions, 15 deletions
src/potentials.h
with
21 additions
and
15 deletions
src/potentials.h
+
21
−
15
View file @
880d66a9
...
...
@@ -78,13 +78,15 @@ struct external_potential {
*
* See Creasey, Theuns & Bower, 2013, MNRAS, Volume 429, Issue 3, p.1922-1948
*
* @param phys_cont The physical constants in internal units.
* @param gp Pointer to the g-particle data.
* @param potential The properties of the potential.
* @param phys_const The physical constants in internal units.
* @param g Pointer to the g-particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
float
external_gravity_disk_patch_timestep
(
const
struct
external_potential
*
potential
,
const
struct
phys_const
*
const
phys_const
,
const
struct
gpart
*
const
g
)
{
external_gravity_disk_patch_timestep
(
const
struct
external_potential
*
restrict
potential
,
const
struct
phys_const
*
restrict
phys_const
,
const
struct
gpart
*
restrict
g
)
{
/* initilize time step to disk dynamical time */
const
float
dt_dyn
=
potential
->
disk_patch_potential
.
dynamical_time
;
...
...
@@ -136,13 +138,15 @@ external_gravity_disk_patch_timestep(const struct external_potential* potential,
*
* See Creasey, Theuns & Bower, 2013, MNRAS, Volume 429, Issue 3, p.1922-1948
*
* @param phys_cont The physical constants in internal units.
* @param time The current time in internal units.
* @param potential The properties of the potential.
* @param phys_const The physical constants in internal units.
* @param g Pointer to the g-particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
external_gravity_disk_patch_potential
(
const
double
time
,
const
struct
external_potential
*
potential
,
const
struct
phys_const
*
cons
t
phys_const
,
struct
gpart
*
g
)
{
double
time
,
const
struct
external_potential
*
restrict
potential
,
const
struct
phys_const
*
restric
t
phys_const
,
struct
gpart
*
restrict
g
)
{
const
float
G_newton
=
phys_const
->
const_newton_G
;
const
float
dz
=
g
->
x
[
2
]
-
potential
->
disk_patch_potential
.
z_disk
;
...
...
@@ -178,8 +182,9 @@ external_gravity_disk_patch_potential(
*/
__attribute__
((
always_inline
))
INLINE
static
float
external_gravity_isothermalpotential_timestep
(
const
struct
external_potential
*
potential
,
const
struct
phys_const
*
const
phys_const
,
const
struct
gpart
*
const
g
)
{
const
struct
external_potential
*
restrict
potential
,
const
struct
phys_const
*
restrict
phys_const
,
const
struct
gpart
*
restrict
g
)
{
const
float
dx
=
g
->
x
[
0
]
-
potential
->
isothermal_potential
.
x
;
const
float
dy
=
g
->
x
[
1
]
-
potential
->
isothermal_potential
.
y
;
...
...
@@ -247,9 +252,10 @@ external_gravity_isothermalpotential(const struct external_potential* potential,
* @param g Pointer to the g-particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
float
external_gravity_pointmass_timestep
(
const
struct
external_potential
*
potential
,
const
struct
phys_const
*
const
phys_const
,
const
struct
gpart
*
const
g
)
{
external_gravity_pointmass_timestep
(
const
struct
external_potential
*
restrict
potential
,
const
struct
phys_const
*
restrict
phys_const
,
const
struct
gpart
*
restrict
g
)
{
const
float
G_newton
=
phys_const
->
const_newton_G
;
const
float
dx
=
g
->
x
[
0
]
-
potential
->
point_mass
.
x
;
...
...
@@ -284,8 +290,8 @@ external_gravity_pointmass_timestep(const struct external_potential* potential,
* @param g Pointer to the g-particle data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
external_gravity_pointmass
(
const
struct
external_potential
*
potential
,
const
struct
phys_const
*
cons
t
phys_const
,
struct
gpart
*
g
)
{
const
struct
external_potential
*
restrict
potential
,
const
struct
phys_const
*
restric
t
phys_const
,
struct
gpart
*
restrict
g
)
{
const
float
dx
=
g
->
x
[
0
]
-
potential
->
point_mass
.
x
;
const
float
dy
=
g
->
x
[
1
]
-
potential
->
point_mass
.
y
;
...
...
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