Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
12License
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
28Class
29 Foam::smoothHeaviside
30
31Description
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
44namespace Foam
45{
46
47/*---------------------------------------------------------------------------*\
48 Class smoothHeaviside Declaration
49\*---------------------------------------------------------------------------*/
50
51class smoothHeaviside
53 public topOInterpolationFunction
54{
55protected:
56
57 // Protected Data Members
58
60
61
62private:
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
73public:
74
75 //- Runtime type information
76 TypeName("smoothHeaviside");
77
78
79 // Constructors
80
81 //- Construct from mesh and dictionary
82 smoothHeaviside
83 (
84 const fvMesh& mesh,
85 const dictionary& dict
86 );
87
88
89 // Destructor
90 virtual ~smoothHeaviside() = default;
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// ************************************************************************* //
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
virtual tmp< scalarField > derivative(const scalarField &arg) const
Return of function with respect to the argument field.
virtual void interpolate(const scalarField &arg, scalarField &res) const
Interpolate argument to result.
virtual ~smoothHeaviside()=default
autoPtr< Function1< scalar > > b_
TypeName("smoothHeaviside")
Runtime type information.
A class for managing temporary objects.
Definition tmp.H:75
dynamicFvMesh & mesh
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68