Skip to content
Snippets Groups Projects
Select Git revision
  • 8074e53b4941f781b8737b3ae7119c93acb96ea5
  • 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

potential.h

Blame
  • potential.h 2.92 KiB
    /*******************************************************************************
     * This file is part of SWIFT.
     * Copyright (c) 2016  Matthieu Schaller (schaller@strw.leidenuniv.nl)
     *
     * 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_POTENTIAL_H
    #define SWIFT_POTENTIAL_H
    
    /**
     * @file src/potential.h
     * @brief Branches between the different external gravitational potentials.
     */
    
    /* Config parameters. */
    #include <config.h>
    
    /* Import the right external potential definition */
    #if defined(EXTERNAL_POTENTIAL_NONE)
    #include "./potential/none/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_POINTMASS)
    #include "./potential/point_mass/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_ISOTHERMAL)
    #include "./potential/isothermal/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_HERNQUIST)
    #include "./potential/hernquist/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_HERNQUIST_SDMH05)
    #include "./potential/hernquist_sdmh05/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_NFW)
    #include "./potential/nfw/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_NFW_MN)
    #include "./potential/nfw_mn/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_MWPotential2014)
    #include "./potential/MWPotential2014/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_DISC_PATCH)
    #include "./potential/disc_patch/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_SINE_WAVE)
    #include "./potential/sine_wave/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_POINTMASS_SOFT)
    #include "./potential/point_mass_softened/potential.h"
    #elif defined(EXTERNAL_POTENTIAL_CONSTANT)
    #include "./potential/constant/potential.h"
    #else
    #error "Invalid choice of external potential"
    #endif
    
    /* Now, some generic functions, defined in the source file */
    void potential_init(struct swift_params* parameter_file,
                        const struct phys_const* phys_const,
                        const struct unit_system* us, const struct space* s,
                        struct external_potential* potential);
    
    void potential_print(const struct external_potential* potential);
    
    /* Dump/restore. */
    void potential_struct_dump(const struct external_potential* potential,
                               FILE* stream);
    void potential_struct_restore(const struct external_potential* potential,
                                  FILE* stream);
    
    #endif /* SWIFT_POTENTIAL_H */