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-2020 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  controllers ( controllerName1 controllerName2 );
46  }
47  \endverbatim
48 
49 SourceFiles
50  lumpedPointDisplacementPointPatchVectorField.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef lumpedPointDisplacementPointPatchVectorField_H
55 #define lumpedPointDisplacementPointPatchVectorField_H
56 
58 #include "lumpedPointMovement.H"
59 #include "lumpedPointState.H"
60 #include "lumpedPointIOMovement.H"
61 #include "labelList.H"
62 #include "tmp.H"
63 #include "pointField.H"
64 #include "pointFieldsFwd.H"
65 
66 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67 
68 namespace Foam
69 {
70 
71 // Forward Declarations
72 class interpolationWeights;
73 
74 /*---------------------------------------------------------------------------*\
75  Class lumpedPointDisplacementPointPatchVectorField Declaration
76 \*---------------------------------------------------------------------------*/
77 
79 :
80  public fixedValuePointPatchField<vector>
81 {
82  // Private Data
83 
84  //- Names of the movement controller(s) in use
85  wordList controllers_;
86 
87  //- Backup method for getting "points0" without a motion solver
88  mutable autoPtr<pointIOField> points0Ptr_;
89 
90 
91  //- Convenience typedefs
94 
95 
96 protected:
97 
98  // Protected Member Functions
99 
100  //- The starting locations (obtained from the motionSolver).
101  const pointField& points0() const;
102 
103  //- The auto-vivifying singleton for movement.
104  const lumpedPointMovement& movement() const;
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("lumpedPointDisplacement");
111 
112 
113  // Constructors
114 
115  //- Construct from patch and internal field
117  (
118  const pointPatch& p,
120  );
121 
122  //- Construct from patch, internal field and dictionary
124  (
125  const pointPatch& p,
127  const dictionary& dict
128  );
129 
130  //- Construct by mapping given patchField<vector> onto a new patch
132  (
134  const pointPatch& p,
136  const pointPatchFieldMapper& mapper
137  );
138 
139  //- Construct and return a clone
140  virtual autoPtr<pointPatchField<vector>> clone() const
141  {
143  (
145  (
146  *this
147  )
148  );
149  }
150 
151  //- Construct as copy setting internal field reference
153  (
156  );
157 
158  //- Construct and return a clone setting internal field reference
160  (
162  ) const
163  {
165  (
167  (
168  *this,
169  iF
170  )
171  );
172  }
173 
174  //- Destructor. De-register movement if in use and managed by this patch
176 
177 
178  // Member Functions
179 
180  //- The controller names for this patch
181  const wordList& controllers() const
182  {
183  return controllers_;
184  }
185 
186  //- Set all patch controls for patches of this type
187  static label setPatchControls
188  (
189  const pointVectorField& pvf,
190  const pointField& points0
191  );
192 
193  //- Set all patch controls for patches of this type
194  static label setInterpolators
195  (
196  const pointVectorField& pvf,
197  const pointField& points0
198  );
199 
200  //- The ids for all patches of this type
201  static labelList patchIds(const pointVectorField& pvf);
202 
203  //- Update the coefficients associated with the patch field
204  virtual void updateCoeffs();
205 
206  //- Write
207  virtual void write(Ostream& os) const;
208 };
209 
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 } // End namespace Foam
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
Foam::lumpedPointDisplacementPointPatchVectorField::setInterpolators
static label setInterpolators(const pointVectorField &pvf, const pointField &points0)
Set all patch controls for patches of this type.
Definition: lumpedPointDisplacementPointPatchVectorField.C:89
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::lumpedPointDisplacementPointPatchVectorField::controllers
const wordList & controllers() const
The controller names for this patch.
Definition: lumpedPointDisplacementPointPatchVectorField.H:180
Foam::lumpedPointDisplacementPointPatchVectorField::setPatchControls
static label setPatchControls(const pointVectorField &pvf, const pointField &points0)
Set all patch controls for patches of this type.
Definition: lumpedPointDisplacementPointPatchVectorField.C:54
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:123
lumpedPointState.H
Foam::lumpedPointDisplacementPointPatchVectorField
This is the point-patch responsible for managing the force integration on a 'lumped-point' basis,...
Definition: lumpedPointDisplacementPointPatchVectorField.H:77
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:139
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:268
Foam::lumpedPointDisplacementPointPatchVectorField::lumpedPointDisplacementPointPatchVectorField
lumpedPointDisplacementPointPatchVectorField(const pointPatch &p, const DimensionedField< vector, pointMesh > &iF)
Construct from patch and internal field.
Definition: lumpedPointDisplacementPointPatchVectorField.C:205
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:420
Foam::List< word >
Foam::lumpedPointMovement
The movement driver that describes initial point locations, the current state of the points/rotations...
Definition: lumpedPointMovement.H:269
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:147
Foam::lumpedPointDisplacementPointPatchVectorField::movement
const lumpedPointMovement & movement() const
The auto-vivifying singleton for movement.
Definition: lumpedPointDisplacementPointPatchVectorField.C:182
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:288
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54