controlMeshRefinement.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) 2013-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::controlMeshRefinement
26 
27 Description
28 
29 SourceFiles
30  controlMeshRefinementI.H
31  controlMeshRefinement.C
32  controlMeshRefinementIO.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef controlMeshRefinement_H
37 #define controlMeshRefinement_H
38 
39 #include "cellShapeControl.H"
40 #include "cellShapeControlMesh.H"
42 #include "conformationSurfaces.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class controlMeshRefinement Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56  // Private data
57 
58  const cellShapeControl& shapeController_;
59 
60  cellShapeControlMesh& mesh_;
61 
62  const cellSizeAndAlignmentControls& sizeControls_;
63 
64  const conformationSurfaces& geometryToConformTo_;
65 
66 
67  // Private Member Functions
68 
69  scalar calcFirstDerivative
70  (
71  const Foam::point& a,
72  const scalar& cellSizeA,
73  const Foam::point& b,
74  const scalar& cellSizeB
75  ) const;
76 
77  scalar calcSecondDerivative
78  (
79  const Foam::point& a,
80  const scalar& cellSizeA,
81  const Foam::point& midPoint,
82  const scalar& cellSizeMid,
83  const Foam::point& b,
84  const scalar& cellSizeB
85  ) const
86  {
87  return (cellSizeA - 2*cellSizeMid + cellSizeB)/magSqr((a - b)/2);
88  }
89 
90 
91  bool detectEdge
92  (
93  const Foam::point& startPt,
94  const Foam::point& endPt,
95  pointHit& pointFound,
96  const scalar tolSqr,
97  const scalar secondDerivTolSqr
98  ) const;
99 
100  pointHit findDiscontinuities(const linePointRef& l) const;
101 
102  //- Disallow default bitwise copy construct
104 
105  //- Disallow default bitwise assignment
106  void operator=(const controlMeshRefinement&);
107 
108 
109 public:
110 
111  //- Runtime type information
112  ClassName("controlMeshRefinement");
113 
114 
115  // Constructors
116 
117  //- Construct null
118  controlMeshRefinement(cellShapeControl& shapeController);
119 
120 
121  //- Destructor
123 
124 
125  // Member Functions
126 
127  // Edit
128 
130  (
131  const autoPtr<backgroundMeshDecomposition>& decomposition
132  );
133 
135  (
136  const autoPtr<backgroundMeshDecomposition>& decomposition
137  );
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
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 line primitive.
Definition: line.H:56
ClassName("controlMeshRefinement")
Runtime type information.
void initialMeshPopulation(const autoPtr< backgroundMeshDecomposition > &decomposition)
label refineMesh(const autoPtr< backgroundMeshDecomposition > &decomposition)
Mid-point interpolation (weighting factors = 0.5) scheme class.
Definition: midPoint.H:50
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
~controlMeshRefinement()
Destructor.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Namespace for OpenFOAM.