Loading...
Searching...
No Matches
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
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
37 defineTypeNameAndDebug(motionInterpolation, 0);
38 defineRunTimeSelectionTable(motionInterpolation, Istream);
39}
40
41
42// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43
44Foam::motionInterpolation::motionInterpolation
45(
46 const fvMesh& mesh
47)
48:
49 mesh_(mesh)
50{}
51
52
53Foam::motionInterpolation::motionInterpolation
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 }
92 return autoPtr<motionInterpolation>(ctorPtr(mesh, is));
93}
94
95
96// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
99{}
100
101
102// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
103
105(
106 const volScalarField& cellDisplacement,
107 pointScalarField& pointDisplacement
108) const
109{
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// ************************************************************************* //
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:60
static FOAM_NO_DANGLING_REFERENCE const volPointInterpolation & New(const fvMesh &mesh, Args &&... args)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition autoPtr.H:178
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,...
virtual void interpolate(const volScalarField &, pointScalarField &) const
Interpolate the given scalar cell displacement.
static autoPtr< motionInterpolation > New(const fvMesh &mesh)
Select default.
const fvMesh & mesh() const
Return const-reference to the mesh.
virtual ~motionInterpolation()
Destructor.
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Definition error.H:637
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, pointPatchField, pointMesh > pointScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
messageStream Info
Information stream (stdout output on master, null elsewhere).
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.