CompactSpatialTensor.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-2017 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::CompactSpatialTensor
29 
30 Description
31  Templated 3D compact spatial tensor derived from MatrixSpace used to
32  represent transformations of spatial vectors and the angular and linear
33  inertia of rigid bodies.
34 
35  Reference:
36  \verbatim
37  Featherstone, R. (2008).
38  Rigid body dynamics algorithms.
39  Springer.
40  \endverbatim
41 
42 SourceFiles
43  CompactSpatialTensorI.H
44 
45 See also
46  Foam::MatrixSpace
47  Foam::SpatialTensor
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef CompactSpatialTensor_H
52 #define CompactSpatialTensor_H
53 
54 #include "SpatialTensor.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class CompactSpatialTensor Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 template<class Cmpt>
67 :
68  public MatrixSpace<CompactSpatialTensor<Cmpt>, Cmpt, 6, 3>
69 {
70 
71 public:
72 
73  // Constructors
74 
75  //- Construct null
76  inline CompactSpatialTensor();
77 
78  inline CompactSpatialTensor(const Foam::zero);
79 
80  //- Construct given MatrixSpace of the same rank
82  (
83  const typename CompactSpatialTensor::msType&
84  );
85 
86  //- Construct given 18 components
88  (
89  const Cmpt& t00, const Cmpt& t01, const Cmpt& t02,
90  const Cmpt& t10, const Cmpt& t11, const Cmpt& t12,
91  const Cmpt& t20, const Cmpt& t21, const Cmpt& t22,
92  const Cmpt& t30, const Cmpt& t31, const Cmpt& t32,
93  const Cmpt& t40, const Cmpt& t41, const Cmpt& t42,
94  const Cmpt& t50, const Cmpt& t51, const Cmpt& t52
95  );
96 
97  //- Construct from Istream
99 };
100 
101 
102 // * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
103 
104 //- Data are contiguous if component type is contiguous
105 template<class Cmpt>
106 struct is_contiguous<CompactSpatialTensor<Cmpt>> : is_contiguous<Cmpt> {};
107 
108 //- Data are contiguous label if component type is label
109 template<class Cmpt>
111 :
112  is_contiguous_label<Cmpt>
113 {};
114 
115 //- Data are contiguous scalar if component type is scalar
116 template<class Cmpt>
118 :
120 {};
121 
122 
123 template<class Cmpt>
124 class typeOfInnerProduct<Cmpt, CompactSpatialTensor<Cmpt>, Tensor<Cmpt>>
125 {
126 public:
127 
129 };
130 
131 
132 template<class Cmpt>
133 class typeOfInnerProduct<Cmpt, CompactSpatialTensor<Cmpt>, Vector<Cmpt>>
134 {
135 public:
136 
137  typedef SpatialVector<Cmpt> type;
138 };
139 
140 
141 template<class Cmpt>
142 class typeOfInnerProduct<Cmpt, SpatialTensor<Cmpt>, CompactSpatialTensor<Cmpt>>
143 {
144 public:
145 
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 // Include inline implementations
157 #include "CompactSpatialTensorT.H"
158 #include "CompactSpatialTensorI.H"
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
Foam::Tensor
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
Definition: complexI.H:275
Foam::typeOfInnerProduct< Cmpt, SpatialTensor< Cmpt >, CompactSpatialTensor< Cmpt > >::type
CompactSpatialTensor< Cmpt > type
Definition: CompactSpatialTensor.H:145
Foam::typeOfInnerProduct< Cmpt, CompactSpatialTensor< Cmpt >, Vector< Cmpt > >::type
SpatialVector< Cmpt > type
Definition: CompactSpatialTensor.H:136
Foam::typeOfInnerProduct< Cmpt, CompactSpatialTensor< Cmpt >, Tensor< Cmpt > >::type
CompactSpatialTensor< Cmpt > type
Definition: CompactSpatialTensor.H:127
Foam::SpatialTensor
Templated 3D spatial tensor derived from MatrixSpace used to represent transformations of spatial vec...
Definition: SpatialTensor.H:67
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::MatrixSpace
Templated matrix space.
Definition: MatrixSpace.H:58
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< CompactSpatialTensor< Cmpt >, Cmpt, 6, 3 >::msType
MatrixSpace< CompactSpatialTensor< Cmpt >, Cmpt, Mrows, Ncols > msType
MatrixSpace type.
Definition: MatrixSpace.H:67
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
SpatialTensor.H
CompactSpatialTensorI.H
Foam::Vector
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:62
Foam::CompactSpatialTensor::CompactSpatialTensor
CompactSpatialTensor()
Construct null.
Definition: CompactSpatialTensorI.H:31
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
CompactSpatialTensorT.H
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