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

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