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 // ************************************************************************* //
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:67
Foam::patchCorrectedInterpolation::~patchCorrectedInterpolation
virtual ~patchCorrectedInterpolation()
Destructor.
Definition: patchCorrectedInterpolation.C:98
Foam::patchCorrectedInterpolation::interpolate
virtual void interpolate(const volScalarField &, pointScalarField &) const
Interpolate the given scalar cell displacement.
Definition: patchCorrectedInterpolation.C:105
Foam::polyMesh::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:444
Foam::patchCorrectedInterpolation::patchCorrectedInterpolation
patchCorrectedInterpolation(const fvMesh &mesh, Istream &entry)
Construct from an fvMesh and an Istream.
Definition: patchCorrectedInterpolation.C:86
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::polyBoundaryMesh::findPatchID
label findPatchID(const word &patchName, const bool allowNotFound=true) const
Find patch index given a name, return -1 if not found.
Definition: polyBoundaryMesh.C:766
Foam::FatalError
error FatalError
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::motionInterpolation
Base class for interpolation of cell displacement fields, generated by fvMotionSolvers,...
Definition: motionInterpolation.H:52
Foam::labelListList
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:56
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
Foam::motionInterpolation::mesh
const fvMesh & mesh() const
Return const-reference to the mesh.
Definition: motionInterpolation.H:119
Foam::List< labelList >
patchCorrectedInterpolation.H
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)