smoothHeaviside.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) 2007-2019 PCOpt/NTUA
9  Copyright (C) 2013-2019 FOSS GP
10  Copyright (C) 2019 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 Class
29  Foam::smoothHeaviside
30 
31 Description
32  A smooth Heaviside function to project the signed distance field in
33  level set topology optimization.
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef smoothHeaviside_H
38 #define smoothHeaviside_H
39 
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class smoothHeaviside Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class smoothHeaviside
52 :
54 {
55 protected:
56 
57  // Protected Data Members
58 
60 
61 
62 private:
63 
64  // Private Member Functions
65 
66  //- No copy construct
67  smoothHeaviside(const smoothHeaviside&) = delete;
68 
69  //- No copy assignment
70  void operator=(const smoothHeaviside&) = delete;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("smoothHeaviside");
77 
78 
79  // Constructors
80 
81  //- Construct from mesh and dictionary
83  (
84  const fvMesh& mesh,
85  const dictionary& dict
86  );
87 
88 
89  // Destructor
90  virtual ~smoothHeaviside() = default;
91 
92 
93  // Member Functions
94 
95  //- Interpolate argument to result
96  virtual void interpolate
97  (
98  const scalarField& arg,
99  scalarField& res
100  ) const;
101 
102  //- Return of function with respect to the argument field
103  virtual tmp<scalarField> derivative(const scalarField& arg) const;
104 };
105 
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 } // End namespace Foam
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 #endif
114 
115 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
autoPtr< Function1< scalar > > b_
A smooth Heaviside function to project the signed distance field in level set topology optimization...
dynamicFvMesh & mesh
virtual tmp< scalarField > derivative(const scalarField &arg) const
Return of function with respect to the argument field.
TypeName("smoothHeaviside")
Runtime type information.
virtual void interpolate(const scalarField &arg, scalarField &res) const
Interpolate argument to result.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.
virtual ~smoothHeaviside()=default