mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
tensor2D: Added specialisation for the outerProduct of Vector2D to enable outer product operation
This commit is contained in:
3
applications/test/tensor2D/Make/files
Normal file
3
applications/test/tensor2D/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
Test-tensor2D.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-tensor2D
|
||||
0
applications/test/tensor2D/Make/options
Normal file
0
applications/test/tensor2D/Make/options
Normal file
14
applications/test/tensor2D/Test-tensor2D.C
Normal file
14
applications/test/tensor2D/Test-tensor2D.C
Normal file
@ -0,0 +1,14 @@
|
||||
#include "tensor2D.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
int main()
|
||||
{
|
||||
vector2D v1(1, 2), v2(3, 4);
|
||||
tensor2D t = v1*v2;
|
||||
|
||||
Info<< "v1(1, 2)*v2(3, 4) = " << t << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -513,6 +513,14 @@ public:
|
||||
};
|
||||
|
||||
|
||||
template<class Cmpt>
|
||||
class outerProduct<Vector2D<Cmpt>, Vector2D<Cmpt> >
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Tensor2D<Cmpt> type;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Reference in New Issue
Block a user