1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 \*---------------------------------------------------------------------------*/
33 #include "IOstreams.H"
34 #include "FixedList.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 int main(int argc, char *argv[])
47 argList::validArgs.clear();
48 argList args(argc, argv);
50 FixedList<label, 4> list;
56 Info<< "list:" << list
57 << " hash:" << FixedList<label, 4>::Hash<>()(list) << endl;
59 Info<< "FixedList<label, ..> is contiguous, "
60 "thus hashing function is irrelevant: with string::hash" << endl;
62 Info<< "list:" << list
63 << " hash:" << FixedList<label, 4>::Hash<string::hash>()(list) << endl;
65 label a[4] = {0, 1, 2, 3};
66 FixedList<label, 4> list2(a);
68 Info<< "list:" << list2
69 << " hash:" << FixedList<label, 4>::Hash<>()(list2) << endl;
71 // FixedList<label, 3> hmm(Sin);
72 // Info<< hmm << endl;
74 if (Pstream::parRun())
76 if (Pstream::myProcNo() != Pstream::masterNo())
78 Serr<< "slave sending to master "
79 << Pstream::masterNo() << endl;
83 Pstream::blocking, Pstream::masterNo(), IOstream::ASCII
86 FixedList<label, 2> list3;
95 int slave = Pstream::firstSlave();
96 slave <= Pstream::lastSlave();
100 Serr << "master receiving from slave " << slave << endl;
103 Pstream::blocking, slave, IOstream::ASCII
105 FixedList<label, 2> list3(fromSlave);
107 Serr<< list3 << endl;
116 // ************************************************************************* //