VirtualFluids 0.2.0
Parallel CFD LBM Solver
Loading...
Searching...
No Matches
D3Q27GridWindingInteractor.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 D3Q27GRIDWINDINGINTERACTOR_H
37#define D3Q27GRIDWINDINGINTERACTOR_H
38
39#include <array>
40#include <string>
41
42#include <PointerDefinitions.h>
43
44#include "D3Q27Interactor.h"
45
48
49class GbTriFaceMesh3D;
50class Grid3D;
51class BC;
52class BCSet;
53class Block3D;
54
55// namespace vf::geometry
56// {
57// class GeneralizedWindingNumber;
58// } // namespace vf::geometry
59
60namespace vf::parallel
61{
62class Communicator;
63} // namespace vf::parallel
64
67{
68public:
70
72 ~D3Q27GridWindingInteractor() override = default;
73
74 void initInteractor(const real &timeStep = 0) override;
75 void updateInteractor(const real &timestep = 0) override;
76 bool setDifferencesToGbObject3D(const SPtr<Block3D> block) override;
77 void setQs(const real &timeStep);
78
83 const SPtr<Grid3D> &grid,
84 const SPtr<BCSet> &bcSet,
85 const std::vector<SPtr<BC>> &boundaryAdapters,
86 double timeStep,
88 const std::string &basePath,
90
93 {
94 return boundaryResult_;
95 }
96
99 {
100 return boundaryResult_.stats;
101 }
102
103private:
104 void rebuildNodeIndexMaps();
105 SPtr<BCSet> findBCSet(const SPtr<Grid3D> &grid) const;
106
108};
109
110namespace vf::grid_winding::cpu
111{
112// void markSolidsWithWinding(const SPtr<Grid3D> &grid,
113// const vf::geometry::GeneralizedWindingNumber &winding,
114// const std::array<double, 3> &meshMin,
115// const std::array<double, 3> &meshMax,
116// double threshold = 0.5,
117// double tolerance = 1.0e-4);
118
119BoundaryProcessingResult processBoundaryData(
121 const SPtr<Grid3D> &grid,
122 const SPtr<BCSet> &bcSet,
123 const std::vector<SPtr<BC>> &boundaryAdapters,
124 const ::D3Q27Interactor *adapterInteractor,
125 double timeStep,
127 const std::string &basePath,
128 const BoundaryProcessingConfig &config = {});
129
131 const SPtr<Grid3D> &grid,
132 const SPtr<BCSet> &bcSet,
133 const std::vector<SPtr<BC>> &boundaryAdapters = {},
134 const ::D3Q27Interactor *adapterInteractor = nullptr,
135 double timeStep = 0.0,
137
138#if defined(VF_HAS_FAST_WINDING)
144 const SPtr<Grid3D> &grid,
148#endif
149} // namespace vf::grid_winding::cpu
150
152 const SPtr<Grid3D> &grid,
153 const SPtr<BCSet> &bcSet,
154 const std::vector<SPtr<BC>> &boundaryAdapters = {},
155 const ::D3Q27Interactor *adapterInteractor = nullptr,
156 double timeStep = 0.0,
158{
160 adapterInteractor, timeStep, stats);
161}
162
163#endif // D3Q27GRIDWINDINGINTERACTOR_H
164
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
A class implements a block structure.
Definition Block3D.h:49
Interactor that can run CPU grid-winding based boundary diagnostics.
~D3Q27GridWindingInteractor() override=default
D3Q27GridWindingInteractor()=default
const vf::grid_winding::SubgridDistanceStats & getSubgridStats() const
Convenience access to the accumulated subgrid statistics.
const vf::grid_winding::cpu::BoundaryProcessingResult & getBoundaryResult() const
Access the last boundary-processing result.
A specialized class for grid generation.
A class implements block grid.
Definition Grid3D.h:60
WPtr< Grid3D > grid
An abstract class for communication between processes in parallel computation.
std::shared_ptr< T > SPtr
float real
Definition DataTypes.h:42
void initInteractor(const real &timeStep=0) override
void computeSubgridDistancesStandalone(const SPtr< GbTriFaceMesh3D > &surface, const SPtr< Grid3D > &grid, const SPtr< BCSet > &bcSet, const std::vector< SPtr< BC > > &boundaryAdapters={}, const ::D3Q27Interactor *adapterInteractor=nullptr, double timeStep=0.0, vf::grid_winding::SubgridDistanceStats *stats=nullptr)
void computeBoundaryData(const SPtr< GbTriFaceMesh3D > &surface, const SPtr< Grid3D > &grid, const SPtr< BCSet > &bcSet, const std::vector< SPtr< BC > > &boundaryAdapters, double timeStep, const SPtr< vf::parallel::Communicator > &comm, const std::string &basePath, const vf::grid_winding::cpu::BoundaryProcessingConfig &config)
Compute subgrid distances and Q-values for the current geometry/grid setup.
void updateInteractor(const real &timestep=0) override
bool setDifferencesToGbObject3D(const SPtr< Block3D > block) override
void computeSubgridDistancesStandalone(const SPtr< GbTriFaceMesh3D > &surface, const SPtr< Grid3D > &grid, const SPtr< BCSet > &bcSet, const std::vector< SPtr< BC > > &boundaryAdapters, const ::D3Q27Interactor *adapterInteractor, double timeStep, SubgridDistanceStats *stats)
BoundaryProcessingResult processBoundaryData(const SPtr< GbTriFaceMesh3D > &surface, const SPtr< Grid3D > &grid, const SPtr< BCSet > &bcSet, const std::vector< SPtr< BC > > &boundaryAdapters, const ::D3Q27Interactor *adapterInteractor, double timeStep, const SPtr< vf::parallel::Communicator > &comm, const std::string &basePath, const BoundaryProcessingConfig &config)
constexpr float FastWindingDefaultAccuracyScale
Default fast-winding accuracy scale used in computeSolidAngle(...).
constexpr float FastWindingDefaultTolerance
Default comparison tolerance near the threshold.
constexpr float FastWindingDefaultThreshold
Default normalized threshold for solid classification.