SphericalTensor2D.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2021 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::SphericalTensor2D
26 
27 Description
28  Templated 2D sphericalTensor derived from VectorSpace adding construction
29  from 1 component, element access using ii() member function and the
30  inner-product (dot-product) and outer-product operators.
31 
32 SourceFiles
33  SphericalTensor2DI.H
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef SphericalTensor2D_H
38 #define SphericalTensor2D_H
39 
40 #include "VectorSpace.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class SphericalTensor2D Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Cmpt>
53 :
54  public VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>
55 {
56 
57 public:
58 
59  // Member constants
60 
61  //- Rank of SphericalTensor2D is 2
62  static const direction rank = 2;
63 
64 
65  // Static Data Members
66 
67  static const SphericalTensor2D I;
69  static const SphericalTensor2D twoThirdsI;
70 
71 
72  //- Component labeling enumeration
73  enum components { II };
74 
75 
76  // Constructors
77 
78  //- Construct null
79  inline SphericalTensor2D();
80 
81  //- Construct initialised to zero
82  inline SphericalTensor2D(const Foam::zero);
83 
84  //- Construct given VectorSpace
85  inline SphericalTensor2D
86  (
87  const VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>&
88  );
89 
90  //- Construct given the component
91  inline SphericalTensor2D(const Cmpt& tii);
92 
93  //- Construct from Istream
94  inline SphericalTensor2D(Istream&);
95 
96 
97  // Member Functions
98 
99  // Access
100 
101  inline const Cmpt& ii() const;
102  inline Cmpt& ii();
103 };
104 
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 } // End namespace Foam
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 // Include inline implementations
113 #include "SphericalTensor2DI.H"
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #endif
118 
119 // ************************************************************************* //
components
Component labeling enumeration.
SphericalTensor2D()
Construct null.
uint8_t direction
Definition: direction.H:45
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Templated vector space.
Definition: VectorSpace.H:53
static const direction rank
Rank of SphericalTensor2D is 2.
static const SphericalTensor2D oneThirdI
static const SphericalTensor2D I
const Cmpt & ii() const
Templated 2D sphericalTensor derived from VectorSpace adding construction from 1 component, element access using ii() member function and the inner-product (dot-product) and outer-product operators.
static const SphericalTensor2D twoThirdsI
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
Definition: zero.H:49
Namespace for OpenFOAM.