OpenLB 1.7
Loading...
Searching...
No Matches
entityF.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2022 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 ENTITY_F_H
25#define ENTITY_F_H
26
27/* Note: Throughout the whole source code directory genericFunctions, the
28 * template parameters for i/o dimensions are:
29 * F: S^m -> T^n (S=source, T=target)
30 */
31
32namespace olb {
33
34template <typename T, unsigned D, typename ENTITY>
35class EntityF : public GenericF<T,int> {
36protected:
37 EntityF(int targetDim, int sourceDim, ENTITY& entity);
38 ENTITY& _entity;
39public:
40 static constexpr int d = D;
41 static constexpr bool isSuper = false;
43 ~EntityF() override {};
45 auto getExtent(){ return _entity.getExtent();}
47 ENTITY& getEntityF(){ return _entity; }
49 using GenericF<T,int>::operator();
50};
51
52
53template <typename T, unsigned D, typename ENTITY, typename W=T>
54class SuperEntityF : public GenericF<W,int> {
55protected:
56 SuperEntityF(LoadBalancer<T>& loadBalancer, int targetDim, int sourceDim);
62 std::vector<std::unique_ptr<EntityF<W,D,ENTITY>>> _entityF;
63public:
64 static constexpr int d = D;
65 static constexpr bool isSuper = true;
69 int getNumOfEntityF() const;
73 bool operator() (W output[], const int input []);
74 using GenericF<W,int>::operator();
75};
76
77} //namespace olb
78
79#endif
EntityF(int targetDim, int sourceDim, ENTITY &entity)
static constexpr bool isSuper
Definition entityF.h:41
auto getExtent()
get extent
Definition entityF.h:45
~EntityF() override
virtual destructor for defined behaviour
Definition entityF.h:43
ENTITY & getEntityF()
expose entity reference
Definition entityF.h:47
static constexpr int d
Definition entityF.h:40
ENTITY & _entity
Definition entityF.h:38
GenericF is a base class, that can represent continuous as well as discrete functions.
Definition genericF.h:50
Base class for all LoadBalancer.
bool operator()(W output[], const int input[])
operator
EntityF< W, D, ENTITY > & getEntityF(int iCloc)
get specific entity functor
int getNumOfEntityF() const
return number of entity functors
std::vector< std::unique_ptr< EntityF< W, D, ENTITY > > > _entityF
By convention: If entity level functors are used at all, they should number exactly LoadBalancer<T>::...
Definition entityF.h:62
static constexpr bool isSuper
Definition entityF.h:65
SuperEntityF(LoadBalancer< T > &loadBalancer, int targetDim, int sourceDim)
static constexpr int d
Definition entityF.h:64
LoadBalancer< T > & _loadBalancer
Definition entityF.h:57
LoadBalancer< T > & getLoadBalancer()
expose load balancer
Top level namespace for all of OpenLB.