uniformDistance.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 Copyright (C) 2018 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::uniformDistance
29
30Description
31
32SourceFiles
33 uniformDistance.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef uniformDistance_H
38#define uniformDistance_H
39
40#include "cellSizeFunction.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47/*---------------------------------------------------------------------------*\
48 Class uniformDistance Declaration
49\*---------------------------------------------------------------------------*/
52:
53 public cellSizeFunction
54{
55
56private:
57
58 // Private data
59
60 //- Distance
61 scalar distance_;
62
63 //- Distance squared
64 scalar distanceSqr_;
65
66
67public:
68
69 //- Runtime type information
70 TypeName("uniformDistance");
71
72 // Constructors
73
74 //- Construct from components
76 (
77 const dictionary& initialPointsDict,
78 const searchableSurface& surface,
79 const scalar& defaultCellSize,
80 const labelList regionIndices
81 );
82
83
84 //- Destructor
85 virtual ~uniformDistance() = default;
86
87
88 // Member Functions
90 virtual bool sizeLocations
91 (
92 const pointIndexHit& hitPt,
93 const vector& n,
94 pointField& shapePts,
95 scalarField& shapeSizes
96 ) const;
97
98 //- Modify scalar argument to the cell size specified by function.
99 // Return a boolean specifying if the function was used, i.e. false if
100 // the point was not in range of the surface for a spatially varying
101 // size.
102 virtual bool cellSize
103 (
104 const point& pt,
105 scalar& size
106 ) const;
107
108 //- Adapt local cell size. Return true if anything changed.
109 virtual bool setCellSize
110 (
111 const pointField& pts
112 );
113};
114
115
116// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117
118} // End namespace Foam
119
120// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121
122#endif
123
124// ************************************************************************* //
label n
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Definition: PointIndexHit.H:66
Abstract base class for specifying target cell sizes.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
virtual ~uniformDistance()=default
Destructor.
virtual bool sizeLocations(const pointIndexHit &hitPt, const vector &n, pointField &shapePts, scalarField &shapeSizes) const
virtual bool cellSize(const point &pt, scalar &size) const
Modify scalar argument to the cell size specified by function.
TypeName("uniformDistance")
Runtime type information.
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.
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73