OpenMD  2.6
Molecular Dynamics in the Open
OpenMD::MagneticField Class Reference

Applies a uniform (vector) magnetic field to the system. More...

#include <MagneticField.hpp>

Inheritance diagram for OpenMD::MagneticField:
OpenMD::Perturbation

Public Member Functions

 MagneticField (SimInfo *info)
 
- Public Member Functions inherited from OpenMD::Perturbation
virtual ~Perturbation ()
 

Protected Member Functions

virtual void initialize ()
 
virtual void applyPerturbation ()
 

Private Attributes

bool initialized
 
bool doMagneticField
 
GlobalssimParams
 
SimInfoinfo_
 
Vector3d MF
 

Detailed Description

Applies a uniform (vector) magnetic field to the system.

The field is applied as an external perturbation. The user specifies

magneticField = (a, b, c);

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

$ \mathbf{B} = \left( \begin{array}{c} a \\ b \\ c \end{array} \right) $

The external magnetic field applies a force on moving charged atoms, $ \mathbf{F} = C \mathbf{v} \times \mathbf{B} $ and a torque on moving (and rotating) dipoles, $ \mathbf{\tau} = \mathbf{D} \times ( \mathbf{v} \times \mathbf{B} ) + (\mathbf{\omega} \times \mathbf{D} ) \times \mathbf{B} $

Definition at line 80 of file MagneticField.hpp.

Constructor & Destructor Documentation

◆ MagneticField()

OpenMD::MagneticField::MagneticField ( SimInfo info)

Definition at line 52 of file MagneticField.cpp.

References OpenMD::SimInfo::getSimParams(), info_, and simParams.

Member Function Documentation

◆ applyPerturbation()

◆ initialize()

void OpenMD::MagneticField::initialize ( )
protectedvirtual

Member Data Documentation

◆ doMagneticField

bool OpenMD::MagneticField::doMagneticField
private

Definition at line 91 of file MagneticField.hpp.

Referenced by applyPerturbation(), and initialize().

◆ info_

SimInfo* OpenMD::MagneticField::info_
private

Definition at line 93 of file MagneticField.hpp.

Referenced by applyPerturbation(), and MagneticField().

◆ initialized

bool OpenMD::MagneticField::initialized
private

Definition at line 90 of file MagneticField.hpp.

Referenced by applyPerturbation(), and initialize().

◆ MF

Vector3d OpenMD::MagneticField::MF
private

Definition at line 94 of file MagneticField.hpp.

Referenced by applyPerturbation(), and initialize().

◆ simParams

Globals* OpenMD::MagneticField::simParams
private

Definition at line 92 of file MagneticField.hpp.

Referenced by initialize(), and MagneticField().


The documentation for this class was generated from the following files: