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 -------------------------------------------------------------------------------
10 License
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 
28 #include "genericPatchFieldBase.H"
29 
30 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
31 
32 template<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(),
62  autoPtr<sphericalTensorField>::New(*iter(), mapper)
63  );
64  }
65 
67  {
68  symmTensorFields_.insert
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 
86 template<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 // ************************************************************************* //
Foam::genericPatchFieldBase
Generic infrastructure for reading/writing unknown patch types.
Definition: genericPatchFieldBase.H:54
Foam::genericPatchFieldBase::mapGeneric
void mapGeneric(const genericPatchFieldBase &rhs, const MapperType &mapper)
Implementation for construct with mapper.
Definition: genericPatchFieldBaseTemplates.C:34
Foam::genericPatchFieldBase::vectorFields_
HashPtrTable< vectorField > vectorFields_
Definition: genericPatchFieldBase.H:78
Foam::genericPatchFieldBase::autoMapGeneric
void autoMapGeneric(const MapperType &mapper)
Implementation for autoMap of self given a mapping object.
Definition: genericPatchFieldBaseTemplates.C:88
Foam::genericPatchFieldBase::symmTensorFields_
HashPtrTable< symmTensorField > symmTensorFields_
Definition: genericPatchFieldBase.H:80
Foam::genericPatchFieldBase::tensorFields_
HashPtrTable< tensorField > tensorFields_
Definition: genericPatchFieldBase.H:81
forAllIters
#define forAllIters(container, iter)
Iterate across all elements in the container object.
Definition: stdFoam.H:223
Foam::genericPatchFieldBase::sphTensorFields_
HashPtrTable< sphericalTensorField > sphTensorFields_
Definition: genericPatchFieldBase.H:79
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
forAllConstIters
forAllConstIters(mixture.phases(), phase)
Definition: pEqn.H:28
Foam::genericPatchFieldBase::scalarFields_
HashPtrTable< scalarField > scalarFields_
Definition: genericPatchFieldBase.H:77
genericPatchFieldBase.H