deformedGeom.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
00032
00033
00034 #include "argList.H"
00035 #include "fvMesh.H"
00036 #include "pointFields.H"
00037 #include "IStringStream.H"
00038 #include "volPointInterpolation.H"
00039
00040 using namespace Foam;
00041
00042
00043
00044 int main(int argc, char *argv[])
00045 {
00046 argList::validArgs.append("scaling factor");
00047
00048 # include "setRootCase.H"
00049
00050 scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])()));
00051
00052 # include "createTime.H"
00053 # include "createMesh.H"
00054
00055 volPointInterpolation pInterp(mesh);
00056
00057
00058 instantList Times = runTime.times();
00059
00060 pointField zeroPoints(mesh.points());
00061
00062
00063 for (label timeI = 1; timeI < Times.size(); ++timeI)
00064 {
00065 runTime.setTime(Times[timeI], timeI);
00066
00067 Info<< "Time = " << runTime.timeName() << endl;
00068
00069 IOobject Uheader
00070 (
00071 "U",
00072 runTime.timeName(),
00073 mesh,
00074 IOobject::MUST_READ
00075 );
00076
00077
00078 if (Uheader.headerOk())
00079 {
00080 Info<< " Reading U" << endl;
00081 volVectorField U(Uheader, mesh);
00082
00083 pointField newPoints =
00084 zeroPoints
00085 + scaleFactor*pInterp.interpolate(U)().internalField();
00086
00087 mesh.polyMesh::movePoints(newPoints);
00088
00089 mesh.write();
00090 }
00091 else
00092 {
00093 Info<< " No U" << endl;
00094 }
00095
00096 Info<< endl;
00097 }
00098
00099 Info<< "End\n" << endl;
00100
00101 return 0;
00102 }
00103
00104
00105
Copyright © 2000-2009 OpenCFD Ltd