faunus
Public Types | Public Member Functions | Public Attributes | List of all members
Faunus::Particle Class Reference

Particle class for storing positions, id, and other properties. More...

#include <particle.h>

Public Types

using ParticleExtension = ParticleTemplate< Dipole, Quadrupole, Cigar >
 

Public Member Functions

 Particle (const AtomData &a, const Point &pos)
 
 Particle (const AtomData &a)
 construct from AtomData More...
 
 Particle (const Particle &)
 copy constructor
 
Particleoperator= (const Particle &)
 assignment operator
 
const AtomData & traits () const
 get properties from AtomData
 
void rotate (const Eigen::Quaterniond &quaternion, const Eigen::Matrix3d &rotation_matrix)
 internal rotation More...
 
bool hasExtension () const
 check if particle has extensions (dipole etc.)
 
ParticleExtensioncreateExtension ()
 Create extension.
 
ParticleExtensiongetExt ()
 get/create extension
 
const ParticleExtensiongetExt () const
 Get extended particle properties;.
 

Public Attributes

std::unique_ptr< ParticleExtensionext
 Point to extended properties.
 
int id = -1
 Particle id/type.
 
double charge = 0.0
 Particle charge.
 
Point pos = {0.0, 0.0, 0.0}
 Particle position vector.
 

Detailed Description

Particle class for storing positions, id, and other properties.

Particles carry id, pos, charge by default but can have additional or extended data stored using a different memory model. When serializing from a json object, extended properties are automatically detected and memory is automatically allocated

Todo:
: memory model for extended properties not optimal

Constructor & Destructor Documentation

◆ Particle()

Faunus::Particle::Particle ( const AtomData &  atomdata)

construct from AtomData

Warning
Performance is sub-optimal as conversion is done through a json object

Member Function Documentation

◆ rotate()

void Faunus::Particle::rotate ( const Eigen::Quaterniond &  quaternion,
const Eigen::Matrix3d &  rotation_matrix 
)

internal rotation

Parameters
quaternionQuaternion used to rotate points
rotation_matrixRotation matrix used to rotate tensors
Todo:
Only one of the above should be enough

This has effect only on anisotropic particles and does no positional rotation, only internal rotation


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