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
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
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,
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 // ************************************************************************* //
Foam::linearSpatial::referencePoint_
point referencePoint_
Reference point for spatial size grading.
Definition: linearSpatial.H:57
Foam::linearSpatial::sizeLocations
virtual bool sizeLocations(const pointIndexHit &hitPt, const vector &n, pointField &shapePts, scalarField &shapeSizes) const
Foam::cellSizeFunction
Abstract base class for specifying target cell sizes.
Definition: cellSizeFunction.H:54
Foam::linearSpatial::direction_
vector direction_
Direction of cell size grading, stored as unit vector, may be.
Definition: linearSpatial.H:64
Foam::linearSpatial::cellSizeGradient_
scalar cellSizeGradient_
Gradient of cell size change in direction of direction_.
Definition: linearSpatial.H:67
cellSizeFunction.H
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::PointIndexHit
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Definition: PointIndexHit.H:53
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::linearSpatial::linearSpatial
linearSpatial(const dictionary &initialPointsDict, const searchableSurface &surface, const scalar &defaultCellSize, const labelList regionIndices)
Construct from components.
Foam::linearSpatial::cellSize
virtual bool cellSize(const point &pt, scalar &size) const
Modify scalar argument to the cell size specified by function.
Foam::searchableSurface
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
Definition: searchableSurface.H:66
Foam::linearSpatial::referenceCellSize_
scalar referenceCellSize_
Cell size at reference point.
Definition: linearSpatial.H:60
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::linearSpatial::sizeFunction
scalar sizeFunction(const point &pt) const
Calculate the cell size as a function of the given position.
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::linearSpatial::TypeName
TypeName("linearSpatial")
Runtime type information.
Foam::surface
Definition: surface.H:55
Foam::linearSpatial::~linearSpatial
virtual ~linearSpatial()
Destructor.
Definition: linearSpatial.H:94
Foam::linearSpatial
Definition: linearSpatial.H:47