VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
MPIIOMigrationBESimulationObserver.h
Go to the documentation of this file.
1//=======================================================================================
2// ____ ____ __ ______ __________ __ __ __ __
3// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
4// \ \ | | | | | |_) | | | | | | | / \ | |
5// \ \ | | | | | _ / | | | | | | / /\ \ | |
6// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
7// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
8// \ \ | | ________________________________________________________________
9// \ \ | | | ______________________________________________________________|
10// \ \| | | | __ __ __ __ ______ _______
11// \ | | |_____ | | | | | | | | | _ \ / _____)
12// \ | | _____| | | | | | | | | | | \ \ \_______
13// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
14// \ _____| |__| |________| \_______/ |__| |______/ (_______/
15//
16// This file is part of VirtualFluids. VirtualFluids is free software: you can
17// redistribute it and/or modify it under the terms of the GNU General Public
18// License as published by the Free Software Foundation, either version 3 of
19// the License, or (at your option) any later version.
20//
21// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
22// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24// for more details.
25//
26// SPDX-License-Identifier: GPL-3.0-or-later
27// SPDX-FileCopyrightText: Copyright © VirtualFluids Project contributors, see AUTHORS.md in root folder
28//
33//=======================================================================================
34#ifndef _MPIIOMigrationBESimulationObserver_H_
35#define _MPIIOMigrationBESimulationObserver_H_
36
37#include <mpi.h>
38#include <string>
39#include <vector>
40
42#include "MPIIODataStructures.h"
43
44class Grid3D;
45class UbScheduler;
46namespace vf::parallel {class Communicator;}
47class BCSet;
48class LBMKernel;
49class Grid3DVisitor;
50
54{
55 enum Arrays {
56 AverageDensity = 1,
57 AverageVelocity = 2,
58 AverageFluktuations = 3,
59 AverageTriple = 4,
60 ShearStressVal = 5,
61 RelaxationFactor = 6,
62 PhaseField1 = 7,
63 PhaseField2 = 8,
64 PressureField = 9
65 };
66
67public:
69 std::shared_ptr<vf::parallel::Communicator> comm);
72 void update(real step) override;
74 void restart(int step);
76 void writeBlocks(int step);
78 void writeDataSet(int step);
79 void write4DArray(int step, Arrays arrType, std::string fname);
80 void write3DArray(int step, Arrays arrType, std::string fname);
81 // void writeAverageDensityArray(int step);
82 // void writeAverageVelocityArray(int step);
83 // void writeAverageFluktuationsArray(int step);
84 // void writeAverageTripleArray(int step);
85 // void writeShearStressValArray(int step);
86 // void writeRelaxationFactor(int step);
88 void writeBoundaryConds(int step);
89
91 void readBlocks(int step);
93 void readDataSet(int step);
94 void readArray(int step, Arrays arrType, std::string fname);
95 // void readAverageDensityArray(int step);
96 // void readAverageVelocityArray(int step);
97 // void readAverageFluktuationsArray(int step);
98 // void readAverageTripleArray(int step);
99 // void readShearStressValArray(int step);
100 // void readRelaxationFactor(int step);
102 void readBoundaryConds(int step);
104 void setLBMKernel(SPtr<LBMKernel> kernel);
108 void clearAllFiles(int step);
109 void setNu(real nu);
110 void setNuLG(real cfL, real cfG);
111 void setDensityRatio(real dr);
112
113 void blocksExchange(int tagN, int ind1, int ind2, int doubleCountInBlock, std::vector<real> &pV,
114 std::vector<real> *rawDataReceive);
115
116private:
117 // MPI_Datatype gridParamType, block3dType;
118 // MPI_Datatype dataSetType, dataSetSmallType;
119 MPI_Datatype dataSetDoubleType;
120 // MPI_Datatype boundCondParamType, boundCondTypeAdd;
121 MPI_Datatype bcindexmatrixType;
122 MPI_Datatype sendBlockDoubleType, sendBlockIntType;
123
125 SPtr<LBMKernel> lbmKernel;
126 SPtr<BCSet> bcSet;
127 SPtr<Grid3DVisitor> metisVisitor;
128 real nue;
129 real nuL;
130 real nuG;
131 real densityRatio;
132
133};
134
135#endif
136
A class provides an interface for boundary conditions in the calculation loop.
Definition BCSet.h:47
A class implements block grid.
Definition Grid3D.h:60
Abstract class provides interface for visitor design pettern.
A base class provides basic functionality for LBM kernel.
Definition LBMKernel.h:50
std::shared_ptr< vf::parallel::Communicator > comm
virtual void update()=0
A class implements scheduling.
Definition UbScheduler.h:58
std::shared_ptr< T > SPtr
float real
Definition DataTypes.h:42
void readBlocks(int step)
Reads the blocks of the grid from the file cpBlocks.bin.
void write4DArray(int step, Arrays arrType, std::string fname)
void write3DArray(int step, Arrays arrType, std::string fname)
void writeBoundaryConds(int step)
Writes the boundary conditions of the blocks into the file cpBC.bin.
void writeBlocks(int step)
Writes the blocks of the grid into the file cpBlocks.bin.
void readArray(int step, Arrays arrType, std::string fname)
void restart(int step)
Reads the grid from the files before grid reconstruction.
void blocksExchange(int tagN, int ind1, int ind2, int doubleCountInBlock, std::vector< real > &pV, std::vector< real > *rawDataReceive)
void setBCSet(SPtr< BCSet > BCSet)
The function sets BCSet.
void readDataSet(int step)
Reads the datasets of the blocks from the file cpDataSet.bin.
void readBoundaryConds(int step)
Reads the boundary conditions of the blocks from the file cpBC.bin.
void clearAllFiles(int step)
The function truncates the data files.
void writeDataSet(int step)
Writes the datasets of the blocks into the file cpDataSet.bin.
void setLBMKernel(SPtr< LBMKernel > kernel)
The function sets LBMKernel.
Structure describes parameters of the boundaryConditions that are equal in all blocks.