patchCorrectedInterpolation.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) 2015 OpenFOAM Foundation
9 Copyright (C) 2015 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
31
32// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33
34namespace Foam
35{
37
39 (
43 );
44}
45
46
47// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
48
49Foam::labelListList Foam::patchCorrectedInterpolation::getPatchGroups
50(
51 Istream& entry
52) const
53{
54 List<List<word>> patchGroupNames(entry);
55
56 labelListList patchGroups(patchGroupNames.size());
57
58 forAll(patchGroupNames, patchI)
59 {
60 patchGroups[patchI].resize(patchGroupNames[patchI].size());
61
62 forAll(patchGroupNames[patchI], patchJ)
63 {
64 patchGroups[patchI][patchJ] =
66 (
67 patchGroupNames[patchI][patchJ]
68 );
69
70 if (patchGroups[patchI][patchJ] == -1)
71 {
73 << "patch \"" << patchGroupNames[patchI][patchJ]
74 << "\" not found" << exit(FatalError);
75 }
76 }
77 }
78
79 return patchGroups;
80}
81
82
83// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
84
86(
87 const fvMesh& mesh,
89)
90:
92 patchGroups_(getPatchGroups(entry))
93{}
94
95
96// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
97
99{}
100
101
102// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
103
105(
106 const volScalarField& cellDisplacement,
107 pointScalarField& pointDisplacement
108) const
109{
110 interpolateType(cellDisplacement, pointDisplacement);
111}
112
113
115(
116 const volVectorField& cellDisplacement,
117 pointVectorField& pointDisplacement
118) const
119{
120 interpolateType(cellDisplacement, pointDisplacement);
121}
122
123
124// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:70
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Base class for interpolation of cell displacement fields, generated by fvMotionSolvers,...
const fvMesh & mesh() const
Return const-reference to the mesh.
Interpolation of cell-based displacements to the points with additional correction for interpolation ...
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:456
bool interpolate() const noexcept
Same as isPointData()
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
dynamicFvMesh & mesh
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Namespace for OpenFOAM.
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:56
error FatalError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333