fieldMapper.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fieldMapper
26 
27 Description
28  Abstract base class for field mapping
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef fieldMapper_H
33 #define fieldMapper_H
34 
35 #include "Field.H"
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 
42 /*---------------------------------------------------------------------------*\
43  Class fieldMapper Declaration
44 \*---------------------------------------------------------------------------*/
45 
46 class fieldMapper
47 {
48 
49 public:
50 
51  // Constructors
52 
53  //- Null constructor
54  fieldMapper()
55  {}
56 
57 
58  //- Destructor
59  virtual ~fieldMapper()
60  {}
61 
62 
63  // Member Functions
64 
65  //- Are there unmapped values? I.e. do all size() elements get
66  // get value
67  virtual bool hasUnmapped() const = 0;
68 
69 
70  // Member Operators
71 
72  virtual void operator()
73  (
75  const Field<scalar>& mapF
76  ) const = 0;
77 
78  virtual void operator()
79  (
81  const Field<vector>& mapF
82  ) const = 0;
83 
84  virtual void operator()
85  (
87  const Field<sphericalTensor>& mapF
88  ) const = 0;
89 
90  virtual void operator()
91  (
93  const Field<symmTensor>& mapF
94  ) const = 0;
95 
96  virtual void operator()
97  (
99  const Field<tensor>& mapF
100  ) const = 0;
101 
102  template<class Type>
103  void operator()(Field<Type>& f, const tmp<Field<Type>>& tmapF) const;
104 
105 
106  virtual tmp<Field<scalar>> operator()
107  (
108  const Field<scalar>& mapF
109  ) const = 0;
110 
111  virtual tmp<Field<vector>> operator()
112  (
113  const Field<vector>& mapF
114  ) const = 0;
115 
116  virtual tmp<Field<sphericalTensor>> operator()
117  (
118  const Field<sphericalTensor>& mapF
119  ) const = 0;
120 
121  virtual tmp<Field<symmTensor>> operator()
122  (
123  const Field<symmTensor>& mapF
124  ) const = 0;
125 
126  virtual tmp<Field<tensor>> operator()
127  (
128  const Field<tensor>& mapF
129  ) const = 0;
130 
131  template<class Type>
132  tmp<Field<Type>> operator()(const tmp<Field<Type>>& tmapF) const;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #ifdef NoRepository
143  #include "fieldMapperTemplates.C"
144 #endif
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
virtual bool hasUnmapped() const =0
Are there unmapped values? I.e. do all size() elements get.
Abstract base class for field mapping.
Definition: fieldMapper.H:45
labelList f(nPoints)
virtual ~fieldMapper()
Destructor.
Definition: fieldMapper.H:58
fieldMapper()
Null constructor.
Definition: fieldMapper.H:53
virtual void operator()(Field< scalar > &f, const Field< scalar > &mapF) const =0
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.