Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
SWIFTsim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
72
Issues
72
List
Boards
Labels
Milestones
Merge Requests
14
Merge Requests
14
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SWIFT
SWIFTsim
Commits
d22a3689
Commit
d22a3689
authored
Sep 04, 2020
by
Mladen Ivkovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added rt struct
parent
30ac285b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
140 additions
and
0 deletions
+140
-0
src/hydro/Gadget2/hydro_part.h
src/hydro/Gadget2/hydro_part.h
+4
-0
src/rt/debug/rt.h
src/rt/debug/rt.h
+40
-0
src/rt/debug/rt_struct.h
src/rt/debug/rt_struct.h
+41
-0
src/rt_struct.h
src/rt_struct.h
+41
-0
src/space.c
src/space.c
+8
-0
src/stars/GEAR/stars.h
src/stars/GEAR/stars.h
+2
-0
src/stars/GEAR/stars_part.h
src/stars/GEAR/stars_part.h
+4
-0
No files found.
src/hydro/Gadget2/hydro_part.h
View file @
d22a3689
...
...
@@ -40,6 +40,7 @@
#include "star_formation_struct.h"
#include "timestep_limiter_struct.h"
#include "tracers_struct.h"
#include "rt_struct.h"
/* Extra particle data not needed during the SPH loops over neighbours. */
struct
xpart
{
...
...
@@ -71,6 +72,9 @@ struct xpart {
/* Additional data used by the feedback */
struct
feedback_part_data
feedback_data
;
/* Additional Radiative Transfer Data */
struct
rt_xpart_data
rt_data
;
#ifdef WITH_LOGGER
/* Additional data for the particle logger */
struct
logger_part_data
logger_data
;
...
...
src/rt/debug/rt.h
View file @
d22a3689
...
...
@@ -31,4 +31,44 @@ __attribute__((always_inline)) INLINE static void rt_dummy_function(void) {
message
(
"Called debug RT scheme."
);
}
/**
* @brief First initialisation of the RT extra hydro partilce data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
rt_first_init_xpart
(
struct
xpart
*
restrict
xp
)
{
xp
->
rt_data
.
iact_stars
=
0
;
xp
->
rt_data
.
calls_tot
=
0
;
xp
->
rt_data
.
calls_per_step
=
0
;
}
/**
* @brief Initialisation of the RT extra hydro partilce data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
rt_init_xpart
(
struct
xpart
*
restrict
xp
)
{
xp
->
rt_data
.
iact_stars
=
0
;
xp
->
rt_data
.
calls_per_step
=
0
;
}
/**
* @brief First initialisation of the RT extra star partilce data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
rt_first_init_spart
(
struct
spart
*
restrict
sp
)
{
sp
->
rt_data
.
iact_hydro
=
0
;
sp
->
rt_data
.
calls_tot
=
0
;
sp
->
rt_data
.
calls_per_step
=
0
;
}
/**
* @brief First initialisation of the RT extra star partilce data.
*/
__attribute__
((
always_inline
))
INLINE
static
void
rt_init_spart
(
struct
spart
*
restrict
sp
)
{
sp
->
rt_data
.
iact_hydro
=
0
;
sp
->
rt_data
.
calls_per_step
=
0
;
}
#endif
/* SWIFT_RT_DEBUG_H */
src/rt/debug/rt_struct.h
0 → 100644
View file @
d22a3689
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2020 Mladen Ivkovic (mladen.ivkovic@hotmail.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_RT_STRUCT_DEBUG_H
#define SWIFT_RT_STRUCT_DEBUG_H
/**
* @file src/rt/debug/rt_struct.h
* @brief Main header file for the debug radiative transfer struct.
*/
struct
rt_xpart_data
{
int
iact_stars
;
/* how many stars this particle interacted with */
int
calls_tot
;
/* total number of calls to this particle during entire run */
int
calls_per_step
;
/* calls per time step to this particle */
};
struct
rt_spart_data
{
int
iact_hydro
;
/* how many hydro particles this particle interacted with */
int
calls_tot
;
/* total number of calls to this particle during entire run */
int
calls_per_step
;
/* calls per time step to this particle */
};
#endif
/* SWIFT_RT_STRUCT_DEBUG_H */
src/rt_struct.h
0 → 100644
View file @
d22a3689
/*******************************************************************************
* This file is part of SWIFT.
* Copyright (c) 2020 Mladen Ivkovic (mladen.ivkovic@hotmail.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_RT_STRUCT_H
#define SWIFT_RT_STRUCT_H
/**
* @file src/rt_struct.h
* @brief Branches between the different radiative transfer structs.
*/
/* Config parameters. */
#include "../config.h"
/* Import the right RT struct definition */
#if defined(RT_NONE)
#include "./rt/none/rt_struct.h"
#elif defined(RT_DEBUG)
#include "./rt/debug/rt_struct.h"
#elif defined(RT_M1)
#include "./rt/M1closure/rt_struct.h"
#else
#error "Invalid choice of radiation scheme"
#endif
#endif
/* SWIFT_RT_STRUCT_H */
src/space.c
View file @
d22a3689
...
...
@@ -59,6 +59,7 @@
#include "pressure_floor.h"
#include "proxy.h"
#include "restart.h"
#include "rt.h"
#include "sink.h"
#include "sort_part.h"
#include "space_unique_id.h"
...
...
@@ -4923,6 +4924,9 @@ void space_first_init_parts_mapper(void *restrict map_data, int count,
/* And the black hole markers */
black_holes_mark_part_as_not_swallowed
(
&
p
[
k
].
black_holes_data
);
/* And the radiative transfer */
rt_first_init_xpart
(
&
xp
[
k
]);
#ifdef SWIFT_DEBUG_CHECKS
/* Check part->gpart->part linkeage. */
if
(
p
[
k
].
gpart
&&
p
[
k
].
gpart
->
id_or_neg_offset
!=
-
(
k
+
delta
))
...
...
@@ -5082,6 +5086,9 @@ void space_first_init_sparts_mapper(void *restrict map_data, int count,
/* Also initialise the chemistry */
chemistry_first_init_spart
(
chemistry
,
&
sp
[
k
]);
/* And radiative transfer data */
rt_first_init_spart
(
&
sp
[
k
]);
#ifdef SWIFT_DEBUG_CHECKS
if
(
sp
[
k
].
gpart
&&
sp
[
k
].
gpart
->
id_or_neg_offset
!=
-
(
k
+
delta
))
error
(
"Invalid gpart -> spart link"
);
...
...
@@ -5275,6 +5282,7 @@ void space_init_parts_mapper(void *restrict map_data, int count,
black_holes_init_potential
(
&
parts
[
k
].
black_holes_data
);
chemistry_init_part
(
&
parts
[
k
],
e
->
chemistry
);
pressure_floor_init_part
(
&
parts
[
k
],
&
xparts
[
k
]);
rt_init_xpart
(
&
xparts
[
k
]);
star_formation_init_part
(
&
parts
[
k
],
e
->
star_formation
);
tracers_after_init
(
&
parts
[
k
],
&
xparts
[
k
],
e
->
internal_units
,
e
->
physical_constants
,
with_cosmology
,
e
->
cosmology
,
...
...
src/stars/GEAR/stars.h
View file @
d22a3689
...
...
@@ -20,6 +20,7 @@
#define SWIFT_GEAR_STARS_H
#include "minmax.h"
#include "rt.h"
#include <float.h>
...
...
@@ -50,6 +51,7 @@ __attribute__((always_inline)) INLINE static void stars_init_spart(
sp
->
density
.
wcount
=
0
.
f
;
sp
->
density
.
wcount_dh
=
0
.
f
;
rt_init_spart
(
sp
);
}
/**
...
...
src/stars/GEAR/stars_part.h
View file @
d22a3689
...
...
@@ -27,6 +27,7 @@
#include "feedback_struct.h"
#include "star_formation_struct.h"
#include "tracers_struct.h"
#include "rt_struct.h"
/**
* @brief Particle fields for the star particles.
...
...
@@ -91,6 +92,9 @@ struct spart {
/*! Chemistry structure */
struct
chemistry_spart_data
chemistry_data
;
/*! Radiative Transfer data */
struct
rt_spart_data
rt_data
;
/*! Particle time bin */
timebin_t
time_bin
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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