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 -------------------------------------------------------------------------------
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 
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36  defineTypeNameAndDebug(patchCorrectedInterpolation, 0);
37 
39  (
40  motionInterpolation,
41  patchCorrectedInterpolation,
42  Istream
43  );
44 }
45 
46 
47 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
48 
49 Foam::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,
88  Istream& entry
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 // ************************************************************************* //
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
const fvMesh & mesh() const
Return const-reference to the mesh.
virtual void interpolate(const volScalarField &, pointScalarField &) const
Interpolate the given scalar cell displacement.
List< labelList > labelListList
List of labelList.
Definition: labelList.H:38
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
dynamicFvMesh & mesh
patchCorrectedInterpolation(const fvMesh &mesh, Istream &entry)
Construct from an fvMesh and an Istream.
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
Definition: polyMesh.H:608
Base class for interpolation of cell displacement fields, generated by fvMotionSolvers, to the points. This base class implements the default method which applies volPointInterpolation only.
defineTypeNameAndDebug(combustionModel, 0)
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Namespace for OpenFOAM.
A keyword and a list of tokens is an &#39;entry&#39;.
Definition: entry.H:63
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)