ls1-MarDyn
ls1-MarDyn molecular dynamics code
Public Member Functions | List of all members
Charge Class Reference

Charge center. More...

#include <Site.h>

Inheritance diagram for Charge:
Site

Public Member Functions

 Charge (double x, double y, double z, double m, double q)
 Constructor. More...
 
void readXML (XMLfileUnits &xmlconfig)
 Read in XML configuration for a Charge and all its included objects. More...
 
void write (std::ostream &ostrm) const
 write to stream More...
 
double q () const
 
void setQ (double q)
 
- Public Member Functions inherited from Site
double rx () const
 
double ry () const
 
double rz () const
 
std::array< double, 3 > r () const
 
double m () const
 
void setR (int d, double r)
 
void setM (double m)
 

Additional Inherited Members

- Protected Member Functions inherited from Site
 Site (double x=0., double y=0., double z=0., double m=0.)
 Constructor. More...
 
- Protected Attributes inherited from Site
std::array< double, 3 > _r
 
double _m
 

Detailed Description

Charge center.

Electrical charge interaction site. The potential between two charge centers is given by the coulomb interaction

\[ U_\text{coulomb} = \frac{1}{4 \pi \epsilon_0} \frac{q_1 q_2}{r} \]

where $r$ is the distance between the two coulomb centers, $q_1$ and $q_2$ are the charges of the two centers and $\epsilon_0$ is the vacuum permittivity. See potforce.h for the detailed implementation.

Constructor & Destructor Documentation

◆ Charge()

Charge::Charge ( double  x,
double  y,
double  z,
double  m,
double  q 
)
inline

Constructor.

Parameters
[in]xrelative x coordinate
[in]yrelative y coordinate
[in]zrelative z coordinate
[in]mmass
[in]qcharge

Member Function Documentation

◆ q()

double Charge::q ( ) const
inline

get charge

◆ readXML()

void Charge::readXML ( XMLfileUnits xmlconfig)
inlinevirtual

Read in XML configuration for a Charge and all its included objects.

The following xml object structure is handled by this method:

<site>
<!-- all Site class parameters -->
<charge>DOUBLE</charge>
</site>

Reimplemented from Site.

◆ setQ()

void Charge::setQ ( double  q)
inline

set the charge

◆ write()

void Charge::write ( std::ostream &  ostrm) const
inlinevirtual

write to stream

Reimplemented from Site.


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