Alpine3D  Alpine3D-3.2.0
EnergyBalance.h
Go to the documentation of this file.
1 /***********************************************************************************/
2 /* Copyright 2009-2015 WSL Institute for Snow and Avalanche Research SLF-DAVOS */
3 /***********************************************************************************/
4 /* This file is part of Alpine3D.
5  Alpine3D is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Alpine3D is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with Alpine3D. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef ENERGYBALANCE_H
19 #define ENERGYBALANCE_H
20 
21 #include <string>
22 #include <meteoio/MeteoIO.h>
23 
24 class SnowpackInterface;
25 
29 
69 {
70  public:
71  EnergyBalance( const unsigned int& i_nbworkers, const mio::Config& cfg, const mio::DEMObject &dem_in);
73  ~EnergyBalance( );
74 
76 
77  void setSnowPack(SnowpackInterface &mysnowpack );
78  void setAlbedo( const mio::Grid2DObject &in_albedo );
79 
80  void setMeteo(const mio::Grid2DObject& in_ilwr,
81  const mio::Grid2DObject& in_ta, const mio::Grid2DObject& in_rh, const mio::Grid2DObject& in_p, const mio::Date timestamp);
82 
83  void setStations(const std::vector<mio::MeteoData>& in_vecMeteo);
84  double getTiming() const;
85  void Destroy();
86  std::string getGridsRequirements() const;
87 
88  private:
89  SnowpackInterface *snowpack;
90  TerrainRadiationAlgorithm *terrain_radiation;
91  std::vector<RadiationField*> radfields;
92  mio::DEMObject dem;
93  std::vector<mio::MeteoData> vecMeteo;
94  mio::Grid2DObject albedo;
95  mio::Array2D<double> direct, diffuse, reflected;
96  mio::Timer timer;
97 
98  size_t dimx, dimy;
99  unsigned int nbworkers;
100 };
101 
102 #endif
Definition: TerrainRadiationAlgorithm.h:35
EnergyBalance & operator=(const EnergyBalance &)
Assignement operator, required because of pointer member.
Definition: EnergyBalance.cc:64
void setStations(const std::vector< mio::MeteoData > &in_vecMeteo)
Definition: EnergyBalance.cc:115
Definition: EnergyBalance.h:68
void Destroy()
Definition: EnergyBalance.cc:88
Definition: SnowpackInterface.h:127
std::string getGridsRequirements() const
Definition: EnergyBalance.cc:83
~EnergyBalance()
Definition: EnergyBalance.cc:60
void setMeteo(const mio::Grid2DObject &in_ilwr, const mio::Grid2DObject &in_ta, const mio::Grid2DObject &in_rh, const mio::Grid2DObject &in_p, const mio::Date timestamp)
Definition: EnergyBalance.cc:124
void setAlbedo(const mio::Grid2DObject &in_albedo)
Definition: EnergyBalance.cc:106
EnergyBalance(const unsigned int &i_nbworkers, const mio::Config &cfg, const mio::DEMObject &dem_in)
Definition: EnergyBalance.cc:25
double getTiming() const
Definition: EnergyBalance.cc:179
void setSnowPack(SnowpackInterface &mysnowpack)
Definition: EnergyBalance.cc:101