VM2D 1.14
Vortex methods for 2D flows simulation
Loading...
Searching...
No Matches
BarnesHut.h
Go to the documentation of this file.
1/*--------------------------------*- VM2D -*-----------------*---------------*\
2| ## ## ## ## #### ##### | | Version 1.14 |
3| ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2026/03/06 |
4| ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------*
5| #### ## ## ## ## ## | Open Source Code |
6| ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D |
7| |
8| Copyright (C) 2017-2026 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova |
9*-----------------------------------------------------------------------------*
10| File name: BarnesHut.h |
11| Info: Source code of VM2D |
12| |
13| This file is part of VM2D. |
14| VM2D is free software: you can redistribute it and/or modify it |
15| under the terms of the GNU General Public License as published by |
16| the Free Software Foundation, either version 3 of the License, or |
17| (at your option) any later version. |
18| |
19| VM2D is distributed in the hope that it will be useful, but WITHOUT |
20| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
21| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
22| for more details. |
23| |
24| You should have received a copy of the GNU General Public License |
25| along with VM2D. If not, see <http://www.gnu.org/licenses/>. |
26\*---------------------------------------------------------------------------*/
27
40#ifndef BARNESHUT_H
41#define BARNESHUT_H
42
43#include "TreeBH.h"
44
45namespace BH
46{
59 {
60 public:
62 const params& prm;
63
65 std::vector<PointsCopy> pointsCopyVrt;
66
68 mutable std::unique_ptr<MortonTree> treeVrt;
69
74 BarnesHut(const params& prm_, const std::vector<Vortex2D>& pointsVrt);
75
78
85 void BuildOneTree(std::unique_ptr<MortonTree>& tree, int maxTreeLevel, std::vector<PointsCopy>& pointsCopy, double& time);
86
90 void BuildNecessaryTrees(double& time);
91
92 //габаритные прямоугольники для листовых ячеек
93 void BuildEnclosingRectangle(double& time);
94
100 void InfluenceComputation(std::vector<Point2D>& result, std::vector<double>& epsast, double& timeParams, double& timeInfl, bool calcRadius);
101 };
102
103}//namespace BH
104
105#endif
Заголовок класса Tree для метода Барнса - Хата для CPU.
Класс, определяющий основной алгоритм модификации метода Барнса - Хата
Definition BarnesHut.h:59
void BuildOneTree(std::unique_ptr< MortonTree > &tree, int maxTreeLevel, std::vector< PointsCopy > &pointsCopy, double &time)
Построение одного дерева tree на основе заданных точек pointsCopy
Definition BarnesHut.cpp:56
void InfluenceComputation(std::vector< Point2D > &result, std::vector< double > &epsast, double &timeParams, double &timeInfl, bool calcRadius)
Расчет влияния в точках дерева, характерных для решаемой задачи (определяется внутри функции)
const params & prm
Ссылка на параметры, считываемые из файла
Definition BarnesHut.h:62
void BuildNecessaryTrees(double &time)
Построение всех нужных деревьев на основе заданных точек pointsCopy
Definition BarnesHut.cpp:76
std::unique_ptr< MortonTree > treeVrt
Умный yказатель на дерево вихрей
Definition BarnesHut.h:68
void BuildEnclosingRectangle(double &time)
Definition BarnesHut.cpp:84
std::vector< PointsCopy > pointsCopyVrt
Список оберток положений вихрей
Definition BarnesHut.h:65
~BarnesHut()
Деструктор
Definition BarnesHut.h:77
Класс, содержащий параметры метода Баонса - Хата для CPU.
Definition ParamsBH.h:65