patchToPatchFieldMapper.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) 2022-2023 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::patchToPatchFieldMapper
26 
27 Description
28  Base class for fieldMappers which uses a patchToPatch object to map from
29  another patch. The source patch may be differently decomposed and/or
30  geometrically and topologically different from the target. Derived into
31  versions which handle unmapped regions differently.
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef patchToPatchFieldMapper_H
36 #define patchToPatchFieldMapper_H
37 
38 #include "fieldMapper.H"
39 #include "patchToPatch.H"
40 #include "ListOps.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class patchToPatchFieldMapper Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public fieldMapper
54 {
55 protected:
56 
57  // Protected Data
58 
59  //- Patch-to-patch interpolation engine
60  const patchToPatch& pToP_;
61 
62 
63 public:
64 
65  // Constructors
66 
67  //- Construct given a patch-to-patch interpolation
69  :
70  fieldMapper(),
71  pToP_(pToP)
72  {}
73 
74 
75  //- Destructor
76  virtual ~patchToPatchFieldMapper()
77  {}
78 
79 
80  // Member Operators
81 
82  //- Map a label field (not implemented)
84 
85  //- Inherit the base call operator
86  using fieldMapper::operator();
87 
88  //- Map a temporary field
89  template<class Type>
90  void operator()(Field<Type>& f, const tmp<Field<Type>>& tmapF) const;
91 
92  //- Map a temporary field
93  template<class Type>
94  tmp<Field<Type>> operator()(const tmp<Field<Type>>& tmapF) const;
95 };
96 
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 } // End namespace Foam
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 #ifdef NoRepository
106 #endif
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 #endif
111 
112 // ************************************************************************* //
Various functions to operate on Lists.
Pre-declare SubField and related Field type.
Definition: Field.H:83
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Base class for fieldMappers which uses a patchToPatch object to map from another patch....
patchToPatchFieldMapper(const patchToPatch &pToP)
Construct given a patch-to-patch interpolation.
DEFINE_FIELD_MAPPER_MAP_OPERATOR(label,)
Map a label field (not implemented)
const patchToPatch & pToP_
Patch-to-patch interpolation engine.
void operator()(Field< Type > &f, const tmp< Field< Type >> &tmapF) const
Map a temporary field.
virtual ~patchToPatchFieldMapper()
Destructor.
Class to generate coupling geometry between two primitive patches.
Definition: patchToPatch.H:56
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
labelList f(nPoints)