coordinateScaling.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) 2018-2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::coordinateScaling
28
29Description
30 Helper class to wrap coordinate system and component-wise scaling
31
32See also
33 Foam::Function1Types
34
35SourceFiles
36 coordinateScaling.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef coordinateScaling_H
41#define coordinateScaling_H
42
43#include "coordinateSystem.H"
44#include "Function1.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class coordinateScaling Declaration
53\*---------------------------------------------------------------------------*/
54
55template<class Type>
57{
58 // Private Data
59
60 //- Local coordinate system
61 const autoPtr<coordinateSystem> coordSys_;
62
63 //- In local coordinate system component-wise scaling
65
66 //- Cache whether any scaling or coordinate system
67 bool active_;
68
69
70 // Private Member Functions
71
72 //- No copy assignment
73 void operator=(const coordinateScaling<Type>&) = delete;
74
75public:
76
77 // Constructors
78
79 //- Default construct
81
82 //- Construct from registry and dictionary
84 (
85 const objectRegistry& obr,
86 const dictionary& dict
87 );
88
89 //- Construct copy
91
92
93 //- Destructor
94 virtual ~coordinateScaling() = default;
95
96
97 // Member Functions
98
99 //- Has any scaling or coordinate transformation
100 bool active() const
101 {
102 return active_;
103 }
104
105 //- Access to optional coordinate system
107 {
108 return coordSys_;
109 }
110
111 //- Evaluate
113 (
114 const pointField& pos,
115 const Field<Type>& local
116 ) const;
117
118 //- Write dictionary entry
119 virtual void writeEntry(Ostream& os) const;
120};
121
122
123// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124
125// Template specializations
126template<>
128(
129 const pointField& pos,
130 const Field<label>& local
131) const;
132
133} // End namespace Foam
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137#ifdef NoRepository
138 #include "coordinateScaling.C"
139#endif
140
141// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142
143#endif
144
145// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Helper class to wrap coordinate system and component-wise scaling.
virtual tmp< Field< Type > > transform(const pointField &pos, const Field< Type > &local) const
Evaluate.
coordinateScaling()
Default construct.
virtual void writeEntry(Ostream &os) const
Write dictionary entry.
bool active() const
Has any scaling or coordinate transformation.
const autoPtr< coordinateSystem > & coordSys() const
Access to optional coordinate system.
virtual ~coordinateScaling()=default
Destructor.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Default transformation behaviour.
Registry of regIOobjects.
A class for managing temporary objects.
Definition: tmp.H:65
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
dictionary dict