Microflow 3D  v1.0
LatticeParametersD3Q19.h
Go to the documentation of this file.
1 // ==============================================================================================
2 // Microflow 3D, http://www.microflow.pwr.edu.pl/
3 // Created by Roman Szafran on 01.05.19.
4 // Copyright (c) 2019 Wroclaw University of Science and Technology.
5 // Distributed under the Apache License, Version 2.0. You may obtain a copy of the License at
6 // http://www.apache.org/licenses/LICENSE-2.0 or see accompanying file license.txt.
7 // Redistributions of source code must retain the above copyright and license notice.
8 // ==============================================================================================
9 
10 # pragma once
11 
12 #include <memory>
13 
14 #define MFQ19 (19)
15 #define MFQ27 (27)
16 #define MFQ19_H ((MFQ19 - 1) / 2)
17 
18 namespace MF {
19  namespace GU {
20 
24  public:
25  LatticeParametersD3Q19() = default;
26 
27  ~LatticeParametersD3Q19() = default;
28 
29  static std::shared_ptr<MF::GU::LatticeParametersD3Q19> New() {
30  auto LatticeParametersD3Q19_Ptr = std::make_shared<MF::GU::LatticeParametersD3Q19>();
31  return LatticeParametersD3Q19_Ptr;
32  };
33 
34  static constexpr double LatticeConstant_CSQ = 1.0 / 3.0;
35 
37  static constexpr int8_t DirectionVectorComponent_Cx[MFQ27]
38  //f = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12, 13, 14,15,16,17,18,|19,20,21, 22, 23,24,25, 26
39  = {0, 1, 0, -1, 0, 0, 0, 1, -1, -1, 1, 1, 1, -1, -1, 0, 0, 0, 0, -1, 1, 1, -1, -1, 1, 1, -1};
40 
42  static constexpr int8_t DirectionVectorComponent_Cy[MFQ27]
43  //f = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16, 17, 18,|19,20,21,22, 23, 24, 25, 26
44  = {0, 0, 1, 0, -1, 0, 0, 1, 1, -1, -1, 0, 0, 0, 0, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1};
45 
47  static constexpr int8_t DirectionVectorComponent_Cz[MFQ27]
48  //f = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11, 12, 13,14,15, 16, 17,18,|19, 20,21,22, 23, 24,25,26
49  = {0, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 1, 1, -1, -1, 1, 1};
50 
52  static constexpr uint8_t ReverseDirectionVector_Rc[MFQ27]
53  //f = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,|19,20,21,22,23,24,25,26
54  = {0, 3, 4, 1, 2, 6, 5, 9, 10, 7, 8, 13, 14, 11, 12, 17, 18, 15, 16, 25, 26, 23, 24, 21, 22, 19, 20};
55 
57  static constexpr uint8_t SwapDirections[MFQ19_H][2] = {{1,3},{2,4},{5,6},{7,9},{8,10},{11,13},{12,14},{15,17},{16,18}};
58 
60  static constexpr double DirectionWeight_W[MFQ19]
61  //f = 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 ,13 ,14 ,15 ,16 ,17 ,18
62  = {1.0 / 3.0, 1.0 / 18.0, 1.0 / 18.0, 1.0 / 18.0, 1.0 / 18.0, 1.0 / 18.0, 1.0 / 18.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0,
63  1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0, 1.0 / 36.0};
64 
66  static uint8_t find_f(const char nz, const char ny, const char nx) {
67  unsigned char k;
68 
69  for (k = 0; k < MFQ27; k++)
71  return (k);
72  return (0);
73  };
74 
75  };
76 
77  } /* namespace GU */
78 } /* namespase MF */
#define MFQ19
Number of lattice directions D3Q19.
static constexpr uint8_t ReverseDirectionVector_Rc[MFQ27]
Indexes of reverse directions to given direction of lattice Q19 plus additional nodes of lattice Q27...
static constexpr int8_t DirectionVectorComponent_Cx[MFQ27]
The x direction vector component of all D3Q19 lattice directions plus additional nodes of the Q27 lat...
#define MFQ27
Number of lattice directions D3Q27.
static constexpr int8_t DirectionVectorComponent_Cy[MFQ27]
The y direction vector component of all D3Q19 lattice directions plus additional nodes of the Q27 lat...
static constexpr int8_t DirectionVectorComponent_Cz[MFQ27]
The z direction vector component of all D3Q19 lattice directions plus additional nodes of the Q27 lat...
static constexpr double LatticeConstant_CSQ
c_s^2 lattice constant
#define MFQ19_H
Number of elements (linked directions) in propagation table for one node.
static uint8_t find_f(const char nz, const char ny, const char nx)
Function finds the direction of f based on the components of the direction vector nx...
static constexpr double DirectionWeight_W[MFQ19]
Weights for lattice directions.
A class that stores the parameters characteristic for the D3Q19 lattice.
static std::shared_ptr< MF::GU::LatticeParametersD3Q19 > New()
static constexpr uint8_t SwapDirections[MFQ19_H][2]
Indexes of swap directions of f(i) in D3Q19.