surfaceOffsetLinearDistance.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::surfaceOffsetLinearDistance
26 
27 Description
28 
29 SourceFiles
30  surfaceOffsetLinearDistance.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef surfaceOffsetLinearDistance_H
35 #define surfaceOffsetLinearDistance_H
36 
37 #include "cellSizeFunction.H"
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class surfaceOffsetLinearDistance Declaration
46 \*---------------------------------------------------------------------------*/
47 
49 :
50  public cellSizeFunction
51 {
52 
53 private:
54 
55  // Private data
56 
57  //- Cell size at distance_ from the surface
58  scalar distanceCellSize_;
59 
60  //- Offset distance from surface for constant size portion
61  scalar surfaceOffset_;
62 
63  //- Total distance from the surface to control over (distance +
64  // surfaceOffset)
65  scalar totalDistance_;
66 
67  //- totalDistance squared
68  scalar totalDistanceSqr_;
69 
70 
71  // Private Member Functions
72 
73  //- Calculate the cell size as a function of the given distance
74  scalar sizeFunction(const point& pt, scalar d, label index) const;
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("surfaceOffsetLinearDistance");
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
96  {}
97 
98 
99  // Member Functions
100 
101  virtual bool sizeLocations
102  (
103  const pointIndexHit& hitPt,
104  const vector& n,
105  pointField& shapePts,
106  scalarField& shapeSizes
107  ) const;
108 
109  //- Modify scalar argument to the cell size specified by function.
110  // Return a boolean specifying if the function was used, i.e. false if
111  // the point was not in range of the surface for a spatially varying
112  // size.
113  virtual bool cellSize
114  (
115  const point& pt,
116  scalar& size
117  ) const;
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
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.
virtual bool sizeLocations(const pointIndexHit &hitPt, const vector &n, pointField &shapePts, scalarField &shapeSizes) const
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
surfaceOffsetLinearDistance(const dictionary &initialPointsDict, const searchableSurface &surface, const scalar &defaultCellSize, const labelList regionIndices)
Construct from components.
TypeName("surfaceOffsetLinearDistance")
Runtime type information.
label n
virtual bool cellSize(const point &pt, scalar &size) const
Modify scalar argument to the cell size specified by function.
Namespace for OpenFOAM.