Matrix: Added (i, j) addressing to allow support for addressing blocks of the matrix

This change brings OpenFOAM into line with the standard matrix
addressing in other C++ libraries for better interoperability.
This commit is contained in:
Henry Weller
2016-03-20 19:44:29 +00:00
parent 767ffc3c7b
commit c13421b10a
29 changed files with 197 additions and 224 deletions

View File

@ -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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,15 +35,15 @@ int main(int argc, char *argv[])
{
simpleMatrix<vector> hmm(3);
hmm[0][0] = -3.0;
hmm[0][1] = 10.0;
hmm[0][2] = -4.0;
hmm[1][0] = 2.0;
hmm[1][1] = 3.0;
hmm[1][2] = 10.0;
hmm[2][0] = 2.0;
hmm[2][1] = 6.0;
hmm[2][2] = 1.0;
hmm(0, 0) = -3.0;
hmm(0, 1) = 10.0;
hmm(0, 2) = -4.0;
hmm(1, 0) = 2.0;
hmm(1, 1) = 3.0;
hmm(1, 2) = 10.0;
hmm(2, 0) = 2.0;
hmm(2, 1) = 6.0;
hmm(2, 2) = 1.0;
hmm.source()[0] = vector(2.0, 1.0, 3.0);
hmm.source()[1] = vector(1.0, 4.0, 3.0);