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-2019 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);
38  defineRunTimeSelectionTable(motionInterpolation, Istream);
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 cstrIter = IstreamConstructorTablePtr_->cfind(modelType);
80 
81  if (!cstrIter.found())
82  {
84  (
85  is,
86  "interpolation",
87  modelType,
88  *IstreamConstructorTablePtr_
89  ) << exit(FatalIOError);
90  }
91 
92  return autoPtr<motionInterpolation>(cstrIter()(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 // ************************************************************************* //
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:67
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::motionInterpolation::~motionInterpolation
virtual ~motionInterpolation()
Destructor.
Definition: motionInterpolation.C:98
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::MeshObject< fvMesh, UpdateableMeshObject, volPointInterpolation >::New
static const volPointInterpolation & New(const fvMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
Definition: MeshObject.C:48
Foam::FatalIOError
IOerror FatalIOError
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::volPointInterpolation::interpolate
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
FatalIOErrorInLookup
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:406
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
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::interpolate
virtual void interpolate(const volScalarField &, pointScalarField &) const
Interpolate the given scalar cell displacement.
Definition: motionInterpolation.C:105
volPointInterpolation.H
Foam::autoPtr< Foam::motionInterpolation >
Foam::motionInterpolation::mesh
const fvMesh & mesh() const
Return const-reference to the mesh.
Definition: motionInterpolation.H:119
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::motionInterpolation::New
static autoPtr< motionInterpolation > New(const fvMesh &mesh)
Select default.
Definition: motionInterpolation.C:66
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
motionInterpolation.H