pairPotentialList.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 
83 public:
84 
85  // Constructors
86 
88 
89  //- Construct from idList and potential dictionaries
91  (
92  const List<word>& idList,
93  const dictionary& pairPotentialDict,
94  const polyMesh& mesh
95  );
96 
97  //- Disallow default bitwise assignment
98  void operator=(const pairPotentialList&) = delete;
99 
100 
101  //- Destructor
103 
104 
105  // Member Functions
106 
107  void buildPotentials
108  (
109  const List<word>& idList,
110  const dictionary& pairPotentialDict,
111  const polyMesh& mesh
112  );
113 
114 
115  // Access
116 
117  inline scalar rCutMax() const;
118 
119  inline scalar rCutMaxSqr() const;
120 
121  bool rCutMaxSqr(scalar rIJMagSqr) const;
122 
124  (
125  const label a,
126  const label b
127  ) const;
128 
129  // Return true if rIJ is within rCut for this pair.
130  bool rCutSqr
131  (
132  const label a,
133  const label b,
134  const scalar rIJMagSqr
135  ) const;
136 
137  scalar rMin(const label a, const label b) const;
138 
139  scalar dr(const label a, const label b) const;
140 
141  scalar rCutSqr(const label a, const label b) const;
142 
143  scalar rCut(const label a, const label b) const;
144 
145  scalar force
146  (
147  const label a,
148  const label b,
149  const scalar rIJMag
150  ) const;
151 
152  scalar energy
153  (
154  const label a,
155  const label b,
156  const scalar rIJMag
157  ) const;
158 
159  inline const pairPotential& electrostatic() const;
160 
161 
162  // Member Operators
163 
164  //- Disallow default bitwise copy construction
165  pairPotentialList(const pairPotentialList&) = delete;
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #include "pairPotentialListI.H"
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
bool rCutSqr(const label a, const label b, const scalar rIJMagSqr) const
const dimensionedScalar b
Wien displacement law constant: default SI units: [m K].
Definition: createFields.H:27
fvMesh & mesh
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:70
scalar rMin(const label a, const label b) const
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
scalar dr(const label a, const label b) const
scalar rCut(const label a, const label b) const
~pairPotentialList()
Destructor.
scalar force(const label a, const label b, const scalar rIJMag) const
const pairPotential & electrostatic() const
void operator=(const pairPotentialList &)=delete
Disallow default bitwise assignment.
Namespace for OpenFOAM.
scalar energy(const label a, const label b, const scalar rIJMag) const