Skip to content
Snippets Groups Projects
Select Git revision
  • 18547437d181b0fab325731b68537058b92a6e30
  • master default protected
  • logger_index_file
  • timestep_limiter_update
  • mpi-packed-parts
  • mpi-subparts-vector-grav
  • gear_feedback
  • extra_EAGLE_EoS
  • mpi-send-subparts-vector
  • ivanova-dirty
  • simba-stellar-feedback
  • active_h_max
  • sampled_stellar_evolution
  • mpi-send-subparts
  • yb-bhdev-mergers
  • yb-bhdev-multiPhaseBondi
  • reverted_grav_depth_logic
  • dumper-thread
  • remove_long_long
  • isolated_galaxy_update
  • new_cpp
  • v0.8.4
  • v0.8.3
  • v0.8.2
  • v0.8.1
  • v0.8.0
  • v0.7.0
  • v0.6.0
  • v0.5.0
  • v0.4.0
  • v0.3.0
  • v0.2.0
  • v0.1.0-pre
  • v0.1
  • v0.0
35 results

plot_scaling_results.py

Blame
  • Forked from SWIFT / SWIFTsim
    Source project has a limited visibility.
    gravity_derivatives.h 2.63 KiB
    /*******************************************************************************
     * This file is part of SWIFT.
     * Copyright (c) 2016 Matthieu Schaller (matthieu.schaller@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_GRAVITY_DERIVATIVE_H
    #define SWIFT_GRAVITY_DERIVATIVE_H
    
    /* Some standard headers. */
    #include <math.h>
    
    /* Local headers. */
    #include "inline.h"
    
    /**
     * @brief \f$ \phi(r_x, r_y, r_z) \f$.
     */
    __attribute__((always_inline)) INLINE static double D_000(double r_x,
                                                              double r_y,
                                                              double r_z,
                                                              double r_inv) {
    
      return r_inv;
    }
    
    /**
     * @brief \f$ \frac{\partial\phi(r_x, r_y, r_z)}{\partial r_x} \f$.
     */
    __attribute__((always_inline)) INLINE static double D_100(double r_x,
                                                              double r_y,
                                                              double r_z,
                                                              double r_inv) {
    
      return -r_x * r_inv * r_inv * r_inv;
    }
    
    /**
     * @brief \f$ \frac{\partial\phi(r_x, r_y, r_z)}{\partial r_x} \f$.
     */
    __attribute__((always_inline)) INLINE static double D_010(double r_x,
                                                              double r_y,
                                                              double r_z,
                                                              double r_inv) {
    
      return -r_y * r_inv * r_inv * r_inv;
    }
    
    /**
     * @brief \f$ \frac{\partial\phi(r_x, r_y, r_z)}{\partial r_x} \f$.
     */
    __attribute__((always_inline)) INLINE static double D_001(double r_x,
                                                              double r_y,
                                                              double r_z,
                                                              double r_inv) {
    
      return -r_z * r_inv * r_inv * r_inv;
    }
    
    #endif /* SWIFT_GRAVITY_DERIVATIVE_H */