OpenLB 1.7
Loading...
Searching...
No Matches
superData.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2015 Mathias J. Krause, Benjamin Förster
4 * 2021 Adrian Kummerlaender
5 * E-mail contact: info@openlb.net
6 * The most recent release of OpenLB can be downloaded at
7 * <http://www.openlb.net/>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public
20 * License along with this program; if not, write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
23*/
24
29#ifndef SUPER_DATA_H
30#define SUPER_DATA_H
31
32#include <vector>
33#include <memory>
34
35#include "blockData.h"
36#include "utilities/aliases.h"
40
41
42namespace olb {
43
44template<unsigned D, typename T, typename U>
45class SuperData : public SuperStructure<T,D> {
46protected:
48 const std::size_t _size;
50 std::vector<std::unique_ptr<BlockData<D,T,U>>> _block;
52 std::unique_ptr<SuperCommunicator<T,SuperData>> _communicator;
53
54public:
55 constexpr static unsigned d = D;
56
58
59 SuperData(CuboidGeometry<T,D>& cuboidGeometry,
60 LoadBalancer<T>& loadBalancer,
61 int overlap = 2,
62 int size = 1);
63 virtual ~SuperData() = default;
65
66 const BlockData<D,T,U>& getBlock(int iC) const;
68
69 template <typename BLOCK = BlockData<D,T,U>>
70 BLOCK& getBlock(int iC);
71 template <typename BLOCK = BlockData<D,T,U>>
72 const BLOCK& getBlock(int iC) const;
73
75 void communicate() override;
76
78 int getDataSize() const;
80 int getDataTypeSize() const;
81
82};
83
84}
85
86#endif
Base class for all LoadBalancer.
static constexpr unsigned d
Definition superData.h:55
const std::size_t _size
Dimension of the data field.
Definition superData.h:48
const BlockData< D, T, U > & getBlock(int iC) const
Definition superData.hh:88
SuperData(CuboidGeometry< T, D > &cuboidGeometry, LoadBalancer< T > &loadBalancer, int overlap=2, int size=1)
Definition superData.hh:40
void communicate() override
Communicate overlaps.
Definition superData.hh:114
int getDataTypeSize() const
Read only access to the data type dim of the data of the super structure.
Definition superData.hh:128
int getDataSize() const
Read only access to the dim of the data of the super structure.
Definition superData.hh:122
std::unique_ptr< SuperCommunicator< T, SuperData > > _communicator
Inter-block communicator.
Definition superData.h:52
std::vector< std::unique_ptr< BlockData< D, T, U > > > _block
Vector of BlockData.
Definition superData.h:50
virtual ~SuperData()=default
Top level namespace for all of OpenLB.
std::conditional_t< D==2, SuperF2D< T, U >, SuperF3D< T, U > > SuperF
Definition aliases.h:198
std::conditional_t< D==2, CuboidGeometry2D< T >, CuboidGeometry3D< T > > CuboidGeometry
Definition aliases.h:47
Curried BlockData template for use in callUsingConcretePlatform.
Definition blockData.h:91