Alpine3D 20241222.625fd38
ViewFactorsCluster.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 VIEWFACTORSCLUSTER_H
19#define VIEWFACTORSCLUSTER_H
20
21#include <meteoio/MeteoIO.h>
23#include <map>
24
26
27 public:
28 ViewFactorsCluster(const mio::Config& cfg, const mio::DEMObject &dem_in);
29 double getSkyViewFactor(const int &i, const int &j);
30 void getSkyViewFactor(mio::Array2D<double> &o_sky_vf) const;
31 double GetViewfactor(const int i, const int j, const int a, const int b);
32
33 private:
34 mio::Array4D<double> vf_cluster;
35 mio::Array4D<unsigned int> vc_cluster;
36 mio::Array2D<double> sky_vf;
37 std::map<int, double> vf;
38
39 mio::DEMObject dem;
40 double cellsize;
41 double sw_radius;
42 double max_shade_distance;
43 double sub_crit;
44
45 int dimx, dimy;
46 unsigned int hSections, vSections;
47 unsigned int schrittweitenLimit;
48
49 void fill_vf_map();
50 void calcHorizonField();
51 void calcSchrittweite(const double& altitude, const double& dH, const double& distance,
52 const double& horizon_tan_angle, unsigned int& schrittweite) const;
53 double getHorizonForRay(const unsigned int& ix1, const unsigned int& iy1, const double& alpha,
54 std::vector<unsigned int>& viewCells, std::vector<unsigned int>& vf_clusterT);
55 double GetSymetricPartOfViewFactor(const int i, const int j, const int a, const int b);
56 double GetZEdgeVector(const double z, const double nx, const double ny, const double deltaX, const double deltaY);
57 double EuclidianDistance(const double x, const double y, const double z);
58 int GetSplitFactor(const double sideLength, const double dist);
59 double GetCoordinateForSmallCell(const double veca, const double vecb, const double vecc,
60 const int i, const int j, const int splitFactor);
61 double CosAngleBetween2Vectors(const double nx, const double ny, const double nz, const double bx,
62 const double by, const double bz);
63
64 void calcVF_cluster();
65 bool VF_calc(const unsigned int ix1, const unsigned int iy1, const int ix2, const int iy2, mio::Array1D<double> &tan_h);
66};
67
68#endif
Definition: ViewFactorsAlgorithm.h:21
Definition: ViewFactorsCluster.h:25
double getSkyViewFactor(const int &i, const int &j)
Definition: ViewFactorsCluster.cc:43
ViewFactorsCluster(const mio::Config &cfg, const mio::DEMObject &dem_in)
Definition: ViewFactorsCluster.cc:20
double GetViewfactor(const int i, const int j, const int a, const int b)
Definition: ViewFactorsCluster.cc:184