OpenLB 1.7
Loading...
Searching...
No Matches
genericF.hh
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2*
3* Copyright (C) 2012-2013 Lukas Baron, Mathias J. Krause, Albert Mink
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 GENERIC_F_HH
25#define GENERIC_F_HH
26
27
33#include"genericF.h"
34
35
36namespace olb {
37
38template <typename T, typename S>
40{
41 return _m;
42}
43
44template <typename T, typename S>
46{
47 return _n;
48}
49
50template <typename T, typename S>
52{
53 return _name;
54}
55
56template <typename T, typename S>
57std::string const& GenericF<T,S>::getName() const
58{
59 return _name;
60}
61
62template <typename T, typename S>
64{
65 S tmp[0];
66 return operator()(output,tmp);
67}
68
69template <typename T, typename S>
70bool GenericF<T,S>::operator() (T output[], S input0)
71{
72 S tmp[1] = {input0};
73 return operator()(output,tmp);
74}
76template <typename T, typename S>
77bool GenericF<T,S>::operator() (T output[], S input0, S input1)
78{
79 S tmp[2] = {input0,input1};
80 return operator()(output,tmp);
81}
82
83template <typename T, typename S>
84bool GenericF<T,S>::operator() (T output[], S input0, S input1, S input2)
85{
86 S tmp[3] = {input0,input1,input2};
87 return operator()(output,tmp);
90template <typename T, typename S>
91bool GenericF<T,S>::operator() (T output[], S input0, S input1, S input2, S input3)
92{
93 S tmp[4] = {input0,input1,input2,input3};
94 return operator()(output,tmp);
95}
96
97} // end namespace olb
98
99#endif
int getTargetDim() const
read only access to member variable _n
Definition genericF.hh:45
int getSourceDim() const
read only access to member variable _m
Definition genericF.hh:39
std::string & getName()
read and write access to name
Definition genericF.hh:51
virtual bool operator()(T output[], const S input[])=0
has to be implemented for 'every' derived class
bool operator()(T output[], S input0)
Definition genericF.hh:70
The description of a generic interface for all functor classes – header file.
Top level namespace for all of OpenLB.