OpenFOAM: API Guide
v2112
The open source CFD toolbox
faPatchTemplates.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) 2016-2017 Wikki Ltd
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
#include "
faPatch.H
"
30
31
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32
33
template
<
class
Type>
34
Foam::tmp<Foam::Field<Type>
>
Foam::faPatch::patchInternalField
35
(
36
const
UList<Type>
&
f
37
)
const
38
{
39
return
patchInternalField(
f
, this->edgeFaces());
40
}
41
42
43
template
<
class
Type>
44
Foam::tmp<Foam::Field<Type>
>
Foam::faPatch::patchInternalField
45
(
46
const
UList<Type>
&
f
,
47
const
labelUList
& edgeFaces
48
)
const
49
{
50
auto
tpif =
tmp<Field<Type>
>
::New
(size());
51
auto
& pif = tpif.ref();
52
53
forAll
(pif, facei)
54
{
55
pif[facei] =
f
[edgeFaces[facei]];
56
}
57
58
return
tpif;
59
}
60
61
62
template
<
class
GeometricField,
class
Type>
63
const
typename
GeometricField::Patch
&
Foam::faPatch::patchField
64
(
65
const
GeometricField
& gf
66
)
const
67
{
68
return
gf.
boundaryField
()[index()];
69
}
70
71
72
// ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition:
PtrList.H:61
Foam::faPatch::patchInternalField
tmp< Field< Type > > patchInternalField(const UList< Type > &) const
Return given internal field next to patch as patch field.
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition:
stdFoam.H:296
Foam::faPatch::patchField
const GeometricField::Patch & patchField(const GeometricField &) const
Return the corresponding patchField of the named field.
Definition:
faPatchTemplates.C:64
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
f
labelList f(nPoints)
faPatch.H
Foam::UList< Type >
Foam::GeometricField
Generic GeometricField class.
Definition:
areaFieldsFwd.H:53
Foam::GeometricField::Patch
PatchField< Type > Patch
Definition:
GeometricField.H:111
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition:
GeometricFieldI.H:62
src
finiteArea
faMesh
faPatches
faPatch
faPatchTemplates.C
Generated by
1.8.17
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.