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

fvBoundaryMesh.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 "fvMesh.H"
00028 #include "fvBoundaryMesh.H"
00029 
00030 
00031 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00032 
00033 namespace Foam
00034 {
00035 
00036 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00037 
00038 void fvBoundaryMesh::addPatches(const polyBoundaryMesh& basicBdry)
00039 {
00040     setSize(basicBdry.size());
00041 
00042     // Set boundary patches
00043     fvPatchList& Patches = *this;
00044 
00045     forAll(Patches, patchI)
00046     {
00047         Patches.set(patchI, fvPatch::New(basicBdry[patchI], *this));
00048     }
00049 }
00050 
00051     
00052 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00053 
00054 fvBoundaryMesh::fvBoundaryMesh
00055 (
00056     const fvMesh& m
00057 )
00058 :
00059     fvPatchList(0),
00060     mesh_(m)
00061 {}
00062 
00063 
00064 fvBoundaryMesh::fvBoundaryMesh
00065 (
00066     const fvMesh& m,
00067     const polyBoundaryMesh& basicBdry
00068 )
00069 :
00070     fvPatchList(basicBdry.size()),
00071     mesh_(m)
00072 {
00073     addPatches(basicBdry);
00074 }
00075 
00076 
00077 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00078 
00079 void fvBoundaryMesh::movePoints()
00080 {
00081     forAll(*this, patchi)
00082     {
00083         operator[](patchi).initMovePoints();
00084     }
00085 
00086     forAll(*this, patchi)
00087     {
00088         operator[](patchi).movePoints();
00089     }
00090 }
00091 
00092 
00093 lduInterfacePtrsList fvBoundaryMesh::interfaces() const
00094 {
00095     lduInterfacePtrsList interfaces(size());
00096 
00097     forAll (interfaces, patchi)
00098     {
00099         if (isA<lduInterface>(this->operator[](patchi)))
00100         {
00101             interfaces.set
00102             (
00103                 patchi,
00104                &refCast<const lduInterface>(this->operator[](patchi))
00105             );
00106         }
00107     }
00108 
00109     return interfaces;
00110 }
00111 
00112 
00113 void fvBoundaryMesh::readUpdate(const polyBoundaryMesh& basicBdry)
00114 {
00115     clear();
00116     addPatches(basicBdry);
00117 }
00118 
00119 
00120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00121 
00122 } // End namespace Foam
00123 
00124 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd