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-2021 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 #include "fieldTypes.H"
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 namespace Foam
41 {
42 
43 /*---------------------------------------------------------------------------*\
44  Class fieldMapper Declaration
45 \*---------------------------------------------------------------------------*/
46 
47 class fieldMapper
48 {
49 
50 public:
51 
52  // Constructors
53 
54  //- Null constructor
55  fieldMapper()
56  {}
57 
58 
59  //- Destructor
60  virtual ~fieldMapper()
61  {}
62 
63 
64  // Member Functions
65 
66  //- Are there unmapped values? I.e. do all size() elements get
67  // get value
68  virtual bool hasUnmapped() const = 0;
69 
70 
71  // Member Operators
72 
73  virtual void operator()
74  (
76  const Field<scalar>& mapF
77  ) const = 0;
78 
79  virtual void operator()
80  (
82  const Field<vector>& mapF
83  ) const = 0;
84 
85  virtual void operator()
86  (
88  const Field<sphericalTensor>& mapF
89  ) const = 0;
90 
91  virtual void operator()
92  (
94  const Field<symmTensor>& mapF
95  ) const = 0;
96 
97  virtual void operator()
98  (
100  const Field<tensor>& mapF
101  ) const = 0;
102 
103  template<class Type>
104  void operator()(Field<Type>& f, const tmp<Field<Type>>& tmapF) const;
105 
106 
107  virtual tmp<Field<scalar>> operator()
108  (
109  const Field<scalar>& mapF
110  ) const = 0;
111 
112  virtual tmp<Field<vector>> operator()
113  (
114  const Field<vector>& mapF
115  ) const = 0;
116 
117  virtual tmp<Field<sphericalTensor>> operator()
118  (
119  const Field<sphericalTensor>& mapF
120  ) const = 0;
121 
122  virtual tmp<Field<symmTensor>> operator()
123  (
124  const Field<symmTensor>& mapF
125  ) const = 0;
126 
127  virtual tmp<Field<tensor>> operator()
128  (
129  const Field<tensor>& mapF
130  ) const = 0;
131 
132  template<class Type>
133  tmp<Field<Type>> operator()(const tmp<Field<Type>>& tmapF) const;
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #ifdef NoRepository
144  #include "fieldMapperTemplates.C"
145 #endif
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
Include the header files for all the primitive types that Fields are instantiated for...
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:46
labelList f(nPoints)
virtual ~fieldMapper()
Destructor.
Definition: fieldMapper.H:59
fieldMapper()
Null constructor.
Definition: fieldMapper.H:54
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.