Alpine3D 20241222.625fd38
ViewFactorsHelbig.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 VIEWFACTORSHELBIG_H
19#define VIEWFACTORSHELBIG_H
20
21#include <meteoio/MeteoIO.h>
24
25#include <string>
26
28{
29public:
30 ViewFactorsHelbig(const mio::Config &cfg, const mio::DEMObject &dem_in);
31 double getSkyViewFactor(const int &i, const int &j);
32 void getSkyViewFactor(mio::Array2D<double> &o_sky_vf) const;
33 double GetViewfactor(const int i, const int j, const int a, const int b);
34 double getSymetricTerrainViewFactor(const int &i, const int &j);
35
36 double min_area; // min (inclined) surface area
37 double min_vterr; // min terrain view factor
38 double max_vterr; // max terrain view factor
40
41private:
42 mio::IOManager io;
43 mio::Array2D<double> sky_vf, vf_t;
44 double cellsize;
45 int dimx, dimy;
46 mio::DEMObject dem;
47 std::string vf_file_in, tvfarea_file_in; //where to read the sky view factors and the terrain view factor x surface
48 std::string vf_file_out, tvfarea_file_out; //where to write the sky view factors and the terrain view factor x surface
49 double sub_crit;
50 VFSymetricMatrix<float, double> vf; // view factor matrix with dynamic dimension
51 int LW_distance_index, SW_distance_index;
52
53 const static double to_rad;
54
55 const static double vf_thresh; //below this threshold, view factor is forced to 0
56
57 double EuclidianDistance(const double x, const double y, const double z);
58 double DoubleRounding(const double aNumber, const double precision);
59 int GetStep(const int a, const int b);
60 double GetMax(const int step, const double azi, const bool x_Mode);
61 double GetDelta(const int step, const double azi, const bool x_Mode);
62 double GetPseudoAzimuth(const int i, const int j, const int m, const int t);
63 void GetNextCell(int &x, int &y, double &tMaxX, double &tMaxY,
64 const int stepsX, const int stepsY, const double tDeltaX, const double tDeltaY);
65 bool CellOutsideGrid(const int a, const int b);
66 double DistanceBetween2Cells(const int i, const int j, const int a, const int b, const double bz);
67 double DistanceOnTheBeamMiddleCell(const int i, const int j, const int a, const int b,
68 const int m, const int t, const double bz);
69 double DistanceOnTheBeamBorderCell(const int i, const int j, const int a, const int b,
70 const int m, const int t, const double bz);
71 bool IsAngleHigher(const double view_angleP, const int i, const int j, int &m, int &t);
72 bool Is2CellsVisible(int i, int j, int m, int t);
73 void ApplySunBorderTreatment(const int i, const int j, int &m, int &t);
74 int ComputeFirstObstacle(const double solar_elev, const int i, const int j, const int mt, const int tt,
75 int &horizon_x, int &horizon_y);
76 double GetZEdgeVector(const double z, const double nx, const double ny, const double deltaX, const double deltaY);
77 int GetSplitFactor(const double sideLength, const double dist);
78 double GetCoordinateForSmallCell(const double veca, const double vecb, const double vecc,
79 const int i, const int j, const int splitFactor);
80 double CosAngleBetween2Vectors(const double nx, const double ny, const double nz, const double bx,
81 const double by, const double bz);
82 double GetSymetricPartOfViewFactor(const int i, const int j, const int a, const int b);
83 int InitGridViewFactors();
84 int InitSkyViewFactors();
85 bool InitializeViewFactor();
86
87 void setVF_IN_RAM(bool);
88};
89
90#endif
Definition: ViewFactorsAlgorithm.h:21
Definition: ViewFactorsHelbig.h:28
double min_vterr
Definition: ViewFactorsHelbig.h:37
double getSymetricTerrainViewFactor(const int &i, const int &j)
Definition: ViewFactorsHelbig.cc:1045
double min_area
Definition: ViewFactorsHelbig.h:36
ViewFactorsHelbig(const mio::Config &cfg, const mio::DEMObject &dem_in)
Definition: ViewFactorsHelbig.cc:32
double getSkyViewFactor(const int &i, const int &j)
Definition: ViewFactorsHelbig.cc:67
bool vf_in_ram
Definition: ViewFactorsHelbig.h:39
double GetViewfactor(const int i, const int j, const int a, const int b)
Definition: ViewFactorsHelbig.cc:812
double max_vterr
Definition: ViewFactorsHelbig.h:38