00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Application 00025 mergeMeshes 00026 00027 Description 00028 Merge two meshes. 00029 00030 Usage 00031 00032 - mergeMeshes [OPTIONS] <master root> <master case name> <root to add> <case to add> 00033 00034 @param <master root> \n 00035 @todo Detailed description of argument. 00036 00037 @param <master case name> \n 00038 @todo Detailed description of argument. 00039 00040 @param <root to add> \n 00041 @todo Detailed description of argument. 00042 00043 @param <case to add> \n 00044 @todo Detailed description of argument. 00045 00046 @param -case <dir>\n 00047 Case directory. 00048 00049 @param -help \n 00050 Display help message. 00051 00052 @param -doc \n 00053 Display Doxygen API documentation page for this application. 00054 00055 @param -srcDoc \n 00056 Display Doxygen source documentation page for this application. 00057 00058 \*---------------------------------------------------------------------------*/ 00059 00060 #include <OpenFOAM/argList.H> 00061 #include <OpenFOAM/Time.H> 00062 #include "mergePolyMesh.H" 00063 00064 using namespace Foam; 00065 00066 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00067 // Main program: 00068 00069 int main(int argc, char *argv[]) 00070 { 00071 argList::noParallel(); 00072 # include "setRoots.H" 00073 # include "createTimes.H" 00074 00075 Info<< "Reading master mesh for time = " << runTimeMaster.timeName() << endl; 00076 00077 Info<< "Create mesh\n" << endl; 00078 mergePolyMesh masterMesh 00079 ( 00080 IOobject 00081 ( 00082 masterRegion, 00083 runTimeMaster.timeName(), 00084 runTimeMaster 00085 ) 00086 ); 00087 00088 00089 Info<< "Reading mesh to add for time = " << runTimeToAdd.timeName() << endl; 00090 00091 Info<< "Create mesh\n" << endl; 00092 polyMesh meshToAdd 00093 ( 00094 IOobject 00095 ( 00096 addRegion, 00097 runTimeToAdd.timeName(), 00098 runTimeToAdd 00099 ) 00100 ); 00101 00102 runTimeMaster++; 00103 00104 Info<< "Writing combined mesh to " << runTimeMaster.timeName() << endl; 00105 00106 masterMesh.addMesh(meshToAdd); 00107 masterMesh.merge(); 00108 masterMesh.polyMesh::write(); 00109 00110 Info << nl << "End" << endl; 00111 00112 return 0; 00113 } 00114 00115 00116 // ************************ vim: set sw=4 sts=4 et: ************************ //