edgeSlipDisplacementPointPatchVectorField.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) 2024 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::edgeSlipDisplacementPointPatchVectorField
28 
29 Description
30  Displacement follows an edgeMesh. Use in a displacementMotionSolver
31  as a bc on the pointDisplacement field.
32 
33  Needs:
34  - file : name of edgeMesh. Either:
35  - .extendedFeatureEdgeMesh (read from constant/extendedFeatureEdgeMesh)
36  - or .eMesh in or a known format (read from constant/triSurface)
37  - frozenPointsZone : empty or name of pointZone containing points
38  that do not move
39  - velocity : maximum displacement velocity
40 
41 
42 SourceFiles
43  edgeSlipDisplacementPointPatchVectorField.cxx
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef Foam_edgeSlipDisplacementPointPatchVectorField_H
48 #define Foam_edgeSlipDisplacementPointPatchVectorField_H
49 
50 #include "pointPatchFields.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class edgeSlipDisplacementPointPatchVectorField Declaration
60 \*---------------------------------------------------------------------------*/
61 
63 :
65 {
68 
69  // Private Data
70 
71  //- Maximum velocity
72  const vector velocity_;
73 
74  //- file
75  const fileName featFileName_;
76 
77  //- pointZone with frozen points
78  const word frozenPointsZone_;
79 
80  //- Edge searching
81  mutable autoPtr<indexedOctree<treeDataEdge>> edgeTreePtr_;
82 
83 
84  // Private Member Functions
85 
86  //- Calculate displacement (w.r.t. points0()) to project onto surface
87  void calcProjection(vectorField& displacement) const;
88 
89 
90 protected:
91 
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("edgeSlipDisplacement");
99 
100 
101  // Constructors
102 
103  //- Construct from patch and internal field
105  (
106  const pointPatch&,
108  );
109 
110  //- Construct from patch, internal field and dictionary
112  (
113  const pointPatch&,
115  const dictionary&
116  );
117 
118  //- Construct by mapping onto a new patch
120  (
121  const this_bctype&,
122  const pointPatch&,
124  const pointPatchFieldMapper&
125  );
126 
127  //- Construct as copy setting internal field reference
129  (
130  const this_bctype&,
132  );
133 
134  //- No copy without an internal field
136 
137  //- Clone with an internal field reference
139  (
141  ) const
142  {
143  return pointPatchField<vector>::Clone(*this, iF);
144  }
145 
146 
147  // Member Functions
148 
149  //- Update the coefficients associated with the patch field
150  virtual void updateCoeffs();
151 
152  //- Read (& store) geometry. Exposed so point attraction can reuse it.
153  static void read
154  (
155  const objectRegistry& obr,
156  const dictionary& dict
157  );
159  //- Write
160  virtual void write(Ostream&) const;
161 
162 
163  // Member Operators
164 
165  //- No copy assignment
166  void operator=
167  (
169  ) = delete;
170 
171  //- Inherit assignment
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
TypeName("edgeSlipDisplacement")
Runtime type information.
dictionary dict
A class for handling file names.
Definition: fileName.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
Foam::pointPatchFieldMapper.
virtual autoPtr< pointPatchField< Type > > clone() const
No clone without an internal field reference.
friend Ostream & operator(Ostream &, const pointPatchField< vector > &)
const indexedOctree< treeDataEdge > & edgeTree() const
A class for handling words, derived from Foam::string.
Definition: word.H:63
edgeSlipDisplacementPointPatchVectorField(const pointPatch &, const DimensionedField< vector, pointMesh > &)
Construct from patch and internal field.
static autoPtr< pointPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual void write(Ostream &) const
Write.
Non-pointer based hierarchical recursive searching.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:64
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Displacement follows an edgeMesh. Use in a displacementMotionSolver as a bc on the pointDisplacement ...
Registry of regIOobjects.
Namespace for OpenFOAM.
static void read(const objectRegistry &obr, const dictionary &dict)
Read (& store) geometry. Exposed so point attraction can reuse it.