linearInterpolation.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Interpolation CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2020-2023 PCOpt/NTUA
9  Copyright (C) 2020-2023 FOSS GP
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 
29 #include "linearInterpolation.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36  defineTypeNameAndDebug(linearInterpolation, 0);
38  (
40  linearInterpolation,
41  dictionary
42  );
43 }
44 
45 
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 
48 Foam::linearInterpolation::linearInterpolation
49 (
50  const fvMesh& mesh,
51  const dictionary& dict
52 )
53 :
55 {}
56 
57 
58 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
59 
61 (
62  const scalarField& arg,
63  scalarField& res
64 ) const
65 {
66  res = arg;
67 }
68 
69 
72 {
73  return tmp<scalarField>::New(arg.size(), scalar(1));
74 }
75 
76 
77 // ************************************************************************* //
Abstract base class for interpolation functions used in topology optimisation.
dictionary dict
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:116
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual void interpolate(const scalarField &arg, scalarField &res) const
Interpolate argument and write to result.
Macros for easy insertion into run-time selection tables.
dynamicFvMesh & mesh
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition: tmp.H:206
defineTypeNameAndDebug(combustionModel, 0)
virtual tmp< scalarField > derivative(const scalarField &arg) const
Return of function with respect to the argument field.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)