Add support for "Dipoles" section in molecule file
This commit is contained in:
10
src/atom.cpp
10
src/atom.cpp
@ -26,6 +26,7 @@
|
||||
#include "input.h"
|
||||
#include "label_map.h"
|
||||
#include "math_const.h"
|
||||
#include "math_extra.h"
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
#include "molecule.h"
|
||||
@ -2112,6 +2113,15 @@ std::vector<Molecule *>Atom::get_molecule_by_id(const std::string &id)
|
||||
void Atom::add_molecule_atom(Molecule *onemol, int iatom, int ilocal, tagint offset)
|
||||
{
|
||||
if (onemol->qflag && q_flag) q[ilocal] = onemol->q[iatom];
|
||||
if (onemol->muflag && mu_flag) {
|
||||
double r[3], rotmat[3][3];
|
||||
MathExtra::quat_to_mat(onemol->quat_external, rotmat);
|
||||
MathExtra::matvec(rotmat, onemol->mu[iatom], r);
|
||||
mu[ilocal][0] = r[0];
|
||||
mu[ilocal][1] = r[1];
|
||||
mu[ilocal][2] = r[2];
|
||||
mu[ilocal][3] = sqrt(r[0] * r[0] + r[1] * r[1] + r[2] * r[2]);
|
||||
}
|
||||
if (onemol->radiusflag && radius_flag) radius[ilocal] = onemol->radius[iatom];
|
||||
if (onemol->rmassflag && rmass_flag) rmass[ilocal] = onemol->rmass[iatom];
|
||||
else if (rmass_flag)
|
||||
|
||||
Reference in New Issue
Block a user