preservePatchTypes.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 #include "preservePatchTypes.H"
00028 #include "polyBoundaryMeshEntries.H"
00029 #include "dictionary.H"
00030
00031
00032
00033 void Foam::preservePatchTypes
00034 (
00035 const objectRegistry& obr,
00036 const word& meshInstance,
00037 const fileName& meshDir,
00038 const wordList& patchNames,
00039 wordList& patchTypes,
00040 const word& defaultFacesName,
00041 word& defaultFacesType,
00042 wordList& patchPhysicalTypes
00043 )
00044 {
00045 dictionary patchDictionary;
00046
00047 {
00048 IOobject patchEntriesHeader
00049 (
00050 "boundary",
00051 meshInstance,
00052 meshDir,
00053 obr,
00054 IOobject::MUST_READ,
00055 IOobject::NO_WRITE,
00056 false
00057 );
00058
00059 if (patchEntriesHeader.headerOk())
00060 {
00061
00062 polyBoundaryMeshEntries patchEntries(patchEntriesHeader);
00063
00064 forAll(patchEntries, patchi)
00065 {
00066 patchDictionary.add(patchEntries[patchi]);
00067 }
00068 }
00069 }
00070
00071 if (patchDictionary.size())
00072 {
00073 forAll(patchNames, patchi)
00074 {
00075 if (patchDictionary.found(patchNames[patchi]))
00076 {
00077 const dictionary& patchDict =
00078 patchDictionary.subDict(patchNames[patchi]);
00079
00080 patchDict.lookup("type") >> patchTypes[patchi];
00081
00082 patchDict.readIfPresent("geometricType", patchTypes[patchi]);
00083 patchDict.readIfPresent
00084 (
00085 "physicalType",
00086 patchPhysicalTypes[patchi]
00087 );
00088 }
00089 }
00090
00091 if (patchDictionary.found(defaultFacesName))
00092 {
00093 const dictionary& patchDict =
00094 patchDictionary.subDict(defaultFacesName);
00095
00096 patchDict.readIfPresent("geometricType", defaultFacesType);
00097 }
00098 }
00099
00100 Info << nl << "Default patch type set to " << defaultFacesType << endl;
00101 }
00102
00103
00104
Copyright © 2000-2009 OpenCFD Ltd