Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
9c0c6c5f
Commit
9c0c6c5f
authored
Mar 17, 2016
by
Henry Weller
Browse files
SpatialVector: Added component access member functions
wx(), wy(), wz(), lx(), ly() and lz()
parent
9a04ebae
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialVector/SpatialVector.H
View file @
9c0c6c5f
...
...
@@ -67,6 +67,10 @@ class SpatialVector
public:
//- Component labeling enumeration
enum
components
{
WX
,
WY
,
WZ
,
LX
,
LY
,
LZ
};
// Constructors
//- Construct null
...
...
@@ -81,19 +85,19 @@ public:
//- Construct from the angular and linear vector components
inline
SpatialVector
(
const
Vector
<
Cmpt
>&
angular
,
const
Vector
<
Cmpt
>&
l
inear
const
Vector
<
Cmpt
>&
w
,
const
Vector
<
Cmpt
>&
l
);
//- Construct given 6 components
inline
SpatialVector
(
const
Cmpt
&
v0
,
const
Cmpt
&
v1
,
const
Cmpt
&
v2
,
const
Cmpt
&
v3
,
const
Cmpt
&
v4
,
const
Cmpt
&
v5
const
Cmpt
&
wx
,
const
Cmpt
&
wy
,
const
Cmpt
&
wz
,
const
Cmpt
&
lx
,
const
Cmpt
&
ly
,
const
Cmpt
&
lz
);
//- Construct from Istream
...
...
@@ -102,11 +106,32 @@ public:
// Member Functions
//- Return the angular part of the spatial vector as a vector
inline
Vector
<
Cmpt
>
angular
()
const
;
// Component access
inline
const
Cmpt
&
wx
()
const
;
inline
const
Cmpt
&
wy
()
const
;
inline
const
Cmpt
&
wz
()
const
;
inline
const
Cmpt
&
lx
()
const
;
inline
const
Cmpt
&
ly
()
const
;
inline
const
Cmpt
&
lz
()
const
;
inline
Cmpt
&
wx
();
inline
Cmpt
&
wy
();
inline
Cmpt
&
wz
();
inline
Cmpt
&
lx
();
inline
Cmpt
&
ly
();
inline
Cmpt
&
lz
();
// Sub-vector access.
//- Return the angular part of the spatial vector as a vector
inline
Vector
<
Cmpt
>
w
()
const
;
//- Return the linear part of the spatial vector as a vector
inline
Vector
<
Cmpt
>
l
inear
()
const
;
//- Return the linear part of the spatial vector as a vector
inline
Vector
<
Cmpt
>
l
()
const
;
// Member Operators
...
...
src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialVector/SpatialVectorI.H
View file @
9c0c6c5f
...
...
@@ -50,16 +50,16 @@ inline Foam::SpatialVector<Cmpt>::SpatialVector
template
<
class
Cmpt
>
inline
Foam
::
SpatialVector
<
Cmpt
>::
SpatialVector
(
const
Vector
<
Cmpt
>&
angular
,
const
Vector
<
Cmpt
>&
l
inear
const
Vector
<
Cmpt
>&
w
,
const
Vector
<
Cmpt
>&
l
)
{
this
->
v_
[
0
]
=
angular
.
x
();
this
->
v_
[
1
]
=
angular
.
y
();
this
->
v_
[
2
]
=
angular
.
z
();
this
->
v_
[
3
]
=
l
inear
.
x
();
this
->
v_
[
4
]
=
l
inear
.
y
();
this
->
v_
[
5
]
=
l
inear
.
z
();
this
->
v_
[
0
]
=
w
.
x
();
this
->
v_
[
1
]
=
w
.
y
();
this
->
v_
[
2
]
=
w
.
z
();
this
->
v_
[
3
]
=
l
.
x
();
this
->
v_
[
4
]
=
l
.
y
();
this
->
v_
[
5
]
=
l
.
z
();
}
...
...
@@ -93,13 +93,97 @@ inline Foam::SpatialVector<Cmpt>::SpatialVector(Istream& is)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
Cmpt
>
inline
Foam
::
Vector
<
Cmpt
>
Foam
::
SpatialVector
<
Cmpt
>::
angular
()
const
inline
const
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
wx
()
const
{
return
this
->
v_
[
WX
];
}
template
<
class
Cmpt
>
inline
const
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
wy
()
const
{
return
this
->
v_
[
WY
];
}
template
<
class
Cmpt
>
inline
const
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
wz
()
const
{
return
this
->
v_
[
WZ
];
}
template
<
class
Cmpt
>
inline
const
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
lx
()
const
{
return
this
->
v_
[
LX
];
}
template
<
class
Cmpt
>
inline
const
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
ly
()
const
{
return
this
->
v_
[
LY
];
}
template
<
class
Cmpt
>
inline
const
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
lz
()
const
{
return
this
->
v_
[
LZ
];
}
template
<
class
Cmpt
>
inline
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
wx
()
{
return
this
->
v_
[
WX
];
}
template
<
class
Cmpt
>
inline
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
wy
()
{
return
this
->
v_
[
WY
];
}
template
<
class
Cmpt
>
inline
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
wz
()
{
return
this
->
v_
[
WZ
];
}
template
<
class
Cmpt
>
inline
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
lx
()
{
return
this
->
v_
[
LX
];
}
template
<
class
Cmpt
>
inline
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
ly
()
{
return
this
->
v_
[
LY
];
}
template
<
class
Cmpt
>
inline
Cmpt
&
Foam
::
SpatialVector
<
Cmpt
>::
lz
()
{
return
this
->
v_
[
LZ
];
}
template
<
class
Cmpt
>
inline
Foam
::
Vector
<
Cmpt
>
Foam
::
SpatialVector
<
Cmpt
>::
w
()
const
{
return
Vector
<
Cmpt
>
(
this
->
v_
[
0
],
this
->
v_
[
1
],
this
->
v_
[
2
]);
}
template
<
class
Cmpt
>
inline
Foam
::
Vector
<
Cmpt
>
Foam
::
SpatialVector
<
Cmpt
>::
l
inear
()
const
inline
Foam
::
Vector
<
Cmpt
>
Foam
::
SpatialVector
<
Cmpt
>::
l
()
const
{
return
Vector
<
Cmpt
>
(
this
->
v_
[
3
],
this
->
v_
[
4
],
this
->
v_
[
5
]);
}
...
...
src/OpenFOAM/primitives/spatialVectorAlgebra/SpatialVector/spatialVector/spatialVector.C
View file @
9c0c6c5f
...
...
@@ -36,7 +36,7 @@ const char* const Foam::spatialVector::vsType::typeName = "spatialVector";
template
<>
const
char
*
const
Foam
::
spatialVector
::
vsType
::
componentNames
[]
=
{
"x"
,
"y"
,
"z"
"
w
x"
,
"
w
y"
,
"
wz"
,
"lx"
,
"ly"
,
"l
z"
};
template
<>
...
...
src/OpenFOAM/primitives/spatialVectorAlgebra/spatialTransform/spatialTransformI.H
View file @
9c0c6c5f
...
...
@@ -148,8 +148,8 @@ inline Foam::spatialVector Foam::spatialTransform::operator&
{
return
spatialVector
(
E_
&
v
.
angular
(),
E_
&
(
v
.
l
inear
()
-
(
r_
^
v
.
angular
()))
E_
&
v
.
w
(),
E_
&
(
v
.
l
()
-
(
r_
^
v
.
w
()))
);
}
...
...
@@ -169,11 +169,11 @@ inline Foam::spatialVector Foam::spatialTransform::transpose::operator&
const
spatialVector
&
f
)
const
{
vector
ETfl
(
X_
.
E
().
T
()
&
f
.
l
inear
());
vector
ETfl
(
X_
.
E
().
T
()
&
f
.
l
());
return
spatialVector
(
(
X_
.
E
().
T
()
&
f
.
angular
())
+
(
X_
.
r
()
^
ETfl
),
(
X_
.
E
().
T
()
&
f
.
w
())
+
(
X_
.
r
()
^
ETfl
),
ETfl
);
}
...
...
@@ -196,8 +196,8 @@ inline Foam::spatialVector Foam::spatialTransform::dual::operator&
{
return
spatialVector
(
X_
.
E
()
&
(
f
.
angular
()
-
(
X_
.
r
()
^
f
.
l
inear
())),
X_
.
E
()
&
f
.
l
inear
()
X_
.
E
()
&
(
f
.
w
()
-
(
X_
.
r
()
^
f
.
l
())),
X_
.
E
()
&
f
.
l
()
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment