VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
GridWindingDiagnosticsSimulationObserver.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//
34//=======================================================================================
35
36#ifndef GRIDWINDINGDIAGNOSTICSSIMULATIONOBSERVER_H
37#define GRIDWINDINGDIAGNOSTICSSIMULATIONOBSERVER_H
38
39#include <PointerDefinitions.h>
40#include <string>
41#include <vector>
42
43#include "SimulationObserver.h"
44
46
47class GbTriFaceMesh3D;
48class Grid3D;
49class BC;
50class BCSet;
51class UbScheduler;
52
53namespace vf::parallel
54{
55class Communicator;
56} // namespace vf::parallel
57
59
61{
64 const SPtr<Grid3D> &grid);
65} // namespace vf::grid_winding::cpu
66
69{
70public:
74 const std::vector<SPtr<GbTriFaceMesh3D>> &surfaces,
75 const SPtr<BCSet> &bcSet,
76 const std::vector<SPtr<BC>> &boundaryAdapters,
77 const SPtr<D3Q27GridWindingInteractor> &interactor,
78 const std::string &path,
81
86 const SPtr<BCSet> &bcSet,
87 const std::vector<SPtr<BC>> &boundaryAdapters,
88 const SPtr<D3Q27GridWindingInteractor> &interactor,
89 const std::string &path,
92
94
95 void update(real step) override;
96
98 {
99 return stats_;
100 }
101
102private:
103
104 void ensureOutputDirectory() const;
105 void writeMissingLinkReport() const;
106 void writeQReports() const;
107 void writeWindingVolumeReport(real step) const;
108
109 std::string path_;
111 SPtr<GbTriFaceMesh3D> surface_;
112 SPtr<BCSet> bcSet_;
113 std::vector<SPtr<BC>> boundaryAdapters_;
116
117 bool diagnosticsComputed_{ false };
118
122};
123
124#endif // GRIDWINDINGDIAGNOSTICSSIMULATIONOBSERVER_H
125
Abstract class of baundary conditions adapter.
Definition BC.h:48
A class provides an interface for boundary conditions in the calculation loop.
Definition BCSet.h:47
Interactor that can run CPU grid-winding based boundary diagnostics.
A class implements block grid.
Definition Grid3D.h:60
Simulation observer that runs CPU grid-winding boundary diagnostics.
~GridWindingDiagnosticsSimulationObserver() override=default
const vf::grid_winding::SubgridDistanceStats & getSubgridStats() const
An abstract class implements observer design pettern.
SPtr< UbScheduler > scheduler
virtual void update()=0
A class implements scheduling.
Definition UbScheduler.h:58
std::shared_ptr< T > SPtr
float real
Definition DataTypes.h:42
void finalizeMissingLinkCollection(vf::grid_winding::MissingLinkCollection &collection, const SPtr< GbTriFaceMesh3D > &surface, const SPtr< Grid3D > &grid)