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

sumData.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 Class
00026     Foam::sumData
00027 
00028 Description
00029     Sums data while walking across cells. Used in collapsing fields.
00030 
00031 SourceFiles
00032     sumDataI.H
00033     sumData.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef sumData_H
00038 #define sumData_H
00039 
00040 #include "point.H"
00041 #include "tensor.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 class polyPatch;
00049 class polyMesh;
00050 
00051 /*---------------------------------------------------------------------------*\
00052                            Class sumData Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class sumData
00056 {
00057     // Private data
00058 
00059         //- Previous face
00060         label oldFace_;
00061 
00062         //- summed data
00063         scalar sum_;
00064 
00065         //- number of items summed
00066         label count_;
00067 
00068 public:
00069 
00070     // Constructors
00071 
00072         //- Construct null
00073         inline sumData();
00074 
00075         //- Construct from count
00076         inline sumData
00077         (
00078             const label oldFace,
00079             const scalar sum,
00080             const label count
00081         );
00082 
00083 
00084     // Member Functions
00085 
00086         // Access
00087 
00088             inline label oldFace() const
00089             {
00090                 return oldFace_;
00091             }
00092 
00093             inline scalar sum() const
00094             {
00095                 return sum_;
00096             }
00097 
00098             inline label count() const
00099             {
00100                 return count_;
00101             }
00102 
00103 
00104         // Needed by FaceCellWave
00105 
00106             //- Check whether origin has been changed at all or
00107             //  still contains original (invalid) value.
00108             inline bool valid() const;
00109 
00110             //- Check for identical geometrical data. Used for cyclics checking.
00111             inline bool sameGeometry
00112             (
00113                 const polyMesh&,
00114                 const sumData&,
00115                 const scalar
00116             ) const;
00117 
00118             //- Convert any absolute coordinates into relative to (patch)face
00119             //  centre
00120             inline void leaveDomain
00121             (
00122                 const polyMesh&,
00123                 const polyPatch&,
00124                 const label patchFaceI,
00125                 const point& faceCentre
00126             );
00127 
00128             //- Reverse of leaveDomain
00129             inline void enterDomain
00130             (
00131                 const polyMesh&,
00132                 const polyPatch&,
00133                 const label patchFaceI,
00134                 const point& faceCentre
00135             );
00136 
00137             //- Apply rotation matrix to any coordinates
00138             inline void transform
00139             (
00140                 const polyMesh&,
00141                 const tensor&
00142             );
00143 
00144             //- Influence of neighbouring face.
00145             inline bool updateCell
00146             (
00147                 const polyMesh&,
00148                 const label thisCellI,
00149                 const label neighbourFaceI,
00150                 const sumData& neighbourInfo,
00151                 const scalar tol
00152             );
00153 
00154             //- Influence of neighbouring cell.
00155             inline bool updateFace
00156             (
00157                 const polyMesh&,
00158                 const label thisFaceI,
00159                 const label neighbourCellI,
00160                 const sumData& neighbourInfo,
00161                 const scalar tol
00162             );
00163 
00164             //- Influence of different value on same face.
00165             inline bool updateFace
00166             (
00167                 const polyMesh&,
00168                 const label thisFaceI,
00169                 const sumData& neighbourInfo,
00170                 const scalar tol
00171             );
00172 
00173     // Member Operators
00174 
00175         // Needed for List IO
00176         inline bool operator==(const sumData&) const;
00177 
00178         inline bool operator!=(const sumData&) const;
00179 
00180 
00181     // IOstream Operators
00182 
00183         friend Ostream& operator<<(Ostream&, const sumData&);
00184         friend Istream& operator>>(Istream&, sumData&);
00185 };
00186 
00187 
00188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00189 
00190 } // End namespace Foam
00191 
00192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00193 
00194 #include "sumDataI.H"
00195 
00196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00197 
00198 #endif
00199 
00200 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd