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

smoothDeltaDeltaDataI.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-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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00028 
00029 namespace Foam
00030 {
00031 
00032 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00033 
00034 
00035 // Update this with w2 if applicable
00036 inline bool smoothDelta::deltaData::update
00037 (
00038     const smoothDelta::deltaData& w2,
00039     const scalar scale,
00040     const scalar tol
00041 )
00042 {   
00043     if (!valid() || (delta_ < VSMALL))
00044     {
00045         // My delta not set. Take over neighbour.
00046         delta_ = w2.delta()/scale;
00047 
00048         // Something changed. Let caller know.
00049         return true;
00050     }
00051     else if (w2.delta() > (1 + tol)*scale*delta_)
00052     {
00053         // Neighbour is too big for me. Up my delta.
00054         delta_ = w2.delta()/scale;
00055 
00056         // Something changed. Let caller know.
00057         return true;
00058     }
00059     else
00060     {
00061         // Neighbour is not too big for me or change is too small
00062         // Nothing changed.
00063         return false;
00064     }
00065 }
00066     
00067 
00068 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00069 
00070 // Null constructor
00071 inline smoothDelta::deltaData::deltaData()
00072 :
00073     delta_(-GREAT)
00074 {}
00075 
00076 
00077 // Construct from components
00078 inline smoothDelta::deltaData::deltaData(const scalar delta)
00079 :
00080     delta_(delta)
00081 {}
00082 
00083 
00084 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00085 
00086 inline bool smoothDelta::deltaData::valid() const
00087 {
00088     return delta_ > -SMALL;
00089 }
00090 
00091 
00092 // Checks for cyclic faces
00093 inline bool smoothDelta::deltaData::sameGeometry
00094 (
00095     const polyMesh&,
00096     const deltaData&,
00097     const scalar
00098 ) const
00099 {
00100     return true;
00101 }
00102 
00103 
00104 inline void smoothDelta::deltaData::leaveDomain
00105 (
00106     const polyMesh&,
00107     const polyPatch&,
00108     const label,
00109     const point&
00110 )
00111 {}
00112 
00113 
00114 inline void smoothDelta::deltaData::transform
00115 (
00116     const polyMesh&,
00117     const tensor&
00118 )
00119 {}
00120 
00121 
00122 // Update absolute geometric quantities.
00123 inline void smoothDelta::deltaData::enterDomain
00124 (
00125     const polyMesh&,
00126     const polyPatch&,
00127     const label,
00128     const point&
00129 )
00130 {}
00131 
00132 
00133 // Update this (cellI) with face information.
00134 inline bool smoothDelta::deltaData::updateCell
00135 (
00136     const polyMesh&,
00137     const label,
00138     const label,
00139     const deltaData& neighbourWallInfo,
00140     const scalar tol
00141 )
00142 {
00143     // Take over info from face if more than deltaRatio larger.
00144     return update(neighbourWallInfo, maxDeltaRatio, tol);
00145 }    
00146 
00147 
00148 // Update this (face) with cell information.
00149 inline bool smoothDelta::deltaData::updateFace
00150 (
00151     const polyMesh&,
00152     const label,
00153     const label,
00154     const deltaData& neighbourWallInfo,
00155     const scalar tol
00156 )
00157 {
00158     // Take over information from cell without any scaling (scale = 1.0)
00159     return update(neighbourWallInfo, 1.0, tol);
00160 }    
00161 
00162 
00163 // Update this (face) with coupled face information.
00164 inline bool smoothDelta::deltaData::updateFace
00165 (
00166     const polyMesh&,
00167     const label,
00168     const deltaData& neighbourWallInfo,
00169     const scalar tol
00170 )
00171 {
00172     // Take over information from coupled face without any scaling (scale = 1.0)
00173     return update(neighbourWallInfo, 1.0, tol);
00174 }    
00175 
00176 
00177 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
00178 
00179 inline bool smoothDelta::deltaData::operator==
00180 (
00181     const deltaData& rhs
00182 ) const
00183 {
00184     return delta_ == rhs.delta();
00185 }
00186 
00187 
00188 inline bool smoothDelta::deltaData::operator!=
00189 (
00190     const deltaData& rhs
00191 ) const
00192 {
00193     return !(*this == rhs);
00194 }
00195 
00196 
00197 // ************************************************************************* //
00198 
00199 } // End namespace Foam
00200 
00201 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd