BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / applications / test / fieldDependency / Test-fieldDependency.C
blobedcca1d6685695d3e61574da91ba21107abe0d54
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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/>.
24 Description
25     Test field dependencies.
27 \*---------------------------------------------------------------------------*/
29 #include "argList.H"
30 #include "Time.H"
31 #include "volFields.H"
33 using namespace Foam;
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 // Main program:
39 int main(int argc, char *argv[])
41     #include "setRootCase.H"
42     #include "createTime.H"
43     #include "createMesh.H"
45     Info<< "Creating field T\n" << endl;
46     volScalarField T
47     (
48         IOobject
49         (
50             "T",
51             runTime.timeName(),
52             mesh,
53             IOobject::NO_READ,
54             IOobject::AUTO_WRITE
55         ),
56         mesh,
57         dimensionedScalar("zero", dimless, 0)
58     );
60     Info<< "Creating field p\n" << endl;
61     volScalarField p
62     (
63         IOobject
64         (
65             "p",
66             runTime.timeName(),
67             mesh,
68             IOobject::NO_READ,
69             IOobject::AUTO_WRITE
70         ),
71         mesh,
72         dimensionedScalar("zero", dimless, 0)
73     );
76     Info<< "p.eventNo:" << p.eventNo() << endl;
77     Info<< "p.uptodate:" << p.upToDate(T)<< endl;
79     // Change T and mark as uptodate.
80     Info<< "Changing T" << endl;
81     T = 0.0;
82     T.setUpToDate();
83     Info<< "T.eventNo:" << T.eventNo() << endl;
85     // Check p dependency:
86     Info<< "p.uptodate:" << p.upToDate(T)<< endl;
88     // Change p and mark as uptodate.
89     Info<< "Changing p." << endl;
90     p.setUpToDate();
91     Info<< "p.uptodate:" << p.upToDate(T)<< endl;
92     Info<< "p.eventNo:" << p.eventNo() << endl;
95     Info<< "End\n" << endl;
97     return 0;
101 // ************************************************************************* //