genericPointPatchField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 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::genericPointPatchField
26 
27 Description
28  A generic version of calculatedPointPatchField, useful as a fallback for
29  handling unknown patch types.
30 
31 SourceFiles
32  genericPointPatchField.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef genericPointPatchField_H
37 #define genericPointPatchField_H
38 
39 #include "genericPatchField.H"
41 #include "HashPtrTable.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class genericPointPatchField Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class Type>
54 :
55  public genericPatchField,
56  public calculatedPointPatchField<Type>
57 {
58  // Private Data
59 
60  dictionary dict_;
61 
62  HashPtrTable<scalarField> scalarFields_;
63  HashPtrTable<vectorField> vectorFields_;
64  HashPtrTable<sphericalTensorField> sphericalTensorFields_;
65  HashPtrTable<symmTensorField> symmTensorFields_;
66  HashPtrTable<tensorField> tensorFields_;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("generic");
73 
74 
75  // Constructors
76 
77  //- Construct from patch and internal field
79  (
80  const pointPatch&,
82  );
83 
84  //- Construct from patch, internal field and dictionary
86  (
87  const pointPatch&,
89  const dictionary&
90  );
91 
92  //- Construct by mapping given patchField<Type> onto a new patch
94  (
96  const pointPatch&,
99  );
100 
101  //- Construct as copy setting internal field reference
103  (
106  );
107 
108  //- Construct and return a clone setting internal field reference
110  (
112  ) const
113  {
115  (
117  (
118  *this,
119  iF
120  )
121  );
122  }
123 
124 
125  // Member Functions
126 
127  // Mapping functions
128 
129  //- Map (and resize as needed) from self given a mapping object
130  // Used to update fields following mesh topology change
131  virtual void autoMap(const pointPatchFieldMapper&);
132 
133  //- Reverse map the given pointPatchField onto this pointPatchField
134  // Used to reconstruct fields
135  virtual void rmap(const pointPatchField<Type>&, const labelList&);
136 
137  //- Reset the pointPatchField to the given pointPatchField
138  // Used for mesh to mesh mapping
139  virtual void reset(const pointPatchField<Type>&);
140 
141 
142  //- Write
143  virtual void write(Ostream&) const;
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #ifdef NoRepository
154  #include "genericPointPatchField.C"
155 #endif
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
virtual void write(Ostream &) const
Write.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Foam::pointPatchFieldMapper.
A HashTable specialisation for hashing pointers.
Definition: HashPtrTable.H:50
A calculated boundary condition for pointField.
Abstract base class for point-mesh patch fields.
A generic version of calculatedPointPatchField, useful as a fallback for handling unknown patch types...
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given pointPatchField onto this pointPatchField.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:56
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void reset(const pointPatchField< Type > &)
Reset the pointPatchField to the given pointPatchField.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
TypeName("generic")
Runtime type information.
genericPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
autoPtr< pointPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Namespace for OpenFOAM.