initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / molecularDynamics / molecule / interactionLists / interactionLists.H
blob744b59b067a17867b1cd4906281183f9c30d6f6a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::interactionLists
28 Description
30 SourceFiles
31     interactionListsI.H
32     interactionLists.C
33     interactionListsIO.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef interactionLists_H
38 #define interactionLists_H
40 #include "polyMesh.H"
41 #include "vector2D.H"
42 #include "directInteractionList.H"
43 #include "referredCell.H"
44 #include "referredCellList.H"
45 #include "sendingReferralList.H"
46 #include "receivingReferralList.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 /*---------------------------------------------------------------------------*\
55                        Class interactionLists Declaration
56 \*---------------------------------------------------------------------------*/
58 class interactionLists
60     // Private data
62         const polyMesh& mesh_;
64         scalar rCutMaxSqr_;
66         directInteractionList dil_;
68         referredCellList ril_;
70         List<sendingReferralList> cellSendingReferralLists_;
72         List<receivingReferralList> cellReceivingReferralLists_;
75     // Private Member Functions
77         //- Build referralLists which define how to send information
78         // to referredCells to source cells
79         void buildCellReferralLists();
81         //- Disallow default bitwise copy construct
82         interactionLists(const interactionLists&);
84         //- Disallow default bitwise assignment
85         void operator=(const interactionLists&);
88 public:
90     // Static data members
92         //- Tolerance for checking that faces on a patch segment
93         static scalar transTol;
96     // Constructors
98         //- Construct and create all information from the mesh
99         interactionLists
100         (
101             const polyMesh& mesh,
102             scalar rCutMaxSqr,
103             bool pointPointListBuild = false
104         );
106         //- Construct from file
107         interactionLists(const polyMesh& mesh);
110     // Destructor
112         ~interactionLists();
115     // Member Functions
117             bool testPointPointDistance
118             (
119                 const label ptI,
120                 const label ptJ
121             ) const;
123             bool testPointFaceDistance
124             (
125                 const label p,
126                 const label faceNo
127             ) const;
129             bool testPointFaceDistance
130             (
131                 const label p,
132                 const referredCell& refCell
133             ) const;
135             bool testPointFaceDistance
136             (
137                 const vectorList& pointsToTest,
138                 const label faceNo
139             ) const;
141             bool testPointFaceDistance
142             (
143                 const vector& p,
144                 const label faceNo
145             ) const;
147             bool testPointFaceDistance
148             (
149                 const vector& p,
150                 const labelList& faceToTest,
151                 const vectorList& points,
152                 const vector& faceC,
153                 const vector& faceA
154             ) const;
156             bool testEdgeEdgeDistance
157             (
158                 const edge& eI,
159                 const edge& eJ
160             ) const;
162             bool testEdgeEdgeDistance
163             (
164                 const edge& eI,
165                 const vector& eJs,
166                 const vector& eJe
167             ) const;
169             const labelList realCellsInRangeOfSegment
170             (
171                 const labelList& segmentFaces,
172                 const labelList& segmentEdges,
173                 const labelList& segmentPoints
174             ) const;
176             const labelList referredCellsInRangeOfSegment
177             (
178                 const List<referredCell>& referredInteractionList,
179                 const labelList& segmentFaces,
180                 const labelList& segmentEdges,
181                 const labelList& segmentPoints
182             ) const;
185         // Access
187             inline const polyMesh& mesh() const;
189             inline const directInteractionList& dil() const;
191             inline const referredCellList& ril() const;
192             inline referredCellList& ril();
194             inline const List<sendingReferralList>&
195                 cellSendingReferralLists() const;
197             inline const List<receivingReferralList>&
198                 cellReceivingReferralLists() const;
200             inline label nInteractingProcs() const;
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 } // End namespace Foam
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 #include "interactionListsI.H"
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 #endif
216 // ************************************************************************* //