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

pointBoundaryMesh.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 "pointBoundaryMesh.H"
00028 #include "polyBoundaryMesh.H"
00029 #include "facePointPatch.H"
00030 #include "globalPointPatch.H"
00031 
00032 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00033 
00034 Foam::pointBoundaryMesh::pointBoundaryMesh
00035 (
00036     const pointMesh& m,
00037     const polyBoundaryMesh& basicBdry
00038 )
00039 :
00040     pointPatchList(basicBdry.size()),
00041     mesh_(m)
00042 {
00043     // Set boundary patches
00044     pointPatchList& Patches = *this;
00045 
00046     forAll(Patches, patchI)
00047     {
00048         Patches.set
00049         (
00050             patchI,
00051             facePointPatch::New(basicBdry[patchI], *this).ptr()
00052         );
00053     }
00054 }
00055 
00056 
00057 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00058 
00059 void Foam::pointBoundaryMesh::calcGeometry()
00060 {
00061     forAll(*this, patchi)
00062     {
00063         operator[](patchi).initGeometry();
00064     }
00065 
00066     forAll(*this, patchi)
00067     {
00068         operator[](patchi).calcGeometry();
00069     }
00070 }
00071 
00072 
00073 const Foam::globalPointPatch&
00074 Foam::pointBoundaryMesh::globalPatch() const
00075 {
00076     const pointPatchList& patches = *this;
00077 
00078     forAll (patches, patchI)
00079     {
00080         if (isType<globalPointPatch>(patches[patchI]))
00081         {
00082             return refCast<const globalPointPatch>(patches[patchI]);
00083         }
00084     }
00085 
00086     FatalErrorIn
00087     (
00088         "const pointBoundaryMesh::"
00089         "globalPointPatch& globalPatch() const"
00090     )   << "patch not found."
00091         << abort(FatalError);
00092 
00093     // Dummy return
00094     return refCast<const globalPointPatch>(patches[0]);
00095 }
00096 
00097 
00098 void Foam::pointBoundaryMesh::movePoints(const pointField& p)
00099 {
00100     pointPatchList& patches = *this;
00101 
00102     forAll(patches, patchi)
00103     {
00104         patches[patchi].initMovePoints(p);
00105     }
00106 
00107     forAll(patches, patchi)
00108     {
00109         patches[patchi].movePoints(p);
00110     }
00111 }
00112 
00113 
00114 void Foam::pointBoundaryMesh::updateMesh()
00115 {
00116     pointPatchList& patches = *this;
00117 
00118     forAll(patches, patchi)
00119     {
00120         patches[patchi].initUpdateMesh();
00121     }
00122 
00123     forAll(patches, patchi)
00124     {
00125         patches[patchi].updateMesh();
00126     }
00127 }
00128 
00129 
00130 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd