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 | Copyright (C) 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::fieldSmoother
26 
27 Description
28  Utility functions for mesh motion solvers
29 
30 SourceFiles
31  fieldSmoother.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fieldSmoother_H
36 #define fieldSmoother_H
37 
38 #include "meshRefinement.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class fieldSmoother Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class fieldSmoother
50 {
51  // Private data
52 
53  //- Reference to the poly mesh
54  const polyMesh& mesh_;
55 
56 
57  // Private Member Functions
58 
59  //- Disallow default bitwise copy construct
61 
62  //- Disallow default bitwise assignment
63  void operator=(const fieldSmoother&);
64 
65 
66 public:
67 
68  // Run-time type information
69  TypeName("fieldSmoother");
70 
71 
72  // Constructors
73 
74  //- Construct from a polyMesh
75  fieldSmoother(const polyMesh&);
76 
77 
78  //- Destructor
79  virtual ~fieldSmoother();
80 
81 
82  // Member Functions
83 
84  //- Smooth interior normals
85  void smoothNormals
86  (
87  const label nIter,
88  const PackedBoolList& isMeshMasterPoint,
89  const PackedBoolList& isMeshMasterEdge,
90  const labelList& fixedPoints,
91  pointVectorField& normals
92  ) const;
93 
94  //- Smooth patch normals
96  (
97  const label nIter,
98  const PackedBoolList& isPatchMasterPoint,
99  const PackedBoolList& isPatchMasterEdge,
100  const indirectPrimitivePatch& adaptPatch,
101  pointField& normals
102  ) const;
103 
104  //- Smooth a scalar field towards, but not beyond, a minimum value
105  template <class Type>
106  void minSmoothField
107  (
108  const label nIter,
109  const PackedBoolList& isPatchMasterPoint,
110  const PackedBoolList& isPatchMasterEdge,
111  const indirectPrimitivePatch& adaptPatch,
112  const scalarField& fieldMin,
113  Field<Type>& field
114  ) const;
115 
116  //- Smooth and then un-smooth a displacement
118  (
119  const label nIter,
120  const PackedBoolList& isMeshMasterPoint,
121  const PackedBoolList& isMeshMasterEdge,
122  const PackedBoolList& isSmoothable,
123  vectorField& displacement
124  ) const;
125 };
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #ifdef NoRepository
134 # include "fieldSmootherTemplates.C"
135 #endif
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
Foam::PackedBoolList
A bit-packed bool list.
Definition: PackedBoolList.H:63
Foam::fieldSmoother::minSmoothField
void minSmoothField(const label nIter, const PackedBoolList &isPatchMasterPoint, const PackedBoolList &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:30
Foam::fieldSmoother
Utility functions for mesh motion solvers.
Definition: fieldSmoother.H:48
Foam::fieldSmoother::~fieldSmoother
virtual ~fieldSmoother()
Destructor.
Definition: fieldSmoother.C:46
Foam::fieldSmoother::smoothNormals
void smoothNormals(const label nIter, const PackedBoolList &isMeshMasterPoint, const PackedBoolList &isMeshMasterEdge, const labelList &fixedPoints, pointVectorField &normals) const
Smooth interior normals.
Definition: fieldSmoother.C:53
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::fieldSmoother::smoothLambdaMuDisplacement
void smoothLambdaMuDisplacement(const label nIter, const PackedBoolList &isMeshMasterPoint, const PackedBoolList &isMeshMasterEdge, const PackedBoolList &isSmoothable, vectorField &displacement) const
Smooth and then un-smooth a displacement.
Definition: fieldSmoother.C:207
Foam::label
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
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::fieldSmoother::mesh_
const polyMesh & mesh_
Reference to the poly mesh.
Definition: fieldSmoother.H:53
meshRefinement.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::fieldSmoother::smoothPatchNormals
void smoothPatchNormals(const label nIter, const PackedBoolList &isPatchMasterPoint, const PackedBoolList &isPatchMasterEdge, const indirectPrimitivePatch &adaptPatch, pointField &normals) const
Smooth patch normals.
Definition: fieldSmoother.C:141
Foam::fieldSmoother::fieldSmoother
fieldSmoother(const fieldSmoother &)
Disallow default bitwise copy construct.
Foam::fieldSmoother::TypeName
TypeName("fieldSmoother")
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::fieldSmoother::operator=
void operator=(const fieldSmoother &)
Disallow default bitwise assignment.
fieldSmootherTemplates.C
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::PrimitivePatch
A list of faces which address into the list of points.
Definition: PrimitivePatchTemplate.H:88