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-2019 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 and return a clone
102  virtual autoPtr<pointPatchField<Type>> clone() const
103  {
105  (
107  (
108  *this
109  )
110  );
111  }
112 
113  //- Construct as copy setting internal field reference
115  (
118  );
119 
120  //- Construct and return a clone setting internal field reference
122  (
124  ) const
125  {
127  (
129  (
130  *this,
131  iF
132  )
133  );
134  }
135 
136 
137  // Member Functions
138 
139  // Mapping functions
140 
141  //- Map (and resize as needed) from self given a mapping object
142  // Used to update fields following mesh topology change
143  virtual void autoMap(const pointPatchFieldMapper&);
144 
145  //- Reverse map the given pointPatchField onto this pointPatchField
146  // Used to reconstruct fields
147  virtual void rmap(const pointPatchField<Type>&, const labelList&);
148 
149 
150  //- Write
151  virtual void write(Ostream&) const;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #ifdef NoRepository
162  #include "genericPointPatchField.C"
163 #endif
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
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:158
Foam::pointPatchFieldMapper.
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
A calculated boundary condition for pointField.
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
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.
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.
Namespace for OpenFOAM.