Loading...
Searching...
No Matches
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-2022 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 Foam_coordinateScaling_H
41#define Foam_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
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 noexcept
101 {
102 return active_;
103 }
104
105 //- Access to optional coordinate system
107 {
108 return coordSys_;
109 }
110
111 //- Convert to local coordinates,
112 //- pass-through if no coordinate system is active
113 tmp<pointField> localPosition(const pointField& globalPos) const;
114
115 //- Evaluate
117 (
118 const pointField& pos,
119 const Field<Type>& local
120 ) const;
122 //- Write dictionary entry
123 virtual void writeEntry(Ostream& os) const;
124};
125
126
127// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128
129// Template specializations
130template<>
132(
133 const pointField& pos,
134 const Field<label>& local
135) const;
136
137} // End namespace Foam
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141#ifdef NoRepository
142 #include "coordinateScaling.C"
143#endif
144
145// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146
147#endif
148
149// ************************************************************************* //
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
virtual tmp< Field< Type > > transform(const pointField &pos, const Field< Type > &local) const
Evaluate.
bool active() const noexcept
Has any scaling or coordinate transformation.
tmp< pointField > localPosition(const pointField &globalPos) const
Convert to local coordinates, pass-through if no coordinate system is active.
coordinateScaling()
Default construct.
virtual void writeEntry(Ostream &os) const
Write dictionary entry.
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:133
Registry of regIOobjects.
A class for managing temporary objects.
Definition tmp.H:75
bool local
Definition EEqn.H:20
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
const direction noexcept
Definition scalarImpl.H:265
vectorField pointField
pointField is a vectorField.
dictionary dict