uniformDistance.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::uniformDistance
26 
27 Description
28 
29 SourceFiles
30  uniformDistance.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef uniformDistance_H
35 #define uniformDistance_H
36 
37 #include "cellSizeFunction.H"
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class uniformDistance Declaration
46 \*---------------------------------------------------------------------------*/
47 
48 class uniformDistance
49 :
50  public cellSizeFunction
51 {
52 
53 private:
54 
55  // Private Data
56 
57  //- Distance
58  scalar distance_;
59 
60  //- Distance squared
61  scalar distanceSqr_;
62 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("uniformDistance");
68 
69  // Constructors
70 
71  //- Construct from components
73  (
74  const dictionary& initialPointsDict,
75  const searchableSurface& surface,
76  const scalar& defaultCellSize,
77  const labelList regionIndices
78  );
79 
80 
81  //- Destructor
82  virtual ~uniformDistance()
83  {}
84 
85 
86  // Member Functions
87 
88  virtual bool sizeLocations
89  (
90  const pointIndexHit& hitPt,
91  const vector& n,
92  pointField& shapePts,
93  scalarField& shapeSizes
94  ) const;
95 
96  //- Modify scalar argument to the cell size specified by function.
97  // Return a boolean specifying if the function was used, i.e. false if
98  // the point was not in range of the surface for a spatially varying
99  // size.
100  virtual bool cellSize
101  (
102  const point& pt,
103  scalar& size
104  ) const;
105 
106  //- Adapt local cell size. Return true if anything changed.
107  virtual bool setCellSize
108  (
109  const pointField& pts
110  );
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace Foam
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #endif
121 
122 // ************************************************************************* //
uniformDistance(const dictionary &initialPointsDict, const searchableSurface &surface, const scalar &defaultCellSize, const labelList regionIndices)
Construct from components.
virtual bool setCellSize(const pointField &pts)
Adapt local cell size. Return true if anything changed.
virtual bool cellSize(const point &pt, scalar &size) const
Modify scalar argument to the cell size specified by function.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Abstract base class for specifying target cell sizes.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Definition: PointIndexHit.H:53
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
virtual ~uniformDistance()
Destructor.
virtual bool sizeLocations(const pointIndexHit &hitPt, const vector &n, pointField &shapePts, scalarField &shapeSizes) const
label n
TypeName("uniformDistance")
Runtime type information.
Namespace for OpenFOAM.