Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://subversion.renater.fr/anonscm/svn/fullswof-2d
13 April 2021, 17:02:37 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    No releases to show
  • 56f377c
  • /
  • trunk
  • /
  • Headers
  • /
  • libschemes
  • /
  • scheme.hpp
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:67c451ce52960fcc9d25594853985dbd1614930d
origin badgedirectory badge
swh:1:dir:ad5db916eb649993237642053f7a3f78f3d41397
origin badgerevision badge
swh:1:rev:f0d2c4ea29c8923198d21ac3f64a48eeae9bfb55
origin badgesnapshot badge
swh:1:snp:0b5ec9ba5beee743d28d9984aa27fdced8d4bc64

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: f0d2c4ea29c8923198d21ac3f64a48eeae9bfb55 authored by fdarboux on 09 July 2020, 15:20:26 UTC
Update of HowtoRelease document
Tip revision: f0d2c4e
scheme.hpp
/**
 * @file scheme.hpp
 * @author Olivier Delestre <olivierdelestre41@yahoo.fr> (2008)
 * @author Christian Laguerre <christian.laguerre@math.cnrs.fr> (2012-2015)
 * @version 1.07.01
 * @date 2017-05-09
 *
 * @brief Numerical scheme
 * @details
 * Common part for all the numerical schemes.
 *
 * @copyright License Cecill-V2 \n
 * <http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>
 *
 * (c) CNRS - Universite d'Orleans - BRGM (France)
 */
/* 
 *
 * This file is part of FullSWOF_2D software. 
 * <https://sourcesup.renater.fr/projects/fullswof-2d/> 
 *
 * FullSWOF_2D = Full Shallow-Water equations for Overland Flow, 
 * in two dimensions of space.
 * This software is a computer program whose purpose is to compute
 * solutions for 2D Shallow-Water equations.
 *
 * LICENSE
 *
 * This software is governed by the CeCILL license under French law and
 * abiding by the rules of distribution of free software. You can use,
 * modify and/ or redistribute the software under the terms of the CeCILL
 * license as circulated by CEA, CNRS and INRIA at the following URL
 * <http://www.cecill.info>.
 *
 * As a counterpart to the access to the source code and rights to copy,
 * modify and redistribute granted by the license, users are provided only
 * with a limited warranty and the software's author, the holder of the
 * economic rights, and the successive licensors have only limited
 * liability.
 *
 * In this respect, the user's attention is drawn to the risks associated
 * with loading, using, modifying and/or developing or reproducing the
 * software by the user in light of its specific status of free software,
 * that may mean that it is complicated to manipulate, and that also
 * therefore means that it is reserved for developers and experienced
 * professionals having in-depth computer knowledge. Users are therefore
 * encouraged to load and test the software's suitability as regards their
 * requirements in conditions enabling the security of their systems and/or
 * data to be ensured and, more generally, to use and operate it in the
 * same conditions as regards security.
 *
 * The fact that you are presently reading this means that you have had
 * knowledge of the CeCILL license and that you accept its terms.
 *
 ******************************************************************************/

#ifndef PARAMETERS_HPP
#include "parameters.hpp"
#endif

#ifndef HYDROSTATIC_HPP
#include "hydrostatic.hpp"
#endif


#ifndef CHOICE_CONDITION_HPP
#include "choice_condition.hpp"
#endif

#ifndef CHOICE_FLUX_HPP
#include "choice_flux.hpp"
#endif

#ifndef CHOICE_FRICTION_HPP
#include "choice_friction.hpp"
#endif

#ifndef CHOICE_INFILTRATION_HPP
#include "choice_infiltration.hpp"
#endif

#ifndef CHOICE_INIT_TOPO_HPP
#include "choice_init_topo.hpp"
#endif

#ifndef CHOICE_INIT_HUV_HPP
#include "choice_init_huv.hpp"
#endif

#ifndef CHOICE_RAIN_HPP
#include "choice_rain.hpp"
#endif

#ifndef CHOICE_OUTPUT_HPP
#include "choice_output.hpp"
#endif

#ifndef CHOICE_RECONSTRUCTION
#include "choice_reconstruction.hpp"
#endif

#ifndef CHOICE_SAVE_SPECIFIC_POINTS_HPP
#include "choice_save_specific_points.hpp"
#endif

#ifndef SCHEME_HPP
#define SCHEME_HPP

/** @class Scheme
 * @brief Numerical scheme
 * @details 
 * Class that contains all the common declarations for the numerical schemes.
 */


class Scheme{
    
  public:
    
    /** @brief Constructor */
    Scheme(Parameters &);
    
    /** @brief Function to be specified in each numerical scheme */
    virtual void calcul() = 0;
    
    /** @brief Allocation of spatialized variables */
    void allocation();
    
    /** @brief Deallocation of variables */
    void deallocation();
    
    /** @brief Main calculation of the flux */
    void maincalcflux(SCALAR,SCALAR, SCALAR, SCALAR , SCALAR, SCALAR &);
    
    /** @brief Main calculation of the scheme */
    void maincalcscheme(TAB &,TAB &,TAB &,TAB &,TAB &,TAB &,TAB &,TAB &,TAB &,TAB &,TAB &,SCALAR,SCALAR,int);
    
    /** @brief Calls the boundary conditions and affects the boundary values */
    void boundary(TAB &,TAB &,TAB &, SCALAR,const int , const int);
    
    /** @brief Returns the Froude number */
    SCALAR froude_number(TAB,TAB,TAB);
    
    /** @brief Destructor*/
    virtual ~Scheme();
    
  protected :
  
    /** Number of cells in space in the first (x) direction. */
    const  int NXCELL;
    /** Number of cells in space in the second (y) direction. */
    const int NYCELL;
    /** Order of the numerical scheme. */
    const int ORDER;
    /** Final time.*/
    const SCALAR T;
    /** Number of times saved. */
    const int NBTIMES;
    /** Type of scheme (fixed cfl or time step). */
    const int SCHEME_TYPE;
    /** Space step in the first (x) direction.*/
    const SCALAR DX;
    /** Space step in the second (y) direction.*/
    const SCALAR DY;
    /** Value of the fixed cfl.*/
    const  SCALAR CFL_FIX;
    /** Value of the fixed time step.*/
    SCALAR DT_FIX;
    /** Ratio dt/dx.*/
    SCALAR tx;
    /** Ratio dt/dy.*/
    SCALAR ty;
    /** Time to save the data (evolution file).*/
    SCALAR T_output;
    /** Time step to save the data (evolution file).*/
    SCALAR dt_output;
    /** Friction coefficient. */
    const SCALAR FRICCOEF;
    /** Imposed discharge on the left boundary.*/
    map<int,SCALAR> & L_IMP_Q;
    /** Imposed water height on the left boundary.*/
    map<int,SCALAR> & L_IMP_H;
    /** List of files and time values corresponding to the left boundary condition.*/
    map<SCALAR,string> left_times_files;
    /** Iterator  pointing to a file and time value corresponding to the left boundary condition */
    map<SCALAR,string>::const_iterator p_left_times_files;
    /** Right boundary condition.*/
    map<int,int>  L_choice_bound;
    /** Type (constant or file) of left boundary condition */
    int Lbound_type;
    /** This variable is true if the boundary has been updated */
    bool is_Lbound_changed ;
    /** Imposed discharge on the right boundary.*/
    map<int,SCALAR> & R_IMP_Q;
    /** Imposed water height on the right boundary.*/
    map<int,SCALAR> & R_IMP_H;
    /** List of files and time values corresponding to the right boundary condition.*/
    map<SCALAR,string> right_times_files;
    /** Iterator  pointing to a file and time value corresponding to the right boundary condition */
    map<SCALAR,string>::const_iterator p_right_times_files;
    /** Right boundary condition.*/
    map<int,int>  R_choice_bound;
    /** Type (constant or file) of right boundary condition */
    int Rbound_type;
    /** This variable is true if the boundary has been updated */
    bool is_Rbound_changed ;
     /** Imposed discharge on the bottom boundary.*/
    map<int,SCALAR> & B_IMP_Q;
    /** Imposed water height on the bottom boundary.*/
    map<int,SCALAR> & B_IMP_H;
    /** List of files and time values corresponding to the bottom boundary condition.*/
    map<SCALAR,string> bottom_times_files;
    /** Iterator pointing to a file and time value corresponding to the bottom boundary condition */
    map<SCALAR,string>::const_iterator p_bottom_times_files;
    /** Bottom boundary condition.*/
    map<int,int>  B_choice_bound;
    /** Type (constant or file) of bottom boundary condition */
    int Bbound_type;
    /** This variable is true if the boundary has been updated */
    bool is_Bbound_changed ;
     /** Imposed discharge on the top boundary.*/
    map<int,SCALAR> & T_IMP_Q;
    /** Imposed water height on the top boundary.*/
    map<int,SCALAR> & T_IMP_H;
    /** List of files and time values corresponding to the top boundary condition.*/
    map<SCALAR,string> top_times_files;
    /** Iterator pointing to a file and time value corresponding to the top boundary condition */
    map<SCALAR,string>::const_iterator p_top_times_files;
    /** Top boundary condition.*/
    map<int,int>  T_choice_bound;
    /** Type (constant or file) of top boundary condition */
    int Tbound_type;
    /** This variable is true if the boundary has been updated */
    bool is_Tbound_changed ;
    /** Parameters object to read the files of boundary conditions */
    Parameters & fs2d_par;
    /** Topography.*/
    TAB z;
    /** Water height.*/
    TAB h;
    /** First component of the velocity.*/
    TAB u;
    /** Second component of the velocity.*/
    TAB v;
    /** First component of the discharge.*/
    TAB q1;
    /** Second component of the discharge.*/
    TAB q2;
    /** Water height after one step of the scheme.*/
    TAB hs;
    /** First component of the velocity after one step of the scheme.*/
    TAB us;
    /** Second component of the velocity after one step of the scheme.*/
    TAB vs;
    /** First component of the discharge after one step of the scheme.*/
    TAB qs1;
    /** Second component of the discharge after one step of the scheme.*/
    TAB qs2;
    /** First component of the numerical flux along x. */
    TAB f1;
    /** Second component of the numerical flux along x. */
    TAB f2;
    /** Third component of the numerical flux along x. */
    TAB f3;
    /** First component of the numerical flux along y. */
    TAB g1;
    /** Second component of the numerical flux along y. */
    TAB g2;
    /** Third component of the numerical flux along y. */
    TAB g3;
    /** %Hydrostatic reconstruction on the left along x.*/
    TAB h1left;
    /** %Hydrostatic reconstruction on the right along x.*/
    TAB h1right;
    /** %Hydrostatic reconstruction on the left along y.*/
    TAB h2left;
    /** %Hydrostatic reconstruction on the right along y.*/
    TAB h2right;
    /** Variations of the topography along x.*/
    TAB delz1;
    /** Variations of the topography along y.*/
    TAB delz2;
    /** Difference between the reconstructed topographies on the left and on the right boundary of a cell along x.*/
    TAB delzc1;
    /** Difference between the reconstructed topographies on the left and on the right boundary of a cell along y.*/
    TAB delzc2;
    /** Water height on the cell located at the right of the boundary along x.*/
    TAB h1r;
    /** First component of the velocity on the cell located at the right of the boundary along x.*/
    TAB u1r;
    /** Second component of the velocity on the cell located at the right of the boundary along x.*/
    TAB v1r;
    /** Water height on the cell located at the left of the boundary along x.*/
    TAB h1l;
    /** First component of the velocity on the cell located at the left of the boundary along x.*/
    TAB u1l;
    /** Second component of the velocity on the cell located at the left of the boundary along x.*/
    TAB v1l;
    /** Water height on the cell located at the right of the boundary along y.*/
    TAB h2r;
    /** First component of the velocity on the cell located at the right of the boundary along y.*/
    TAB u2r;
    /** Second component of the velocity on the cell located at the right of the boundary along y.*/
    TAB v2r;
    /** Water height on the cell located at the left of the boundary along y.*/
    TAB h2l;
    /** First component of the velocity on the cell located at the left of the boundary along y.*/
    TAB u2l;
    /** Second component of the velocity on the cell located at the left of the boundary along y.*/
    TAB v2l;
    /** %Rain intensity.*/
    TAB Rain;
    /** Cumulative volume of infiltrated water (at each point).*/
    TAB Vin_tot;
    /** Beginning of timer.*/
    time_t start;
    /** End of timer.*/
    time_t  end;
    /** Duration of the computation.*/
    SCALAR timecomputation;
    /** CPU time.*/
    clock_t cpu_time;
    /** Iterator for the loop in time.*/
    int n;
    /** Mean Froude number.*/
    SCALAR Fr;
    /** Time step in case of fixed cfl. */
    SCALAR dt1;
    /** Maximum time step in case of fixed cfl. */
    SCALAR dt_max;
    /** The current simulation time. */
    SCALAR cur_time;
    /** Space step in the first step in the method Heun.*/
    SCALAR dt_first;
    /** Cumulative volume of rain on the whole domain.*/
    SCALAR Volrain_Tot;
    /** Cumulative outflow volume at the boundary. */
    SCALAR Total_volume_outflow;
    /** Cumulative water height on the whole domain*/
    SCALAR height_of_tot;
    /** Cumulative height of infiltrated water on the whole domain*/
    SCALAR height_Vinf_tot;
    /** Cumulative volume of water infiltrated.*/
    SCALAR Vol_inf_tot_cumul;
    /** Cumulative streammed volume.*/
    SCALAR Vol_of_tot;
    /** The choice of the left boundary condition.*/
    Choice_condition * Lbound;
    /** The choice of the right boundary condition.*/
    Choice_condition * Rbound;
    /** The choice of the bottom boundary condition.*/
    Choice_condition * Bbound;
    /** The choice of the top boundary condition.*/
    Choice_condition * Tbound;
    /** The choice of output.*/
    Choice_output * out;
    /** Flag for the time step.*/
    int verif;
    /** The choice of output for the specific points.*/
    Choice_save_specific_points *out_specific_points;
  
  private:
    /** The choice of the left boundary condition.*/
    map<int,int> nchoice_Lbound;
    /** The choice of the right boundary condition.*/
    map<int,int> nchoice_Rbound;
    /** The choice of the bottom boundary condition.*/
    map<int,int> nchoice_Bbound;
    /** The choice of the top boundary condition.*/
    map<int,int> nchoice_Tbound;
    /** The choice of rain.*/
    Choice_rain * Prain;
    Hydrostatic rec_hydro;
    Choice_flux * flux_num;
    Choice_friction * fric;
    Choice_infiltration * I;
    Choice_init_topo * topo;
    Choice_init_huv * huv_init;
};
#endif

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API