LBIBCell
 All Classes Functions Variables Friends Pages
tutorial_02_CDESolverD2Q5_R.hpp
1 /* Copyright (c) 2013 David Sichau <mail"at"sichau"dot"eu>
2  * 2013-2015 Simon Tanaka <tanakas"at"gmx"dot"ch>
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 #ifndef TUTORIAL_02_CDESOLVERD2Q5_R_HPP
23 #define TUTORIAL_02_CDESOLVERD2Q5_R_HPP
24 #include <LbmLib/include/solver/CDESolver/CDEAbstractSolver.hpp>
25 #include <array>
26 #include <string>
27 
28 namespace LbmLib {
29 namespace solver {
30 
34 class tutorial_02_CDESolverD2Q5_R : public BaseCDESolver<tutorial_02_CDESolverD2Q5_R> {
35  public:
40 
45  const double reaction(void) const;
46 
50  virtual void collide();
51 
55  virtual void advect();
56 
60  virtual void initSolver();
61 
67  virtual double calculateEquilibrium(const Direction& dir);
68 
74  virtual double& accessDistribution(const Direction& dir);
75 
80  virtual void rescaleDistributions(const double factor);
81 
86  virtual double getC() const;
87 
91  virtual void reinitialise();
92 
97  virtual void loadSolver(std::stringstream* const stream);
98 
103  virtual void writeSolver(std::ostream* const stream);
104 
105  private:
109  friend class BaseCDESolver;
110 
115 
119  void localSwap();
120 
124  std::array<double, 5> distributions_;
125 
129  static const CDEDirectionsIteratorD2Q5 cdeDirIter_;
130 
134  static const std::string name;
135 };
136 }
137 } // end namespace
138 
139 #endif // TUTORIAL_02_CDESOLVERD2Q5_R_HPP
virtual double calculateEquilibrium(const Direction &dir)
calculateEquilibrium calculates the equilibirum for direction dir
The Base class for all CDESolver implementations This classes uses the recursive template idiom to au...
virtual void advect()
advect The advect step of the LBM
virtual void reinitialise()
reinitialise this solver as the corresponding physical node has switched domain
virtual void collide()
collide The collision step of the LBM
The CDEDirectionsIteratorD2Q5 class Provides methods to handle the Directions. Use the Function Direc...
Definition: Direction.hpp:126
virtual double & accessDistribution(const Direction &dir)
accessDistribution Access to the distribution
virtual double getC() const
getC Calculates the concentration on this node
virtual void rescaleDistributions(const double factor)
Rescales all distributions by a factor.
virtual void writeSolver(std::ostream *const stream)
writes the solver to the stream
virtual void loadSolver(std::stringstream *const stream)
loads the solver from the stream
const double reaction(void) const
reaction The reaction term of the tutorial_02_CDESolverD2Q5_R solver is implemented here...
virtual void initSolver()
initSolver Use this to initalise the solver
virtual ~tutorial_02_CDESolverD2Q5_R()
~CDESolverD2Q5 virtual Destructor