motionSmoother.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) 2013-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::motionSmoother
28
29Description
30 Given a displacement moves the mesh by scaling the displacement back
31 until there are no more mesh errors.
32
33 Holds displacement field (read upon construction since need boundary
34 conditions) and scaling factor and optional patch number on which to
35 scale back displacement.
36
37 E.g.
38 \verbatim
39 // Construct iterative mesh mover.
40 motionSmoother meshMover(mesh, labelList(1, patchi));
41
42 // Set desired displacement:
43 meshMover.displacement() = ..
44
45 for (label iter = 0; iter < maxIter; iter++)
46 {
47 if (meshMover.scaleMesh(true))
48 {
49 Info<< "Successfully moved mesh" << endl;
50 return true;
51 }
52 }
53 \endverbatim
54
55Note
56 - Shared points (parallel): a processor can have points which are part of
57 pp on another processor but have no pp itself (i.e. it has points
58 and/or edges but no faces of pp). Hence we have to be careful when e.g.
59 synchronising displacements that the value from the processor which has
60 faces of pp get priority. This is currently handled in setDisplacement
61 by resetting the internal displacement to zero before doing anything
62 else. The combine operator used will give preference to non-zero
63 values.
64
65 - Various routines take baffles. These are sets of boundary faces that
66 are treated as a single internal face. This is a hack used to apply
67 movement to internal faces.
68
69 - Mesh constraints are looked up from the supplied dictionary. (uses
70 recursive lookup)
71
72SourceFiles
73 motionSmoother.C
74
75\*---------------------------------------------------------------------------*/
76
77#ifndef motionSmoother_H
78#define motionSmoother_H
79
80#include "motionSmootherData.H"
81#include "motionSmootherAlgo.H"
82
83// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84
85namespace Foam
86{
87
88/*---------------------------------------------------------------------------*\
89 Class motionSmoother Declaration
90\*---------------------------------------------------------------------------*/
93:
94 public motionSmootherData,
96
97{
98public:
100 ClassName("motionSmoother");
101
102 // Constructors
103
104 //- Construct from mesh, patches to work on and smoothing parameters.
105 // Reads displacement field (only boundary conditions used)
107 (
108 polyMesh& mesh,
111 const labelList& adaptPatchIDs,
112 const dictionary& paramDict,
113 const bool dryRun = false
114 );
115
116 //- Construct from mesh, patches to work on and smoothing parameters and
117 // displacementfield (only boundary conditions used)
119 (
120 polyMesh& mesh,
122 const labelList& adaptPatchIDs,
124 const dictionary& paramDict,
125 const bool dryRun = false
126 );
127};
128
129
130// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131
132} // End namespace Foam
133
134// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135
136#endif
137
138// ************************************************************************* //
A list of faces which address into the list of points.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Given a displacement moves the mesh by scaling the displacement back until there are no more mesh err...
const labelList & adaptPatchIDs() const
Patch labels that are being adapted.
const polyMesh & mesh() const
Reference to mesh.
const pointMesh & pMesh() const
Reference to pointMesh.
const dictionary & paramDict() const
pointVectorField & displacement()
Reference to displacement field.
Given a displacement moves the mesh by scaling the displacement back until there are no more mesh err...
ClassName("motionSmoother")
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:55
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
Namespace for OpenFOAM.