Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
finiteVolume
finiteVolume
fvc
fvcLaplacian.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 | Copyright (C) 1991-2011 OpenCFD Ltd.
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 <
finiteVolume/fvMesh.H
>
28
#include <
finiteVolume/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> >
44
laplacian
45
(
46
const
GeometricField<Type, fvPatchField, volMesh>
& vf,
47
const
word
&
name
48
)
49
{
50
return
fv::laplacianScheme<Type, scalar>::New
51
(
52
vf.
mesh
(),
53
vf.
mesh
().
laplacianScheme
(name)
54
)().
fvcLaplacian
(vf);
55
}
56
57
58
template
<
class
Type>
59
tmp<GeometricField<Type, fvPatchField, volMesh>
>
60
laplacian
61
(
62
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf,
63
const
word
& name
64
)
65
{
66
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
67
(
68
fvc::laplacian
(tvf(), name)
69
);
70
tvf.clear();
71
return
Laplacian;
72
}
73
74
75
template
<
class
Type>
76
tmp<GeometricField<Type, fvPatchField, volMesh>
>
77
laplacian
78
(
79
const
GeometricField<Type, fvPatchField, volMesh>
& vf
80
)
81
{
82
return
fvc::laplacian
(vf,
"laplacian("
+ vf.
name
() +
')'
);
83
}
84
85
86
template
<
class
Type>
87
tmp<GeometricField<Type, fvPatchField, volMesh>
>
88
laplacian
89
(
90
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf
91
)
92
{
93
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
94
(
95
fvc::laplacian
(tvf())
96
);
97
tvf.clear();
98
return
Laplacian;
99
}
100
101
102
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103
104
template
<
class
Type,
class
GType>
105
tmp<GeometricField<Type, fvPatchField, volMesh>
>
106
laplacian
107
(
108
const
dimensioned<GType>
& gamma,
109
const
GeometricField<Type, fvPatchField, volMesh>
& vf,
110
const
word
& name
111
)
112
{
113
GeometricField<GType, fvsPatchField, surfaceMesh>
Gamma
114
(
115
IOobject
116
(
117
gamma.
name
(),
118
vf.
instance
(),
119
vf.
mesh
(),
120
IOobject::NO_READ
121
),
122
vf.
mesh
(),
123
gamma
124
);
125
126
return
fvc::laplacian
(Gamma, vf, name);
127
}
128
129
130
template
<
class
Type,
class
GType>
131
tmp<GeometricField<Type, fvPatchField, volMesh>
>
132
laplacian
133
(
134
const
dimensioned<GType>
& gamma,
135
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf,
136
const
word
& name
137
)
138
{
139
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
140
(
141
fvc::laplacian
(gamma, tvf(), name)
142
);
143
tvf.clear();
144
return
Laplacian;
145
}
146
147
148
template
<
class
Type,
class
GType>
149
tmp<GeometricField<Type, fvPatchField, volMesh>
>
150
laplacian
151
(
152
const
dimensioned<GType>
& gamma,
153
const
GeometricField<Type, fvPatchField, volMesh>
& vf
154
)
155
{
156
GeometricField<GType, fvsPatchField, surfaceMesh>
Gamma
157
(
158
IOobject
159
(
160
gamma.
name
(),
161
vf.
instance
(),
162
vf.
mesh
(),
163
IOobject::NO_READ
164
),
165
vf.
mesh
(),
166
gamma
167
);
168
169
return
fvc::laplacian
(Gamma, vf);
170
}
171
172
173
template
<
class
Type,
class
GType>
174
tmp<GeometricField<Type, fvPatchField, volMesh>
>
175
laplacian
176
(
177
const
dimensioned<GType>
& gamma,
178
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf
179
)
180
{
181
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
182
(
183
fvc::laplacian
(gamma, tvf())
184
);
185
tvf.clear();
186
return
Laplacian;
187
}
188
189
190
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191
192
template
<
class
Type,
class
GType>
193
tmp<GeometricField<Type, fvPatchField, volMesh>
>
194
laplacian
195
(
196
const
GeometricField<GType, fvPatchField, volMesh>
& gamma,
197
const
GeometricField<Type, fvPatchField, volMesh>
& vf,
198
const
word
& name
199
)
200
{
201
return
fv::laplacianScheme<Type, GType>::New
202
(
203
vf.
mesh
(),
204
vf.
mesh
().
laplacianScheme
(name)
205
)().
fvcLaplacian
(gamma, vf);
206
}
207
208
209
template
<
class
Type,
class
GType>
210
tmp<GeometricField<Type, fvPatchField, volMesh>
>
211
laplacian
212
(
213
const
tmp
<
GeometricField<GType, fvPatchField, volMesh>
>& tgamma,
214
const
GeometricField<Type, fvPatchField, volMesh>
& vf,
215
const
word
& name
216
)
217
{
218
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
219
(
220
fvc::laplacian
(tgamma(), vf, name)
221
);
222
tgamma.clear();
223
return
Laplacian;
224
}
225
226
227
template
<
class
Type,
class
GType>
228
tmp<GeometricField<Type, fvPatchField, volMesh>
>
229
laplacian
230
(
231
const
GeometricField<GType, fvPatchField, volMesh>
& gamma,
232
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf,
233
const
word
& name
234
)
235
{
236
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
237
(
238
fvc::laplacian
(gamma, tvf(), name)
239
);
240
tvf.clear();
241
return
Laplacian;
242
}
243
244
245
template
<
class
Type,
class
GType>
246
tmp<GeometricField<Type, fvPatchField, volMesh>
>
247
laplacian
248
(
249
const
tmp
<
GeometricField<GType, fvPatchField, volMesh>
>& tgamma,
250
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf,
251
const
word
& name
252
)
253
{
254
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
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>
265
tmp<GeometricField<Type, fvPatchField, volMesh>
>
266
laplacian
267
(
268
const
GeometricField<GType, fvPatchField, volMesh>
& gamma,
269
const
GeometricField<Type, fvPatchField, volMesh>
& vf
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>
282
tmp<GeometricField<Type, fvPatchField, volMesh>
>
283
laplacian
284
(
285
const
tmp
<
GeometricField<GType, fvPatchField, volMesh>
>& tgamma,
286
const
GeometricField<Type, fvPatchField, volMesh>
& vf
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>
299
tmp<GeometricField<Type, fvPatchField, volMesh>
>
300
laplacian
301
(
302
const
GeometricField<GType, fvPatchField, volMesh>
& gamma,
303
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf
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>
316
tmp<GeometricField<Type, fvPatchField, volMesh>
>
317
laplacian
318
(
319
const
tmp
<
GeometricField<GType, fvPatchField, volMesh>
>& tgamma,
320
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf
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>
335
tmp<GeometricField<Type, fvPatchField, volMesh>
>
336
laplacian
337
(
338
const
GeometricField<GType, fvsPatchField, surfaceMesh>
& gamma,
339
const
GeometricField<Type, fvPatchField, volMesh>
& vf,
340
const
word
& name
341
)
342
{
343
return
fv::laplacianScheme<Type, GType>::New
344
(
345
vf.
mesh
(),
346
vf.
mesh
().
laplacianScheme
(name)
347
)().
fvcLaplacian
(gamma, vf);
348
}
349
350
351
template
<
class
Type,
class
GType>
352
tmp<GeometricField<Type, fvPatchField, volMesh>
>
353
laplacian
354
(
355
const
tmp
<
GeometricField<GType, fvsPatchField, surfaceMesh>
>& tgamma,
356
const
GeometricField<Type, fvPatchField, volMesh>
& vf,
357
const
word
& name
358
)
359
{
360
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
361
(
362
fvc::laplacian
(tgamma(), vf, name)
363
);
364
tgamma.clear();
365
return
Laplacian;
366
}
367
368
369
template
<
class
Type,
class
GType>
370
tmp<GeometricField<Type, fvPatchField, volMesh>
>
371
laplacian
372
(
373
const
GeometricField<GType, fvsPatchField, surfaceMesh>
& gamma,
374
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf,
375
const
word
& name
376
)
377
{
378
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
379
(
380
fvc::laplacian
(gamma, tvf(), name)
381
);
382
tvf.clear();
383
return
Laplacian;
384
}
385
386
387
template
<
class
Type,
class
GType>
388
tmp<GeometricField<Type, fvPatchField, volMesh>
>
laplacian
389
(
390
const
tmp
<
GeometricField<GType, fvsPatchField, surfaceMesh>
>& tgamma,
391
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf,
392
const
word
& name
393
)
394
{
395
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
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>
406
tmp<GeometricField<Type, fvPatchField, volMesh>
>
407
laplacian
408
(
409
const
GeometricField<GType, fvsPatchField, surfaceMesh>
& gamma,
410
const
GeometricField<Type, fvPatchField, volMesh>
& vf
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>
423
tmp<GeometricField<Type, fvPatchField, volMesh>
>
424
laplacian
425
(
426
const
tmp
<
GeometricField<GType, fvsPatchField, surfaceMesh>
>& tgamma,
427
const
GeometricField<Type, fvPatchField, volMesh>
& vf
428
)
429
{
430
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
431
(
432
fvc::laplacian
(tgamma(), vf)
433
);
434
tgamma.clear();
435
return
Laplacian;
436
}
437
438
439
template
<
class
Type,
class
GType>
440
tmp<GeometricField<Type, fvPatchField, volMesh>
>
441
laplacian
442
(
443
const
GeometricField<GType, fvsPatchField, surfaceMesh>
& gamma,
444
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf
445
)
446
{
447
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
448
(
449
fvc::laplacian
(gamma, tvf())
450
);
451
tvf.clear();
452
return
Laplacian;
453
}
454
455
456
template
<
class
Type,
class
GType>
457
tmp<GeometricField<Type, fvPatchField, volMesh>
>
laplacian
458
(
459
const
tmp
<
GeometricField<GType, fvsPatchField, surfaceMesh>
>& tgamma,
460
const
tmp
<
GeometricField<Type, fvPatchField, volMesh>
>& tvf
461
)
462
{
463
tmp<GeometricField<Type, fvPatchField, volMesh>
> Laplacian
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
// ************************ vim: set sw=4 sts=4 et: ************************ //