Loading...
Searching...
No Matches
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
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 }
79 return patchGroups;
80}
81
82
83// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
84
86(
87 const fvMesh& mesh,
89)
90:
91 motionInterpolation(mesh, entry),
92 patchGroups_(getPatchGroups(entry))
93{}
94
95
96// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
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:60
A keyword and a list of tokens is an 'entry'.
Definition entry.H:66
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
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 ...
patchCorrectedInterpolation(const fvMesh &mesh, Istream &entry)
Construct from an fvMesh and an Istream.
virtual void interpolate(const volScalarField &, pointScalarField &) const
Interpolate the given scalar cell displacement.
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 noexcept
Return boundary mesh.
Definition polyMesh.H:609
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299