genericPointPatchField.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 | Copyright (C) 2011-2016 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 
40 #include "HashPtrTable.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class genericPointPatchField Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type>
53 :
54  public calculatedPointPatchField<Type>
55 {
56  // Private data
57 
58  word actualTypeName_;
59  dictionary dict_;
60 
61  HashPtrTable<scalarField> scalarFields_;
62  HashPtrTable<vectorField> vectorFields_;
63  HashPtrTable<sphericalTensorField> sphericalTensorFields_;
64  HashPtrTable<symmTensorField> symmTensorFields_;
65  HashPtrTable<tensorField> tensorFields_;
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("generic");
72 
73 
74  // Constructors
75 
76  //- Construct from patch and internal field
78  (
79  const pointPatch&,
81  );
82 
83  //- Construct from patch, internal field and dictionary
85  (
86  const pointPatch&,
88  const dictionary&
89  );
90 
91  //- Construct by mapping given patchField<Type> onto a new patch
93  (
95  const pointPatch&,
98  );
99 
100  //- Construct and return a clone
101  virtual autoPtr<pointPatchField<Type>> clone() const
102  {
104  (
106  (
107  *this
108  )
109  );
110  }
111 
112  //- Construct as copy setting internal field reference
114  (
117  );
118 
119  //- Construct and return a clone setting internal field reference
121  (
123  ) const
124  {
126  (
128  (
129  *this,
130  iF
131  )
132  );
133  }
134 
135 
136  // Member functions
137 
138  // Mapping functions
139 
140  //- Map (and resize as needed) from self given a mapping object
141  virtual void autoMap
142  (
143  const pointPatchFieldMapper&
144  );
145 
146  //- Reverse map the given pointPatchField onto this pointPatchField
147  virtual void rmap
148  (
149  const pointPatchField<Type>&,
150  const labelList&
151  );
152 
153 
154  //- Write
155  virtual void write(Ostream&) const;
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #ifdef NoRepository
166  #include "genericPointPatchField.C"
167 #endif
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
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:137
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...
A class for handling words, derived from string.
Definition: word.H:59
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:53
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.