GeometricFieldNew.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) 2017 OpenFOAM Foundation
9  Copyright (C) 2019 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 \*---------------------------------------------------------------------------*/
28 
29 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
30 
31 template<class Type, template<class> class PatchField, class GeoMesh>
34 (
35  const word& name,
36  const Mesh& mesh,
37  const dimensionSet& ds,
38  const word& patchFieldType
39 )
40 {
42  (
43  IOobject
44  (
45  name,
46  mesh.thisDb().time().timeName(),
47  mesh.thisDb(),
48  IOobject::NO_READ,
49  IOobject::NO_WRITE,
50  false
51  ),
52  mesh,
53  ds,
54  patchFieldType
55  );
56 }
57 
58 
59 template<class Type, template<class> class PatchField, class GeoMesh>
62 (
63  const word& name,
64  const Mesh& mesh,
65  const dimensionSet& ds,
66  const Field<Type>& iField,
67  const word& patchFieldType
68 )
69 {
71  (
72  IOobject
73  (
74  name,
75  mesh.thisDb().time().timeName(),
76  mesh.thisDb(),
77  IOobject::NO_READ,
78  IOobject::NO_WRITE,
79  false
80  ),
81  mesh,
82  ds,
83  iField,
84  patchFieldType
85  );
86 }
87 
88 
89 template<class Type, template<class> class PatchField, class GeoMesh>
92 (
93  const word& name,
94  const Mesh& mesh,
95  const dimensionSet& ds,
96  Field<Type>&& iField,
97  const word& patchFieldType
98 )
99 {
101  (
102  IOobject
103  (
104  name,
105  mesh.thisDb().time().timeName(),
106  mesh.thisDb(),
107  IOobject::NO_READ,
108  IOobject::NO_WRITE,
109  false
110  ),
111  mesh,
112  ds,
113  std::move(iField),
114  patchFieldType
115  );
116 }
117 
118 
119 template<class Type, template<class> class PatchField, class GeoMesh>
122 (
123  const word& name,
124  const Mesh& mesh,
125  const dimensioned<Type>& dt,
126  const word& patchFieldType
127 )
128 {
130  (
131  IOobject
132  (
133  name,
134  mesh.thisDb().time().timeName(),
135  mesh.thisDb(),
136  IOobject::NO_READ,
137  IOobject::NO_WRITE,
138  false
139  ),
140  mesh,
141  dt,
142  patchFieldType
143  );
144 }
145 
146 
147 template<class Type, template<class> class PatchField, class GeoMesh>
150 (
151  const word& name,
152  const Mesh& mesh,
153  const dimensioned<Type>& dt,
154  const wordList& patchFieldTypes,
155  const wordList& actualPatchTypes
156 )
157 {
159  (
160  IOobject
161  (
162  name,
163  mesh.thisDb().time().timeName(),
164  mesh.thisDb(),
165  IOobject::NO_READ,
166  IOobject::NO_WRITE,
167  false
168  ),
169  mesh,
170  dt,
171  patchFieldTypes,
172  actualPatchTypes
173  );
174 }
175 
176 
177 template<class Type, template<class> class PatchField, class GeoMesh>
180 (
181  const word& newName,
183 )
184 {
186  (
187  IOobject
188  (
189  newName,
190  tgf().instance(),
191  tgf().local(),
192  tgf().db(),
193  IOobject::NO_READ,
194  IOobject::NO_WRITE,
195  false
196  ),
197  tgf
198  );
199 }
200 
201 
202 template<class Type, template<class> class PatchField, class GeoMesh>
205 (
206  const word& newName,
208  const wordList& patchFieldTypes,
209  const wordList& actualPatchTypes
210 )
211 {
213  (
214  IOobject
215  (
216  newName,
217  tgf().instance(),
218  tgf().local(),
219  tgf().db(),
220  IOobject::NO_READ,
221  IOobject::NO_WRITE,
222  false
223  ),
224  tgf,
225  patchFieldTypes,
226  actualPatchTypes
227  );
228 }
229 
230 
231 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::dimensionSet
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:108
Foam::GeometricField::New
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Mesh &mesh, const dimensionSet &ds, const word &patchFieldType=PatchField< Type >::calculatedType())
Return tmp field from name, mesh, dimensions and patch type.
Definition: GeometricFieldNew.C:34
Foam::GeometricField< Type, fvPatchField, volMesh >::Mesh
volMesh ::Mesh Mesh
Type of mesh on which this GeometricField is instantiated.
Definition: GeometricField.H:100
Foam::Field
Generic templated field type.
Definition: Field.H:63
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:42
Foam::GeoMesh
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:48
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
Foam::List< word >
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53