OpenLB 1.7
Loading...
Searching...
No Matches
blockReduction3D2D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2017 Adrian Kummerlaender
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 */
23
24#ifndef BLOCK_REDUCTION_3D2D_H
25#define BLOCK_REDUCTION_3D2D_H
26
27#include "core/blockData.h"
28#include "core/vector.h"
29#include "blockBaseF2D.h"
30#include "superBaseF2D.h"
31#include "superBaseF3D.h"
37
38#include <tuple>
39
40namespace olb {
41
42
45
53template <typename T>
54class BlockReduction3D2D final : public HyperplaneLattice3D<T>, public BlockDataF2D<T,T> {
55private:
57 std::unique_ptr<BlockData<2,T,T>> _blockDataMemory;
63 std::vector<std::tuple<int,int,int>> _rankLocalSubplane;
66 const BlockDataSyncMode _syncMode;
68 const BlockDataReductionMode _reductionMode;
69
70 void updateBlockAnalytical(BlockData<2,T,T>& block);
71 void updateBlockDiscrete(BlockData<2,T,T>& block);
72
73public:
75
86 const HyperplaneLattice3D<T>& lattice,
90
99 const Hyperplane3D<T>& hyperplane,
103
111 const Hyperplane3D<T>& hyperplane,
112 int resolution=600,
114
116
126 const Vector<T,3>& origin, const Vector<T,3>& u, const Vector<T,3>& v,
127 int resolution=600,
130
139 const Vector<T,3>& origin, const Vector<T,3>& normal,
140 int resolution=600,
143
151 const Vector<T,3>& normal,
152 int resolution=600,
154
156 void initialize();
158 void update();
162 const std::vector<std::tuple<int,int,int>>& getRankLocalSubplane() const;
163
164};
165
166
167} // end namespace olb
168
169#endif
BlockDataF2D can store data of any BlockFunctor2D.
BlockReduction3D2D reduces the data of a SuperF3D functor to the intersection between a given hyperpl...
void initialize()
Initialize rank-local list of plane points to be stored in _blockData.
void update()
Updates and writes the data to _blockData using _rankLocalSubplane.
BlockStructureD< 2 > & getBlockStructure() override
Overload of virtual function from class BlockF2D.
BlockReduction3D2D(FunctorPtr< SuperF3D< T > > &&f, const HyperplaneLattice3D< T > &lattice, BlockDataSyncMode syncMode=BlockDataSyncMode::ReduceAndBcast, BlockDataReductionMode reductionMode=BlockDataReductionMode::Analytical)
Construction using functor and hyperplane lattice.
const std::vector< std::tuple< int, int, int > > & getRankLocalSubplane() const
Base of a regular block.
Smart pointer for managing the various ways of passing functors around.
Definition functorPtr.h:60
Parametrization of a hyperplane lattice.
represents all functors that operate on a SuperStructure<T,3> in general
Plain old scalar vector.
Definition vector.h:47
Top level namespace for all of OpenLB.
BlockDataReductionMode
Mode of reducing block data from given, possibly higher dimensional data.
@ Analytical
Interpolate block data at exact physical locations.
BlockDataSyncMode
Mode of synchronizing functor block data between processes.
@ ReduceAndBcast
default behavior, full block data available on all ranks after update
Definition of a analytical 2D plane embedded in 3D space.
efficient implementation of a vector class