LBIBCell
 All Classes Functions Variables Friends Pages
PhysicalNode.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 FLUIDPOINT_HPP
23 #define FLUIDPOINT_HPP
24 
25 
26 #include <LbmLib/include/nodes/EulerianPoint.hpp>
27 #include <LbmLib/include/Direction.hpp>
28 #include <LbmLib/include/solver/FluidSolver/FluidSolver.hpp>
29 #include <array>
30 #include <vector>
31 #include <string>
32 #include <iostream>
33 #include <memory>
34 
35 namespace LbmLib {
36 namespace solver {
37 class CDEAbstractSolver;
38 }
39 namespace nodes {
40 class BoundaryNode;
41 
45 class PhysicalNode : public EulerianPoint {
46  public:
52  explicit PhysicalNode(
53  int x,
54  int y);
58  ~PhysicalNode();
65  PhysicalNode* const node,
66  const Direction& d);
67 
74  BoundaryNode* const boundaryNode,
75  const Direction& d);
76 
82  BoundaryNode* getBoundaryNeighbour(const Direction& d) const;
83 
89  PhysicalNode* getPhysicalNeighbour(const Direction& d) const;
90 
94  void resetBoundaryNodes();
95 
100  virtual std::string getType() const;
101 
106  void dumpNode(std::ostream* oStream) const;
107 
112  const solver::FluidSolver& getFluidSolver() const;
113 
119 
125  solver::CDEAbstractSolver& getCDESolver(size_t id) const;
126 
133  solver::CDEAbstractSolver& getCDESolverSlow(const std::string& name) const;
134 
139  std::vector<solver::CDEAbstractSolver*>& getCDESolvers();
140 
145  void addCDESolver(const std::string& cdeSolverName);
146 
151  void updateDomainIdentifier();
152 
157  unsigned int getDomainIdentifier() const;
158 
163  void setDomainIdentifier(unsigned int domainIdentifier);
164 
169  unsigned int getCellType() const;
170 
175  void setCellType(unsigned int celltype);
176 
177  private:
181  void reinitialiseCDESolvers();
182 
186  solver::FluidSolver fluidSolver_;
190  std::vector<solver::CDEAbstractSolver*> cdeSolvers_;
191 
195  std::array<PhysicalNode*, 9> neighbourNodes_;
196 
200  std::array<BoundaryNode*, 5> boundaryNodes_;
201 
205  unsigned int domainIdentifier_;
206 
210  unsigned int cellType_;
211 };
212 } // end namespace
213 } // end namespace
214 
215 #endif // FLUIDPOINT_HPP
The abstract base class for all CDESolvers.
solver::CDEAbstractSolver & getCDESolverSlow(const std::string &name) const
getCDESolverSlow Getter method for the cde Solver
void dumpNode(std::ostream *oStream) const
dumpNode dumps the node for dot
void setCellType(unsigned int celltype)
setCellType setter for the celltype
PhysicalNode * getPhysicalNeighbour(const Direction &d) const
getPhysicalNeighbour Getter method to access the Physical Neighbour
The EulerianPoint class The base class for all points with an integer position and no speed...
class representing a physical node
void setDomainIdentifier(unsigned int domainIdentifier)
setDomainIdentifier setter for the domain identifier
the Fluid Solver which solves the D2Q9 LBGK
Definition: FluidSolver.hpp:41
void setBoundaryNeighbour(BoundaryNode *const boundaryNode, const Direction &d)
setBoundaryNeighbour Setter for the neighbour boundary point
PhysicalNode(int x, int y)
PhysicalNode constructs a physical node.
unsigned int getDomainIdentifier() const
getter for the Domain Identifier of this node
~PhysicalNode()
~PhysicalNode Destructor
unsigned int getCellType() const
getter for the cell type of this node
void updateDomainIdentifier()
updateDomainIdentifier updates the domain Identifier of this node. If the domain changes it returns t...
const solver::FluidSolver & getFluidSolver() const
getFluidSolver Const getter method for the fluid Solver
virtual std::string getType() const
getType The type of a node class
BoundaryNode * getBoundaryNeighbour(const Direction &d) const
getBoundaryNeighbour Getter method to access the Boundary Neighbour
void addCDESolver(const std::string &cdeSolverName)
addCDESolver Adds a CDESolver to this node
class representing a boundary node
solver::CDEAbstractSolver & getCDESolver(size_t id) const
getCDESolver Getter method for the cde Solver
std::vector< solver::CDEAbstractSolver * > & getCDESolvers()
getCDESolvers Getter method for all CDE Solvers
void resetBoundaryNodes()
resetBoundaryNodes Resets the boundary nodes to nullptr
void setPhysicalNeighbour(PhysicalNode *const node, const Direction &d)
setPhysicalNeighbour Setter for the neighbour fluid point