volSurfaceMapping.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016-2017 Wikki Ltd
9  Copyright (C) 2019-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::volSurfaceMapping
29 
30 Description
31  Volume to surface and surface to volume mapping
32 
33 Author
34  Hrvoje Jasak, Wikki Ltd.
35 
36 SourceFiles
37  volSurfaceMapping.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef volSurfaceMapping_H
42 #define volSurfaceMapping_H
43 
44 #include "faMesh.H"
45 #include "volMesh.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 template<class Type> class fvPatchField;
53 
54 /*---------------------------------------------------------------------------*\
55  Class volSurfaceMapping Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 {
60  // Private Data
61 
62  //- Reference to mesh
63  const faMesh& mesh_;
64 
65 
66 public:
67 
68  // Constructors
69 
70  //- Construct from mesh
72  :
73  mesh_(mesh)
74  {}
75 
76  //- No copy construct
77  volSurfaceMapping(const volSurfaceMapping&) = delete;
78 
79  //- No copy assignment
80  void operator=(const volSurfaceMapping&) = delete;
81 
82 
83  //- Destructor
84  ~volSurfaceMapping() = default;
85 
86 
87  // Member Functions
88 
89  //- Map Boundary field to surface
90  template<class Type>
92  (
93  const typename
95  ) const;
96 
97  //- Map vol Field to surface Field
98  template<class Type>
100 
101  //- Map patch internal field to surface
102  template<class Type>
104  (
105  const typename
107  ) const;
108 
109  //- Map surface field to volume boundary field
110  template<class Type>
111  void mapToVolume
112  (
115  ) const;
116 
117  //- Map surface tmp field to volume boundary field
118  template<class Type>
119  void mapToVolume
120  (
123  ) const;
124 
125  //- Map surface field to field
126  // Assumes Field faces in the same order as Boundary
127  template<class Type>
128  void mapToField
129  (
131  Field<Type>& f
132  ) const;
133 
134  //- Map surface field to volume field
135  // Assumes Field faces in the same order as Boundary
136  template<class Type>
137  void mapToField
138  (
139  const Field<Type>& af,
140  Field<Type>& f
141  ) const;
142 };
143 
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 } // End namespace Foam
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 #ifdef NoRepository
152  #include "volSurfaceMapping.C"
153 #endif
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: volSurfaceMapping.H:51
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
volMesh.H
Foam::volSurfaceMapping::operator=
void operator=(const volSurfaceMapping &)=delete
No copy assignment.
Foam::volSurfaceMapping::mapToSurface
tmp< Field< Type > > mapToSurface(const typename GeometricField< Type, fvPatchField, volMesh >::Boundary &df) const
Map Boundary field to surface.
Foam::volSurfaceMapping::~volSurfaceMapping
~volSurfaceMapping()=default
Destructor.
faMesh.H
Foam::volSurfaceMapping::volSurfaceMapping
volSurfaceMapping(const faMesh &mesh)
Construct from mesh.
Definition: volSurfaceMapping.H:70
Foam::volSurfaceMapping::mapToField
void mapToField(const GeometricField< Type, faPatchField, areaMesh > &af, Field< Type > &f) const
Map surface field to field.
Definition: volSurfaceMapping.C:180
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::volSurfaceMapping::mapToVolume
void mapToVolume(const GeometricField< Type, faPatchField, areaMesh > &af, typename GeometricField< Type, fvPatchField, volMesh >::Boundary &bf) const
Map surface field to volume boundary field.
Definition: volSurfaceMapping.C:135
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
volSurfaceMapping.C
f
labelList f(nPoints)
Foam::volSurfaceMapping::mapInternalToSurface
tmp< Field< Type > > mapInternalToSurface(const typename GeometricField< Type, fvPatchField, volMesh >::Boundary &df) const
Map patch internal field to surface.
Foam::volSurfaceMapping
Volume to surface and surface to volume mapping.
Definition: volSurfaceMapping.H:57
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53