24 #include "../Atomicrex.h" 25 #include "../job/FitObject.h" 26 #include "../job/FitJob.h" 30 class AtomicStructure;
32 class DegreeOfFreedom;
51 BOOST_ASSERT(speciesA >= 0 && speciesA < _interactionFlags.size());
52 BOOST_ASSERT(_interactionFlags[speciesA].size() ==
job()->numAtomTypes());
53 BOOST_ASSERT(speciesB >= 0 && speciesB < _interactionFlags[speciesA].size());
55 _interactionFlags[speciesA][speciesB] =
true;
56 _interactionFlags[speciesB][speciesA] =
true;
57 _atomTypeFlags[speciesA] =
true;
58 _atomTypeFlags[speciesB] =
true;
64 BOOST_ASSERT(speciesA >= 0 && speciesA < _interactionFlags.size());
65 BOOST_ASSERT(_interactionFlags[speciesA].size() ==
job()->numAtomTypes());
66 BOOST_ASSERT(speciesB >= 0 && speciesB < _interactionFlags[speciesA].size());
67 return _interactionFlags[speciesA][speciesB];
74 BOOST_ASSERT(species >= 0 && species < _atomTypeFlags.size());
75 return _atomTypeFlags[species];
79 virtual double cutoff()
const = 0;
119 std::vector<bool> _atomTypeFlags;
123 std::vector<std::vector<bool>> _interactionFlags;
Base class for maintaining structures.
Definition: AtomicStructure.h:42
virtual double computeEnergyAndForces(AtomicStructure &structure, NeighborList &neighborList)=0
Computes the total energy and forces of the structure.
int numAtomTypes() const
Returns the number of atom types used in this job.
Definition: FitJob.h:63
virtual void parse(XML::Element potentialElement) override
Parses any potential-specific parameters in the XML element in the job file.
Definition: Potential.cpp:76
void enableInteraction(int speciesA, int speciesB)
Enables the interaction between two atom types.
Definition: Potential.h:49
Definition: NeighborList.h:58
virtual void preparePotential()
Definition: Potential.h:109
const FPString & tag() const
Returns the assigned tag string.
Definition: FitObject.h:144
bool interacting(int speciesA, int speciesB) const
Returns whether the interaction between two atom types is enabled for this potential.
Definition: Potential.h:62
bool isAtomTypeEnabled(int species) const
Definition: Potential.h:72
Potential(const FPString &id, FitJob *job, const FPString &tag=FPString())
Constructor.
Definition: Potential.cpp:35
virtual double cutoff() const =0
Returns the maximum cutoff of the potential.
virtual size_t perAtomDataSize() const
Definition: Potential.h:94
This file collects the definition of classes that define various simple crystal structures.
Definition: Atomicrex.h:67
std::string FPString
The default string type used throughout the code:
Definition: Atomicrex.h:70
Definition: XMLUtilities.h:226
Definition: XMLUtilities.h:69
Definition: FitObject.h:42
FitJob * job() const
Returns a pointer to the job to which this object belongs.
Definition: FitObject.h:150
virtual size_t perBondDataSize() const
Definition: Potential.h:99
virtual void outputResults()
Definition: Potential.cpp:52
virtual double computeEnergy(AtomicStructure &structure, NeighborList &neighborList)=0
Computes the total energy of the structure.
virtual XML::OElement generateXMLDefinition()
Definition: Potential.h:113
Base class for potential.
Definition: Potential.h:41