Alpine3D 20241222.625fd38
TerrainRadiationAlgorithm.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 TERRAINRADIATIONALGORITHM_H
19#define TERRAINRADIATIONALGORITHM_H
20
21#include <meteoio/MeteoIO.h>
24
25//Class for shooting cells
26class CellsList {
27 public:
28 double radiation;
29 int x;
30 int y;
31};
32
33inline bool operator_greater(const CellsList& a, const CellsList& b) {
34 return a.radiation > b.radiation;
35}
36
38 public:
39 TerrainRadiationAlgorithm(const std::string& i_algo) : algo(i_algo), _hasSP(false) {}
41 bool hasSP(){return _hasSP;}
42 virtual void getRadiation(mio::Array2D<double>& direct, mio::Array2D<double>& diffuse,
43 mio::Array2D<double>& terrain, const mio::Array2D<double>& direct_unshaded_horizontal,
44 const mio::Array2D<double>& total_ilwr, mio::Array2D<double>& sky_ilwr,
45 mio::Array2D<double>& terrain_ilwr, double solarAzimuth, double solarElevation) = 0;
46 virtual void setMeteo(const mio::Array2D<double>& albedo, const mio::Array2D<double>& ta) = 0;
47
48 const std::string algo;
49 virtual void setSP(const mio::Date /*timestamp*/, const double /*solarAzimuth*/, const double /*solarElevation*/){};
50 virtual void writeSP(const unsigned int /*max_steps*/){};
51 virtual void getSkyViewFactor(mio::Array2D<double> &o_sky_vf) = 0;
52
53 protected:
54 bool _hasSP;
55};
56
58 public:
59 // FELIX: const RadiationField* radfield
60 static TerrainRadiationAlgorithm* getAlgorithm(const mio::Config& cfg, const mio::DEMObject &dem, const int& nbworkers);
61};
62
63#endif
bool operator_greater(const CellsList &a, const CellsList &b)
Definition: TerrainRadiationAlgorithm.h:33
Definition: TerrainRadiationAlgorithm.h:26
int y
Definition: TerrainRadiationAlgorithm.h:30
double radiation
Definition: TerrainRadiationAlgorithm.h:28
int x
Definition: TerrainRadiationAlgorithm.h:29
Definition: TerrainRadiationAlgorithm.h:37
virtual ~TerrainRadiationAlgorithm()
Definition: TerrainRadiationAlgorithm.cc:26
virtual void writeSP(const unsigned int)
Definition: TerrainRadiationAlgorithm.h:50
TerrainRadiationAlgorithm(const std::string &i_algo)
Definition: TerrainRadiationAlgorithm.h:39
bool hasSP()
Definition: TerrainRadiationAlgorithm.h:41
virtual void setSP(const mio::Date, const double, const double)
Definition: TerrainRadiationAlgorithm.h:49
const std::string algo
Definition: TerrainRadiationAlgorithm.h:48
bool _hasSP
Definition: TerrainRadiationAlgorithm.h:54
virtual void setMeteo(const mio::Array2D< double > &albedo, const mio::Array2D< double > &ta)=0
virtual void getSkyViewFactor(mio::Array2D< double > &o_sky_vf)=0
virtual void getRadiation(mio::Array2D< double > &direct, mio::Array2D< double > &diffuse, mio::Array2D< double > &terrain, const mio::Array2D< double > &direct_unshaded_horizontal, const mio::Array2D< double > &total_ilwr, mio::Array2D< double > &sky_ilwr, mio::Array2D< double > &terrain_ilwr, double solarAzimuth, double solarElevation)=0
Definition: TerrainRadiationAlgorithm.h:57
static TerrainRadiationAlgorithm * getAlgorithm(const mio::Config &cfg, const mio::DEMObject &dem, const int &nbworkers)
Definition: TerrainRadiationAlgorithm.cc:29