OpenLB 1.7
Loading...
Searching...
No Matches
blockReduction2D2D.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2018 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_2D2D_H
25#define BLOCK_REDUCTION_2D2D_H
26
27#include "io/ostreamManager.h"
28#include "core/blockData.h"
29#include "core/vector.h"
30#include "blockBaseF2D.h"
31#include "superBaseF2D.h"
32#include "superBaseF3D.h"
36
37#include <tuple>
38
39namespace olb {
40
41
43
46template<typename T>
47class BlockReduction2D2D final : public BlockDataF2D<T,T> {
48private:
54 std::vector<std::tuple<int,int,int>> _rankLocalSubplane;
55
56 Vector<T,2> _origin;
57 T _h;
58 int _nx;
59 int _ny;
62 const BlockDataSyncMode _syncMode;
63
65 void updateToWantedResolution(int resolution);
66
67public:
69 int resolution=600,
71
73 Vector<T,2> getPhysR(const int& iX, const int& iY) const;
75
82
84 void initialize();
86 void update();
89
90};
91
92
93} // end namespace olb
94
95#endif
BlockDataF2D can store data of any BlockFunctor2D.
BlockReduction2D2D interpolates the data of a SuperF2D functor in a given resolution.
void initialize()
Initialize rank-local list of points to be stored in _blockData.
HyperplaneLattice3D< T > getPlaneDiscretizationIn3D() const
Returns embedding of the discretized plane in 3D space.
void update()
Updates and writes the data to _blockData using _rankLocalSubplane.
Vector< T, 2 > getPhysR(const int &iX, const int &iY) const
Transform lattice coordinates to their physical location.
BlockReduction2D2D(FunctorPtr< SuperF2D< T > > &&f, int resolution=600, BlockDataSyncMode mode=BlockDataSyncMode::ReduceAndBcast)
BlockStructureD< 2 > & getBlockStructure() override
Overload of virtual function from class BlockF2D.
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,2> in general
Plain old scalar vector.
Definition vector.h:47
Top level namespace for all of OpenLB.
BlockDataSyncMode
Mode of synchronizing functor block data between processes.
@ ReduceAndBcast
default behavior, full block data available on all ranks after update
efficient implementation of a vector class