Loading...
Searching...
No Matches
RowVector.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) 2016 OpenFOAM Foundation
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::RowVector
28
29Description
30 Templated 3D row-vector derived from MatrixSpace adding construction from
31 3 components and element access using x(), y() and z().
32
33SourceFiles
34 RowVectorI.H
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef RowVector_H
39#define RowVector_H
40
41#include "MatrixSpace.H"
42#include "Vector.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class RowVector Declaration
51\*---------------------------------------------------------------------------*/
52
53template<class Cmpt>
54class RowVector
55:
56 public MatrixSpace<RowVector<Cmpt>, Cmpt, 1, 3>
57{
58
59public:
60
61 //- Equivalent type of labels used for valid component indexing
63
64
65 //- Component labeling enumeration
66 enum components { X, Y, Z };
67
68
69 // Constructors
70
71 //- Default construct
72 RowVector() = default;
74 //- Construct initialized to zero
75 inline RowVector(const Foam::zero);
76
77 //- Construct given VectorSpace of the same rank
78 template<class Cmpt2>
79 inline RowVector(const MatrixSpace<RowVector<Cmpt2>, Cmpt2, 1, 3>&);
80
81 //- Construct given three components
82 inline RowVector(const Cmpt& rvx, const Cmpt& rvy, const Cmpt& rvz);
83
84 //- Construct from Istream
85 inline explicit RowVector(Istream&);
86
87
88 // Member Functions
90 // Component Access
91
92 const Cmpt& x() const noexcept { return this->v_[X]; }
93 const Cmpt& y() const noexcept { return this->v_[Y]; }
94 const Cmpt& z() const noexcept { return this->v_[Z]; }
95
96 Cmpt& x() noexcept { return this->v_[X]; }
97 Cmpt& y() noexcept { return this->v_[Y]; }
98 Cmpt& z() noexcept { return this->v_[Z]; }
99};
100
102template<class Cmpt>
103class typeOfTranspose<Cmpt, Vector<Cmpt>>
104{
105public:
108};
109
110
111template<class Cmpt>
112class typeOfTranspose<Cmpt, RowVector<Cmpt>>
113{
114public:
115
117};
118
119
120// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122} // End namespace Foam
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126#include "RowVectorI.H"
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130#endif
131
132// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
Templated 3D row-vector derived from MatrixSpace adding construction from 3 components and element ac...
Definition RowVector.H:52
RowVector(const MatrixSpace< RowVector< Cmpt2 >, Cmpt2, 1, 3 > &)
Construct given VectorSpace of the same rank.
Definition RowVectorI.H:33
Cmpt & y() noexcept
Definition RowVector.H:106
const Cmpt & x() const noexcept
Definition RowVector.H:101
components
Component labeling enumeration.
Definition RowVector.H:65
RowVector(const Foam::zero)
Construct initialized to zero.
Definition RowVectorI.H:24
Cmpt & z() noexcept
Definition RowVector.H:107
const Cmpt & z() const noexcept
Definition RowVector.H:103
Cmpt & x() noexcept
Definition RowVector.H:105
RowVector(const Cmpt &rvx, const Cmpt &rvy, const Cmpt &rvz)
Construct given three components.
Definition RowVectorI.H:43
RowVector(Istream &)
Construct from Istream.
Definition RowVectorI.H:56
RowVector< label > labelType
Equivalent type of labels used for valid component indexing.
Definition RowVector.H:59
const Cmpt & y() const noexcept
Definition RowVector.H:102
RowVector()=default
Default construct.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition Vector.H:61
Abstract template class to provide the transpose form of a form.
Definition products.H:63
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
PtrList< volScalarField > & Y
Namespace for OpenFOAM.
const direction noexcept
Definition scalarImpl.H:265