OpenMD
2.6
Molecular Dynamics in the Open
|
Applies a uniform (vector) magnetic field to the system. More...
#include <MagneticField.hpp>
Public Member Functions | |
MagneticField (SimInfo *info) | |
![]() | |
virtual | ~Perturbation () |
Protected Member Functions | |
virtual void | initialize () |
virtual void | applyPerturbation () |
Private Attributes | |
bool | initialized |
bool | doMagneticField |
Globals * | simParams |
SimInfo * | info_ |
Vector3d | MF |
Applies a uniform (vector) magnetic field to the system.
The field is applied as an external perturbation. The user specifies
in the .omd file where the values of a, b, and c are in units of Tesla
When a charge moves in a magnetic field, there is no work done, so there is no change in potential.
The field itself is
The external magnetic field applies a force on moving charged atoms, and a torque on moving (and rotating) dipoles,
Definition at line 80 of file MagneticField.hpp.
OpenMD::MagneticField::MagneticField | ( | SimInfo * | info | ) |
Definition at line 52 of file MagneticField.cpp.
References OpenMD::SimInfo::getSimParams(), info_, and simParams.
|
protectedvirtual |
Implements OpenMD::Perturbation.
Definition at line 81 of file MagneticField.cpp.
References OpenMD::StuntDouble::addFrc(), OpenMD::StuntDouble::addTrq(), OpenMD::Molecule::beginAtom(), OpenMD::SimInfo::beginMolecule(), OpenMD::Constants::chargeFieldConvert, OpenMD::cross(), OpenMD::Constants::dipoleFieldConvert, doMagneticField, OpenMD::Atom::getAtomType(), OpenMD::FixedChargeAdapter::getCharge(), OpenMD::StuntDouble::getDipole(), OpenMD::Atom::getI(), OpenMD::StuntDouble::getJ(), OpenMD::StuntDouble::getPos(), OpenMD::StuntDouble::getVel(), info_, initialize(), initialized, OpenMD::SquareMatrix3< Real >::inverse(), OpenMD::MultipoleAdapter::isDipole(), OpenMD::FixedChargeAdapter::isFixedCharge(), OpenMD::StuntDouble::isLinear(), OpenMD::StuntDouble::linearAxis(), OpenMD::Constants::magneticFieldConvert, MF, OpenMD::Molecule::nextAtom(), and OpenMD::SimInfo::nextMolecule().
|
protectedvirtual |
Definition at line 58 of file MagneticField.cpp.
References doMagneticField, errorStruct::errMsg, initialized, errorStruct::isFatal, MF, painCave, simError(), simParams, OpenMD::Vector3< Real >::x(), OpenMD::Vector3< Real >::y(), and OpenMD::Vector3< Real >::z().
Referenced by applyPerturbation().
|
private |
Definition at line 91 of file MagneticField.hpp.
Referenced by applyPerturbation(), and initialize().
|
private |
Definition at line 93 of file MagneticField.hpp.
Referenced by applyPerturbation(), and MagneticField().
|
private |
Definition at line 90 of file MagneticField.hpp.
Referenced by applyPerturbation(), and initialize().
|
private |
Definition at line 94 of file MagneticField.hpp.
Referenced by applyPerturbation(), and initialize().
|
private |
Definition at line 92 of file MagneticField.hpp.
Referenced by initialize(), and MagneticField().