OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

pairPotentialList.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::pairPotentialList
00027 
00028 Description
00029 
00030 SourceFiles
00031     pairPotentialListI.H
00032     pairPotentialList.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef pairPotentialList_H
00037 #define pairPotentialList_H
00038 
00039 #include "PtrList.H"
00040 #include "word.H"
00041 #include "pairPotential.H"
00042 #include "polyMesh.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050                       Class pairPotentialList Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class pairPotentialList
00054 :
00055     public PtrList<pairPotential>
00056 {
00057     // Private data
00058 
00059         label nIds_;
00060 
00061         scalar rCutMax_;
00062 
00063         scalar rCutMaxSqr_;
00064 
00065         autoPtr<pairPotential> electrostaticPotential_;
00066 
00067 
00068     // Private Member Functions
00069 
00070         inline label pairPotentialIndex
00071         (
00072             const label a,
00073             const label b
00074         ) const;
00075 
00076         void readPairPotentialDict
00077         (
00078             const List<word>& idList,
00079             const dictionary& pairPotentialDict,
00080             const polyMesh& mesh
00081         );
00082 
00083         //- Disallow default bitwise assignment
00084         void operator=(const pairPotentialList&);
00085 
00086         //- Disallow default bitwise copy construct
00087         pairPotentialList(const pairPotentialList&);
00088 
00089 
00090 public:
00091 
00092     // Constructors
00093 
00094         pairPotentialList();
00095 
00096         //- Construct from idList and potental dictionaries
00097         pairPotentialList
00098         (
00099             const List<word>& idList,
00100             const dictionary& pairPotentialDict,
00101             const polyMesh& mesh
00102         );
00103 
00104 
00105     // Destructor
00106 
00107         ~pairPotentialList();
00108 
00109 
00110     // Member Functions
00111 
00112         void buildPotentials
00113         (
00114             const List<word>& idList,
00115             const dictionary& pairPotentialDict,
00116             const polyMesh& mesh
00117         );
00118 
00119 
00120         // Access
00121 
00122             inline scalar rCutMax() const;
00123 
00124             inline scalar rCutMaxSqr() const;
00125 
00126             bool rCutMaxSqr(scalar rIJMagSqr) const;
00127 
00128             const pairPotential& pairPotentialFunction
00129             (
00130                 const label a,
00131                 const label b
00132             ) const;
00133 
00134             // Return true if rIJ is within rCut for this pair.
00135             bool rCutSqr
00136             (
00137                 const label a,
00138                 const label b,
00139                 const scalar rIJMagSqr
00140             ) const;
00141 
00142             scalar rMin(const label a, const label b) const;
00143 
00144             scalar dr(const label a, const label b) const;
00145 
00146             scalar rCutSqr(const label a, const label b) const;
00147 
00148             scalar rCut(const label a, const label b) const;
00149 
00150             scalar force
00151             (
00152                 const label a,
00153                 const label b,
00154                 const scalar rIJMag
00155             ) const;
00156 
00157             scalar energy
00158             (
00159                 const label a,
00160                 const label b,
00161                 const scalar rIJMag
00162             ) const;
00163 
00164             inline const pairPotential& electrostatic() const;
00165 };
00166 
00167 
00168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00169 
00170 } // End namespace Foam
00171 
00172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00173 
00174 #include "pairPotentialListI.H"
00175 
00176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00177 
00178 #endif
00179 
00180 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd