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
ff473b98
Commit
ff473b98
authored
Nov 04, 2010
by
graham
Browse files
ENH: cmptProduct function, i.e. cmptProduct(vector(a, b, c)) = a*b*c.
parent
d9931658
Changes
2
Hide whitespace changes
Inline
Side-by-side
applications/test/vector/vectorTest.C
View file @
ff473b98
...
...
@@ -27,7 +27,11 @@ int main()
Info
<<
magSqr
(
d
)
<<
endl
;
vector
d2
(
0
.
5
,
0
.
51
,
-
0
.
5
);
Info
<<
cmptMax
(
d2
)
<<
" "
<<
cmptSum
(
d2
)
<<
" "
<<
cmptMag
(
d2
)
<<
endl
;
Info
<<
cmptMax
(
d2
)
<<
" "
<<
cmptSum
(
d2
)
<<
" "
<<
cmptProduct
(
d2
)
<<
" "
<<
cmptMag
(
d2
)
<<
endl
;
Info
<<
min
(
d
,
d2
)
<<
endl
;
return
0
;
}
src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H
View file @
ff473b98
...
...
@@ -406,6 +406,17 @@ inline Cmpt cmptAv
return
cmptSum
(
vs
)
/
nCmpt
;
}
template
<
class
Form
,
class
Cmpt
,
int
nCmpt
>
inline
Cmpt
cmptProduct
(
const
VectorSpace
<
Form
,
Cmpt
,
nCmpt
>&
vs
)
{
Cmpt
product
=
vs
.
v_
[
0
];
VectorSpaceOps
<
nCmpt
,
1
>::
SeqOp
(
product
,
vs
,
multiplyEqOp
<
Cmpt
>
());
return
product
;
}
template
<
class
Form
,
class
Cmpt
,
int
nCmpt
>
inline
Form
cmptMag
...
...
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