tetherPotentialList.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::tetherPotentialList
28 
29 Description
30 
31 SourceFiles
32  tetherPotentialList.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef tetherPotentialList_H
37 #define tetherPotentialList_H
38 
39 #include "ListOps.H"
40 #include "PtrList.H"
41 #include "word.H"
42 #include "tetherPotential.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class tetherPotentialList Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public PtrList<tetherPotential>
56 {
57  // Private data
58 
59  List<label> idMap_;
60 
61 
62  // Private Member Functions
63 
64  inline label tetherPotentialIndex
65  (
66  const label a
67  ) const;
68 
69  void readTetherPotentialDict
70  (
71  const List<word>& siteIdList,
72  const dictionary& tetherPotentialDict,
73  const List<word>& tetherSiteIdList
74  );
75 
76  //- No copy construct
78 
79  //- No copy assignment
80  void operator=(const tetherPotentialList&) = delete;
81 
82 
83 public:
84 
85  // Constructors
86 
88 
89  //- Construct from siteIdList and potential dictionaries
91  (
92  const List<word>& siteIdList,
93  const dictionary& tetherPotentialDict,
94  const List<word>& tetherSiteIdList
95  );
96 
97 
98  //- Destructor
100 
101 
102  // Member Functions
103 
104  void buildPotentials
105  (
106  const List<word>& siteIdList,
107  const dictionary& tetherPotentialDict,
108  const List<word>& tetherSiteIdList
109  );
110 
111  // Access
112 
113  inline const List<word>& idMap() const;
114 
115  const tetherPotential& tetherPotentialFunction(const label a) const;
116 
117  vector force(const label a, const vector rIT) const;
118 
119  scalar energy (const label a, const vector rIT) const;
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #include "tetherPotentialListI.H"
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
Foam::tetherPotentialList::force
vector force(const label a, const vector rIT) const
Definition: tetherPotentialList.C:141
Foam::tetherPotential
Definition: tetherPotential.H:55
Foam::tetherPotentialList::~tetherPotentialList
~tetherPotentialList()
Destructor.
Definition: tetherPotentialList.C:112
tetherPotentialListI.H
Foam::tetherPotentialList::energy
scalar energy(const label a, const vector rIT) const
Definition: tetherPotentialList.C:151
Foam::tetherPotentialList::idMap
const List< word > & idMap() const
tetherPotential.H
Foam::tetherPotentialList::buildPotentials
void buildPotentials(const List< word > &siteIdList, const dictionary &tetherPotentialDict, const List< word > &tetherSiteIdList)
Definition: tetherPotentialList.C:119
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
Foam::tetherPotentialList::tetherPotentialList
tetherPotentialList()
Definition: tetherPotentialList.C:89
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::tetherPotentialList::tetherPotentialFunction
const tetherPotential & tetherPotentialFunction(const label a) const
Definition: tetherPotentialList.C:132
Foam::tetherPotentialList
Definition: tetherPotentialList.H:52
Foam::Vector< scalar >
Foam::List< label >
PtrList.H
ListOps.H
Various functions to operate on Lists.
word.H