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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::pairPotentialList
28
29Description
30
31SourceFiles
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
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class pairPotentialList Declaration
52\*---------------------------------------------------------------------------*/
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
91public:
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// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
scalar energy(const label a, const label b, const scalar rIJMag) const
scalar force(const label a, const label b, const scalar rIJMag) const
scalar rCut(const label a, const label b) const
const pairPotential & electrostatic() const
bool rCutSqr(const label a, const label b, const scalar rIJMagSqr) const
scalar dr(const label a, const label b) const
void buildPotentials(const List< word > &idList, const dictionary &pairPotentialDict, const polyMesh &mesh)
const pairPotential & pairPotentialFunction(const label a, const label b) const
scalar rMin(const label a, const label b) const
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
dynamicFvMesh & mesh
Namespace for OpenFOAM.
volScalarField & b
Definition: createFields.H:27