OpenFOAM-dev / data /src /lagrangian /molecularDynamics /potential /pairPotential /basic /pairPotential.H
Download data/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H from introvoyz042/OpenFOAM-dev: direct link, hf CLI and curl.
- Browser
- Download file 4.87 kB
-
https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H
- Command line
-
hf download hf://datasets/introvoyz042/OpenFOAM-dev/data/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H
-
curl -L -o pairPotential.H https://huggingface.co/datasets/introvoyz042/OpenFOAM-dev/resolve/main/data/src/lagrangian/molecularDynamics/potential/pairPotential/basic/pairPotential.H
4.87 kB
| /*---------------------------------------------------------------------------*\ | |
| ========= | | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | |
| \\ / O peration | Website: https://openfoam.org | |
| \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation | |
| \\/ M anipulation | | |
| ------------------------------------------------------------------------------- | |
| License | |
| This file is part of OpenFOAM. | |
| OpenFOAM is free software: you can redistribute it and/or modify it | |
| under the terms of the GNU General Public License as published by | |
| the Free Software Foundation, either version 3 of the License, or | |
| (at your option) any later version. | |
| OpenFOAM is distributed in the hope that it will be useful, but WITHOUT | |
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| for more details. | |
| You should have received a copy of the GNU General Public License | |
| along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. | |
| Class | |
| Foam::pairPotential | |
| Description | |
| SourceFiles | |
| pairPotential.C | |
| pairPotentialNew.C | |
| \*---------------------------------------------------------------------------*/ | |
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | |
| namespace Foam | |
| { | |
| // Forward declaration of classes | |
| class energyScalingFunction; | |
| /*---------------------------------------------------------------------------*\ | |
| Class pairPotential Declaration | |
| \*---------------------------------------------------------------------------*/ | |
| class pairPotential | |
| { | |
| protected: | |
| // Protected Data | |
| word name_; | |
| dictionary pairPotentialProperties_; | |
| scalar rCut_; | |
| scalar rCutSqr_; | |
| scalar rMin_; | |
| scalar dr_; | |
| List<scalar> forceLookup_; | |
| List<scalar> energyLookup_; | |
| mutable energyScalingFunction* esfPtr_; | |
| bool writeTables_; | |
| // Protected Member Functions | |
| void scaleEnergy(scalar& e, const scalar r) const; | |
| public: | |
| //- Runtime type information | |
| TypeName("pairPotential"); | |
| // Declare run-time constructor selection table | |
| declareRunTimeSelectionTable | |
| ( | |
| autoPtr, | |
| pairPotential, | |
| dictionary, | |
| ( | |
| const word& name, | |
| const dictionary& pairPotentialProperties | |
| ), | |
| (name, pairPotentialProperties) | |
| ); | |
| // Selectors | |
| //- Return a reference to the selected viscosity model | |
| static autoPtr<pairPotential> New | |
| ( | |
| const word& name, | |
| const dictionary& pairPotentialProperties | |
| ); | |
| // Constructors | |
| //- Construct from components | |
| pairPotential | |
| ( | |
| const word& name, | |
| const dictionary& pairPotentialProperties | |
| ); | |
| //- Disallow default bitwise copy construction | |
| pairPotential(const pairPotential&) = delete; | |
| //- Destructor | |
| virtual ~pairPotential() | |
| {} | |
| // Member Functions | |
| void setLookupTables(); | |
| inline scalar rMin() const; | |
| inline scalar dr() const; | |
| inline scalar rCut() const; | |
| inline scalar rCutSqr() const; | |
| scalar energy (const scalar r) const; | |
| scalar force (const scalar r) const; | |
| List<Pair<scalar>> energyTable() const; | |
| List<Pair<scalar>> forceTable() const; | |
| inline bool writeTables() const; | |
| virtual scalar unscaledEnergy(const scalar r) const = 0; | |
| scalar scaledEnergy(const scalar r) const; | |
| scalar energyDerivative | |
| ( | |
| const scalar r, | |
| const bool scaledEnergyDerivative = true | |
| ) const; | |
| const dictionary& pairPotentialProperties() const | |
| { | |
| return pairPotentialProperties_; | |
| } | |
| bool writeEnergyAndForceTables(Ostream& os) const; | |
| //- Read pairPotential dictionary | |
| virtual bool read(const dictionary& pairPotentialProperties) = 0; | |
| // Member Operators | |
| //- Disallow default bitwise assignment | |
| void operator=(const pairPotential&) = delete; | |
| }; | |
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | |
| } // End namespace Foam | |
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | |
| // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | |
| // ************************************************************************* // | |