betaMax.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) 2020-2023 PCOpt/NTUA
9  Copyright (C) 2020-2023 FOSS GP
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 
28 Class
29  Foam::betaMax
30 
31 Description
32  Base class for selecting the betaMax value, i.e. the value multiplying the
33  Brinkman penalisation term, for topology optimisation.
34 
35 SourceFiles
36  betaMax.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef betaMax_H
41 #define betaMax_H
42 
43 #include "fvMesh.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class betaMax Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class betaMax
55 {
56 private:
57 
58  // Private Member Functions
59 
60  //- No copy construct
61  betaMax(const betaMax&) = delete;
62 
63  //- No copy assignment
64  void operator=(const betaMax&) = delete;
65 
66 
67 protected:
68 
69  // Protected Data
70 
71  //- Reference to mesh
72  const fvMesh& mesh_;
73 
74  //- betaMax value
75  scalar value_;
76 
77 
78  // Protected Member Functions
79 
80  //- Compute the characteristic length
81  scalar computeLength(const dictionary& dict) const;
82 
83  //- Mark all common inlet - processor edges
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("betaMax");
91 
92 
93  // Declare run-time constructor selection table
94 
96  (
97  autoPtr,
98  betaMax,
99  dictionary,
100  (
101  const fvMesh& mesh,
102  const dictionary& dict
103  ),
104  (mesh, dict)
105  );
106 
107 
108  // Constructors
109 
110  //- Construct from components
111  betaMax
112  (
113  const fvMesh& mesh,
114  const dictionary& dict
115  );
116 
117 
118  // Selectors
119 
120  //- Construct and return the selected betaMax model
121  static autoPtr<betaMax> New
122  (
123  const fvMesh& mesh,
124  const dictionary& dict
125  );
126 
127 
128  //- Destructor
129  virtual ~betaMax() = default;
130 
131 
132  // Member Functions
133 
134  //- Get value
135  virtual scalar value() const;
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
dictionary dict
const fvMesh & mesh_
Reference to mesh.
Definition: betaMax.H:73
scalar value_
betaMax value
Definition: betaMax.H:78
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual ~betaMax()=default
Destructor.
static autoPtr< betaMax > New(const fvMesh &mesh, const dictionary &dict)
Construct and return the selected betaMax model.
Definition: betaMax.C:221
dynamicFvMesh & mesh
boolList markProcessorEdges(const polyPatch &patch) const
Mark all common inlet - processor edges.
Definition: betaMax.C:122
TypeName("betaMax")
Runtime type information.
Base class for selecting the betaMax value, i.e. the value multiplying the Brinkman penalisation term...
Definition: betaMax.H:49
scalar computeLength(const dictionary &dict) const
Compute the characteristic length.
Definition: betaMax.C:37
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const std::string patch
OpenFOAM patch number as a std::string.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual scalar value() const
Get value.
Definition: betaMax.C:249
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
declareRunTimeSelectionTable(autoPtr, betaMax, dictionary,(const fvMesh &mesh, const dictionary &dict),(mesh, dict))
Namespace for OpenFOAM.