Debian Codegraph @

pkg/lbm/LBMnode.hpp

raw
1 /*************************************************************************
2 * Copyright (C) 2009-2012 by Franck Lominé *
3 * [email protected] *
4 * *
5 * This program is free software; it is licensed under the terms of the *
6 * GNU General Public License v2 or later. See file LICENSE for details. *
7 * *
8 *************************************************************************/
9 #ifdef LBM_ENGINE
10
11 #pragma once
12 #include <lib/multimethods/Indexable.hpp>
13 #include <lib/serialization/Serializable.hpp>
14
15 namespace yade { // Cannot have #include directive inside.
16
17 class LBMnode : public Serializable {
18 public:
19 int i, /*! node index in x direction */
20 j, /*! node index in y direction */
21 k, /*! node index in z direction */
22 body_id; /*! the node belongs to the body indexed with body_id*/
23
24 short int IsolNb; /*! number of boundary links of a fluid boundary nodes*/
25
26 bool isObstacle, /*! the node belongs to an obstacle */
27 isObstacleBoundary, /*! the node is an obstacle boundary */
28 isFluidBoundary, /*! the node is a fluid boundary */
29 wasObstacle, /*! the node was an obstacle */
30 isNewObstacle, /*! the node is an new obstacle node */
31 isNewFluid, /*! the node is an new fluid node */
32 applyBC, /*! the node is subject to the one boundary condition */
33 applyXmBC, /*! the node is subject to the left boundary condition */
34 applyXpBC, /*! the node is subject to the right boundary condition */
35 applyYpBC, /*! the node is subject to the top boundary condition */
36 applyYmBC, /*! the node is subject to the bottom boundary condition */
37 applyZpBC, /*! the node is subject to the front boundary condition NOT USED NOW*/
38 applyZmBC, /*! the node is subject to the back boundary condition NOT USED NOW*/
39 applyYmXmBC, /*! the node is subject to the bottom-left boundary condition */
40 applyYpXmBC, /*! the node is subject to the top-left boundary condition */
41 applyYmXpBC, /*! the node is subject to the bottom-right boundary condition */
42 applyYpXpBC; /*! the node is subject to the top-right boundary condition */
43
44 Vector3r posb, /*! the node position */
45 velb; /*! the node velocity */
46
47 Real rhob; /*! the node density */ /*! the node density */
48 vector<int> neighbour_id; /*! list of adjacent nodes */
49 vector<int> links_id; /*! list of links */
50 vector<Real> f;
51 vector<Real> fprecol;
52 vector<Real> fpostcol;
53
54 void DispatchBoundaryConditions(int SizeNx, int SizeNy, int SizeNz);
55 bool checkIsNewFluid();
56 bool checkIsNewObstacle();
57 void MixteBC(string lbmodel, Real density, Vector3r U, string where);
58 void SetCellIndexesAndPosition(int indI, int indJ, int indK);
59 void setAsObstacle() { isObstacle = true; }
60 void setAsFluid() { isObstacle = false; }
61
62 virtual ~LBMnode();
63 // clang-format off
64 YADE_CLASS_BASE_DOC(LBMnode,Serializable,"Node class for Lattice Boltzmann Method ");
65 // clang-format on
66 };
67 REGISTER_SERIALIZABLE(LBMnode);
68
69 } // namespace yade
70
71 #endif //LBM_ENGINE