OpenLB 1.7
Loading...
Searching...
No Matches
blockReduction2D1D.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_2D1D_H
25#define BLOCK_REDUCTION_2D1D_H
26
27#include "core/blockData.h"
28#include "core/vector.h"
29#include "blockBaseF2D.h"
30#include "superBaseF2D.h"
36
37#include <tuple>
38
39
40namespace olb {
41
42
45
53template <typename T>
54class BlockReduction2D1D final : public HyperplaneLattice2D<T>, public BlockDataF2D<T,T> {
55private:
61 std::vector<std::tuple<int,int>> _rankLocalSubplane;
64 const BlockDataSyncMode _syncMode;
66 const BlockDataReductionMode _reductionMode;
67
68 void updateBlockAnalytical(BlockData<2,T,T>& block);
69 void updateBlockDiscrete(BlockData<2,T,T>& block);
70
71public:
73
84 const HyperplaneLattice2D<T>& lattice,
88
97 const Hyperplane2D<T>& hyperplane,
101
109 const Hyperplane2D<T>& hyperplane,
110 int resolution=600,
112
114
123 const Vector<T,2>& origin, const Vector<T,2>& direction,
124 int resolution=600,
126
128 bool operator() (T output[], int i);
130 void initialize();
132 void update();
136 const std::vector<std::tuple<int,int>>& getRankLocalSubplane() const;
137
138};
139
140
141} // end namespace olb
142
143#endif
BlockDataF2D can store data of any BlockFunctor2D.
BlockReduction2D1D reduces the data of a SuperF2D functor to the intersection between a given 2D hype...
BlockReduction2D1D(FunctorPtr< SuperF2D< T > > &&f, const HyperplaneLattice2D< T > &lattice, BlockDataSyncMode syncMode=BlockDataSyncMode::ReduceAndBcast, BlockDataReductionMode reductionMode=BlockDataReductionMode::Analytical)
Construction using functor and hyperplane lattice.
const std::vector< std::tuple< int, int > > & getRankLocalSubplane() const
void update()
Updates and writes the data to _blockData using _rankLocalSubplane.
void initialize()
Initialize rank-local list of plane points to be stored in _blockData.
bool operator()(T output[], int i)
Custom operator for easier access to 1-dimensional block data.
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 (i.e. a line 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.
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 line embedded in 2D space.
efficient implementation of a vector class