fieldCoordinateSystemTransform.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-2013 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::fieldCoordinateSystemTransform
26 
27 Group
28  grpFieldFunctionObjects
29 
30 Description
31  This function object transforms a user-specified selection of fields from
32  global Cartesian co-ordinates to a local co-ordinate system. The fields
33  are run-time modifiable.
34 
35  Example of function object specification:
36  \verbatim
37  fieldCoordinateSystemTransform1
38  {
39  type fieldCoordinateSystemTransform;
40  functionObjectLibs ("libfieldFunctionObjects.so");
41  ...
42  fields
43  (
44  U
45  UMean
46  UPrime2Mean
47  );
48  coordinateSystem
49  {
50  origin (0.001 0 0);
51  e1 (1 0.15 0);
52  e3 (0 0 -1);
53  }
54  }
55  \endverbatim
56 
57  \heading Function object usage
58  \table
59  Property | Description | Required | Default value
60  type | type name: fieldCoordinateSystemTransform | yes |
61  fields | list of fields to be transformed |yes |
62  coordinateSystem | local co-ordinate system | yes |
63  \endtable
64 
65 SeeAlso
66  Foam::functionObject
67  Foam::OutputFilterFunctionObject
68  Foam::coordinateSystem
69 
70 SourceFiles
71  fieldCoordinateSystemTransform.C
72  fieldCoordinateSystemTransformTemplates.C
73  IOfieldCoordinateSystemTransform.H
74 
75 \*---------------------------------------------------------------------------*/
76 
77 #ifndef fieldCoordinateSystemTransform_H
78 #define fieldCoordinateSystemTransform_H
79 
80 #include "OFstream.H"
81 #include "volFields.H"
82 #include "surfaceFields.H"
83 #include "coordinateSystem.H"
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 namespace Foam
88 {
89 
90 // Forward declaration of classes
91 class objectRegistry;
92 class dictionary;
93 class polyMesh;
94 class mapPolyMesh;
95 
96 /*---------------------------------------------------------------------------*\
97  Class fieldCoordinateSystemTransform Declaration
98 \*---------------------------------------------------------------------------*/
99 
100 class fieldCoordinateSystemTransform
101 {
102 protected:
103 
104  // Protected data
105 
106  //- Name
107  word name_;
108 
109  const objectRegistry& obr_;
110 
111  //- on/off switch
112  bool active_;
113 
114  //- Fields to transform
116 
117  //- Co-ordinate system to transform to
118  coordinateSystem coordSys_;
120 
121  // Protected Member Functions
122 
123  //- Disallow default bitwise copy construct
125 
126  //- Disallow default bitwise assignment
129  template<class Type>
130  void transform(const word& fieldName) const;
132  template<class Type>
133  void transformField(const Type& field) const;
135 
136 public:
138  //- Runtime type information
139  TypeName("fieldCoordinateSystemTransform");
140 
141 
142  // Constructors
143 
144  //- Construct for given objectRegistry and dictionary.
145  // Allow the possibility to load fields from files
147  (
148  const word& name,
149  const objectRegistry&,
150  const dictionary&,
151  const bool loadFromFiles = false
152  );
153 
154 
155  //- Destructor
157 
158 
159  // Member Functions
160 
161  //- Return name of the fieldCoordinateSystemTransform object
162  virtual const word& name() const
163  {
164  return name_;
165  }
166 
167  //- Read the input data
168  virtual void read(const dictionary&);
169 
170  //- Execute, currently does nothing
171  virtual void execute();
172 
173  //- Execute at the final time-loop, currently does nothing
174  virtual void end();
175 
176  //- Called when time was set at the end of the Time::operator++
177  virtual void timeSet();
178 
179  //- Write
180  virtual void write();
182  //- Update for changes of mesh
183  virtual void updateMesh(const mapPolyMesh&)
184  {}
185 
186  //- Update for changes of mesh
187  virtual void movePoints(const polyMesh&)
188  {}
189 };
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace Foam
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #ifdef NoRepository
200 #endif
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
fieldCoordinateSystemTransform(const fieldCoordinateSystemTransform &)
Disallow default bitwise copy construct.
Foam::surfaceFields.
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
virtual void read(const dictionary &)
Read the input data.
TypeName("fieldCoordinateSystemTransform")
Runtime type information.
virtual const word & name() const
Return name of the fieldCoordinateSystemTransform object.
A class for handling words, derived from string.
Definition: word.H:59
coordinateSystem coordSys_
Co-ordinate system to transform to.
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
List< word > wordList
A List of words.
Definition: fileName.H:54
Registry of regIOobjects.
virtual void end()
Execute at the final time-loop, currently does nothing.
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
This function object transforms a user-specified selection of fields from global Cartesian co-ordinat...
virtual void execute()
Execute, currently does nothing.
void operator=(const fieldCoordinateSystemTransform &)
Disallow default bitwise assignment.