39 Thread (uint64_t NodeID, uint32_t NrOfNodes){
42 m_NodeArray_Ptr = std::make_shared<std::vector<MF::Database::Node>>(NrOfNodes);
45 m_Coordinate_Ptr = std::make_shared<std::vector<MF::Database::Vec3<int32_t>>>(NrOfNodes);
58 static std::shared_ptr<MF::Database::Thread>
New(
const std::shared_ptr<MF::GU::LatticeParametersD3Q19>& LatticeParameters_Ptr, uint64_t NodeID, uint32_t NrOfNodes) {
59 auto Thread_Ptr = std::make_shared<MF::Database::Thread>(NodeID, NrOfNodes);
60 Thread_Ptr->m_Thread_Ptr = Thread_Ptr;
90 std::shared_ptr<std::vector<MF::Database::Vec3<int32_t>>>
m_Coordinate_Ptr = {
nullptr};
104 inline int32_t&
getNodeCoordX(
const std::size_t &nodeNr){
return (*m_Coordinate_Ptr)[nodeNr].x;};
105 inline int32_t&
getNodeCoordY(
const std::size_t &nodeNr){
return (*m_Coordinate_Ptr)[nodeNr].y;};
106 inline int32_t&
getNodeCoordZ(
const std::size_t &nodeNr){
return (*m_Coordinate_Ptr)[nodeNr].z;};
107 inline void setNodeCoordX(
const std::size_t &nodeNr,
const int32_t& X){(*m_Coordinate_Ptr)[nodeNr].x = X;};
108 inline void setNodeCoordY(
const std::size_t &nodeNr,
const int32_t& Y){(*m_Coordinate_Ptr)[nodeNr].y = Y;};
109 inline void setNodeCoordZ(
const std::size_t &nodeNr,
const int32_t& Z){(*m_Coordinate_Ptr)[nodeNr].z = Z;};
117 for (
auto k = 0; k <
MFQ19_H; k++){
122 else if (f == direction2)
136 omp_set_num_threads(CPU_ThreadsNr);
137 #pragma omp parallel for default(none) schedule(guided) //OpenMP compilation directive 139 (*m_pColideFunc)(&(*m_NodeArray_Ptr)[node]);
149 omp_set_num_threads(CPU_ThreadsNr);
150 #pragma omp parallel for default(none) schedule(guided) //OpenMP compilation directive 152 (*m_pBoundaryFunction)(&(*m_NodeArray_Ptr)[node]);
162 omp_set_num_threads(CPU_ThreadsNr);
163 #pragma omp parallel for default(none) schedule(guided) //OpenMP compilation directive 165 (*m_pBoundaryFunction)(&(*m_NodeArray_Ptr)[node]);
166 (*m_pColideFunc)(&(*m_NodeArray_Ptr)[node]);
177 omp_set_num_threads(CPU_ThreadsNr);
178 #pragma omp parallel for schedule(static) default(none) private(LinkNr)//OpenMP compilation directive 180 for (LinkNr = 0; LinkNr <
MFQ19_H; LinkNr++) {
182 const auto link1 = m_LatticeParameters_Ptr->SwapDirections[LinkNr][0];
183 const auto link2 = m_LatticeParameters_Ptr->SwapDirections[LinkNr][1];
bool m_IsInletBalanceSurface
Flag used during post-processing stage. If true, nodes lie on the inlet surface. Value used for manua...
struct MF::GB::NodeID::@0::@1 Node
uint16_t m_uidThreadNr
MFThread number +1 from thread config file. Automatically created threads have uidThreadNr = 0...
int32_t & getNodeCoordZ(const std::size_t &nodeNr)
Returns Y coordinate of node nodeNr.
void DoPreCollisionOnly(const int &CPU_ThreadsNr)
Invokes ONLY the pre-collision function for all nodes.
void DoCollisionOnly(const int &CPU_ThreadsNr)
Invokes the collision function for all nodes.
MFThread is an object that collects some number of Nodes of the same type which shares the same addit...
std::shared_ptr< NodePropArray > m_SecondHalfPropagationTable_Ptr
Propagation table of pointers to nodes. Second half.
MF::Database::Node & getPropTableNodeRef(const MF::Database::Node *nodePointer, const uint8_t &LinkNr)
Sets a pointer to a linked node in a second propagation table.
MF::Database::Node * getSecPropTableNodePointer(const std::size_t &nodeNr, const uint8_t &LinkNr)
Returns a pointer to a linked node from a propagation table.
A class that allows to determine the proper NodeID from combined nodeType, uidThreadNr, ThreadCount, ComponentNr and PhaseNr.
std::shared_ptr< std::vector< MF::Database::Vec3< int32_t > > > m_Coordinate_Ptr
Original nodes coordinates in a sparse geometry.
MF::Database::Vec3< double > m_BoundaryValue_ULB
Initial or boundary value of LB velocity (x,y,z).
std::shared_ptr< MF::Database::Thread > m_Thread_Ptr
Shared Ptr to MFThread.
Basic data structure for storing f(i) data for each computational grid node.
MF::Database::Node & getNodeRef(const std::size_t &nodeNr)
Returns a reference to a linked node from a propagation table.
MF::Database::Node & getSecondPropTableNodeRef(const std::size_t &nodeNr, const uint8_t &LinkNr)
Returns a reference to a linked node from a propagation table.
void setNodeCoordX(const std::size_t &nodeNr, const int32_t &X)
Returns Z coordinate of node nodeNr.
int32_t & getNodeCoordY(const std::size_t &nodeNr)
Returns X coordinate of node nodeNr.
std::string m_ThreadName
Name of MFThread.
MF::Database::Node * getPropTableNodePointer(const std::size_t &nodeNr, const uint8_t &LinkNr)
MF::Database::Node & getPropTableNodeRef(const std::size_t &nodeNr, const uint8_t &LinkNr)
Converts a node pointer to a node number.
bool m_IsOutletBalanceSurface
Flag used during post-processing stage. If true, nodes lie on the outlet surface. Value used for manu...
std::size_t getNodeNr(const MF::Database::Node *nodePointer)
Returns a pointer to a linked node from a propagation table.
static std::shared_ptr< MF::GU::LatticeParametersD3Q19 > m_LatticeParameters_Ptr
Lattice parameters shared pointer.
uint16_t m_NodeType
Node type number.
void(* m_pColideFunc)(MF::Database::Node *)
Velocity and rho function pointer.
uint8_t m_ComponentNr
Component number for multicomponent systems. Max. 255.
void setNodeCoordY(const std::size_t &nodeNr, const int32_t &Y)
Sets X coordinate of node nodeNr.
void setNodeCoordZ(const std::size_t &nodeNr, const int32_t &Z)
Sets Y coordinate of node nodeNr.
void setNodePtrInSecondPropTable(const std::size_t &nodeNr, const uint8_t &LinkNr, MF::Database::Node *nodePtr)
Sets a pointer to a linked node in a propagation table.
MF::Database::Vec3< double > m_XYZForce_LB
Components X, Y, Z of the volumetric force, e.g. gravitational force [N/m3].
Thread(uint64_t NodeID, uint32_t NrOfNodes)
double m_BoundaryValue_RhoLB
Initial or boundary value of Rho LB.
union MF::GB::NodeID::@0 node_id
std::shared_ptr< NodePropArray > m_PropagationTable_Ptr
Propagation table of pointers to nodes. First half.
static std::shared_ptr< MF::Database::Thread > New(const std::shared_ptr< MF::GU::LatticeParametersD3Q19 > &LatticeParameters_Ptr, uint64_t NodeID, uint32_t NrOfNodes)
MFThread allocator.
bool m_DoPreCollision
Flag for pre-collision stage. If true, thread is processed during pre-collision stage.
void DoPreANDCollision(const int &CPU_ThreadsNr)
Invokes the pre-collision and collision functions for all nodes.
void setNodePtrInPropTable(const std::size_t &nodeNr, const uint8_t &LinkNr, MF::Database::Node *nodePtr)
Returns a reference to a linked node from a second propagation table.
#define MFQ19_H
Number of elements (linked directions) in propagation table for one node.
int32_t & getNodeCoordX(const std::size_t &nodeNr)
Returns a pointer to node of nodeNr.
uint32_t getNumberOfNodes()
Sets Z coordinate of node nodeNr.
bool m_DoPropagation
Flag for propagation stage. If true, thread is processed during propagation stage.
MF::Database::Node * getNodePointer(const std::size_t &nodeNr)
Returns a reference to node of nodeNr.
std::shared_ptr< std::vector< MF::Database::Node > > m_NodeArray_Ptr
< Collision function pointer.
void DoPropagation(const int &CPU_ThreadsNr)
Do the propagation for all nodes.
MF::Database::Node * getPropTableNodePointer(const MF::Database::Node *nodePointer, const uint8_t &LinkNr)
Returns a pointer to a linked node from a second propagation table.
uint16_t m_ThreadCount
For partitioned MFThreads, it is a part number. For non partitioned MFThreads = 0;.
bool m_DoCollision
Flag for collision stage. If true, thread is processed during collision stage.
uint8_t m_PhaseNr
Phase number for multiphase flows. Max. 255.
MF::Database::Node * getLinkedNodePointer(const std::size_t &nodeNr, const uint8_t f)
Returns the number of nodes in the thread.
static constexpr uint8_t SwapDirections[MFQ19_H][2]
Indexes of swap directions of f(i) in D3Q19.
void(* m_pBoundaryFunction)(MF::Database::Node *)