OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

genericPolyPatch.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 #include "genericPolyPatch.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 
00030 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00031 
00032 namespace Foam
00033 {
00034     defineTypeNameAndDebug(genericPolyPatch, 0);
00035 
00036     addToRunTimeSelectionTable(polyPatch, genericPolyPatch, word);
00037     addToRunTimeSelectionTable(polyPatch, genericPolyPatch, dictionary);
00038 }
00039 
00040 
00041 // * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * * * * * //
00042 
00043 Foam::genericPolyPatch::genericPolyPatch
00044 (
00045     const word& name,
00046     const label size,
00047     const label start,
00048     const label index,
00049     const polyBoundaryMesh& bm
00050 )
00051 :
00052     polyPatch(name, size, start, index, bm)
00053 {}
00054 
00055 
00056 Foam::genericPolyPatch::genericPolyPatch
00057 (
00058     const word& name,
00059     const dictionary& dict,
00060     const label index,
00061     const polyBoundaryMesh& bm
00062 )
00063 :
00064     polyPatch(name, dict, index, bm),
00065     actualTypeName_(dict.lookup("type")),
00066     dict_(dict)
00067 {}
00068 
00069 
00070 Foam::genericPolyPatch::genericPolyPatch
00071 (
00072     const genericPolyPatch& pp,
00073     const polyBoundaryMesh& bm
00074 )
00075 :
00076     polyPatch(pp, bm),
00077     actualTypeName_(pp.actualTypeName_),
00078     dict_(pp.dict_)
00079 {}
00080 
00081 
00082 Foam::genericPolyPatch::genericPolyPatch
00083 (
00084     const genericPolyPatch& pp,
00085     const polyBoundaryMesh& bm,
00086     const label index,
00087     const label newSize,
00088     const label newStart
00089 )
00090 :
00091     polyPatch(pp, bm, index, newSize, newStart),
00092     actualTypeName_(pp.actualTypeName_),
00093     dict_(pp.dict_)
00094 {}
00095 
00096 
00097 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00098 
00099 Foam::genericPolyPatch::~genericPolyPatch()
00100 {}
00101 
00102 
00103 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00104 
00105 void Foam::genericPolyPatch::write(Ostream& os) const
00106 {
00107     os.writeKeyword("type") << actualTypeName_ << token::END_STATEMENT << nl;
00108     patchIdentifier::write(os);
00109     os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl;
00110     os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl;
00111 
00112     for
00113     (
00114         dictionary::const_iterator iter = dict_.begin();
00115         iter != dict_.end();
00116         ++iter
00117     )
00118     {
00119         if
00120         (
00121             iter().keyword() != "type"
00122          && iter().keyword() != "nFaces"
00123          && iter().keyword() != "startFace"
00124         )
00125         {
00126             iter().write(os);
00127         }
00128     }
00129 }
00130 
00131 
00132 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd