FreeFOAM The Cross-Platform CFD Toolkit
pairPotentialList.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::pairPotentialList
26 
27 Description
28 
29 SourceFiles
30  pairPotentialListI.H
31  pairPotentialList.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef pairPotentialList_H
36 #define pairPotentialList_H
37 
38 #include <OpenFOAM/PtrList.H>
39 #include <OpenFOAM/word.H>
41 #include <OpenFOAM/polyMesh.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class pairPotentialList Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public PtrList<pairPotential>
55 {
56  // Private data
57 
58  label nIds_;
59 
60  scalar rCutMax_;
61 
62  scalar rCutMaxSqr_;
63 
64  autoPtr<pairPotential> electrostaticPotential_;
65 
66 
67  // Private Member Functions
68 
69  inline label pairPotentialIndex
70  (
71  const label a,
72  const label b
73  ) const;
74 
75  void readPairPotentialDict
76  (
77  const List<word>& idList,
78  const dictionary& pairPotentialDict,
79  const polyMesh& mesh
80  );
81 
82  //- Disallow default bitwise assignment
83  void operator=(const pairPotentialList&);
84 
85  //- Disallow default bitwise copy construct
87 
88 
89 public:
90 
91  // Constructors
92 
94 
95  //- Construct from idList and potental dictionaries
97  (
98  const List<word>& idList,
99  const dictionary& pairPotentialDict,
100  const polyMesh& mesh
101  );
102 
103 
104  // Destructor
105 
107 
108 
109  // Member Functions
110 
111  void buildPotentials
112  (
113  const List<word>& idList,
114  const dictionary& pairPotentialDict,
115  const polyMesh& mesh
116  );
117 
118 
119  // Access
120 
121  inline scalar rCutMax() const;
122 
123  inline scalar rCutMaxSqr() const;
124 
125  bool rCutMaxSqr(scalar rIJMagSqr) const;
126 
128  (
129  const label a,
130  const label b
131  ) const;
132 
133  // Return true if rIJ is within rCut for this pair.
134  bool rCutSqr
135  (
136  const label a,
137  const label b,
138  const scalar rIJMagSqr
139  ) const;
140 
141  scalar rMin(const label a, const label b) const;
142 
143  scalar dr(const label a, const label b) const;
144 
145  scalar rCutSqr(const label a, const label b) const;
146 
147  scalar rCut(const label a, const label b) const;
148 
149  scalar force
150  (
151  const label a,
152  const label b,
153  const scalar rIJMag
154  ) const;
155 
156  scalar energy
157  (
158  const label a,
159  const label b,
160  const scalar rIJMag
161  ) const;
162 
163  inline const pairPotential& electrostatic() const;
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************ vim: set sw=4 sts=4 et: ************************ //