OpenLB 1.7
Loading...
Searching...
No Matches
groupedFieldF.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2021 Nicolas Hafen, Mathias J. Krause,
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 GROUPED_FIELD_F_H
25#define GROUPED_FIELD_F_H
26
27
28#include "functors/genericF.h"
29#include "core/container.h"
30
31namespace olb {
32
37template <typename T, typename DESCRIPTOR, typename FIELD_ARRAY_TYPE, typename W=T>
38class ContainerF : public GenericF<W,int> {
39public:
40 ContainerF( Container<T,DESCRIPTOR,FIELD_ARRAY_TYPE>& container, int targetDim );
41
43
44public:
45 static constexpr bool isSuper = false;
46 static constexpr unsigned d = DESCRIPTOR::d;
47
50
52 int getContainerSize() const;
53
54 bool operator() (W output[], const int input []);
55
56 using GenericF<W,int>::operator();
57};
58
59
60
69template <typename T, typename DESCRIPTOR, typename GROUP, typename FIELD>
70class GroupedFieldF : public ContainerF<T,DESCRIPTOR,DynamicFieldGroupsD<T,typename DESCRIPTOR::fields_t>,T> {
71public:
73
74public:
75 bool operator() (T output[], const int input []);
76
77};
78
79
80
81//TODO: Prototype edition for now!
82
83template <typename T, typename DESCRIPTOR, typename FIELD_ARRAY_TYPE, typename W=T>
84class SuperContainerF : public GenericF<W,int> {
85protected:
86 SuperContainerF( LoadBalancer<T>& loadBalancer, int targetDim );
87
89
90 std::vector<std::unique_ptr<ContainerF<T,DESCRIPTOR,FIELD_ARRAY_TYPE>>> _containerF;
91public:
92 static constexpr bool isSuper = true;
93 static constexpr unsigned d = DESCRIPTOR::d;
94
96
97 int getContainerSize() const;
98
100
101 bool operator() (W output[], const int input []);
102
103 using GenericF<W,int>::operator();
104};
105
106
107//Forward declaration
108namespace particles{
109template<typename T, typename DESCRIPTOR>
110class SuperParticleSystem;
111}
112
113template <typename T, typename DESCRIPTOR, typename GROUP, typename FIELD, typename W=T>
114class SuperParticleGroupedFieldF : public SuperContainerF<T,DESCRIPTOR,DynamicFieldGroupsD<T,typename DESCRIPTOR::fields_t>,W> {
115private:
117public:
119};
120
121
122
123
124} //namespace olb
125
126#endif
ContainerF is a NON-PARALLELIZED (no block/super differentiation) functor intended to extract data fr...
bool operator()(W output[], const int input[])
static constexpr unsigned d
static constexpr bool isSuper
Container< T, DESCRIPTOR, FIELD_ARRAY_TYPE > & _container
int getContainerSize() const
Container< T, DESCRIPTOR, FIELD_ARRAY_TYPE > & getContainer()
ContainerF(Container< T, DESCRIPTOR, FIELD_ARRAY_TYPE > &container, int targetDim)
Container is a std::vector inspired data wrapper that allows for simple content manipulation of its o...
Definition container.h:44
Storage for dynamic field groups (Prototype for ParticleSystem)
GenericF is a base class, that can represent continuous as well as discrete functions.
Definition genericF.h:50
GroupedFieldF is a NON-PARALLELIZED (no block/super differentiation) functor.
GroupedFieldF(Container< T, DESCRIPTOR, DynamicFieldGroupsD< T, typename DESCRIPTOR::fields_t > > &container)
bool operator()(T output[], const int input[])
Base class for all LoadBalancer.
LoadBalancer< T > & _loadBalancer
ContainerF< T, DESCRIPTOR, FIELD_ARRAY_TYPE > & getContainerF(int iCloc)
LoadBalancer< T > & getLoadBalancer()
static constexpr unsigned d
SuperContainerF(LoadBalancer< T > &loadBalancer, int targetDim)
int getContainerSize() const
std::vector< std::unique_ptr< ContainerF< T, DESCRIPTOR, FIELD_ARRAY_TYPE > > > _containerF
static constexpr bool isSuper
bool operator()(W output[], const int input[])
SuperParticleGroupedFieldF(particles::SuperParticleSystem< T, DESCRIPTOR > &sParticleSystem)
The description of a generic interface for all functor classes – header file.
Top level namespace for all of OpenLB.