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

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