FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-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 \*---------------------------------------------------------------------------*/
00025 
00026 #include "genericPolyPatch.H"
00027 #include <OpenFOAM/addToRunTimeSelectionTable.H>
00028 
00029 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033     defineTypeNameAndDebug(genericPolyPatch, 0);
00034 
00035     addToRunTimeSelectionTable(polyPatch, genericPolyPatch, word);
00036     addToRunTimeSelectionTable(polyPatch, genericPolyPatch, dictionary);
00037 }
00038 
00039 
00040 // * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * * * * * //
00041 
00042 Foam::genericPolyPatch::genericPolyPatch
00043 (
00044     const word& name,
00045     const label size,
00046     const label start,
00047     const label index,
00048     const polyBoundaryMesh& bm
00049 )
00050 :
00051     polyPatch(name, size, start, index, bm)
00052 {}
00053 
00054 
00055 Foam::genericPolyPatch::genericPolyPatch
00056 (
00057     const word& name,
00058     const dictionary& dict,
00059     const label index,
00060     const polyBoundaryMesh& bm
00061 )
00062 :
00063     polyPatch(name, dict, index, bm),
00064     actualTypeName_(dict.lookup("type")),
00065     dict_(dict)
00066 {}
00067 
00068 
00069 Foam::genericPolyPatch::genericPolyPatch
00070 (
00071     const genericPolyPatch& pp,
00072     const polyBoundaryMesh& bm
00073 )
00074 :
00075     polyPatch(pp, bm),
00076     actualTypeName_(pp.actualTypeName_),
00077     dict_(pp.dict_)
00078 {}
00079 
00080 
00081 Foam::genericPolyPatch::genericPolyPatch
00082 (
00083     const genericPolyPatch& pp,
00084     const polyBoundaryMesh& bm,
00085     const label index,
00086     const label newSize,
00087     const label newStart
00088 )
00089 :
00090     polyPatch(pp, bm, index, newSize, newStart),
00091     actualTypeName_(pp.actualTypeName_),
00092     dict_(pp.dict_)
00093 {}
00094 
00095 
00096 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00097 
00098 Foam::genericPolyPatch::~genericPolyPatch()
00099 {}
00100 
00101 
00102 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00103 
00104 void Foam::genericPolyPatch::write(Ostream& os) const
00105 {
00106     os.writeKeyword("type") << actualTypeName_ << token::END_STATEMENT << nl;
00107     patchIdentifier::write(os);
00108     os.writeKeyword("nFaces") << size() << token::END_STATEMENT << nl;
00109     os.writeKeyword("startFace") << start() << token::END_STATEMENT << nl;
00110 
00111     for
00112     (
00113         dictionary::const_iterator iter = dict_.begin();
00114         iter != dict_.end();
00115         ++iter
00116     )
00117     {
00118         if
00119         (
00120             iter().keyword() != "type"
00121          && iter().keyword() != "nFaces"
00122          && iter().keyword() != "startFace"
00123         )
00124         {
00125             iter().write(os);
00126         }
00127     }
00128 }
00129 
00130 
00131 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines