LBIBCell
 All Classes Functions Variables Friends Pages
SchnakenbergD2Q4v.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 SCHNAKENBERGD2Q4V_HPP
23 #define SCHNAKENBERGD2Q4V_HPP
24 #include <LbmLib/include/solver/CDESolver/CDEAbstractSolver.hpp>
25 #include <array>
26 #include <string>
27 
28 namespace LbmLib {
29 namespace solver {
33 class SchnakenbergD2Q4v : public BaseCDESolver<SchnakenbergD2Q4v> {
34  public:
38  virtual ~SchnakenbergD2Q4v() {}
39 
43  virtual void collide();
44 
48  virtual void advect();
49 
53  virtual void initSolver();
54 
60  virtual double calculateEquilibrium(const Direction& dir);
61 
67  virtual double& accessDistribution(const Direction& dir);
68 
73  virtual void rescaleDistributions(const double factor);
74 
79  virtual double getC() const;
80 
84  virtual void reinitialise();
85 
90  virtual void loadSolver(std::stringstream* const stream);
91 
96  virtual void writeSolver(std::ostream* const stream);
97 
98  private:
99  friend class BaseCDESolver;
104 
108  void localSwap();
109 
113  std::array<double, 5> distributions_;
114 
118  static const CDEDirectionsIteratorD2Q4 cdeDirIter_;
122  static const std::string name;
123 };
124 }
125 } // end namespace
126 
127 #endif // SCHNAKENBERGD2Q4V_HPP
virtual void reinitialise()
reinitialise this solver as the corresponding physical node has switched domain
virtual void collide()
collide The collision step of the LBM
virtual void loadSolver(std::stringstream *const stream)
loads the solver from the stream
The Base class for all CDESolver implementations This classes uses the recursive template idiom to au...
virtual void initSolver()
initSolver Use this to initalise the solver
virtual void advect()
advect The advect step of the LBM
virtual double & accessDistribution(const Direction &dir)
accessDistribution Access to the distribution
the cde solver for the D2Q4 Schnakenberg turing pattern
virtual double getC() const
getC Calculates the concentration on this node
virtual ~SchnakenbergD2Q4v()
~CDESolverD2Q4 virtual Destructor
virtual void rescaleDistributions(const double factor)
Rescales all distributions by a factor.
virtual double calculateEquilibrium(const Direction &dir)
calculateEquilibrium calculates the equilibirum for direction dir
virtual void writeSolver(std::ostream *const stream)
writes the solver to the stream
The CDEDirectionsIteratorD2Q4 class Provides methods to handle the Directions. Use the Function Direc...
Definition: Direction.hpp:91