Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
6b6defc1
Commit
6b6defc1
authored
Sep 20, 2016
by
Tom Theuns
Browse files
merged with master
parent
7fd9ad30
Changes
5
Hide whitespace changes
Inline
Side-by-side
examples/main.c
View file @
6b6defc1
...
...
@@ -444,14 +444,14 @@ int main(int argc, char *argv[]) {
if
(
with_external_gravity
&&
myrank
==
0
)
potential_print
(
&
potential
);
/* Initialise the cooling function properties */
struct
cooling_data
cooling
;
if
(
with_cooling
)
cooling_init
(
params
,
&
us
,
&
prog_const
,
&
cooling
);
if
(
with_cooling
&&
myrank
==
0
)
cooling_print
(
&
cooling
);
struct
cooling_
function_
data
cooling
_func
;
if
(
with_cooling
)
cooling_init
(
params
,
&
us
,
&
prog_const
,
&
cooling
_func
);
if
(
with_cooling
&&
myrank
==
0
)
cooling_print
(
&
cooling
_func
);
/* Initialise the feedback properties */
struct
sourceterms
sourceterms
;
if
(
with_sourceterms
)
source
_
terms_init
(
params
,
&
us
,
&
sourceterms
);
if
(
with_sourceterms
&&
myrank
==
0
)
source
_
terms_print
(
&
sourceterms
);
if
(
with_sourceterms
)
sourceterms_init
(
params
,
&
us
,
&
sourceterms
);
if
(
with_sourceterms
&&
myrank
==
0
)
sourceterms_print
(
&
sourceterms
);
/* Construct the engine policy */
int
engine_policies
=
ENGINE_POLICY
|
engine_policy_steal
;
...
...
@@ -468,7 +468,7 @@ int main(int argc, char *argv[]) {
struct
engine
e
;
engine_init
(
&
e
,
&
s
,
params
,
nr_nodes
,
myrank
,
nr_threads
,
with_aff
,
engine_policies
,
talking
,
&
us
,
&
prog_const
,
&
hydro_properties
,
&
potential
,
&
cooling
,
&
sourceterms
);
&
potential
,
&
cooling
_func
,
&
sourceterms
);
if
(
myrank
==
0
)
{
clocks_gettime
(
&
toc
);
message
(
"engine_init took %.3f %s."
,
clocks_diff
(
&
tic
,
&
toc
),
...
...
src/engine.c
View file @
6b6defc1
...
...
@@ -3188,7 +3188,7 @@ void engine_init(struct engine *e, struct space *s,
const
struct
phys_const
*
physical_constants
,
const
struct
hydro_props
*
hydro
,
const
struct
external_potential
*
potential
,
const
struct
cooling_data
*
cooling
,
const
struct
cooling_
function_
data
*
cooling
_func
,
struct
sourceterms
*
sourceterms
)
{
/* Clean-up everything */
...
...
@@ -3241,7 +3241,7 @@ void engine_init(struct engine *e, struct space *s,
e
->
physical_constants
=
physical_constants
;
e
->
hydro_properties
=
hydro
;
e
->
external_potential
=
potential
;
e
->
cooling_
data
=
cooling
;
e
->
cooling_
func
=
cooling
_func
;
e
->
sourceterms
=
sourceterms
;
e
->
parameter_file
=
params
;
engine_rank
=
nodeID
;
...
...
src/engine.h
View file @
6b6defc1
...
...
@@ -207,7 +207,7 @@ struct engine {
const
struct
external_potential
*
external_potential
;
/* Properties of the cooling scheme */
const
struct
cooling_data
*
cooling_
data
;
const
struct
cooling_
function_
data
*
cooling_
func
;
/* Properties of source terms */
struct
sourceterms
*
sourceterms
;
...
...
@@ -228,7 +228,7 @@ void engine_init(struct engine *e, struct space *s,
const
struct
phys_const
*
physical_constants
,
const
struct
hydro_props
*
hydro
,
const
struct
external_potential
*
potential
,
const
struct
cooling_data
*
cooling
,
const
struct
cooling_
function_
data
*
cooling
,
struct
sourceterms
*
sourceterms
);
void
engine_launch
(
struct
engine
*
e
,
int
nr_runners
,
unsigned
int
mask
,
unsigned
int
submask
);
...
...
src/sourceterms.c
View file @
6b6defc1
...
...
@@ -35,7 +35,7 @@
* @param us The current internal system of units
* @param source the structure that has all the source term properties
*/
void
source
_
terms_init
(
const
struct
swift_params
*
parameter_file
,
void
sourceterms_init
(
const
struct
swift_params
*
parameter_file
,
struct
UnitSystem
*
us
,
struct
sourceterms
*
source
)
{
#ifdef SN_FEEDBACK
...
...
@@ -54,7 +54,7 @@ void source_terms_init(const struct swift_params* parameter_file,
*
* @param source the structure that has all the source term properties
*/
void
source
_
terms_print
(
const
struct
sourceterms
*
source
)
{
void
sourceterms_print
(
struct
sourceterms
*
source
)
{
#ifdef SN_FEEDBACK
message
(
...
...
src/sourceterms.h
View file @
6b6defc1
...
...
@@ -30,9 +30,9 @@ struct sourceterms {
#endif
};
void
source
_
terms_init
(
const
struct
swift_params
*
parameter_file
,
void
sourceterms_init
(
const
struct
swift_params
*
parameter_file
,
struct
UnitSystem
*
us
,
struct
sourceterms
*
source
);
void
source
_
terms_print
(
const
struct
sourceterms
*
source
);
void
sourceterms_print
(
struct
sourceterms
*
source
);
#ifdef SN_FEEDBACK
#include
"sourceterms/sn_feedback/sn_feedback.h"
#endif
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment