OpenFOAM logo
Open Source CFD Toolkit

regionInfoI.H

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-2005 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 Description
00026 
00027 \*---------------------------------------------------------------------------*/
00028 
00029 
00030 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00031 
00032 // Update this with w2 information
00033 inline bool Foam::regionInfo::update
00034 (
00035     const regionInfo& w2,
00036     const label thisFaceI,
00037     const label thisCellI,
00038     const label neighbourFaceI,
00039     const label neighbourCellI
00040 )
00041 {
00042     if (w2.region() == -1)
00043     {
00044         FatalErrorIn
00045         (
00046             "regionInfo::update(const regionInfo&, const label,"
00047             "const label, const label)"
00048         ) << "Problem: w2 is -1" << abort(FatalError);
00049 
00050         return false;
00051     }
00052     else if (region() != -1)
00053     {
00054         // our already set. Stop any transfer
00055         return false;
00056     }
00057     else
00058     {
00059         region_ = w2.region();
00060 
00061         return true;
00062     }
00063 }
00064     
00065 
00066 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00067 
00068 // Null constructor
00069 inline Foam::regionInfo::regionInfo()
00070 :
00071     region_(-1)
00072 {}
00073 
00074 
00075 // Construct from components
00076 inline Foam::regionInfo::regionInfo(const label region)
00077 :
00078     region_(region)
00079 {}
00080 
00081 
00082 // Construct as copy
00083 inline Foam::regionInfo::regionInfo(const regionInfo& w2)
00084 :
00085     region_(w2.region())
00086 {}
00087 
00088 
00089 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00090 
00091 inline bool Foam::regionInfo::valid() const
00092 {
00093     return region_ != -1;
00094 }
00095 
00096 
00097 // No geometric data so never any problem on cyclics
00098 inline bool Foam::regionInfo::sameGeometry
00099 (
00100     const regionInfo&,
00101     const scalar
00102 ) const
00103 {
00104     return true;
00105 }
00106 
00107 
00108 // No geometric data.
00109 inline void Foam::regionInfo::leaveDomain
00110 (
00111     const polyPatch& patch,
00112     const label patchFaceI,
00113     const point& faceCentre
00114 )
00115 {}
00116 
00117 
00118 // No geometric data.
00119 inline void Foam::regionInfo::transform(const tensor& rotTensor)
00120 {}
00121 
00122 
00123 // No geometric data.
00124 inline void Foam::regionInfo::enterDomain
00125 (
00126     const polyPatch& patch,
00127     const label patchFaceI,
00128     const point& faceCentre
00129 )
00130 {}
00131 
00132 
00133 // Update this with neighbour information
00134 inline bool Foam::regionInfo::updateCell
00135 (
00136     const polyMesh& mesh,
00137     const label thisCellI,
00138     const label neighbourFaceI,
00139     const regionInfo& neighbourInfo,
00140     const scalar tol
00141 )
00142 {
00143     return update
00144     (
00145         neighbourInfo,
00146         -1,
00147         thisCellI,
00148         neighbourFaceI,
00149         -1
00150     );
00151 }    
00152 
00153 
00154 // Update this with neighbour information
00155 inline bool Foam::regionInfo::updateFace
00156 (
00157     const polyMesh& mesh,
00158     const label thisFaceI,
00159     const label neighbourCellI,
00160     const regionInfo& neighbourInfo,
00161     const scalar tol
00162 )
00163 {
00164     return update
00165     (
00166         neighbourInfo,
00167         thisFaceI,
00168         -1,
00169         -1,
00170         neighbourCellI
00171     );
00172 }    
00173 
00174 // Update this with neighbour information
00175 inline bool Foam::regionInfo::updateFace
00176 (
00177     const polyMesh& mesh,
00178     const label thisFaceI,
00179     const regionInfo& neighbourInfo,
00180     const scalar tol
00181 )
00182 {
00183     return update
00184     (
00185         neighbourInfo,
00186         thisFaceI,
00187         -1,
00188         -1,
00189         -1
00190     );
00191 }    
00192 
00193 
00194 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
00195 
00196 inline bool Foam::regionInfo::operator==(const Foam::regionInfo& rhs) const
00197 {
00198     return region() == rhs.region();
00199 }
00200 
00201 
00202 inline bool Foam::regionInfo::operator!=(const Foam::regionInfo& rhs) const
00203 {
00204     return !(*this == rhs);
00205 }
00206 
00207 
00208 // ************************************************************************* //
For further information go to www.openfoam.org