antioch-0.4.0
particle_flux.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // Antioch - A Gas Dynamics Thermochemistry Library
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Benjamin S. Kirk,
7 // Sylvain Plessis, Roy H. Stonger
8 //
9 // Copyright (C) 2013 The PECOS Development Team
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the Version 2.1 GNU Lesser General
13 // Public License as published by the Free Software Foundation.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
23 // Boston, MA 02110-1301 USA
24 //
25 //-----------------------------------------------------------------------el-
26 
27 #ifndef ANTIOCH_PARTICLE_FLUX_H
28 #define ANTIOCH_PARTICLE_FLUX_H
29 
30 namespace Antioch
31 {
32 
37  template<typename VectorCoeffType>
39  {
40  private:
41  VectorCoeffType _abscissa;
42  VectorCoeffType _flux;
43  bool _updated;
44  bool _x_updated;
45  unsigned int _n_coupled;
46  unsigned int _n_updated;
47 
48  public:
49  ParticleFlux();
50  ParticleFlux(const VectorCoeffType &x, const VectorCoeffType &flux);
51  ~ParticleFlux();
52 
54  bool updated() const;
55 
57  bool x_updated() const;
58 
60  const VectorCoeffType &abscissa() const;
61 
63  const VectorCoeffType &flux() const;
64 
66  template<typename VectorStateType>
67  void set_abscissa(const VectorStateType &x);
68 
70  template<typename VectorStateType>
71  void set_flux(const VectorStateType &flux);
72 
74  void update_done();
75 
77  void add_a_reaction();
78 
80  void remove_a_reaction();
81 
82  };
83 
84  template<typename VectorCoeffType>
85  inline
86  const VectorCoeffType &ParticleFlux<VectorCoeffType>::abscissa() const
87  {
88  return _abscissa;
89  }
90 
91  template<typename VectorCoeffType>
92  inline
93  const VectorCoeffType &ParticleFlux<VectorCoeffType>::flux() const
94  {
95  return _flux;
96  }
97 
98  template<typename VectorCoeffType>
99  inline
101  {
102  _n_coupled--;
103  return;
104  }
105 
106  template<typename VectorCoeffType>
107  inline
109  {
110  _n_coupled++;
111  _updated = true;
112  return;
113  }
114 
115  template<typename VectorCoeffType>
116  inline
118  {
119  return _updated;
120  }
121 
122  template<typename VectorCoeffType>
123  inline
125  {
126  return _x_updated;
127  }
128 
129  template<typename VectorCoeffType>
130  inline
132  {
133  _n_updated++;
134  if(_n_updated == _n_coupled)
135  {
136  _updated = false;
137  _x_updated = false;
138  _n_updated = 0;
139  }
140  return;
141  }
142 
143  template<typename VectorCoeffType>
144  template<typename VectorStateType>
145  inline
146  void ParticleFlux<VectorCoeffType>::set_abscissa(const VectorStateType &x)
147  {
148  _abscissa = x;
149  _updated = true;
150  _x_updated = true;
151  }
152 
153  template<typename VectorCoeffType>
154  template<typename VectorStateType>
155  inline
156  void ParticleFlux<VectorCoeffType>::set_flux(const VectorStateType &flux)
157  {
158  _flux = flux;
159  _updated = true;
160  }
161 
162  template<typename VectorCoeffType>
163  inline
165  _updated(false),
166  _x_updated(false),
167  _n_coupled(0),
168  _n_updated(0)
169  {
170  return;
171  }
172 
173  template<typename VectorCoeffType>
174  inline
176  {
177  return;
178  }
179 
180  template<typename VectorCoeffType>
181  inline
182  ParticleFlux<VectorCoeffType>::ParticleFlux(const VectorCoeffType &x, const VectorCoeffType &flux):
183  _abscissa(x),
184  _flux(flux),
185  _updated(true),
186  _x_updated(true),
187  _n_coupled(0),
188  _n_updated(0)
189  {
190  return;
191  }
192 
193 }
194 
195 #endif
bool updated() const
Stores the incoming flux of particles.
Definition: particle_flux.h:38
const VectorCoeffType & flux() const
Definition: particle_flux.h:93
VectorCoeffType _abscissa
Definition: particle_flux.h:41
const VectorCoeffType & abscissa() const
Definition: particle_flux.h:86
bool x_updated() const
void set_flux(const VectorStateType &flux)
unsigned int _n_updated
Definition: particle_flux.h:46
VectorCoeffType _flux
Definition: particle_flux.h:42
void set_abscissa(const VectorStateType &x)
The parameters are reduced parameters.
unsigned int _n_coupled
Definition: particle_flux.h:45

Generated on Thu Jul 7 2016 11:09:45 for antioch-0.4.0 by  doxygen 1.8.8