1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
26 \*---------------------------------------------------------------------------*/
29 #include "DynamicField.H"
30 #include "IOstreams.H"
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 int main(int argc, char *argv[])
39 DynamicField<point, 0, 10, 11> testField;
40 DynamicField<point, 0, 10, 11> testField2;
43 testField2.setSize(5);
45 testField[0] = testField2[0] = vector(1.0, 4.5, 6.3);
46 testField[1] = testField2[1] = vector(5.2, 2.3, 3.5);
47 testField[2] = testField2[2] = vector(7.5, 4.7, 7.7);
48 testField[3] = testField2[3] = vector(2.8, 8.2, 2.3);
49 testField[4] = testField2[4] = vector(6.1, 1.7, 8.8);
51 Info << "testField:" << testField << endl;
53 testField.append(vector(0.5, 4.8, 6.2));
55 Info << "testField after appending:" << testField << endl;
57 testField.append(vector(2.7, 2.3, 6.1));
59 Info << "testField after appending:" << testField << endl;
61 vector elem = testField.remove();
63 Info << "removed element:" << elem << endl;
64 Info << "testField:" << testField << endl;
66 testField.append(vector(3.0, 1.3, 9.2));
68 Info << "testField:" << testField << endl;
70 testField.setSize(10, vector(1.5, 0.6, -1.0));
72 Info << "testField after setSize:" << testField << endl;
74 testField.append(testField2);
76 Info << "testField after appending testField2:" << testField << endl;
78 testField = testField2;
80 Info << "testField after assignment:" << testField << endl;
82 testField += testField2;
84 Info << "testField after field algebra:" << testField << endl;
88 testField.append(vector(3.0, 1.3, 9.2));
90 Info << "testField after clear and append:" << testField << endl;
92 testField.clearStorage();
94 Info << "testField after clearStorage:" << testField << endl;
100 // ************************************************************************* //