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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::CompactSpatialTensor
29
30Description
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
42SourceFiles
43 CompactSpatialTensorI.H
44
45See 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
58namespace Foam
59{
60
61/*---------------------------------------------------------------------------*\
62 Class CompactSpatialTensor Declaration
63\*---------------------------------------------------------------------------*/
64
65template<class Cmpt>
67:
68 public MatrixSpace<CompactSpatialTensor<Cmpt>, Cmpt, 6, 3>
69{
70
71public:
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
105template<class Cmpt>
106struct is_contiguous<CompactSpatialTensor<Cmpt>> : is_contiguous<Cmpt> {};
107
108//- Data are contiguous label if component type is label
109template<class Cmpt>
111:
113{};
114
115//- Data are contiguous scalar if component type is scalar
116template<class Cmpt>
118:
120{};
121
122
123template<class Cmpt>
124class typeOfInnerProduct<Cmpt, CompactSpatialTensor<Cmpt>, Tensor<Cmpt>>
125{
126public:
129};
130
131
132template<class Cmpt>
133class typeOfInnerProduct<Cmpt, CompactSpatialTensor<Cmpt>, Vector<Cmpt>>
134{
135public:
138};
139
140
141template<class Cmpt>
143{
144public:
147};
148
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152} // End namespace Foam
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156// Include inline implementations
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162#endif
163
164// ************************************************************************* //
Templated 3D compact spatial tensor derived from MatrixSpace used to represent transformations of spa...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Templated matrix space.
Definition: MatrixSpace.H:61
Templated 3D spatial tensor derived from MatrixSpace used to represent transformations of spatial vec...
Definition: SpatialTensor.H:70
Templated 3D spatial vector derived from VectorSpace used to represent the anglular and linear compon...
Definition: SpatialVector.H:68
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
Definition: Tensor.H:64
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:65
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
A template class to specify if a data type is composed solely of Foam::label elements.
Definition: contiguous.H:86
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition: contiguous.H:94
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78