Loading...
Searching...
No Matches
topOInterpolationFunction.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) 2020-2023 PCOpt/NTUA
9 Copyright (C) 2020-2023 FOSS GP
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 topOInterpolationFunction
29
30Description
31 Abstract base class for interpolation functions used in topology
32 optimisation
33
34SourceFiles
35 topOInterpolationFunction.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef topOInterpolationFunction_H
40#define topOInterpolationFunction_H
41
42#include "fvMesh.H"
43#include "Function1.H"
44
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
51/*---------------------------------------------------------------------------*\
52 Class topOInterpolationFunction Declaration
53\*---------------------------------------------------------------------------*/
54
55class topOInterpolationFunction
56{
58protected:
60 // Protected data
61
62 const fvMesh& mesh_;
63
65
66
67private:
68
69 // Private Member Functions
70
71 //- No copy construct
72 topOInterpolationFunction(const topOInterpolationFunction&);
73
74 //- No copy assignment
75 void operator=(const topOInterpolationFunction&);
76
77
78public:
79
80 //- Runtime type information
81 TypeName("topOInterpolationFunction");
83
84 // Declare run-time constructor selection table
85
87 (
88 autoPtr,
89 topOInterpolationFunction,
91 (
92 const fvMesh& mesh,
93 const dictionary& dict
94 ),
95 (mesh, dict)
96 );
97
98
99 // Constructors
100
101 //- Construct from components
102 topOInterpolationFunction
103 (
104 const fvMesh& mesh,
105 const dictionary& dict
106 );
107
108
109 // Selectors
110
111 //- Return an autoPtr to the selected interpolation type
113 (
114 const fvMesh& mesh,
115 const dictionary& dict
116 );
117
118
119 //- Destructor
120 virtual ~topOInterpolationFunction() = default;
121
122
123 // Member Functions
124
125 //- Interpolate argument to result
126 virtual void interpolate
128 const scalarField& arg,
129 scalarField& res
130 ) const = 0;
131
132 //- Return of function with respect to the argument field
133 virtual tmp<scalarField> derivative(const scalarField& arg) const = 0;
134
135 //- Set the parameter determining length scale
136 // Warning if the selected interpolation function has no such param
137 virtual void setLengthScaleParam(const scalar lengthScale);
138};
139
140
141// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142
143} // End namespace Foam
145// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146
147#endif
148
149// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A class for managing temporary objects.
Definition tmp.H:75
TypeName("topOInterpolationFunction")
Runtime type information.
static autoPtr< topOInterpolationFunction > New(const fvMesh &mesh, const dictionary &dict)
Return an autoPtr to the selected interpolation type.
virtual tmp< scalarField > derivative(const scalarField &arg) const =0
Return of function with respect to the argument field.
declareRunTimeSelectionTable(autoPtr, topOInterpolationFunction, dictionary,(const fvMesh &mesh, const dictionary &dict),(mesh, dict))
virtual void setLengthScaleParam(const scalar lengthScale)
Set the parameter determining length scale.
virtual ~topOInterpolationFunction()=default
Destructor.
virtual void interpolate(const scalarField &arg, scalarField &res) const =0
Interpolate argument to result.
dynamicFvMesh & mesh
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68