lumpedPointDisplacementPointPatchVectorField.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) 2016 OpenCFD Ltd.
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::lumpedPointDisplacementPointPatchVectorField
28 
29 Description
30  This is the point-patch responsible for managing the force
31  integration on a 'lumped-point' basis, waiting for the external
32  application, reading back the response from the external program
33  and updating the locations of the associated patch points
34  accordingly.
35 
36  The internal patch type name is 'lumpedPointDisplacement'.
37 
38  \heading Patch usage
39  Example:
40  \verbatim
41  walls
42  {
43  type lumpedPointDisplacement;
44  value uniform (0 0 0);
45  }
46  \endverbatim
47 
48 SourceFiles
49  lumpedPointDisplacementPointPatchVectorField.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef lumpedPointDisplacementPointPatchVectorField_H
54 #define lumpedPointDisplacementPointPatchVectorField_H
55 
57 #include "lumpedPointMovement.H"
58 #include "lumpedPointState.H"
59 #include "lumpedPointIOMovement.H"
60 #include "labelList.H"
61 #include "tmp.H"
62 #include "pointField.H"
63 #include "pointFieldsFwd.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 
70 // Forward declarations
71 class interpolationWeights;
72 
73 /*---------------------------------------------------------------------------*\
74  Class lumpedPointDisplacementPointPatchVectorField Declaration
75 \*---------------------------------------------------------------------------*/
76 
78 :
79  public fixedValuePointPatchField<vector>
80 {
81  // Private data
82 
83  //- Convenience typedefs
86 
87 
88 protected:
89 
90  // Protected Member Functions
91 
92  //- The starting locations (obtained from the motionSolver).
93  const pointField& points0() const;
94 
95  //- The auto-vivifying singleton for movement.
96  const lumpedPointMovement& movement() const;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("lumpedPointDisplacement");
103 
104 
105  // Constructors
106 
107  //- Construct from patch and internal field
109  (
110  const pointPatch& p,
112  );
113 
114  //- Construct from patch, internal field and dictionary
116  (
117  const pointPatch& p,
119  const dictionary& dict
120  );
121 
122  //- Construct by mapping given patchField<vector> onto a new patch
124  (
126  const pointPatch& p,
128  const pointPatchFieldMapper& mapper
129  );
130 
131  //- Construct and return a clone
132  virtual autoPtr<pointPatchField<vector>> clone() const
133  {
135  (
137  (
138  *this
139  )
140  );
141  }
142 
143  //- Construct as copy setting internal field reference
145  (
148  );
149 
150  //- Construct and return a clone setting internal field reference
152  (
154  ) const
155  {
157  (
159  (
160  *this,
161  iF
162  )
163  );
164  }
165 
166  //- Destructor. De-register movement if in use and managed by this patch
168 
169 
170  // Member functions
171 
172  //- The ids for all patches of this type
173  static labelList patchIds(const pointVectorField& pvf);
174 
175  //- Update the coefficients associated with the patch field
176  virtual void updateCoeffs();
177 
178  //- Write
179  virtual void write(Ostream& os) const;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::lumpedPointDisplacementPointPatchVectorField::patchIds
static labelList patchIds(const pointVectorField &pvf)
The ids for all patches of this type.
Definition: lumpedPointDisplacementPointPatchVectorField.C:55
lumpedPointState.H
Foam::lumpedPointDisplacementPointPatchVectorField
This is the point-patch responsible for managing the force integration on a 'lumped-point' basis,...
Definition: lumpedPointDisplacementPointPatchVectorField.H:76
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
Foam::fixedValuePointPatchField
A FixedValue boundary condition for pointField.
Definition: fixedValuePointPatchField.H:51
labelList.H
Foam::Field< vector >
Foam::pointPatchField< vector >::patchType
const word & patchType() const
Optional patch type.
Definition: pointPatchField.H:287
fixedValuePointPatchField.H
Foam::lumpedPointDisplacementPointPatchVectorField::clone
virtual autoPtr< pointPatchField< vector > > clone() const
Construct and return a clone.
Definition: lumpedPointDisplacementPointPatchVectorField.H:131
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
lumpedPointIOMovement.H
Foam::lumpedPointDisplacementPointPatchVectorField::TypeName
TypeName("lumpedPointDisplacement")
Runtime type information.
Foam::lumpedPointDisplacementPointPatchVectorField::~lumpedPointDisplacementPointPatchVectorField
virtual ~lumpedPointDisplacementPointPatchVectorField()
Destructor. De-register movement if in use and managed by this patch.
Definition: lumpedPointDisplacementPointPatchVectorField.C:166
Foam::lumpedPointDisplacementPointPatchVectorField::lumpedPointDisplacementPointPatchVectorField
lumpedPointDisplacementPointPatchVectorField(const pointPatch &p, const DimensionedField< vector, pointMesh > &iF)
Construct from patch and internal field.
Definition: lumpedPointDisplacementPointPatchVectorField.C:118
pointField.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
tmp.H
Foam::lumpedPointDisplacementPointPatchVectorField::write
virtual void write(Ostream &os) const
Write.
Definition: lumpedPointDisplacementPointPatchVectorField.C:292
Foam::List< label >
Foam::lumpedPointMovement
The movement driver that describes initial point locations, the segmentation for pressure integration...
Definition: lumpedPointMovement.H:260
pointFieldsFwd.H
Forwards and collection of common point field types.
Foam::lumpedPointDisplacementPointPatchVectorField::points0
const pointField & points0() const
The starting locations (obtained from the motionSolver).
Definition: lumpedPointDisplacementPointPatchVectorField.C:79
Foam::lumpedPointDisplacementPointPatchVectorField::movement
const lumpedPointMovement & movement() const
The auto-vivifying singleton for movement.
Definition: lumpedPointDisplacementPointPatchVectorField.C:92
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::GeometricField< vector, pointPatchField, pointMesh >
lumpedPointMovement.H
Foam::lumpedPointDisplacementPointPatchVectorField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: lumpedPointDisplacementPointPatchVectorField.C:185
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54