controlMeshRefinement.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2019 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 
103 public:
104 
105  //- Runtime type information
106  ClassName("controlMeshRefinement");
107 
108 
109  // Constructors
110 
111  //- Construct null
112  controlMeshRefinement(cellShapeControl& shapeController);
113 
114  //- Disallow default bitwise copy construction
116 
117 
118  //- Destructor
120 
121 
122  // Member Functions
123 
124  // Edit
125 
127  (
128  const autoPtr<backgroundMeshDecomposition>& decomposition
129  );
130 
132  (
133  const autoPtr<backgroundMeshDecomposition>& decomposition
134  );
135 
136 
137  // Member Operators
138 
139  //- Disallow default bitwise assignment
140  void operator=(const controlMeshRefinement&) = delete;
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
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:52
controlMeshRefinement(cellShapeControl &shapeController)
Construct null.
void operator=(const controlMeshRefinement &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.