cellSizeAndAlignmentControl.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) 2012-2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::cellSizeAndAlignmentControl
28 
29 Description
30 
31 SourceFiles
32  cellSizeAndAlignmentControlI.H
33  cellSizeAndAlignmentControl.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cellSizeAndAlignmentControl_H
38 #define cellSizeAndAlignmentControl_H
39 
40 #include "dictionary.H"
41 #include "conformationSurfaces.H"
42 #include "Time.H"
43 #include "quaternion.H"
44 #include "triadField.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 
52 /*---------------------------------------------------------------------------*\
53  Class cellSizeAndAlignmentControl Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58 protected:
59 
60  const Time& runTime_;
61 
62  const scalar& defaultCellSize_;
63 
65 
66 
67 private:
68 
69  // Private data
70 
71  const word name_;
72 
73 
74  // Private Member Functions
75 
76  //- No copy construct
78  (
80  ) = delete;
81 
82  //- No copy assignment
83  void operator=(const cellSizeAndAlignmentControl&) = delete;
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("cellSizeAndAlignmentControl");
90 
91 
92  // Declare run-time constructor selection table
93 
95  (
96  autoPtr,
98  dictionary,
99  (
100  const Time& runTime,
101  const word& name,
102  const dictionary& controlFunctionDict,
103  const conformationSurfaces& geometryToConformTo,
104  const scalar& defaultCellSize
105  ),
106  (
107  runTime,
108  name,
109  controlFunctionDict,
110  geometryToConformTo,
111  defaultCellSize
112  )
113  );
114 
115 
116  // Constructors
117 
118  //- Construct from dictionary and references to conformalVoronoiMesh and
119  // searchableSurfaces
121  (
122  const Time& runTime,
123  const word& name,
124  const dictionary& controlFunctionDict,
125  const conformationSurfaces& geometryToConformTo,
126  const scalar& defaultCellSize
127  );
128 
129 
130  // Selectors
131 
132  //- Return a reference to the selected cellShapeControl
134  (
135  const Time& runTime,
136  const word& name,
137  const dictionary& controlFunctionDict,
138  const conformationSurfaces& geometryToConformTo,
139  const scalar& defaultCellSize
140  );
141 
142 
143  //- Destructor
144  virtual ~cellSizeAndAlignmentControl() = default;
145 
146 
147  // Member Functions
148 
149  // Access
150 
151  const word& name() const
152  {
153  return name_;
154  }
155 
157  {
159  }
160 
161 
162  // Query
163 
164  virtual label maxPriority() const = 0;
165 
166  virtual void cellSizeFunctionVertices
167  (
169  DynamicList<scalar>& sizes
170  ) const = 0;
171 
172  virtual void initialVertices
173  (
174  pointField& pts,
175  scalarField& sizes,
176  triadField& alignments
177  ) const = 0;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual label maxPriority() const =0
engineTime & runTime
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
Definition: Switch.H:77
declareRunTimeSelectionTable(autoPtr, cellSizeAndAlignmentControl, dictionary,(const Time &runTime, const word &name, const dictionary &controlFunctionDict, const conformationSurfaces &geometryToConformTo, const scalar &defaultCellSize),(runTime, name, controlFunctionDict, geometryToConformTo, defaultCellSize))
virtual void cellSizeFunctionVertices(DynamicList< Foam::point > &pts, DynamicList< scalar > &sizes) const =0
TypeName("cellSizeAndAlignmentControl")
Runtime type information.
static autoPtr< cellSizeAndAlignmentControl > New(const Time &runTime, const word &name, const dictionary &controlFunctionDict, const conformationSurfaces &geometryToConformTo, const scalar &defaultCellSize)
Return a reference to the selected cellShapeControl.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Definition: DynamicList.H:51
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual void initialVertices(pointField &pts, scalarField &sizes, triadField &alignments) const =0
const direction noexcept
Definition: Scalar.H:258
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Namespace for OpenFOAM.
const pointField & pts
virtual ~cellSizeAndAlignmentControl()=default
Destructor.