forked from forefireAPI/firefront
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FDCell.h
157 lines (107 loc) · 4.53 KB
/
FDCell.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
Copyright (C) 2012 ForeFire Team, SPE, UniversitŽ de Corse.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 US
*/
#ifndef FDCELL_H_
#define FDCELL_H_
#include "FFPoint.h"
#include "FFVector.h"
#include "FireNode.h"
#include "BurningMap.h"
#include "ParallelException.h"
#include "ArrayDataLayer.h"
#include "Futils.h"
using namespace std;
namespace libforefire {
class FireDomain;
class FDCell {
FireDomain* domain; /*!< FireDomain containing the cells */
FFPoint SWCorner, NECorner; /*!< corners of the cell */
size_t globalI, globalJ; /*!< indices of the cell in the FireDomain */
// Internal variables for the burning matrices
size_t mapSizeX, mapSizeY, mapSize; /*!< size of the matrix */
double dx, dy; /*!< resolution of the matrix */
BurningMap* arrivalTimes; /*!< Burning map inside the cell */
bool allocated; /*!< boolean for the allocation of the burning map */
list<FireNode*>::iterator ifn;
static const double infinity;
public:
static bool outputs; /*! boolean for outputs */
list<FireNode*> fireNodes; /*!< firenodes present in the cell */
/*! \brief default constructor */
FDCell(FireDomain* = 0, size_t = 0, size_t = 0);
/*! \brief destructor */
virtual ~FDCell();
/*! \brief overloaded operator == */
friend int operator==(const FDCell&, const FDCell&);
/*! \brief overloaded operator != */
friend int operator!=(const FDCell&, const FDCell&);
/*! \brief mutator of the FireDomain */
void setDomain(FireDomain*);
/*! \brief mutator of the corners */
void setCorners(const FFPoint&, const FFPoint&);
/*! \brief mutator of the global coordinates */
void setGlobalCoordinates(const size_t&, const size_t&);
/*! \brief mutator of the size of the burning matrix */
void setMatrixSize(const size_t&, const size_t&);
/*! \brief mutator of the burning matrix */
void setArrivalTime(const size_t&, const size_t&, double);
/*! \brief getter of the FireDomain */
FireDomain* getDomain();
double getArea();
double getBmapElementArea();
/*! \brief getter of the map of arrival times */
BurningMap* getBurningMap();
/*! \brief accessors to the global coordinates */
size_t getI();
size_t getJ();
/*! \brief accessors to the global coordinates */
FFPoint& getSWCorner();
FFPoint& getNECorner();
/*! \brief accessors to the burning matrix and properties */
FFArray<double>* getBurningMatrix();
size_t getBMapSizeX();
size_t getBMapSizeY();
/*! \brief accessor to the burning matrix */
double getArrivalTime(const size_t&, const size_t&);
/*! \brief number of firenodes */
size_t getNumFN();
/*! \brief finding the firenode with a given Id */
FireNode* getFirenodeByID(const long&);
FireNode* getFirenodeByID(const double&);
/*! \brief adding a firenode into that cell */
void addFireNode(FireNode*);
/*! \brief removing a firenode into that cell */
void removeFireNode(FireNode*);
/*! \brief computing the burning ratio of the cell */
double getBurningRatio(const double&);
/*! \brief computing the max ROS of the cell */
double getMaxSpeed(const double&);
/*! \brief computing a specified flux on the cell */
double applyModelsOnBmap(string, const double&, const double&,int* );
/*! \brief computes a count of each model active on a layer*/
int activeModelsOnBmap(string , const double& , int*);
/*! \brief interpolating the map of arrival times from a prescribed one */
void interpolateArrivalTimes(Array2DdataLayer<double>*
, const int&, const int&, const int&);
/*! \brief validating the topology for each firenode in the cell */
void validateTopology(string);
/*! \brief managing the trash cell of the domain */
void makeTrash();
/*! \brief string for cell information */
string toString();
/*! \brief string for model information */
string getFluxModelName(int );
};
}
#endif /* FDCELL_H_ */