splineInterpolationWeights.H
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) 2012-2015 OpenFOAM Foundation
9 Copyright (C) 2019 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
27Class
28 Foam::splineInterpolationWeights
29
30Description
31 Catmull-Rom spline interpolation.
32
33SourceFiles
34 splineInterpolationWeights.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef splineInterpolationWeights_H
39#define splineInterpolationWeights_H
40
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class splineInterpolationWeights Declaration
50\*---------------------------------------------------------------------------*/
53:
55{
56 // Private Data
57
58 //- Cached index in samples from previous invocation
59 mutable label index_;
60
61
62public:
63
64 //- Runtime type information
65 TypeName("spline");
66
67
68 // Constructors
69
70 //- Construct from components. By default make sure samples are
71 // equidistant.
73 (
74 const scalarField& samples,
75 const bool checkEqualDistance = true
76 );
77
78
79 //- Destructor
80 virtual ~splineInterpolationWeights() = default;
81
82
83 // Member Functions
84
85 //- Calculate weights and indices to calculate t from samples.
86 // \return true if indices changed.
87 virtual bool valueWeights
88 (
89 const scalar t,
90 labelList& indices,
91 scalarField& weights
92 ) const;
93
94 //- Calculate weights and indices to calculate integrand of t1..t2
95 //- from samples.
96 // \return true if indices changed.
97 virtual bool integrationWeights
98 (
99 const scalar t1,
100 const scalar t2,
101 labelList& indices,
102 scalarField& weights
103 ) const
104 {
106 return false;
107 }
108
109};
110
111
112// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
114} // End namespace Foam
115
116// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118#endif
119
120// ************************************************************************* //
Abstract base class for interpolating in 1D.
Catmull-Rom spline interpolation.
virtual ~splineInterpolationWeights()=default
Destructor.
virtual bool integrationWeights(const scalar t1, const scalar t2, labelList &indices, scalarField &weights) const
TypeName("spline")
Runtime type information.
virtual bool valueWeights(const scalar t, labelList &indices, scalarField &weights) const
Calculate weights and indices to calculate t from samples.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73
scalarField samples(nIntervals, Zero)