implicitFunction.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) 2019 OpenCFD Ltd.
9 Copyright (C) 2019-2020 DLR
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::implicitFunction
29
30Description
31 Base class for implicit functions
32
33 Original code supplied by Henning Scheufler, DLR (2019)
34
35SourceFiles
36 implicitFunction.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef implicitFunction_H
41#define implicitFunction_H
42
43#include "autoPtr.H"
44#include "dictionary.H"
45#include "vector.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53/*---------------------------------------------------------------------------*\
54 Class implicitFunction Declaration
55\*---------------------------------------------------------------------------*/
58{
59public:
60
61 //- Runtime type information
62 TypeName("implicitFunction");
63
64 //- Declare run-time constructor selection table
66 (
67 autoPtr,
69 dict,
70 (
71 const dictionary& dict
72 ),
73 (dict)
74 );
75
76
77 // Constructors
78
79 //- Default construct
80 implicitFunction() = default;
81
82
83 //- Return a reference to the selected implicitFunction
85 (
86 const word& implicitFunctionType,
87 const dictionary& dict
88 );
89
90
91 //- Destructor
92 virtual ~implicitFunction() = default;
93
94
95 // Member Functions
97 virtual scalar value(const vector& p) const
98 {
99 return GREAT;
100 }
102 virtual vector grad(const vector& p) const
103 {
104 return vector::max;
105 }
107 virtual scalar distanceToSurfaces(const vector& p) const
108 {
109 return GREAT;
110 }
111};
112
113
114// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115
116} // End namespace Foam
117
118// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120#endif
121
122// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Base class for implicit functions.
virtual ~implicitFunction()=default
Destructor.
TypeName("implicitFunction")
Runtime type information.
virtual scalar distanceToSurfaces(const vector &p) const
virtual vector grad(const vector &p) const
static autoPtr< implicitFunction > New(const word &implicitFunctionType, const dictionary &dict)
Return a reference to the selected implicitFunction.
declareRunTimeSelectionTable(autoPtr, implicitFunction, dict,(const dictionary &dict),(dict))
Declare run-time constructor selection table.
implicitFunction()=default
Default construct.
virtual scalar value(const vector &p) const
static const complex max
complex (VGREAT,VGREAT)
Definition: complex.H:293
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#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:73