writeCellCentres.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "argList.H"
00032 #include "timeSelector.H"
00033 #include "Time.H"
00034 #include "fvMesh.H"
00035 #include "vectorIOField.H"
00036 #include "volFields.H"
00037
00038 using namespace Foam;
00039
00040
00041
00042
00043
00044 int main(int argc, char *argv[])
00045 {
00046 timeSelector::addOptions();
00047
00048 # include "setRootCase.H"
00049 # include "createTime.H"
00050
00051 instantList timeDirs = timeSelector::select0(runTime, args);
00052
00053 # include "createMesh.H"
00054
00055 forAll(timeDirs, timeI)
00056 {
00057 runTime.setTime(timeDirs[timeI], timeI);
00058
00059 Info<< "Time = " << runTime.timeName() << endl;
00060
00061
00062 mesh.readUpdate();
00063
00064 volVectorField cc
00065 (
00066 IOobject
00067 (
00068 "cellCentres",
00069 runTime.timeName(),
00070 mesh,
00071 IOobject::NO_READ,
00072 IOobject::AUTO_WRITE
00073 ),
00074 mesh.C()
00075 );
00076
00077
00078
00079
00080
00081
00082 Info<< "Writing components of cellCentre positions to volScalarFields"
00083 << " ccx, ccy, ccz in " << runTime.timeName() << endl;
00084
00085 for (direction i=0; i<vector::nComponents; i++)
00086 {
00087 volScalarField cci
00088 (
00089 IOobject
00090 (
00091 "cc" + word(vector::componentNames[i]),
00092 runTime.timeName(),
00093 mesh,
00094 IOobject::NO_READ,
00095 IOobject::AUTO_WRITE
00096 ),
00097 mesh.C().component(i)
00098 );
00099
00100 cci.write();
00101 }
00102 }
00103
00104 Info<< "\nEnd" << endl;
00105
00106 return 0;
00107 }
00108
00109
00110
Copyright © 2000-2009 OpenCFD Ltd