CompactSpatialTensorT.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  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::CompactSpatialTensorT
29 
30 Description
31  Templated 3D transposed compact spatial tensor derived from MatrixSpace
32  used to represent transformations of spatial vectors of rigid bodies.
33 
34  Reference:
35  \verbatim
36  Featherstone, R. (2008).
37  Rigid body dynamics algorithms.
38  Springer.
39  \endverbatim
40 
41 SourceFiles
42  CompactSpatialTensorTI.H
43 
44 See also
45  Foam::MatrixSpace
46  Foam::CompactSpatialTensor
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef CompactSpatialTensorT_H
51 #define CompactSpatialTensorT_H
52 
53 #include "CompactSpatialTensor.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class CompactSpatialTensor Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Cmpt>
66 :
67  public MatrixSpace<CompactSpatialTensorT<Cmpt>, Cmpt, 3, 6>
68 {
69 
70 public:
71 
72  // Constructors
73 
74  //- Construct null
75  inline CompactSpatialTensorT();
76 
77  inline CompactSpatialTensorT(const Foam::zero);
78 
79  //- Construct given MatrixSpace of the same rank
81  (
82  const typename CompactSpatialTensorT::msType&
83  );
84 
85  //- Construct given 18 components
87  (
88  const Cmpt& t00, const Cmpt& t01, const Cmpt& t02,
89  const Cmpt& t10, const Cmpt& t11, const Cmpt& t12,
90  const Cmpt& t20, const Cmpt& t21, const Cmpt& t22,
91  const Cmpt& t30, const Cmpt& t31, const Cmpt& t32,
92  const Cmpt& t40, const Cmpt& t41, const Cmpt& t42,
93  const Cmpt& t50, const Cmpt& t51, const Cmpt& t52
94  );
95 
96  //- Construct from Istream
98 };
99 
100 
101 // * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
102 
103 //- Data are contiguous if component type is contiguous
104 template<class Cmpt>
105 struct is_contiguous<CompactSpatialTensorT<Cmpt>> : is_contiguous<Cmpt> {};
106 
107 //- Data are contiguous label if component type is label
108 template<class Cmpt>
110 :
111  is_contiguous_label<Cmpt>
112 {};
113 
114 //- Data are contiguous scalar if component type is scalar
115 template<class Cmpt>
117 :
119 {};
120 
121 
122 template<class Cmpt>
123 class typeOfTranspose<Cmpt, CompactSpatialTensor<Cmpt>>
124 {
125 public:
126 
128 };
129 
130 
131 template<class Cmpt>
132 class typeOfTranspose<Cmpt, CompactSpatialTensorT<Cmpt>>
133 {
134 public:
135 
137 };
138 
139 
140 template<class Cmpt>
141 class typeOfInnerProduct
142 <
143  Cmpt,
144  CompactSpatialTensor<Cmpt>,
146 >
147 {
148 public:
149 
150  typedef SpatialTensor<Cmpt> type;
151 };
152 
153 
154 template<class Cmpt>
155 class typeOfInnerProduct
156 <
157  Cmpt,
158  CompactSpatialTensorT<Cmpt>,
160 >
161 {
162 public:
163 
164  typedef Tensor<Cmpt> type;
165 };
166 
167 
168 template<class Cmpt>
169 class typeOfInnerProduct
170 <
171  Cmpt,
172  CompactSpatialTensorT<Cmpt>,
173  SpatialVector<Cmpt>
174 >
175 {
176 public:
177 
178  typedef Vector<Cmpt> type;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 // Include inline implementations
189 #include "CompactSpatialTensorTI.H"
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
Foam::Tensor
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
Definition: complexI.H:275
Foam::CompactSpatialTensorT::CompactSpatialTensorT
CompactSpatialTensorT()
Construct null.
Definition: CompactSpatialTensorTI.H:31
Foam::typeOfTranspose
Abstract template class to provide the transpose form of a form.
Definition: products.H:62
Foam::SpatialTensor
Templated 3D spatial tensor derived from MatrixSpace used to represent transformations of spatial vec...
Definition: SpatialTensor.H:67
Foam::CompactSpatialTensorT
Templated 3D transposed compact spatial tensor derived from MatrixSpace used to represent transformat...
Definition: CompactSpatialTensorT.H:64
Foam::is_contiguous_label
A template class to specify if a data type is composed solely of Foam::label elements.
Definition: contiguous.H:83
Foam::typeOfInnerProduct< Cmpt, CompactSpatialTensorT< Cmpt >, CompactSpatialTensor< Cmpt >>::type
Tensor< Cmpt > type
Definition: CompactSpatialTensorT.H:163
Foam::MatrixSpace
Templated matrix space.
Definition: MatrixSpace.H:58
Foam::typeOfInnerProduct< Cmpt, CompactSpatialTensorT< Cmpt >, SpatialVector< Cmpt >>::type
Vector< Cmpt > type
Definition: CompactSpatialTensorT.H:177
Foam::typeOfInnerProduct< Cmpt, CompactSpatialTensor< Cmpt >, CompactSpatialTensorT< Cmpt >>::type
SpatialTensor< Cmpt > type
Definition: CompactSpatialTensorT.H:149
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::SpatialVector
Templated 3D spatial vector derived from VectorSpace used to represent the anglular and linear compon...
Definition: SpatialVector.H:65
Foam::MatrixSpace< CompactSpatialTensorT< Cmpt >, Cmpt, 3, 6 >::msType
MatrixSpace< CompactSpatialTensorT< Cmpt >, Cmpt, Mrows, Ncols > msType
MatrixSpace type.
Definition: MatrixSpace.H:67
CompactSpatialTensorTI.H
Foam::CompactSpatialTensor
Templated 3D compact spatial tensor derived from MatrixSpace used to represent transformations of spa...
Definition: CompactSpatialTensor.H:65
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::is_contiguous_scalar
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition: contiguous.H:91
Foam::Vector
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:62
Foam::typeOfInnerProduct
Definition: products.H:51
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
CompactSpatialTensor.H
Foam::typeOfTranspose< Cmpt, CompactSpatialTensorT< Cmpt > >::type
CompactSpatialTensor< Cmpt > type
Definition: CompactSpatialTensorT.H:135
Foam::typeOfTranspose< Cmpt, CompactSpatialTensor< Cmpt > >::type
CompactSpatialTensorT< Cmpt > type
Definition: CompactSpatialTensorT.H:126
Foam::is_contiguous
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:75
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:62