genericPatchFieldBaseTemplates.C
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) 2021 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
29
30// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
31
32template<class MapperType>
34(
35 const genericPatchFieldBase& rhs,
36 const MapperType& mapper
37)
38{
40 {
41 scalarFields_.insert
42 (
43 iter.key(),
44 autoPtr<scalarField>::New(*iter(), mapper)
45 );
46 }
47
49 {
50 vectorFields_.insert
51 (
52 iter.key(),
53 autoPtr<vectorField>::New(*iter(), mapper)
54 );
55 }
56
58 {
59 sphTensorFields_.insert
60 (
61 iter.key(),
63 );
64 }
65
67 {
69 (
70 iter.key(),
71 autoPtr<symmTensorField>::New(*iter(), mapper)
72 );
73 }
74
76 {
77 tensorFields_.insert
78 (
79 iter.key(),
80 autoPtr<tensorField>::New(*iter(), mapper)
81 );
82 }
83}
84
85
86template<class MapperType>
88(
89 const MapperType& mapper
90)
91{
92 forAllIters(scalarFields_, iter)
93 {
94 (*iter)->autoMap(mapper);
95 }
96
97 forAllIters(vectorFields_, iter)
98 {
99 (*iter)->autoMap(mapper);
100 }
101
102 forAllIters(sphTensorFields_, iter)
103 {
104 (*iter)->autoMap(mapper);
105 }
106
107 forAllIters(symmTensorFields_, iter)
108 {
109 (*iter)->autoMap(mapper);
110 }
111
112 forAllIters(tensorFields_, iter)
113 {
114 (*iter)->autoMap(mapper);
115 }
116}
117
118
119// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Generic infrastructure for reading/writing unknown patch types.
HashPtrTable< vectorField > vectorFields_
void autoMapGeneric(const MapperType &mapper)
Implementation for autoMap of self given a mapping object.
HashPtrTable< symmTensorField > symmTensorFields_
HashPtrTable< sphericalTensorField > sphTensorFields_
HashPtrTable< tensorField > tensorFields_
HashPtrTable< scalarField > scalarFields_
void mapGeneric(const genericPatchFieldBase &rhs, const MapperType &mapper)
Implementation for construct with mapper.
#define forAllIters(container, iter)
Iterate across all elements in the container object.
Definition: stdFoam.H:260
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Definition: stdFoam.H:278