1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 4.0
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Foam::surfaceSlipDisplacementPointPatchVectorField
28 Displacement follows a triSurface. Use in a displacement fvMotionSolver.
31 - POINTNORMAL : intersection with point normal
32 - FIXEDNORMAL : intersection with fixed vector
34 Optionally (intersection only) removes a component ("wedgePlane") to
38 - projectSurfaces : names of triSurfaceMeshes (in constant/triSurface)
39 - followMode : see above
40 - projectDirection : if followMode = fixedNormal
41 - wedgePlane : -1 or component to knock out of intersection normal
42 - frozenPointsZone : empty or name of pointZone containing points
46 surfaceSlipDisplacementPointPatchVectorField.C
48 \*---------------------------------------------------------------------------*/
50 #ifndef surfaceSlipDisplacementPointPatchVectorField_H
51 #define surfaceSlipDisplacementPointPatchVectorField_H
53 #include "pointPatchFields.H"
54 #include "searchableSurfaces.H"
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 /*---------------------------------------------------------------------------*\
62 Class surfaceSlipDisplacementPointPatchVectorField Declaration
63 \*---------------------------------------------------------------------------*/
65 class surfaceSlipDisplacementPointPatchVectorField
67 public pointPatchVectorField
86 static const NamedEnum<followMode, 3> followModeNames_;
89 const dictionary surfacesDict_;
91 //- How to follow/project onto surface
92 const followMode projectMode_;
94 //- direction to project
95 const vector projectDir_;
97 //- plane for 2D wedge case or -1.
98 const label wedgePlane_;
100 //- pointZone with frozen points
101 const word frozenPointsZone_;
103 //- Demand driven: surface to follow
104 mutable autoPtr<searchableSurfaces> surfacesPtr_;
107 // Private Member Functions
109 //- Disallow default bitwise assignment
110 void operator=(const surfaceSlipDisplacementPointPatchVectorField&);
115 //- Runtime type information
116 TypeName("surfaceSlipDisplacement");
121 //- Construct from patch and internal field
122 surfaceSlipDisplacementPointPatchVectorField
125 const DimensionedField<vector, pointMesh>&
128 //- Construct from patch, internal field and dictionary
129 surfaceSlipDisplacementPointPatchVectorField
132 const DimensionedField<vector, pointMesh>&,
136 //- Construct by mapping given patchField<vector> onto a new patch
137 surfaceSlipDisplacementPointPatchVectorField
139 const surfaceSlipDisplacementPointPatchVectorField&,
141 const DimensionedField<vector, pointMesh>&,
142 const PointPatchFieldMapper&
145 //- Construct as copy
146 surfaceSlipDisplacementPointPatchVectorField
148 const surfaceSlipDisplacementPointPatchVectorField&
151 //- Construct and return a clone
152 virtual autoPtr<pointPatchVectorField> clone() const
154 return autoPtr<pointPatchVectorField>
156 new surfaceSlipDisplacementPointPatchVectorField
163 //- Construct as copy setting internal field reference
164 surfaceSlipDisplacementPointPatchVectorField
166 const surfaceSlipDisplacementPointPatchVectorField&,
167 const DimensionedField<vector, pointMesh>&
170 //- Construct and return a clone setting internal field reference
171 virtual autoPtr<pointPatchVectorField> clone
173 const DimensionedField<vector, pointMesh>& iF
176 return autoPtr<pointPatchVectorField>
178 new surfaceSlipDisplacementPointPatchVectorField
188 //- Surfaces to follow
189 const dictionary& surfacesDict() const
191 return surfacesDict_;
194 //- Surface to follow. Demand loads surfaceNames.
195 const searchableSurfaces& surfaces() const;
197 //- Mode of projection/following
198 followMode projectMode() const
203 //- Direction to project back onto surface
204 const vector& projectDir() const
209 //- Normal of wedgeplane (0, 1, 2) or -1. Note: should be obtained
210 // from twoDPointCorrector.
211 label wedgePlane() const
216 //- Zone containing frozen points
217 const word& frozenPointsZone() const
219 return frozenPointsZone_;
222 //- Update the patch field
223 virtual void evaluate
225 const Pstream::commsTypes commsType=Pstream::blocking
229 virtual void write(Ostream&) const;
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 } // End namespace Foam
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 // ************************************************************************* //