part.h 3.07 KB
Newer Older
1
/*******************************************************************************
2
 * This file is part of SWIFT.
3
 * Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
4
 *
5
6
7
8
 * 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.
9
 *
10
11
12
13
 * 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.
14
 *
15
16
 * 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/>.
17
 *
18
 ******************************************************************************/
19
#ifndef SWIFT_PART_H
20
#define SWIFT_PART_H
21

22
23
24
/* Config parameters. */
#include "../config.h"

25
/* Standard headers. */
Pedro Gonnet's avatar
Pedro Gonnet committed
26
#include <stddef.h>
27
28
29
30
31
32
33

/* MPI headers. */
#ifdef WITH_MPI
#include <mpi.h>
#endif

/* Local headers. */
34
#include "align.h"
35
#include "part_type.h"
Matthieu Schaller's avatar
Matthieu Schaller committed
36
#include "timeline.h"
37

38
/* Some constants. */
39
40
#define part_align 128
#define xpart_align 128
41
#define spart_align 128
42
#define gpart_align 128
43

44
/* Import the right hydro particle definition */
45
46
#if defined(MINIMAL_SPH)
#include "./hydro/Minimal/hydro_part.h"
47
#define hydro_need_extra_init_loop 0
48
#elif defined(GADGET2_SPH)
49
#include "./hydro/Gadget2/hydro_part.h"
50
#define hydro_need_extra_init_loop 0
51
52
#elif defined(HOPKINS_PE_SPH)
#include "./hydro/PressureEntropy/hydro_part.h"
53
#define hydro_need_extra_init_loop 1
54
#elif defined(DEFAULT_SPH)
55
#include "./hydro/Default/hydro_part.h"
56
#define hydro_need_extra_init_loop 0
57
58
#elif defined(GIZMO_SPH)
#include "./hydro/Gizmo/hydro_part.h"
59
#define hydro_need_extra_init_loop 0
60
#define EXTRA_HYDRO_LOOP
61
62
#else
#error "Invalid choice of SPH variant"
63
64
#endif

65
/* Import the right gravity particle definition */
66
#include "./gravity/Default/gravity_part.h"
67

68
69
70
/* Import the right star particle definition */
#include "./stars/Default/star_part.h"

71
72
73
74
75
76
77
78
void part_relink_gparts_to_parts(struct part *parts, size_t N,
                                 ptrdiff_t offset);
void part_relink_gparts_to_sparts(struct spart *sparts, size_t N,
                                  ptrdiff_t offset);
void part_relink_parts_to_gparts(struct gpart *gparts, size_t N,
                                 struct part *parts);
void part_relink_sparts_to_gparts(struct gpart *gparts, size_t N,
                                  struct spart *sparts);
79
80
void part_verify_links(struct part *parts, struct gpart *gparts,
                       struct spart *sparts, size_t nr_parts, size_t nr_gparts,
81
                       size_t nr_sparts, int verbose);
82

83
#ifdef WITH_MPI
84
/* MPI data type for the particle transfers */
85
86
87
extern MPI_Datatype part_mpi_type;
extern MPI_Datatype xpart_mpi_type;
extern MPI_Datatype gpart_mpi_type;
88
extern MPI_Datatype spart_mpi_type;
89
extern MPI_Datatype multipole_mpi_type;
90
91

void part_create_mpi_types();
92
93
#endif

94
#endif /* SWIFT_PART_H */