1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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
27 \*---------------------------------------------------------------------------*/
30 #include "DynamicField.H"
31 #include "IOstreams.H"
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 int main(int argc, char *argv[])
40 DynamicField<point, 0, 10, 11> testField;
41 DynamicField<point, 0, 10, 11> testField2;
44 testField2.setSize(5);
46 testField[0] = testField2[0] = vector(1.0, 4.5, 6.3);
47 testField[1] = testField2[1] = vector(5.2, 2.3, 3.5);
48 testField[2] = testField2[2] = vector(7.5, 4.7, 7.7);
49 testField[3] = testField2[3] = vector(2.8, 8.2, 2.3);
50 testField[4] = testField2[4] = vector(6.1, 1.7, 8.8);
52 Info << "testField:" << testField << endl;
54 testField.append(vector(0.5, 4.8, 6.2));
56 Info << "testField after appending:" << testField << endl;
58 testField.append(vector(2.7, 2.3, 6.1));
60 Info << "testField after appending:" << testField << endl;
62 vector elem = testField.remove();
64 Info << "removed element:" << elem << endl;
65 Info << "testField:" << testField << endl;
67 testField.append(vector(3.0, 1.3, 9.2));
69 Info << "testField:" << testField << endl;
71 testField.setSize(10, vector(1.5, 0.6, -1.0));
73 Info << "testField after setSize:" << testField << endl;
75 testField.append(testField2);
77 Info << "testField after appending testField2:" << testField << endl;
79 testField = testField2;
81 Info << "testField after assignment:" << testField << endl;
83 testField += testField2;
85 Info << "testField after field algebra:" << testField << endl;
89 testField.append(vector(3.0, 1.3, 9.2));
91 Info << "testField after clear and append:" << testField << endl;
93 testField.clearStorage();
95 Info << "testField after clearStorage:" << testField << endl;
101 // ************************************************************************* //