Skip to content
Snippets Groups Projects
Select Git revision
  • e3ae510d12d0af94f0738845f31dbbce9c593f91
  • master default protected
  • reyz/gear_preSN_feedback
  • zoom-mesh-considerations
  • stars_sidm_iact
  • karapiperis/plasma_beta_rms_in_tensile_instability_correction_taper_function
  • darwin/gear_preSN_fbk_merge
  • darwin/gear_mechanical_feedback
  • karapiperis/consistent_treatment_of_vsig_in_MHD
  • FS_VP_m2_allGrad
  • examples-GravityTests-HydroStatic-halo-issue
  • fof_props
  • FS_VP_m2
  • FS_m2
  • darwin/gear_chemistry_fluxes
  • zoom_mpi_redux
  • mladen/rt_limit_star_timesteps
  • zoom-missing-rebuild-time
  • moving_mesh
  • zoom_truncate_bkg
  • sidm_merge protected
  • v2025.10 protected
  • v2025.04 protected
  • v2025.01 protected
  • v1.0.0 protected
  • v0.9.0 protected
  • v0.8.5 protected
  • v0.8.4 protected
  • v0.8.3 protected
  • v0.8.2 protected
  • v0.8.1 protected
  • v0.8.0 protected
  • v0.7.0 protected
  • v0.6.0 protected
  • v0.5.0 protected
  • v0.4.0 protected
  • v0.3.0 protected
  • v0.2.0 protected
  • v0.1.0-pre protected
  • v0.1 protected
  • v0.0 protected
41 results

part.h

Blame
  • part.h 3.33 KiB
    /*******************************************************************************
     * This file is part of SWIFT.
     * Copyright (c) 2012 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
     *
     * 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_PART_H
    #define SWIFT_PART_H
    
    /* Config parameters. */
    #include "../config.h"
    
    /* Standard headers. */
    #include <stddef.h>
    
    /* MPI headers. */
    #ifdef WITH_MPI
    #include <mpi.h>
    #endif
    
    /* Local headers. */
    #include "align.h"
    #include "part_type.h"
    #include "timeline.h"
    
    /* Some constants. */
    #define part_align 128
    #define xpart_align 128
    #define spart_align 128
    #define gpart_align 128
    
    /* Import the right hydro particle definition */
    #if defined(DEBUG_INTERACTIONS_SPH)
    #include "./hydro/DebugInteractions/hydro_part.h"
    #define hydro_need_extra_init_loop 0
    #elif defined(MINIMAL_SPH)
    #include "./hydro/Minimal/hydro_part.h"
    #define hydro_need_extra_init_loop 0
    #elif defined(GADGET2_SPH)
    #include "./hydro/Gadget2/hydro_part.h"
    #define hydro_need_extra_init_loop 0
    #elif defined(HOPKINS_PE_SPH)
    #include "./hydro/PressureEntropy/hydro_part.h"
    #define hydro_need_extra_init_loop 1
    #elif defined(DEFAULT_SPH)
    #include "./hydro/Default/hydro_part.h"
    #define hydro_need_extra_init_loop 0
    #elif defined(GIZMO_SPH)
    #include "./hydro/Gizmo/hydro_part.h"
    #define hydro_need_extra_init_loop 0
    #define EXTRA_HYDRO_LOOP
    #elif defined(SHADOWFAX_SPH)
    #include "./hydro/Shadowswift/hydro_part.h"
    #define hydro_need_extra_init_loop 0
    #define EXTRA_HYDRO_LOOP
    #else
    #error "Invalid choice of SPH variant"
    #endif
    
    /* Import the right gravity particle definition */
    #include "./gravity/Default/gravity_part.h"
    
    /* Import the right star particle definition */
    #include "./stars/Default/star_part.h"
    
    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);
    void part_verify_links(struct part *parts, struct gpart *gparts,
                           struct spart *sparts, size_t nr_parts, size_t nr_gparts,
                           size_t nr_sparts, int verbose);
    
    #ifdef WITH_MPI
    /* MPI data type for the particle transfers */
    extern MPI_Datatype part_mpi_type;
    extern MPI_Datatype xpart_mpi_type;
    extern MPI_Datatype gpart_mpi_type;
    extern MPI_Datatype spart_mpi_type;
    extern MPI_Datatype multipole_mpi_type;
    
    void part_create_mpi_types();
    #endif
    
    #endif /* SWIFT_PART_H */