pairPotential.H
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef pairPotential_H
00037 #define pairPotential_H
00038
00039 #include "IOdictionary.H"
00040 #include "typeInfo.H"
00041 #include "runTimeSelectionTables.H"
00042 #include "autoPtr.H"
00043 #include "List.H"
00044 #include "Pair.H"
00045 #include "Switch.H"
00046 #include "mathematicalConstants.H"
00047
00048
00049
00050 namespace Foam
00051 {
00052
00053
00054 class energyScalingFunction;
00055
00056
00057
00058
00059
00060 class pairPotential
00061 {
00062
00063 protected:
00064
00065
00066
00067 word name_;
00068 dictionary pairPotentialProperties_;
00069
00070 scalar rCut_;
00071 scalar rCutSqr_;
00072
00073 scalar rMin_;
00074 scalar dr_;
00075
00076 List<scalar> forceLookup_;
00077 List<scalar> energyLookup_;
00078
00079 mutable energyScalingFunction* esfPtr_;
00080
00081 bool writeTables_;
00082
00083
00084
00085
00086 void scaleEnergy(scalar& e, const scalar r) const;
00087
00088
00089 pairPotential(const pairPotential&);
00090
00091
00092 void operator=(const pairPotential&);
00093
00094
00095 public:
00096
00097
00098 TypeName("pairPotential");
00099
00100
00101
00102
00103 declareRunTimeSelectionTable
00104 (
00105 autoPtr,
00106 pairPotential,
00107 dictionary,
00108 (
00109 const word& name,
00110 const dictionary& pairPotentialProperties
00111 ),
00112 (name, pairPotentialProperties)
00113 );
00114
00115
00116
00117
00118
00119 static autoPtr<pairPotential> New
00120 (
00121 const word& name,
00122 const dictionary& pairPotentialProperties
00123 );
00124
00125
00126
00127
00128
00129 pairPotential
00130 (
00131 const word& name,
00132 const dictionary& pairPotentialProperties
00133 );
00134
00135
00136
00137
00138 virtual ~pairPotential()
00139 {}
00140
00141
00142
00143
00144 void setLookupTables();
00145
00146 inline scalar rMin() const;
00147
00148 inline scalar dr() const;
00149
00150 inline scalar rCut() const;
00151
00152 inline scalar rCutSqr() const;
00153
00154 scalar energy (const scalar r) const;
00155
00156 scalar force (const scalar r) const;
00157
00158 List<Pair<scalar> > energyTable() const;
00159
00160 List<Pair<scalar> > forceTable() const;
00161
00162 inline bool writeTables() const;
00163
00164 virtual scalar unscaledEnergy(const scalar r) const = 0;
00165
00166 scalar scaledEnergy(const scalar r) const;
00167
00168 scalar energyDerivative
00169 (
00170 const scalar r,
00171 const bool scaledEnergyDerivative = true
00172 ) const;
00173
00174 const dictionary& pairPotentialProperties() const
00175 {
00176 return pairPotentialProperties_;
00177 }
00178
00179 bool writeEnergyAndForceTables(Ostream& os) const;
00180
00181
00182 virtual bool read(const dictionary& pairPotentialProperties) = 0;
00183 };
00184
00185
00186
00187
00188 }
00189
00190
00191
00192 #include "pairPotentialI.H"
00193
00194
00195
00196 #endif
00197
00198
Copyright © 2000-2009 OpenCFD Ltd