diff --git a/applications/test/vector/vectorTest.C b/applications/test/vector/vectorTest.C index f48f65d711..65e995ae4a 100644 --- a/applications/test/vector/vectorTest.C +++ b/applications/test/vector/vectorTest.C @@ -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; } diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H index 1eff60d99b..d655990e21 100644 --- a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H +++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H @@ -406,6 +406,17 @@ inline Cmpt cmptAv return cmptSum(vs)/nCmpt; } +template +inline Cmpt cmptProduct +( + const VectorSpace& vs +) +{ + Cmpt product = vs.v_[0]; + VectorSpaceOps::SeqOp(product, vs, multiplyEqOp()); + return product; +} + template inline Form cmptMag