fvcLaplacian.C
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) 2011-2018 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 \*---------------------------------------------------------------------------*/
25 
26 #include "fvcLaplacian.H"
27 #include "fvMesh.H"
28 #include "laplacianScheme.H"
29 
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace fvc
38 {
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 template<class Type>
43 tmp<GeometricField<Type, fvPatchField, volMesh>>
45 (
47  const word& name
48 )
49 {
51  (
52  vf.mesh(),
53  vf.mesh().laplacianScheme(name)
54  ).ref().fvcLaplacian(vf);
55 }
56 
57 
58 template<class Type>
61 (
63  const word& name
64 )
65 {
67  (
68  fvc::laplacian(tvf(), name)
69  );
70  tvf.clear();
71  return Laplacian;
72 }
73 
74 
75 template<class Type>
78 (
80 )
81 {
82  return fvc::laplacian(vf, "laplacian(" + vf.name() + ')');
83 }
84 
85 
86 template<class Type>
89 (
91 )
92 {
94  (
95  fvc::laplacian(tvf())
96  );
97  tvf.clear();
98  return Laplacian;
99 }
100 
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 template<class Type, class GType>
106 laplacian
107 (
108  const dimensioned<GType>& gamma,
110  const word& name
111 )
112 {
114  (
115  IOobject
116  (
117  gamma.name(),
118  vf.instance(),
119  vf.mesh(),
121  ),
122  vf.mesh(),
123  gamma
124  );
125 
126  return fvc::laplacian(Gamma, vf, name);
127 }
128 
129 
130 template<class Type, class GType>
132 laplacian
133 (
134  const dimensioned<GType>& gamma,
136  const word& name
137 )
138 {
140  (
141  fvc::laplacian(gamma, tvf(), name)
142  );
143  tvf.clear();
144  return Laplacian;
145 }
146 
147 
148 template<class Type, class GType>
150 laplacian
151 (
152  const dimensioned<GType>& gamma,
154 )
155 {
157  (
158  IOobject
159  (
160  gamma.name(),
161  vf.instance(),
162  vf.mesh(),
164  ),
165  vf.mesh(),
166  gamma
167  );
168 
169  return fvc::laplacian(Gamma, vf);
170 }
171 
172 
173 template<class Type, class GType>
175 laplacian
176 (
177  const dimensioned<GType>& gamma,
179 )
180 {
182  (
183  fvc::laplacian(gamma, tvf())
184  );
185  tvf.clear();
186  return Laplacian;
187 }
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 template<class Type, class GType>
194 laplacian
195 (
198  const word& name
199 )
200 {
202  (
203  vf.mesh(),
204  vf.mesh().laplacianScheme(name)
205  ).ref().fvcLaplacian(gamma, vf);
206 }
207 
208 
209 template<class Type, class GType>
211 laplacian
212 (
215  const word& name
216 )
217 {
219  (
220  fvc::laplacian(tgamma(), vf, name)
221  );
222  tgamma.clear();
223  return Laplacian;
224 }
225 
226 
227 template<class Type, class GType>
229 laplacian
230 (
233  const word& name
234 )
235 {
237  (
238  fvc::laplacian(gamma, tvf(), name)
239  );
240  tvf.clear();
241  return Laplacian;
242 }
243 
244 
245 template<class Type, class GType>
247 laplacian
248 (
251  const word& name
252 )
253 {
255  (
256  fvc::laplacian(tgamma(), tvf(), name)
257  );
258  tgamma.clear();
259  tvf.clear();
260  return Laplacian;
261 }
262 
263 
264 template<class Type, class GType>
266 laplacian
267 (
270 )
271 {
272  return fvc::laplacian
273  (
274  gamma,
275  vf,
276  "laplacian(" + gamma.name() + ',' + vf.name() + ')'
277  );
278 }
279 
280 
281 template<class Type, class GType>
283 laplacian
284 (
287 )
288 {
289  return fvc::laplacian
290  (
291  tgamma,
292  vf,
293  "laplacian(" + tgamma().name() + ',' + vf.name() + ')'
294  );
295 }
296 
297 
298 template<class Type, class GType>
300 laplacian
301 (
304 )
305 {
306  return fvc::laplacian
307  (
308  gamma,
309  tvf,
310  "laplacian(" + gamma.name() + ',' + tvf().name() + ')'
311  );
312 }
313 
314 
315 template<class Type, class GType>
317 laplacian
318 (
321 )
322 {
323  return fvc::laplacian
324  (
325  tgamma,
326  tvf,
327  "laplacian(" + tgamma().name() + ',' + tvf().name() + ')'
328  );
329 }
330 
331 
332 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
333 
334 template<class Type, class GType>
336 laplacian
337 (
340  const word& name
341 )
342 {
344  (
345  vf.mesh(),
346  vf.mesh().laplacianScheme(name)
347  ).ref().fvcLaplacian(gamma, vf);
348 }
349 
350 
351 template<class Type, class GType>
353 laplacian
354 (
357  const word& name
358 )
359 {
361  (
362  fvc::laplacian(tgamma(), vf, name)
363  );
364  tgamma.clear();
365  return Laplacian;
366 }
367 
368 
369 template<class Type, class GType>
371 laplacian
372 (
375  const word& name
376 )
377 {
379  (
380  fvc::laplacian(gamma, tvf(), name)
381  );
382  tvf.clear();
383  return Laplacian;
384 }
385 
386 
387 template<class Type, class GType>
389 (
392  const word& name
393 )
394 {
396  (
397  fvc::laplacian(tgamma(), tvf(), name)
398  );
399  tgamma.clear();
400  tvf.clear();
401  return Laplacian;
402 }
403 
404 
405 template<class Type, class GType>
407 laplacian
408 (
411 )
412 {
413  return fvc::laplacian
414  (
415  gamma,
416  vf,
417  "laplacian(" + gamma.name() + ',' + vf.name() + ')'
418  );
419 }
420 
421 
422 template<class Type, class GType>
424 laplacian
425 (
428 )
429 {
431  (
432  fvc::laplacian(tgamma(), vf)
433  );
434  tgamma.clear();
435  return Laplacian;
436 }
437 
438 
439 template<class Type, class GType>
441 laplacian
442 (
445 )
446 {
448  (
449  fvc::laplacian(gamma, tvf())
450  );
451  tvf.clear();
452  return Laplacian;
453 }
454 
455 
456 template<class Type, class GType>
458 (
461 )
462 {
464  (
465  fvc::laplacian(tgamma(), tvf())
466  );
467  tgamma.clear();
468  tvf.clear();
469  return Laplacian;
470 }
471 
472 
473 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
474 
475 } // End namespace fvc
476 
477 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
478 
479 } // End namespace Foam
480 
481 // ************************************************************************* //
const word & name() const
Return name.
Definition: IOobject.H:297
Generic GeometricField class.
Generic dimensioned Type class.
tmp< GeometricField< Type, fvPatchField, volMesh > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Definition: fvcLaplacian.C:45
A class for handling words, derived from string.
Definition: word.H:59
Calculate the laplacian of the given field.
const Mesh & mesh() const
Return mesh.
const word & name() const
Return const reference to name.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
const fileName & instance() const
Definition: IOobject.H:392
rDeltaT ref()
A class for managing temporary objects.
Definition: PtrList.H:53
static tmp< laplacianScheme< Type, GType > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new laplacianScheme created on freestore.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.