SphericalTensor2DI.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) 2011-2016 OpenFOAM Foundation
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 \*---------------------------------------------------------------------------*/
27 
28 #include "Vector2D.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 template<class Cmpt>
34 {}
35 
36 
37 template<class Cmpt>
39 :
41 {}
42 
43 
44 template<class Cmpt>
46 (
47  const VectorSpace<SphericalTensor2D<Cmpt>, Cmpt, 1>& vs
48 )
49 :
51 {}
52 
53 
54 template<class Cmpt>
56 {
57  this->v_[II] = stii;
58 }
59 
60 
61 template<class Cmpt>
63 :
65 {}
66 
67 
68 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
69 
70 template<class Cmpt>
71 inline const Cmpt& Foam::SphericalTensor2D<Cmpt>::ii() const
72 {
73  return this->v_[II];
74 }
75 
76 
77 template<class Cmpt>
79 {
80  return this->v_[II];
81 }
82 
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 namespace Foam
87 {
88 
89 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
90 
91 //- Inner-product between two spherical tensors
92 template<class Cmpt>
94 operator&
95 (
96  const SphericalTensor2D<Cmpt>& st1,
97  const SphericalTensor2D<Cmpt>& st2
98 )
99 {
100  return SphericalTensor2D<Cmpt>(st1.ii()*st2.ii());
101 }
102 
103 
104 //- Inner-product between a spherical tensor and a vector
105 template<class Cmpt>
106 inline Vector2D<Cmpt>
108 {
109  return Vector2D<Cmpt>
110  (
111  st.ii()*v.x(),
112  st.ii()*v.y()
113  );
114 }
115 
116 
117 //- Inner-product between a vector and a spherical tensor
118 template<class Cmpt>
119 inline Vector2D<Cmpt>
121 {
122  return Vector2D<Cmpt>
123  (
124  v.x()*st.ii(),
125  v.y()*st.ii()
126  );
127 }
128 
129 
130 //- Division of a scalar by a sphericalTensor2D
131 template<class Cmpt>
132 inline SphericalTensor2D<Cmpt>
133 operator/(const scalar s, const SphericalTensor2D<Cmpt>& st)
134 {
135  return SphericalTensor2D<Cmpt>(s/st.ii());
136 }
137 
138 
139 //- Return the trace of a spherical tensor
140 template<class Cmpt>
141 inline Cmpt tr(const SphericalTensor2D<Cmpt>& st)
142 {
143  return 2*st.ii();
144 }
145 
146 
147 //- Return the spherical part of a spherical tensor, i.e. itself
148 template<class Cmpt>
150 {
151  return st;
152 }
153 
154 
155 //- Return the determinant of a spherical tensor
156 template<class Cmpt>
157 inline Cmpt det(const SphericalTensor2D<Cmpt>& st)
158 {
159  return st.ii()*st.ii();
160 }
161 
162 
163 //- Return the inverse of a symmetric tensor
164 template<class Cmpt>
166 {
167  return SphericalTensor2D<Cmpt>(1.0/st.ii());
168 }
169 
170 
171 template<class Cmpt>
172 class outerProduct<SphericalTensor2D<Cmpt>, Cmpt>
173 {
174 public:
175 
177 };
178 
179 template<class Cmpt>
180 class outerProduct<Cmpt, SphericalTensor2D<Cmpt>>
181 {
182 public:
183 
185 };
186 
187 
188 template<class Cmpt>
190 {
191 public:
192 
194 };
195 
196 
197 template<class Cmpt>
199 {
200 public:
201 
203 };
204 
205 template<class Cmpt>
207 {
208 public:
209 
211 };
212 
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 } // End namespace Foam
217 
218 // ************************************************************************* //
Foam::innerProduct< SphericalTensor2D< Cmpt >, SphericalTensor2D< Cmpt > >::type
SphericalTensor2D< Cmpt > type
Definition: SphericalTensor2DI.H:193
s
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputSpray.H:25
Foam::operator&
tmp< GeometricField< Type, fvPatchField, volMesh > > operator&(const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
Foam::innerProduct
Definition: products.H:141
Foam::SphericalTensor2D::ii
const Cmpt & ii() const
Definition: SphericalTensor2DI.H:71
Foam::Vector2D
Templated 2D Vector derived from VectorSpace adding construction from 2 components,...
Definition: Vector2D.H:55
Foam::VectorSpace
Templated vector space.
Definition: VectorSpace.H:56
Vector2D.H
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::inv
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:73
Foam::sph
SphericalTensor< Cmpt > sph(const DiagTensor< Cmpt > &dt)
Return the spherical part of a diagonal tensor.
Definition: DiagTensorI.H:290
Foam::VectorSpace< SphericalTensor2D< Cmpt >, Cmpt, 1 >::vsType
VectorSpace< SphericalTensor2D< Cmpt >, Cmpt, Ncmpts > vsType
VectorSpace type.
Definition: VectorSpace.H:86
Foam::outerProduct< SphericalTensor2D< Cmpt >, Cmpt >::type
SphericalTensor2D< Cmpt > type
Definition: SphericalTensor2DI.H:176
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::operator/
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
Definition: dimensionedScalar.C:68
Foam::innerProduct< Vector2D< Cmpt >, SphericalTensor2D< Cmpt > >::type
Vector2D< Cmpt > type
Definition: SphericalTensor2DI.H:210
Foam::outerProduct< Cmpt, SphericalTensor2D< Cmpt > >::type
SphericalTensor2D< Cmpt > type
Definition: SphericalTensor2DI.H:184
Foam::tr
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:51
Foam::det
dimensionedScalar det(const dimensionedSphericalTensor &dt)
Definition: dimensionedSphericalTensor.C:62
Foam::Vector2D::y
const Cmpt & y() const
Access to the vector y component.
Definition: Vector2DI.H:78
Foam::SphericalTensor2D::SphericalTensor2D
SphericalTensor2D()
Construct null.
Definition: SphericalTensor2DI.H:33
Foam::innerProduct< SphericalTensor2D< Cmpt >, Vector2D< Cmpt > >::type
Vector2D< Cmpt > type
Definition: SphericalTensor2DI.H:202
Foam::outerProduct
Definition: products.H:106
Foam::Vector2D::x
const Cmpt & x() const
Access to the vector x component.
Definition: Vector2DI.H:71
Foam::SphericalTensor2D
Templated 2D sphericalTensor derived from VectorSpace adding construction from 1 component,...
Definition: SphericalTensor2D.H:55
Foam::zero
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
Definition: zero.H:61