Loading...
Searching...
No Matches
linearSpatial.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::linearSpatial
29
30Description
31
32SourceFiles
33 linearSpatial.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef linearSpatial_H
38#define linearSpatial_H
39
40#include "cellSizeFunction.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
47/*---------------------------------------------------------------------------*\
48 Class linearSpatial Declaration
49\*---------------------------------------------------------------------------*/
50
51class linearSpatial
52:
53 public cellSizeFunction
54{
55
56private:
57
58 // Private data
59
60 //- Reference point for spatial size grading
61 point referencePoint_;
62
63 //- Cell size at reference point
64 scalar referenceCellSize_;
65
66 //- Direction of cell size grading, stored as unit vector, may be
67 // supplied with any magnitude
68 vector direction_;
69
70 //- Gradient of cell size change in direction of direction_
71 scalar cellSizeGradient_;
72
73
74 // Private Member Functions
75
76 //- Calculate the cell size as a function of the given position
77 scalar sizeFunction(const point& pt) const;
78
79
80public:
81
82 //- Runtime type information
83 TypeName("linearSpatial");
84
85 // Constructors
86
87 //- Construct from components
89 (
90 const dictionary& initialPointsDict,
91 const searchableSurface& surface,
92 const scalar& defaultCellSize,
93 const labelList regionIndices
94 );
95
96
97 //- Destructor
98 virtual ~linearSpatial() = default;
99
100
101 // Member Functions
102
103
104 virtual bool sizeLocations
105 (
106 const pointIndexHit& hitPt,
107 const vector& n,
108 pointField& shapePts,
109 scalarField& shapeSizes
110 ) const;
111
112 //- Modify scalar argument to the cell size specified by function.
113 // Return a boolean specifying if the function was used, i.e. false if
114 // the point was not in range of the surface for a spatially varying
115 // size.
116 virtual bool cellSize
117 (
118 const point& pt,
119 scalar& size
120 ) const;
121};
122
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126} // End namespace Foam
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130#endif
132// ************************************************************************* //
label n
label size() const noexcept
The number of elements in list.
Definition DLListBase.H:194
cellSizeFunction(const cellSizeFunction &)=delete
No copy construct.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
virtual ~linearSpatial()=default
Destructor.
linearSpatial(const dictionary &initialPointsDict, const searchableSurface &surface, const scalar &defaultCellSize, const labelList regionIndices)
Construct from components.
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("linearSpatial")
Runtime type information.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
vector point
Point is a vector.
Definition point.H:37
vectorField pointField
pointField is a vectorField.
Vector< scalar > vector
Definition vector.H:57
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68