initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / molecularDynamics / potential / pairPotential / pairPotentialList / pairPotentialList.H
blobb4193a46ae49df57ed5cbcda74f8657e4cdcece4
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::pairPotentialList
28 Description
30 SourceFiles
31     pairPotentialListI.H
32     pairPotentialList.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef pairPotentialList_H
37 #define pairPotentialList_H
39 #include "PtrList.H"
40 #include "word.H"
41 #include "pairPotential.H"
42 #include "polyMesh.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                       Class pairPotentialList Declaration
51 \*---------------------------------------------------------------------------*/
53 class pairPotentialList
55     public PtrList<pairPotential>
57     // Private data
59         label nIds_;
61         scalar rCutMax_;
63         scalar rCutMaxSqr_;
65         autoPtr<pairPotential> electrostaticPotential_;
68     // Private Member Functions
70         inline label pairPotentialIndex
71         (
72             const label a,
73             const label b
74         ) const;
76         void readPairPotentialDict
77         (
78             const List<word>& idList,
79             const dictionary& pairPotentialDict,
80             const polyMesh& mesh
81         );
83         //- Disallow default bitwise assignment
84         void operator=(const pairPotentialList&);
86         //- Disallow default bitwise copy construct
87         pairPotentialList(const pairPotentialList&);
90 public:
92     // Constructors
94         pairPotentialList();
96         //- Construct from idList and potental dictionaries
97         pairPotentialList
98         (
99             const List<word>& idList,
100             const dictionary& pairPotentialDict,
101             const polyMesh& mesh
102         );
105     // Destructor
107         ~pairPotentialList();
110     // Member Functions
112         void buildPotentials
113         (
114             const List<word>& idList,
115             const dictionary& pairPotentialDict,
116             const polyMesh& mesh
117         );
120         // Access
122             inline scalar rCutMax() const;
124             inline scalar rCutMaxSqr() const;
126             bool rCutMaxSqr(scalar rIJMagSqr) const;
128             const pairPotential& pairPotentialFunction
129             (
130                 const label a,
131                 const label b
132             ) const;
134             // Return true if rIJ is within rCut for this pair.
135             bool rCutSqr
136             (
137                 const label a,
138                 const label b,
139                 const scalar rIJMagSqr
140             ) const;
142             scalar rMin(const label a, const label b) const;
144             scalar dr(const label a, const label b) const;
146             scalar rCutSqr(const label a, const label b) const;
148             scalar rCut(const label a, const label b) const;
150             scalar force
151             (
152                 const label a,
153                 const label b,
154                 const scalar rIJMag
155             ) const;
157             scalar energy
158             (
159                 const label a,
160                 const label b,
161                 const scalar rIJMag
162             ) const;
164             inline const pairPotential& electrostatic() const;
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 } // End namespace Foam
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 #include "pairPotentialListI.H"
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 #endif
180 // ************************************************************************* //