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
f849e58a
Commit
f849e58a
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Documentation fixes and restored default configuration file.
parent
f22a6a40
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!217
Disk patch
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/const.h
+5
-6
5 additions, 6 deletions
src/const.h
src/gravity/Default/gravity.h
+2
-1
2 additions, 1 deletion
src/gravity/Default/gravity.h
src/potentials.c
+3
-2
3 additions, 2 deletions
src/potentials.c
src/potentials.h
+5
-9
5 additions, 9 deletions
src/potentials.h
with
15 additions
and
18 deletions
src/const.h
+
5
−
6
View file @
f849e58a
...
@@ -36,8 +36,7 @@
...
@@ -36,8 +36,7 @@
/* Time integration constants. */
/* Time integration constants. */
#define const_max_u_change 0.1f
#define const_max_u_change 0.1f
/* Thermal energy per unit mass to use as a constant when using an isothermal
/* Thermal energy per unit mass used as a constant for the isothermal EoS */
* EoS */
#define const_isothermal_internal_energy 20.2615290634f
#define const_isothermal_internal_energy 20.2615290634f
/* Dimensionality of the problem */
/* Dimensionality of the problem */
...
@@ -51,8 +50,8 @@
...
@@ -51,8 +50,8 @@
//#define HYDRO_GAMMA_2_1
//#define HYDRO_GAMMA_2_1
/* Equation of state choice */
/* Equation of state choice */
//
#define EOS_IDEAL_GAS
#define EOS_IDEAL_GAS
#define EOS_ISOTHERMAL_GAS
//
#define EOS_ISOTHERMAL_GAS
/* Kernel function to use */
/* Kernel function to use */
#define CUBIC_SPLINE_KERNEL
#define CUBIC_SPLINE_KERNEL
...
@@ -74,9 +73,9 @@
...
@@ -74,9 +73,9 @@
#define const_gravity_eta 0.025f
#define const_gravity_eta 0.025f
/* External gravity properties */
/* External gravity properties */
//
#define EXTERNAL_POTENTIAL_POINTMASS
#define EXTERNAL_POTENTIAL_POINTMASS
//#define EXTERNAL_POTENTIAL_ISOTHERMALPOTENTIAL
//#define EXTERNAL_POTENTIAL_ISOTHERMALPOTENTIAL
#define EXTERNAL_POTENTIAL_DISK_PATCH
//
#define EXTERNAL_POTENTIAL_DISK_PATCH
/* Add viscuous force to gas particles to speed-up glass making for disk-patch
/* Add viscuous force to gas particles to speed-up glass making for disk-patch
* ICs */
* ICs */
//#define EXTERNAL_POTENTIAL_DISK_PATCH_ICS
//#define EXTERNAL_POTENTIAL_DISK_PATCH_ICS
...
...
This diff is collapsed.
Click to expand it.
src/gravity/Default/gravity.h
+
2
−
1
View file @
f849e58a
...
@@ -129,12 +129,13 @@ __attribute__((always_inline)) INLINE static void gravity_end_force(
...
@@ -129,12 +129,13 @@ __attribute__((always_inline)) INLINE static void gravity_end_force(
*
*
* This function only branches towards the potential chosen by the user.
* This function only branches towards the potential chosen by the user.
*
*
* @param time The current time in internal units.
* @param potential The properties of the external potential.
* @param potential The properties of the external potential.
* @param phys_const The physical constants in internal units.
* @param phys_const The physical constants in internal units.
* @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
(
const
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.c
+
3
−
2
View file @
f849e58a
...
@@ -29,12 +29,13 @@
...
@@ -29,12 +29,13 @@
* of units.
* of units.
*
*
* @param parameter_file The parsed parameter file
* @param parameter_file The parsed parameter file
* @param phys_const Physical constants in internal units
* @param us The current internal system of units
* @param us The current internal system of units
* @param potential The external potential properties to initialize
* @param potential The external potential properties to initialize
*/
*/
void
potential_init
(
const
struct
swift_params
*
parameter_file
,
void
potential_init
(
const
struct
swift_params
*
parameter_file
,
const
struct
phys_const
*
const
phys_const
,
const
struct
phys_const
*
phys_const
,
struct
UnitSystem
*
us
,
const
struct
UnitSystem
*
us
,
struct
external_potential
*
potential
)
{
struct
external_potential
*
potential
)
{
#ifdef EXTERNAL_POTENTIAL_POINTMASS
#ifdef EXTERNAL_POTENTIAL_POINTMASS
...
...
This diff is collapsed.
Click to expand it.
src/potentials.h
+
5
−
9
View file @
f849e58a
...
@@ -162,9 +162,6 @@ external_gravity_disk_patch_potential(
...
@@ -162,9 +162,6 @@ external_gravity_disk_patch_potential(
G_newton
;
/* returned acceleraton is multiplied by G later on */
G_newton
;
/* returned acceleraton is multiplied by G later on */
if
(
dz
<
0
)
g
->
a_grav
[
2
]
+=
z_accel
/
G_newton
;
if
(
dz
<
0
)
g
->
a_grav
[
2
]
+=
z_accel
/
G_newton
;
if
(
abs
(
g
->
id_or_neg_offset
)
==
1
)
message
(
" time= %e, rf= %e, az= %e"
,
time
,
reduction_factor
,
g
->
a_grav
[
2
]);
#ifdef EXTERNAL_POTENTIAL_DISK_PATCH_ICS
#ifdef EXTERNAL_POTENTIAL_DISK_PATCH_ICS
/* TT: add viscous drag */
/* TT: add viscous drag */
g
->
a_grav
[
0
]
-=
g
->
v_full
[
0
]
/
(
2
*
t_dyn
)
/
G_newton
;
g
->
a_grav
[
0
]
-=
g
->
v_full
[
0
]
/
(
2
*
t_dyn
)
/
G_newton
;
...
@@ -179,7 +176,8 @@ external_gravity_disk_patch_potential(
...
@@ -179,7 +176,8 @@ external_gravity_disk_patch_potential(
#ifdef EXTERNAL_POTENTIAL_ISOTHERMALPOTENTIAL
#ifdef EXTERNAL_POTENTIAL_ISOTHERMALPOTENTIAL
/**
/**
* @brief Computes the time-step due to the acceleration from a point mass
* @brief Computes the time-step due to the acceleration from an isothermal
* potential.
*
*
* @param potential The #external_potential used in the run.
* @param potential The #external_potential used in the run.
* @param phys_const The physical constants in internal units.
* @param phys_const The physical constants in internal units.
...
@@ -213,9 +211,7 @@ external_gravity_isothermalpotential_timestep(
...
@@ -213,9 +211,7 @@ external_gravity_isothermalpotential_timestep(
}
}
/**
/**
* @brief Computes the gravitational acceleration of a particle due to a
* @brief Computes the gravitational acceleration from an isothermal potential.
* point
* mass
*
*
* Note that the accelerations are multiplied by Newton's G constant
* Note that the accelerations are multiplied by Newton's G constant
* later on.
* later on.
...
@@ -315,8 +311,8 @@ __attribute__((always_inline)) INLINE static void external_gravity_pointmass(
...
@@ -315,8 +311,8 @@ __attribute__((always_inline)) INLINE static void external_gravity_pointmass(
/* Now, some generic functions, defined in the source file */
/* Now, some generic functions, defined in the source file */
void
potential_init
(
const
struct
swift_params
*
parameter_file
,
void
potential_init
(
const
struct
swift_params
*
parameter_file
,
const
struct
phys_const
*
const
phys_const
,
const
struct
phys_const
*
phys_const
,
struct
UnitSystem
*
us
,
const
struct
UnitSystem
*
us
,
struct
external_potential
*
potential
);
struct
external_potential
*
potential
);
void
potential_print
(
const
struct
external_potential
*
potential
);
void
potential_print
(
const
struct
external_potential
*
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