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) 2011 OpenFOAM Foundation
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 "PtrList.H"
39 #include "word.H"
40 #include "pairPotential.H"
41 #include "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
106 
107 
108  // Member Functions
109 
110  void buildPotentials
111  (
112  const List<word>& idList,
113  const dictionary& pairPotentialDict,
114  const polyMesh& mesh
115  );
116 
117 
118  // Access
119 
120  inline scalar rCutMax() const;
121 
122  inline scalar rCutMaxSqr() const;
123 
124  bool rCutMaxSqr(scalar rIJMagSqr) const;
125 
127  (
128  const label a,
129  const label b
130  ) const;
131 
132  // Return true if rIJ is within rCut for this pair.
133  bool rCutSqr
134  (
135  const label a,
136  const label b,
137  const scalar rIJMagSqr
138  ) const;
139 
140  scalar rMin(const label a, const label b) const;
141 
142  scalar dr(const label a, const label b) const;
143 
144  scalar rCutSqr(const label a, const label b) const;
145 
146  scalar rCut(const label a, const label b) const;
147 
148  scalar force
149  (
150  const label a,
151  const label b,
152  const scalar rIJMag
153  ) const;
154 
155  scalar energy
156  (
157  const label a,
158  const label b,
159  const scalar rIJMag
160  ) const;
161 
162  inline const pairPotential& electrostatic() const;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #include "pairPotentialListI.H"
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
const pairPotential & electrostatic() const
scalar dr(const label a, const label b) const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
scalar rMin(const label a, const label b) const
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
scalar force(const label a, const label b, const scalar rIJMag) const
bool rCutSqr(const label a, const label b, const scalar rIJMagSqr) const
dynamicFvMesh & mesh
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
const pairPotential & pairPotentialFunction(const label a, const label b) const
void buildPotentials(const List< word > &idList, const dictionary &pairPotentialDict, const polyMesh &mesh)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:62
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
~pairPotentialList()
Destructor.
scalar energy(const label a, const label b, const scalar rIJMag) const
scalar rCut(const label a, const label b) const
Namespace for OpenFOAM.