From 33a2ec60de376e0d6d8f5448a89e789df81cf003 Mon Sep 17 00:00:00 2001 From: henry Date: Wed, 2 Sep 2009 11:34:58 +0100 Subject: [PATCH] Changed the time-selection so that it works correctly with the -parallel option for when the time directories only exist in the processor sub-directories. --- .../preProcessing/mapFields/mapFields.C | 27 ++++++------------- .../preProcessing/mapFields/setTimeIndex.H | 6 +++++ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/applications/utilities/preProcessing/mapFields/mapFields.C b/applications/utilities/preProcessing/mapFields/mapFields.C index fde815d76f..111c871958 100644 --- a/applications/utilities/preProcessing/mapFields/mapFields.C +++ b/applications/utilities/preProcessing/mapFields/mapFields.C @@ -228,15 +228,8 @@ wordList addProcessorPatches int main(int argc, char *argv[]) { -# include "setRoots.H" -# include "createTimes.H" -# include "setTimeIndex.H" - - runTimeSource.setTime(sourceTimes[sourceTimeIndex], sourceTimeIndex); - - Info<< "\nSource time: " << runTimeSource.value() - << "\nTarget time: " << runTimeTarget.value() - << endl; + #include "setRoots.H" + #include "createTimes.H" HashTable patchMap; wordList cuttingPatches; @@ -302,11 +295,7 @@ int main(int argc, char *argv[]) caseDirSource/fileName(word("processor") + name(procI)) ); - runTimeSource.setTime - ( - sourceTimes[sourceTimeIndex], - sourceTimeIndex - ); + #include "setTimeIndex.H" fvMesh meshSource ( @@ -348,6 +337,8 @@ int main(int argc, char *argv[]) Info<< "Create source mesh\n" << endl; + #include "setTimeIndex.H" + fvMesh meshSource ( IOobject @@ -450,11 +441,7 @@ int main(int argc, char *argv[]) caseDirSource/fileName(word("processor") + name(procISource)) ); - runTimeSource.setTime - ( - sourceTimes[sourceTimeIndex], - sourceTimeIndex - ); + #include "setTimeIndex.H" fvMesh meshSource ( @@ -529,6 +516,8 @@ int main(int argc, char *argv[]) } else { + #include "setTimeIndex.H" + Info<< "Create meshes\n" << endl; fvMesh meshSource diff --git a/applications/utilities/preProcessing/mapFields/setTimeIndex.H b/applications/utilities/preProcessing/mapFields/setTimeIndex.H index 19efd9ff5b..80dfb3efca 100644 --- a/applications/utilities/preProcessing/mapFields/setTimeIndex.H +++ b/applications/utilities/preProcessing/mapFields/setTimeIndex.H @@ -23,3 +23,9 @@ runTimeTarget.time().value() ); } + + runTimeSource.setTime(sourceTimes[sourceTimeIndex], sourceTimeIndex); + + Info<< "\nSource time: " << runTimeSource.value() + << "\nTarget time: " << runTimeTarget.value() + << endl;