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-------------------------------------------------------------------------------
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
30#include "motionInterpolation.H"
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
39}
40
41
42// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43
45(
46 const fvMesh& mesh
47)
48:
49 mesh_(mesh)
50{}
51
52
54(
55 const fvMesh& mesh,
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{
110 volPointInterpolation::New(mesh()).interpolate
111 (
112 cellDisplacement,
113 pointDisplacement
114 );
115}
116
117
119(
120 const volVectorField& cellDisplacement,
121 pointVectorField& pointDisplacement
122) const
123{
124 volPointInterpolation::New(mesh()).interpolate
125 (
126 cellDisplacement,
127 pointDisplacement
128 );
129}
130
131
132// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:70
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Base class for interpolation of cell displacement fields, generated by fvMotionSolvers,...
virtual ~motionInterpolation()
Destructor.
bool interpolate() const noexcept
Same as isPointData()
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
dynamicFvMesh & mesh
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition: error.H:478
Namespace for OpenFOAM.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
IOerror FatalIOError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.