specifiedRotation.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) 2021 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::coordinateRotations::specified
28 
29 Description
30  An user-specified coordinateRotation, primarily to be used internally
31  within coding when the rotation matrix is already known but
32  needs to be wrapped as a coordinateRotation for use in a coordinate
33  system.
34 
35 Note
36  Currently no runtime selection mechanism, since specifying a
37  rotation matrix via a dictionary can be fragile due to rounding
38  factors and uncertainty if a forward or reverse rotation matrix
39  is intended.
40 
41 SourceFiles
42  specifiedRotation.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef coordinateRotations_specified_H
47 #define coordinateRotations_specified_H
48 
49 #include "coordinateRotation.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 namespace coordinateRotations
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class coordinateRotations::specified Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class specified
63 :
64  public coordinateRotation
65 {
66  // Private Data
67 
68  //- The rotation matrix
69  tensor Rmatrix_;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeNameNoDebug("specified");
76 
77 
78  // Constructors
79 
80  //- Default construct - an identity matrix
81  specified();
82 
83  //- Construct from transformation matrix
84  explicit specified(const tensor& rot);
85 
86  //- Construct from dictionary
87  explicit specified(const dictionary& unused);
88 
89  //- Return clone
91  {
92  return
95  }
96 
97 
98  //- Destructor
99  virtual ~specified() = default;
100 
101 
102  // Member Functions
103 
104  //- Reset specification
105  virtual void clear();
106 
107  //- Return the rotation tensor
108  virtual tensor R() const;
109 
110  //- Write information
111  virtual void write(Ostream& os) const;
112 
113  //- Write dictionary entry
114  virtual void writeEntry(const word& keyword, Ostream& os) const;
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace coordinateRotations
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::Tensor< scalar >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::coordinateRotations::specified::write
virtual void write(Ostream &os) const
Write information.
Definition: specifiedRotation.C:84
Foam::coordinateRotations::specified::~specified
virtual ~specified()=default
Destructor.
Foam::coordinateRotations::specified::TypeNameNoDebug
TypeNameNoDebug("specified")
Runtime type information.
Foam::coordinateRotation
User specification of a coordinate rotation.
Definition: coordinateRotation.H:78
Foam::coordinateRotations::specified::specified
specified()
Default construct - an identity matrix.
Definition: specifiedRotation.C:48
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::coordinateRotations::specified
An user-specified coordinateRotation, primarily to be used internally within coding when the rotation...
Definition: specifiedRotation.H:61
Foam::coordinateRotations::specified::R
virtual tensor R() const
Return the rotation tensor.
Definition: specifiedRotation.C:78
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::coordinateRotations::specified::clear
virtual void clear()
Reset specification.
Definition: specifiedRotation.C:72
Foam::coordinateRotations::specified::clone
autoPtr< coordinateRotation > clone() const
Return clone.
Definition: specifiedRotation.H:89
coordinateRotation.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::coordinateRotations::specified::writeEntry
virtual void writeEntry(const word &keyword, Ostream &os) const
Write dictionary entry.
Definition: specifiedRotation.C:91