sigmoidalHeaviside.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::sigmoidalHeaviside
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 sigmoidalHeaviside_H
38 #define sigmoidalHeaviside_H
39 
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class sigmoidalHeaviside Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
54 {
55 protected:
56 
57  // Protected Data Members
58 
59  //- The near-band distance
60  scalar dNB_;
61 
62 
63  // Protected Member Functions
64 
65  //- Compute the near-band width of the fluid-solid interface as
66  // the mean edge length of mesh cells
67  scalar computeNearBandWidth() const;
68 
69 
70 private:
71 
72  // Private Member Functions
73 
74  //- No copy construct
75  sigmoidalHeaviside(const sigmoidalHeaviside&) = delete;
76 
77  //- No copy assignment
78  void operator=(const sigmoidalHeaviside&) = delete;
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("sigmoidalHeaviside");
85 
86 
87  // Constructors
88 
89  //- Construct from mesh and dictionary
91  (
92  const fvMesh& mesh,
93  const dictionary& dict
94  );
95 
96 
97  // Destructor
98  virtual ~sigmoidalHeaviside() = default;
99 
100 
101  // Member Functions
102 
103  //- Interpolate argument to result
104  virtual void interpolate
105  (
106  const scalarField& arg,
107  scalarField& res
108  ) const;
109 
110  //- Return of function with respect to the argument field
111  virtual tmp<scalarField> derivative(const scalarField& arg) const;
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
virtual ~sigmoidalHeaviside()=default
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
scalar computeNearBandWidth() const
Compute the near-band width of the fluid-solid interface as.
dynamicFvMesh & mesh
scalar dNB_
The near-band distance.
A smooth Heaviside function to project the signed distance field in level set topology optimization...
TypeName("sigmoidalHeaviside")
Runtime type information.
virtual void interpolate(const scalarField &arg, scalarField &res) const
Interpolate argument to result.
virtual tmp< scalarField > derivative(const scalarField &arg) const
Return of function with respect to the argument field.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.