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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::genericPointPatchField
29 
30 Description
31  A generic version of calculatedPointPatchField, useful as a fallback for
32  handling unknown patch types.
33 
34 SourceFiles
35  genericPointPatchField.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef genericPointPatchField_H
40 #define genericPointPatchField_H
41 
43 #include "HashPtrTable.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class genericPointPatchField Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Type>
56 :
57  public calculatedPointPatchField<Type>
58 {
59  // Private Data
60 
61  const word actualTypeName_;
62 
63  dictionary dict_;
64 
65  HashPtrTable<scalarField> scalarFields_;
66  HashPtrTable<vectorField> vectorFields_;
67  HashPtrTable<sphericalTensorField> sphTensorFields_;
68  HashPtrTable<symmTensorField> symmTensorFields_;
69  HashPtrTable<tensorField> tensorFields_;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("generic");
76 
77 
78  // Constructors
79 
80  //- Construct from patch and internal field
82  (
83  const pointPatch&,
85  );
86 
87  //- Construct from patch, internal field and dictionary
89  (
90  const pointPatch&,
92  const dictionary&
93  );
94 
95  //- Construct by mapping given patchField<Type> onto a new patch
97  (
99  const pointPatch&,
101  const pointPatchFieldMapper&
102  );
103 
104  //- Construct and return a clone
105  virtual autoPtr<pointPatchField<Type>> clone() const
106  {
108  (
110  (
111  *this
112  )
113  );
114  }
115 
116  //- Construct as copy setting internal field reference
118  (
121  );
122 
123  //- Construct and return a clone setting internal field reference
125  (
127  ) const
128  {
130  (
132  (
133  *this,
134  iF
135  )
136  );
137  }
138 
139 
140  // Member Functions
141 
142  // Mapping Functions
143 
144  //- Map (and resize as needed) from self given a mapping object
145  virtual void autoMap
146  (
147  const pointPatchFieldMapper&
148  );
149 
150  //- Reverse map the given pointPatchField onto this pointPatchField
151  virtual void rmap
152  (
153  const pointPatchField<Type>&,
154  const labelList&
155  );
156 
157 
158  //- Return the actual type
159  const word& actualType() const;
160 
161  //- Write
162  virtual void write(Ostream&) const;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #ifdef NoRepository
173  #include "genericPointPatchField.C"
174 #endif
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
Foam::genericPointPatchField::TypeName
TypeName("generic")
Runtime type information.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::genericPointPatchField::clone
virtual autoPtr< pointPatchField< Type > > clone() const
Construct and return a clone.
Definition: genericPointPatchField.H:104
Foam::genericPointPatchField::write
virtual void write(Ostream &) const
Write.
Definition: genericPointPatchField.C:476
Foam::pointPatch
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:58
Foam::genericPointPatchField::autoMap
virtual void autoMap(const pointPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: genericPointPatchField.C:375
Foam::pointPatchField
Abstract base class for point-mesh patch fields.
Definition: pointMVCWeight.H:60
Foam::pointPatchFieldMapper
Foam::pointPatchFieldMapper.
Definition: pointPatchFieldMapper.H:48
Foam::genericPointPatchField::genericPointPatchField
genericPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Definition: genericPointPatchField.C:36
Foam::calculatedPointPatchField
A calculated boundary condition for pointField.
Definition: calculatedPointPatchField.H:51
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::genericPointPatchField::rmap
virtual void rmap(const pointPatchField< Type > &, const labelList &)
Reverse map the given pointPatchField onto this pointPatchField.
Definition: genericPointPatchField.C:408
Foam::genericPointPatchField
A generic version of calculatedPointPatchField, useful as a fallback for handling unknown patch types...
Definition: genericPointPatchField.H:54
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
calculatedPointPatchField.H
Foam::HashPtrTable
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
Definition: HashPtrTable.H:54
Foam::List< label >
HashPtrTable.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
genericPointPatchField.C
Foam::genericPointPatchField::actualType
const word & actualType() const
Return the actual type.
Definition: genericPointPatchField.C:469
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54