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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::pairPotentialList
28 
29 Description
30 
31 SourceFiles
32  pairPotentialListI.H
33  pairPotentialList.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef pairPotentialList_H
38 #define pairPotentialList_H
39 
40 #include "PtrList.H"
41 #include "word.H"
42 #include "pairPotential.H"
43 #include "polyMesh.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class pairPotentialList Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public PtrList<pairPotential>
57 {
58  // Private data
59 
60  label nIds_;
61 
62  scalar rCutMax_;
63 
64  scalar rCutMaxSqr_;
65 
66  autoPtr<pairPotential> electrostaticPotential_;
67 
68 
69  // Private Member Functions
70 
71  inline label pairPotentialIndex
72  (
73  const label a,
74  const label b
75  ) const;
76 
77  void readPairPotentialDict
78  (
79  const List<word>& idList,
80  const dictionary& pairPotentialDict,
81  const polyMesh& mesh
82  );
83 
84  //- No copy construct
85  pairPotentialList(const pairPotentialList&) = delete;
86 
87  //- No copy assignment
88  void operator=(const pairPotentialList&) = delete;
89 
90 
91 public:
92 
93  // Constructors
94 
96 
97  //- Construct from idList and potential dictionaries
99  (
100  const List<word>& idList,
101  const dictionary& pairPotentialDict,
102  const polyMesh& mesh
103  );
104 
105 
106  //- Destructor
108 
109 
110  // Member Functions
111 
112  void buildPotentials
113  (
114  const List<word>& idList,
115  const dictionary& pairPotentialDict,
116  const polyMesh& mesh
117  );
118 
119 
120  // Access
121 
122  inline scalar rCutMax() const;
123 
124  inline scalar rCutMaxSqr() const;
125 
126  bool rCutMaxSqr(scalar rIJMagSqr) const;
127 
129  (
130  const label a,
131  const label b
132  ) const;
133 
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;
141 
142  scalar rMin(const label a, const label b) const;
143 
144  scalar dr(const label a, const label b) const;
145 
146  scalar rCutSqr(const label a, const label b) const;
147 
148  scalar rCut(const label a, const label b) const;
149 
150  scalar force
151  (
152  const label a,
153  const label b,
154  const scalar rIJMag
155  ) const;
156 
157  scalar energy
158  (
159  const label a,
160  const label b,
161  const scalar rIJMag
162  ) const;
163 
164  inline const pairPotential& electrostatic() const;
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #include "pairPotentialListI.H"
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #endif
179 
180 // ************************************************************************* //
Foam::pairPotentialList
Definition: pairPotentialList.H:53
Foam::pairPotentialList::rCut
scalar rCut(const label a, const label b) const
Definition: pairPotentialList.C:302
Foam::pairPotentialList::electrostatic
const pairPotential & electrostatic() const
Definition: pairPotentialListI.H:74
polyMesh.H
pairPotentialListI.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::pairPotentialList::rCutMaxSqr
scalar rCutMaxSqr() const
Definition: pairPotentialListI.H:68
Foam::pairPotentialList::rCutSqr
bool rCutSqr(const label a, const label b, const scalar rIJMagSqr) const
Definition: pairPotentialList.C:256
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::pairPotentialList::energy
scalar energy(const label a, const label b, const scalar rIJMag) const
Definition: pairPotentialList.C:325
Foam::pairPotentialList::~pairPotentialList
~pairPotentialList()
Destructor.
Definition: pairPotentialList.C:213
Foam::pairPotentialList::rMin
scalar rMin(const label a, const label b) const
Definition: pairPotentialList.C:272
Foam::pairPotentialList::dr
scalar dr(const label a, const label b) const
Definition: pairPotentialList.C:282
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::pairPotential
Definition: pairPotential.H:60
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pairPotentialList::force
scalar force(const label a, const label b, const scalar rIJMag) const
Definition: pairPotentialList.C:312
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::pairPotentialList::rCutMax
scalar rCutMax() const
Definition: pairPotentialListI.H:62
Foam::pairPotentialList::pairPotentialFunction
const pairPotential & pairPotentialFunction(const label a, const label b) const
Definition: pairPotentialList.C:235
Foam::List< word >
PtrList.H
word.H
Foam::pairPotentialList::buildPotentials
void buildPotentials(const List< word > &idList, const dictionary &pairPotentialDict, const polyMesh &mesh)
Definition: pairPotentialList.C:220
Foam::pairPotentialList::pairPotentialList
pairPotentialList()
Definition: pairPotentialList.C:192
pairPotential.H