Skip to content
Snippets Groups Projects
Select Git revision
  • 96cc1ee05190a9566143967f8a835249f5ea3c89
  • master default protected
  • darwin/gear_preSN_feedback
  • zoom-missing-rebuild-time
  • reyz/gear_preSN_feedback
  • darwin/sink_tasks_refactored
  • darwin/gear_radiation
  • darwin/gear_preSN_fbk_merge
  • darwin/gear_mechanical_feedback
  • darwin/gear_chemistry_fluxes
  • zoom_merge protected
  • nickishch/MHD_canvas/SwitchesGradientProjection
  • zoom_mpi_redux
  • MHD_canvas protected
  • karapiperis/plasma_beta_rms_in_tensile_instability_correction_taper_function
  • nickishch/MHD_canvas/OWAR_rhob_div_rhob
  • nickishch/MHD_canvas/OWAR_induction_only
  • nickishch/MHD_canvas/OWAR
  • nickishch/MHD_canvas/Switches
  • zoom_truncate_bkg
  • split-space-split
  • 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
40 results

engine_split_particles.c

Blame
  • hydro_space.c 1.76 KiB
    /*******************************************************************************
     * This file is part of SWIFT.
     * Copyright (c) 2017 Bert Vandenbroucke (bert.vandenbroucke@gmail.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/>.
     *
     ******************************************************************************/
    
    #include "hydro_space.h"
    #include "space.h"
    
    /**
     * @brief Initialize the extra space information needed for some hydro schemes.
     *
     * @param hs #hydro_space to initialize.
     * @param s #space containing the hydro space.
     */
    #ifdef SHADOWFAX_SPH
    __attribute__((always_inline)) INLINE void hydro_space_init(
        struct hydro_space *hs, const struct space *s) {
    
      if (s->periodic) {
        hs->anchor[0] = -0.5f * s->dim[0];
        hs->anchor[1] = -0.5f * s->dim[1];
        hs->anchor[2] = -0.5f * s->dim[2];
        hs->side[0] = 2.0f * s->dim[0];
        hs->side[1] = 2.0f * s->dim[1];
        hs->side[2] = 2.0f * s->dim[2];
      } else {
        hs->anchor[0] = 0.0f;
        hs->anchor[1] = 0.0f;
        hs->anchor[2] = 0.0f;
        hs->side[0] = s->dim[0];
        hs->side[1] = s->dim[1];
        hs->side[2] = s->dim[2];
      }
    }
    #else
    void hydro_space_init(struct hydro_space *hs, const struct space *s) {}
    #endif