Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
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::lumpedPointDisplacementPointPatchVectorField
28
29Description
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
49SourceFiles
50 lumpedPointDisplacementPointPatchVectorField.C
51
52\*---------------------------------------------------------------------------*/
53
54#ifndef lumpedPointDisplacementPointPatchVectorField_H
55#define lumpedPointDisplacementPointPatchVectorField_H
56
58#include "lumpedPointMovement.H"
60#include "pointField.H"
61#include "pointFieldsFwd.H"
62
63// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64
65namespace Foam
66{
67
68// Forward Declarations
71/*---------------------------------------------------------------------------*\
72 Class lumpedPointDisplacementPointPatchVectorField Declaration
73\*---------------------------------------------------------------------------*/
74
76:
77 public fixedValuePointPatchField<vector>
78{
79 // Private Data
80
81 //- Names of the movement controller(s) in use
82 wordList controllers_;
83
84 //- Times when data (forces) were written
85 // With first=time, second=prevTime
86 Tuple2<scalar, scalar> dataWritten_;
87
88 //- Backup method for getting "points0" without a motion solver
89 mutable autoPtr<pointIOField> points0Ptr_;
90
91
92 // Convenience typedefs
93
96
97
98protected:
99
100 // Protected Member Functions
101
102 //- The starting locations (obtained from the motionSolver).
103 const pointField& points0() const;
104
105 //- The auto-vivifying singleton for movement.
106 const lumpedPointMovement& movement() const;
107
108
109public:
110
111 //- Runtime type information
112 TypeName("lumpedPointDisplacement");
113
114
115 // Constructors
116
117 //- Construct from patch and internal field
119 (
120 const pointPatch& p,
122 );
123
124 //- Construct from patch, internal field and dictionary
126 (
127 const pointPatch& p,
129 const dictionary& dict
130 );
131
132 //- Construct by mapping given patch field onto a new patch
134 (
136 const pointPatch& p,
138 const pointPatchFieldMapper& mapper
139 );
140
141 //- Construct as copy setting internal field reference
143 (
146 );
147
148 //- Return a clone
150 {
151 return pointPatchField<vector>::Clone(*this);
152 }
153
154 //- Construct and return a clone setting internal field reference
156 (
158 ) const
159 {
160 return pointPatchField<vector>::Clone(*this, iF);
161 }
162
163
164 //- Destructor. De-register movement if in use and managed by this patch
166
168 // Member Functions
169
170 //- The controller names for this patch
171 const wordList& controllers() const
172 {
173 return controllers_;
174 }
176 //- Set all patch controls for patches of this type
177 static label setPatchControls
178 (
179 const pointVectorField& pvf,
180 const pointField& points0
181 );
182
183 //- Set all patch controls for patches of this type
184 static label setInterpolators
185 (
186 const pointVectorField& pvf,
187 const pointField& points0
188 );
189
190 //- The ids for all patches of this type
191 static labelList patchIds(const pointVectorField& pvf);
192
193 //- Update the coefficients associated with the patch field
194 virtual void updateCoeffs();
196 //- Write
197 virtual void write(Ostream& os) const;
198};
199
200
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203} // End namespace Foam
204
205// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206
207#endif
208
209// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition Tuple2.H:51
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
fixedValuePointPatchField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Abstract base class for interpolating in 1D.
static label setPatchControls(const pointVectorField &pvf, const pointField &points0)
Set all patch controls for patches of this type.
virtual ~lumpedPointDisplacementPointPatchVectorField()
Destructor. De-register movement if in use and managed by this patch.
TypeName("lumpedPointDisplacement")
Runtime type information.
const pointField & points0() const
The starting locations (obtained from the motionSolver).
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static label setInterpolators(const pointVectorField &pvf, const pointField &points0)
Set all patch controls for patches of this type.
const lumpedPointMovement & movement() const
The auto-vivifying singleton for movement.
const wordList & controllers() const
The controller names for this patch.
virtual autoPtr< pointPatchField< vector > > clone() const
Return a clone.
lumpedPointDisplacementPointPatchVectorField(const pointPatch &p, const DimensionedField< vector, pointMesh > &iF)
Construct from patch and internal field.
virtual autoPtr< pointPatchField< vector > > clone(const DimensionedField< vector, pointMesh > &iF) const
Construct and return a clone setting internal field reference.
The movement driver that describes initial point locations, the current state of the points/rotations...
Foam::pointPatchFieldMapper.
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Basic pointPatch represents a set of points from the mesh.
Definition pointPatch.H:67
volScalarField & p
labelList patchIds
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
List< label > labelList
A List of labels.
Definition List.H:62
GeometricField< vector, pointPatchField, pointMesh > pointVectorField
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
vectorField pointField
pointField is a vectorField.
runTime write()
Forwards and collection of common point field types.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68
pointField points0(pointIOField(IOobject("points", mesh.time().constant(), polyMesh::meshSubDir, mesh, IOobject::MUST_READ, IOobject::NO_WRITE, IOobject::NO_REGISTER)))