Code_TYMPAN  4.2.0
Industrial site acoustic simulation
meteoLin.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14 */
15 
21 #include <array>
23 #include "meteo.h"
24 
25 #ifndef __METEO_LIN_H
26 #define __METEO_LIN_H
27 
31 using namespace std;
32 
33 class meteoLin : public meteo
34 {
35 public:
37  meteoLin() : meteo() {}
39  meteoLin(const double& windAngle, const double& sound_speed, const double& gradC = 0., const double& gradV = 0.) : meteo(windAngle, sound_speed),
40  grad_C(gradC),
41  grad_V(gradV)
42  {
43  init();
44  }
45 
47  ~meteoLin() {};
48 
50  void setGradC(const double& g) { grad_C = g; }
52  double getGradC() const { return grad_C; }
53 
55  void setGradV(const double& g) { grad_V = g; init(); }
57  double getGradV() const { return grad_V; }
58 
66  double cTemp(const vec3& P, vec3& grad) const;
67 
74  vec3 cWind(const vec3& P) const;
75 
80  virtual const array< array<double, 3>, 3 >& getJacobMatrix() { return jacob_matrix; }
81 
83  virtual void init();
84 
85 private:
86  double grad_C;
87  double grad_V;
88 
89  array< array<double, 3>, 3 > jacob_matrix;
90 };
91 
92 #endif //__METEO_LIN_H
virtual const array< array< double, 3 >, 3 > & getJacobMatrix()
Get the jacobian matrix.
Definition: meteoLin.h:80
double grad_V
Wind gradient.
Definition: meteoLin.h:87
~meteoLin()
Destructor.
Definition: meteoLin.h:47
double grad_C
Sound speed gradient.
Definition: meteoLin.h:86
void setGradV(const double &g)
Set wind gradient.
Definition: meteoLin.h:55
STL namespace.
double getGradC() const
Get speed gradient.
Definition: meteoLin.h:52
meteoLin()
Default constructor.
Definition: meteoLin.h:37
Class to define linear gradient for wind and sound speed.
Definition: meteoLin.h:33
3D vector Vector defined with 3 float numbers
Definition: mathlib.h:107
void setGradC(const double &g)
Set speed gradient.
Definition: meteoLin.h:50
Weather data class for the simulation.
Definition: meteo.h:30
Math library.
array< array< double, 3 >, 3 > jacob_matrix
Jacobian matrix.
Definition: meteoLin.h:89
double getGradV() const
Get wind gradient.
Definition: meteoLin.h:57
meteoLin(const double &windAngle, const double &sound_speed, const double &gradC=0., const double &gradV=0.)
Constructor.
Definition: meteoLin.h:39