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 -------------------------------------------------------------------------------
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 Class
28  Foam::implicitFunction
29 
30 Description
31  Base class for implicit functions
32 
33  Original code supplied by Henning Scheufler, DLR (2019)
34 
35 SourceFiles
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"
46 #include "runTimeSelectionTables.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class implicitFunction Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class implicitFunction
58 {
59 public:
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
96 
97  virtual scalar value(const vector& p) const
98  {
99  return GREAT;
100  }
101 
102  virtual vector grad(const vector& p) const
103  {
104  return vector::max;
105  }
106 
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 // ************************************************************************* //
Foam::implicitFunction::~implicitFunction
virtual ~implicitFunction()=default
Destructor.
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::implicitFunction
Base class for implicit functions.
Definition: implicitFunction.H:56
Foam::implicitFunction::grad
virtual vector grad(const vector &p) const
Definition: implicitFunction.H:101
Foam::implicitFunction::New
static autoPtr< implicitFunction > New(const word &implicitFunctionType, const dictionary &dict)
Return a reference to the selected implicitFunction.
Foam::implicitFunction::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, implicitFunction, dict,(const dictionary &dict),(dict))
Declare run-time constructor selection table.
Foam::implicitFunction::implicitFunction
implicitFunction()=default
Default construct.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::VectorSpace< Vector< scalar >, scalar, 3 >::max
static const Vector< scalar > max
Definition: VectorSpace.H:117
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::Vector< scalar >
dictionary.H
vector.H
Foam::implicitFunction::distanceToSurfaces
virtual scalar distanceToSurfaces(const vector &p) const
Definition: implicitFunction.H:106
Foam::implicitFunction::TypeName
TypeName("implicitFunction")
Runtime type information.
Foam::implicitFunction::value
virtual scalar value(const vector &p) const
Definition: implicitFunction.H:96
autoPtr.H