motionInterpolation.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-2021 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 
30 #include "motionInterpolation.H"
31 #include "volPointInterpolation.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37  defineTypeNameAndDebug(motionInterpolation, 0);
39 }
40 
41 
42 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43 
44 Foam::motionInterpolation::motionInterpolation
45 (
46  const fvMesh& mesh
47 )
48 :
49  mesh_(mesh)
50 {}
51 
52 
53 Foam::motionInterpolation::motionInterpolation
54 (
55  const fvMesh& mesh,
56  Istream& entry
57 )
58 :
59  mesh_(mesh)
60 {}
61 
62 
63 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
64 
67 {
69 }
70 
71 
74 {
75  const word modelType(is);
76 
77  Info<< "Selecting motion interpolation: " << modelType << endl;
78 
79  auto* ctorPtr = IstreamConstructorTable(modelType);
80 
81  if (!ctorPtr)
82  {
84  (
85  is,
86  "interpolation",
87  modelType,
88  *IstreamConstructorTablePtr_
89  ) << exit(FatalIOError);
90  }
91 
92  return autoPtr<motionInterpolation>(ctorPtr(mesh, is));
93 }
94 
95 
96 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
97 
99 {}
100 
101 
102 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
103 
105 (
106  const volScalarField& cellDisplacement,
107  pointScalarField& pointDisplacement
108 ) const
109 {
111  (
112  cellDisplacement,
113  pointDisplacement
114  );
115 }
116 
117 
119 (
120  const volVectorField& cellDisplacement,
121  pointVectorField& pointDisplacement
122 ) const
123 {
125  (
126  cellDisplacement,
127  pointDisplacement
128  );
129 }
130 
131 
132 // ************************************************************************* //
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
virtual ~motionInterpolation()
Destructor.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
static const volPointInterpolation & New(const fvMesh &mesh, Args &&... args)
Get existing or create a new MeshObject. Registered with typeName.
Definition: MeshObject.C:53
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
virtual void interpolate(const volScalarField &, pointScalarField &) const
Interpolate the given scalar cell displacement.
Macros for easy insertion into run-time selection tables.
dynamicFvMesh & mesh
A class for handling words, derived from Foam::string.
Definition: word.H:63
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
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
messageStream Info
Information stream (stdout output on master, null elsewhere)
static autoPtr< motionInterpolation > New(const fvMesh &mesh)
Select default.
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition: autoPtr.H:178
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:635
Namespace for OpenFOAM.
A keyword and a list of tokens is an &#39;entry&#39;.
Definition: entry.H:63
IOerror FatalIOError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL IO ERROR&#39; header text and ...