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