surfaceSlipDisplacementPointPatchVectorField.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) 2011-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::surfaceSlipDisplacementPointPatchVectorField
26 
27 Description
28  Displacement follows a triSurface. Use in a displacementMotionSolver
29  as a bc on the pointDisplacement field.
30  Following is done by calculating the projection onto the surface according
31  to the projectMode
32  - NEAREST : nearest
33  - POINTNORMAL : intersection with point normal
34  - FIXEDNORMAL : intersection with fixed vector
35 
36  Optionally (intersection only) removes a component ("wedgePlane") to
37  stay in 2D.
38 
39  Needs:
40  - geometry : dictionary with searchableSurfaces. (usually
41  triSurfaceMeshes in constant/triSurface)
42  - projectMode : see above
43  - projectDirection : if projectMode = fixedNormal
44  - wedgePlane : -1 or component to knock out of intersection normal
45  - frozenPointsZone : empty or name of pointZone containing points
46  that do not move
47 
48 SourceFiles
49  surfaceSlipDisplacementPointPatchVectorField.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef surfaceSlipDisplacementPointPatchVectorField_H
54 #define surfaceSlipDisplacementPointPatchVectorField_H
55 
56 #include "pointPatchFields.H"
57 #include "searchableSurfaces.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class surfaceSlipDisplacementPointPatchVectorField Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 :
71 {
72 
73 public:
74 
75  // Public data types
76 
77  enum projectMode
78  {
82  };
83 
84 private:
85 
86  // Private data
87 
88  //- Project mode names
90 
91  //- Names of surfaces
93 
94  //- How to project/project onto surface
96 
97  //- Direction to project
98  const vector projectDir_;
99 
100  //- Plane for 2D wedge case or -1.
101  const label wedgePlane_;
102 
103  //- pointZone with frozen points
104  const word frozenPointsZone_;
105 
106  //- Demand driven: surface to project
108 
109 
110  // Private Member Functions
111 
112  //- Calculate displacement (w.r.t. points0()) to project onto surface
113  void calcProjection(vectorField& displacement) const;
114 
115  //- Disallow default bitwise assignment
117 
118 
119 public:
120 
121  //- Runtime type information
122  TypeName("surfaceSlipDisplacement");
123 
124 
125  // Constructors
126 
127  //- Construct from patch and internal field
129  (
130  const pointPatch&,
132  );
133 
134  //- Construct from patch, internal field and dictionary
136  (
137  const pointPatch&,
139  const dictionary&
140  );
141 
142  //- Construct by mapping given patchField<vector> onto a new patch
144  (
146  const pointPatch&,
148  const pointPatchFieldMapper&
149  );
150 
151  //- Construct as copy
153  (
155  );
156 
157  //- Construct and return a clone
158  virtual autoPtr<pointPatchVectorField> clone() const
159  {
161  (
163  (
164  *this
165  )
166  );
167  }
168 
169  //- Construct as copy setting internal field reference
171  (
174  );
175 
176  //- Construct and return a clone setting internal field reference
178  (
180  ) const
181  {
183  (
185  (
186  *this,
187  iF
188  )
189  );
190  }
191 
192  // Member Functions
193 
194  //- Surface to follow. Demand loads surfaceNames.
195  const searchableSurfaces& surfaces() const;
196 
197  //- Update the patch field
198  virtual void evaluate
199  (
200  const Pstream::commsTypes commsType=Pstream::blocking
201  );
202 
203  //- Write
204  virtual void write(Ostream&) const;
205 };
206 
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 } // End namespace Foam
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #endif
215 
216 // ************************************************************************* //
Foam::surfaceSlipDisplacementPointPatchVectorField::surfacesDict_
const dictionary surfacesDict_
Names of surfaces.
Definition: surfaceSlipDisplacementPointPatchVectorField.H:91
Foam::surfaceSlipDisplacementPointPatchVectorField::POINTNORMAL
@ POINTNORMAL
Definition: surfaceSlipDisplacementPointPatchVectorField.H:79
Foam::surfaceSlipDisplacementPointPatchVectorField::projectMode
projectMode
Definition: surfaceSlipDisplacementPointPatchVectorField.H:76
Foam::surfaceSlipDisplacementPointPatchVectorField::calcProjection
void calcProjection(vectorField &displacement) const
Calculate displacement (w.r.t. points0()) to project onto surface.
Definition: surfaceSlipDisplacementPointPatchVectorField.C:57
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::surfaceSlipDisplacementPointPatchVectorField::surfaces
const searchableSurfaces & surfaces() const
Surface to follow. Demand loads surfaceNames.
Definition: surfaceSlipDisplacementPointPatchVectorField.C:385
Foam::surfaceSlipDisplacementPointPatchVectorField::projectDir_
const vector projectDir_
Direction to project.
Definition: surfaceSlipDisplacementPointPatchVectorField.H:97
Foam::surfaceSlipDisplacementPointPatchVectorField::clone
virtual autoPtr< pointPatchVectorField > clone() const
Construct and return a clone.
Definition: surfaceSlipDisplacementPointPatchVectorField.H:157
Foam::surfaceSlipDisplacementPointPatchVectorField::write
virtual void write(Ostream &) const
Write.
Definition: surfaceSlipDisplacementPointPatchVectorField.C:431
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
Foam::pointPatchField
Abstract base class for point-mesh patch fields.
Definition: pointMVCWeight.H:58
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:46
Foam::UPstream::blocking
@ blocking
Definition: UPstream.H:66
searchableSurfaces.H
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::surfaceSlipDisplacementPointPatchVectorField::surfaceSlipDisplacementPointPatchVectorField
surfaceSlipDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.
Definition: surfaceSlipDisplacementPointPatchVectorField.C:304
Foam::surfaceSlipDisplacementPointPatchVectorField::operator=
void operator=(const surfaceSlipDisplacementPointPatchVectorField &)
Disallow default bitwise assignment.
Foam::surfaceSlipDisplacementPointPatchVectorField::surfacesPtr_
autoPtr< searchableSurfaces > surfacesPtr_
Demand driven: surface to project.
Definition: surfaceSlipDisplacementPointPatchVectorField.H:106
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::surfaceSlipDisplacementPointPatchVectorField::frozenPointsZone_
const word frozenPointsZone_
pointZone with frozen points
Definition: surfaceSlipDisplacementPointPatchVectorField.H:103
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::surfaceSlipDisplacementPointPatchVectorField::projectMode_
const projectMode projectMode_
How to project/project onto surface.
Definition: surfaceSlipDisplacementPointPatchVectorField.H:94
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::surfaceSlipDisplacementPointPatchVectorField::TypeName
TypeName("surfaceSlipDisplacement")
Runtime type information.
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::surfaceSlipDisplacementPointPatchVectorField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Update the patch field.
Definition: surfaceSlipDisplacementPointPatchVectorField.C:412
Foam::Vector< scalar >
Foam::searchableSurfaces
Container for searchableSurfaces.
Definition: searchableSurfaces.H:53
pointPatchFields.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::surfaceSlipDisplacementPointPatchVectorField::FIXEDNORMAL
@ FIXEDNORMAL
Definition: surfaceSlipDisplacementPointPatchVectorField.H:80
Foam::surfaceSlipDisplacementPointPatchVectorField::NEAREST
@ NEAREST
Definition: surfaceSlipDisplacementPointPatchVectorField.H:78
Foam::surfaceSlipDisplacementPointPatchVectorField
Displacement follows a triSurface. Use in a displacementMotionSolver as a bc on the pointDisplacement...
Definition: surfaceSlipDisplacementPointPatchVectorField.H:67
Foam::NamedEnum< projectMode, 3 >
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::surfaceSlipDisplacementPointPatchVectorField::wedgePlane_
const label wedgePlane_
Plane for 2D wedge case or -1.
Definition: surfaceSlipDisplacementPointPatchVectorField.H:100
Foam::surfaceSlipDisplacementPointPatchVectorField::projectModeNames_
static const NamedEnum< projectMode, 3 > projectModeNames_
Project mode names.
Definition: surfaceSlipDisplacementPointPatchVectorField.H:88