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 | Copyright (C) 2015 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "motionInterpolation.H"
28 #include "volPointInterpolation.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34  defineTypeNameAndDebug(motionInterpolation, 0);
35 
36  defineRunTimeSelectionTable(motionInterpolation, Istream);
37 }
38 
39 
40 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
41 
43 (
44  const fvMesh& mesh
45 )
46 :
47  mesh_(mesh)
48 {}
49 
50 
52 (
53  const fvMesh& mesh,
54  Istream& entry
55 )
56 :
57  mesh_(mesh)
58 {}
59 
60 
61 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
62 
65 {
67 }
68 
69 
72 {
73  const word type(entry);
74 
75  Info<< "Selecting motion interpolation: " << type << endl;
76 
77  IstreamConstructorTable::iterator cstrIter =
78  IstreamConstructorTablePtr_->find(type);
79 
80  if (cstrIter == IstreamConstructorTablePtr_->end())
81  {
83  << "Unknown interpolation type "
84  << type << nl << nl
85  << "Valid interpolation types are :" << endl
86  << IstreamConstructorTablePtr_->sortedToc()
87  << exit(FatalError);
88  }
89 
90  return autoPtr<motionInterpolation>(cstrIter()(mesh, entry));
91 }
92 
93 
94 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
95 
97 {}
98 
99 
100 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
101 
103 (
104  const volScalarField& cellDisplacement,
105  pointScalarField& pointDisplacement
106 ) const
107 {
109  (
110  cellDisplacement,
111  pointDisplacement
112  );
113 }
114 
115 
117 (
118  const volVectorField& cellDisplacement,
119  pointVectorField& pointDisplacement
120 ) const
121 {
123  (
124  cellDisplacement,
125  pointDisplacement
126  );
127 }
128 
129 
130 // ************************************************************************* //
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:65
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::motionInterpolation::~motionInterpolation
virtual ~motionInterpolation()
Destructor.
Definition: motionInterpolation.C:96
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::MeshObject< fvMesh, UpdateableMeshObject, volPointInterpolation >::New
static const volPointInterpolation & New(const fvMesh &mesh)
Definition: MeshObject.C:44
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
Foam::FatalError
error FatalError
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
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:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::motionInterpolation::motionInterpolation
motionInterpolation(const motionInterpolation &)
Disallow default bitwise copy construct.
Foam::volPointInterpolation::interpolate
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
Definition: volPointInterpolate.C:502
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::motionInterpolation::interpolate
virtual void interpolate(const volScalarField &, pointScalarField &) const
Interpolate the given scalar cell displacement.
Definition: motionInterpolation.C:103
volPointInterpolation.H
Foam::autoPtr< Foam::motionInterpolation >
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::motionInterpolation::mesh
const fvMesh & mesh() const
Return const-refernce to the mesh.
Definition: motionInterpolation.H:117
Foam::type
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:588
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::motionInterpolation::New
static autoPtr< motionInterpolation > New(const fvMesh &mesh)
Select default.
Definition: motionInterpolation.C:64
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
motionInterpolation.H