fieldSmoother.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fieldSmoother
28 
29 Description
30  Utility functions for mesh motion solvers
31 
32 SourceFiles
33  fieldSmoother.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef fieldSmoother_H
38 #define fieldSmoother_H
39 
40 #include "meshRefinement.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class fieldSmoother Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class fieldSmoother
52 {
53  // Private data
54 
55  //- Reference to the poly mesh
56  const polyMesh& mesh_;
57 
58 
59  // Private Member Functions
60 
61  //- No copy construct
62  fieldSmoother(const fieldSmoother&) = delete;
63 
64  //- No copy assignment
65  void operator=(const fieldSmoother&) = delete;
66 
67 
68 public:
69 
70  // Run-time type information
71  TypeName("fieldSmoother");
72 
73 
74  // Constructors
75 
76  //- Construct from a polyMesh
77  fieldSmoother(const polyMesh&);
78 
79 
80  //- Destructor
81  virtual ~fieldSmoother();
82 
83 
84  // Member Functions
85 
86  //- Smooth interior normals
87  void smoothNormals
88  (
89  const label nIter,
90  const bitSet& isMeshMasterPoint,
91  const bitSet& isMeshMasterEdge,
92  const labelList& fixedPoints,
93  pointVectorField& normals
94  ) const;
95 
96  //- Smooth patch normals
98  (
99  const label nIter,
100  const bitSet& isPatchMasterPoint,
101  const bitSet& isPatchMasterEdge,
102  const indirectPrimitivePatch& adaptPatch,
103  pointField& normals
104  ) const;
105 
106  //- Smooth a scalar field towards, but not beyond, a minimum value
107  template <class Type>
108  void minSmoothField
109  (
110  const label nIter,
111  const bitSet& isPatchMasterPoint,
112  const bitSet& isPatchMasterEdge,
113  const indirectPrimitivePatch& adaptPatch,
114  const scalarField& fieldMin,
116  ) const;
117 
118  //- Smooth and then un-smooth a displacement
120  (
121  const label nIter,
122  const bitSet& isMeshMasterPoint,
123  const bitSet& isMeshMasterEdge,
124  const bitSet& isSmoothable,
125  vectorField& displacement
126  ) const;
127 };
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #ifdef NoRepository
136 # include "fieldSmootherTemplates.C"
137 #endif
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:63
Foam::fieldSmoother
Utility functions for mesh motion solvers.
Definition: fieldSmoother.H:50
Foam::fieldSmoother::~fieldSmoother
virtual ~fieldSmoother()
Destructor.
Definition: fieldSmoother.C:48
Foam::fieldSmoother::smoothPatchNormals
void smoothPatchNormals(const label nIter, const bitSet &isPatchMasterPoint, const bitSet &isPatchMasterEdge, const indirectPrimitivePatch &adaptPatch, pointField &normals) const
Smooth patch normals.
Definition: fieldSmoother.C:142
Foam::fieldSmoother::smoothLambdaMuDisplacement
void smoothLambdaMuDisplacement(const label nIter, const bitSet &isMeshMasterPoint, const bitSet &isMeshMasterEdge, const bitSet &isSmoothable, vectorField &displacement) const
Smooth and then un-smooth a displacement.
Definition: fieldSmoother.C:207
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::Field< vector >
field
rDeltaTY field()
meshRefinement.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fieldSmoother::smoothNormals
void smoothNormals(const label nIter, const bitSet &isMeshMasterPoint, const bitSet &isMeshMasterEdge, const labelList &fixedPoints, pointVectorField &normals) const
Smooth interior normals.
Definition: fieldSmoother.C:55
Foam::fieldSmoother::minSmoothField
void minSmoothField(const label nIter, const bitSet &isPatchMasterPoint, const bitSet &isPatchMasterEdge, const indirectPrimitivePatch &adaptPatch, const scalarField &fieldMin, Field< Type > &field) const
Smooth a scalar field towards, but not beyond, a minimum value.
Definition: fieldSmootherTemplates.C:32
Foam::fieldSmoother::TypeName
TypeName("fieldSmoother")
Foam::List< label >
fieldSmootherTemplates.C
Foam::GeometricField< vector, pointPatchField, pointMesh >
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatch.H:79