LBIBCell
 All Classes Functions Variables Friends Pages
DiracD2Q4.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 DiracD2Q4_HPP
23 #define DiracD2Q4_HPP
24 #include <LbmLib/include/solver/CDESolver/CDEAbstractSolver.hpp>
25 #include <array>
26 #include <string>
27 
28 namespace LbmLib {
29 namespace solver {
33 class DiracD2Q4 : public BaseCDESolver<DiracD2Q4> {
34  public:
38  virtual ~DiracD2Q4() {}
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;
103  DiracD2Q4();
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 // DiracD2Q4_HPP
virtual double & accessDistribution(const Direction &dir)
accessDistribution Access to the distribution
Definition: DiracD2Q4.cpp:85
The Base class for all CDESolver implementations This classes uses the recursive template idiom to au...
virtual void loadSolver(std::stringstream *const stream)
loads the solver from the stream
Definition: DiracD2Q4.cpp:75
virtual void rescaleDistributions(const double factor)
Rescales all distributions by a factor.
Definition: DiracD2Q4.cpp:90
virtual void reinitialise()
reinitialise this solver as the corresponding physical node has switched domain
Definition: DiracD2Q4.cpp:182
virtual void collide()
collide The collision step of the LBM
Definition: DiracD2Q4.cpp:100
virtual void initSolver()
initSolver Use this to initalise the solver
Definition: DiracD2Q4.cpp:52
the cde solver for the schnakenberg turing pattern
Definition: DiracD2Q4.hpp:33
virtual double getC() const
getC Calculates the concentration on this node
Definition: DiracD2Q4.cpp:96
virtual double calculateEquilibrium(const Direction &dir)
calculateEquilibrium calculates the equilibirum for direction dir
Definition: DiracD2Q4.cpp:132
virtual void advect()
advect The advect step of the LBM
Definition: DiracD2Q4.cpp:161
virtual void writeSolver(std::ostream *const stream)
writes the solver to the stream
Definition: DiracD2Q4.cpp:67
virtual ~DiracD2Q4()
~CDESolverD2Q4 virtual Destructor
Definition: DiracD2Q4.hpp:38
The CDEDirectionsIteratorD2Q4 class Provides methods to handle the Directions. Use the Function Direc...
Definition: Direction.hpp:91