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

interactionLists.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) 2008-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::interactionLists
00027 
00028 Description
00029 
00030 SourceFiles
00031     interactionListsI.H
00032     interactionLists.C
00033     interactionListsIO.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef interactionLists_H
00038 #define interactionLists_H
00039 
00040 #include "polyMesh.H"
00041 #include "vector2D.H"
00042 #include "directInteractionList.H"
00043 #include "referredCell.H"
00044 #include "referredCellList.H"
00045 #include "sendingReferralList.H"
00046 #include "receivingReferralList.H"
00047 
00048 
00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00050 
00051 namespace Foam
00052 {
00053 
00054 /*---------------------------------------------------------------------------*\
00055                        Class interactionLists Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 class interactionLists
00059 {
00060     // Private data
00061 
00062         const polyMesh& mesh_;
00063 
00064         scalar rCutMaxSqr_;
00065 
00066         directInteractionList dil_;
00067 
00068         referredCellList ril_;
00069 
00070         List<sendingReferralList> cellSendingReferralLists_;
00071 
00072         List<receivingReferralList> cellReceivingReferralLists_;
00073 
00074 
00075     // Private Member Functions
00076 
00077         //- Build referralLists which define how to send information
00078         // to referredCells to source cells
00079         void buildCellReferralLists();
00080 
00081         //- Disallow default bitwise copy construct
00082         interactionLists(const interactionLists&);
00083 
00084         //- Disallow default bitwise assignment
00085         void operator=(const interactionLists&);
00086 
00087 
00088 public:
00089 
00090     // Static data members
00091 
00092         //- Tolerance for checking that faces on a patch segment
00093         static scalar transTol;
00094 
00095 
00096     // Constructors
00097 
00098         //- Construct and create all information from the mesh
00099         interactionLists
00100         (
00101             const polyMesh& mesh,
00102             scalar rCutMaxSqr,
00103             bool pointPointListBuild = false
00104         );
00105 
00106         //- Construct from file
00107         interactionLists(const polyMesh& mesh);
00108 
00109 
00110     // Destructor
00111 
00112         ~interactionLists();
00113 
00114 
00115     // Member Functions
00116 
00117             bool testPointPointDistance
00118             (
00119                 const label ptI,
00120                 const label ptJ
00121             ) const;
00122 
00123             bool testPointFaceDistance
00124             (
00125                 const label p,
00126                 const label faceNo
00127             ) const;
00128 
00129             bool testPointFaceDistance
00130             (
00131                 const label p,
00132                 const referredCell& refCell
00133             ) const;
00134 
00135             bool testPointFaceDistance
00136             (
00137                 const vectorList& pointsToTest,
00138                 const label faceNo
00139             ) const;
00140 
00141             bool testPointFaceDistance
00142             (
00143                 const vector& p,
00144                 const label faceNo
00145             ) const;
00146 
00147             bool testPointFaceDistance
00148             (
00149                 const vector& p,
00150                 const labelList& faceToTest,
00151                 const vectorList& points,
00152                 const vector& faceC,
00153                 const vector& faceA
00154             ) const;
00155 
00156             bool testEdgeEdgeDistance
00157             (
00158                 const edge& eI,
00159                 const edge& eJ
00160             ) const;
00161 
00162             bool testEdgeEdgeDistance
00163             (
00164                 const edge& eI,
00165                 const vector& eJs,
00166                 const vector& eJe
00167             ) const;
00168 
00169             const labelList realCellsInRangeOfSegment
00170             (
00171                 const labelList& segmentFaces,
00172                 const labelList& segmentEdges,
00173                 const labelList& segmentPoints
00174             ) const;
00175 
00176             const labelList referredCellsInRangeOfSegment
00177             (
00178                 const List<referredCell>& referredInteractionList,
00179                 const labelList& segmentFaces,
00180                 const labelList& segmentEdges,
00181                 const labelList& segmentPoints
00182             ) const;
00183 
00184 
00185         // Access
00186 
00187             inline const polyMesh& mesh() const;
00188 
00189             inline const directInteractionList& dil() const;
00190 
00191             inline const referredCellList& ril() const;
00192             inline referredCellList& ril();
00193 
00194             inline const List<sendingReferralList>&
00195                 cellSendingReferralLists() const;
00196 
00197             inline const List<receivingReferralList>&
00198                 cellReceivingReferralLists() const;
00199 
00200             inline label nInteractingProcs() const;
00201 };
00202 
00203 
00204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00205 
00206 } // End namespace Foam
00207 
00208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00209 
00210 #include "interactionListsI.H"
00211 
00212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00213 
00214 #endif
00215 
00216 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd