Molecular Dynamics Simulation  1.0
Static Public Member Functions | List of all members
InternalToXSDTypeAdapter Class Reference

#include <InternalToXSDTypeAdapter.h>

Collaboration diagram for InternalToXSDTypeAdapter:
Collaboration graph

Static Public Member Functions

static ParticleType convertToParticle (const Particle &particle)
 
static DoubleVec3Type convertToVector (const std::array< double, 3 > &vector)
 
static ConnectedParticlesType convertToConnectedParticles (const std::vector< std::tuple< long, double, double >> &connected_particles)
 
static ConnectedParticleEntryType convertToConnectedParticleEntry (const std::tuple< long, double, double > &entry)
 

Detailed Description

Definition at line 6 of file InternalToXSDTypeAdapter.h.

Member Function Documentation

◆ convertToConnectedParticleEntry()

ConnectedParticleEntryType InternalToXSDTypeAdapter::convertToConnectedParticleEntry ( const std::tuple< long, double, double > &  entry)
static

Definition at line 35 of file InternalToXSDTypeAdapter.cpp.

35  {
36  return ConnectedParticleEntryType{std::get<0>(entry), std::get<1>(entry), std::get<2>(entry)};
37 }

◆ convertToConnectedParticles()

ConnectedParticlesType InternalToXSDTypeAdapter::convertToConnectedParticles ( const std::vector< std::tuple< long, double, double >> &  connected_particles)
static

Definition at line 24 of file InternalToXSDTypeAdapter.cpp.

25  {
26  ConnectedParticlesType xsd_connected_particles{};
27 
28  for (const auto& entry : connected_particles) {
29  xsd_connected_particles.entries().push_back(convertToConnectedParticleEntry(entry));
30  }
31 
32  return xsd_connected_particles;
33 }
static ConnectedParticleEntryType convertToConnectedParticleEntry(const std::tuple< long, double, double > &entry)

◆ convertToParticle()

ParticleType InternalToXSDTypeAdapter::convertToParticle ( const Particle particle)
static

Definition at line 3 of file InternalToXSDTypeAdapter.cpp.

3  {
4  auto position = convertToVector(particle.getX());
5  auto velocity = convertToVector(particle.getV());
6  auto force = convertToVector(particle.getF());
7  auto old_force = convertToVector(particle.getOldF());
8  auto mass = particle.getM();
9  auto type = particle.getType();
10  auto epsilon = particle.getEpsilon();
11  auto sigma = particle.getSigma();
12  auto locked = particle.isLocked();
13  auto connected_particles = convertToConnectedParticles(particle.getConnectedParticles());
14 
15  auto particle_type = ParticleType{position, velocity, force, old_force, mass, type, epsilon, sigma, locked, connected_particles};
16 
17  return particle_type;
18 }
static ConnectedParticlesType convertToConnectedParticles(const std::vector< std::tuple< long, double, double >> &connected_particles)
static DoubleVec3Type convertToVector(const std::array< double, 3 > &vector)
double getSigma() const
Gets the Lennard-Jones potential parameter sigma.
Definition: Particle.h:192
const std::array< double, 3 > & getV() const
Gets the velocity of the particle.
Definition: Particle.h:162
bool isLocked() const
Gets whether the particle is locked in space.
Definition: Particle.h:202
int getType() const
Gets the type of the particle.
Definition: Particle.h:182
const std::array< double, 3 > & getX() const
Gets the position of the particle.
Definition: Particle.h:157
double getM() const
Gets the mass of the particle.
Definition: Particle.h:177
double getEpsilon() const
Gets the Lennard-Jones potential parameter epsilon.
Definition: Particle.h:187
const std::array< double, 3 > & getF() const
Gets the total force of the particle.
Definition: Particle.h:167
const std::array< double, 3 > & getOldF() const
Gets the old total force of the particle.
Definition: Particle.h:172
const std::vector< std::tuple< long, double, double > > & getConnectedParticles() const
Gets the list of connected particles.
Definition: Particle.h:207

◆ convertToVector()

DoubleVec3Type InternalToXSDTypeAdapter::convertToVector ( const std::array< double, 3 > &  vector)
static

Definition at line 20 of file InternalToXSDTypeAdapter.cpp.

20  {
21  return DoubleVec3Type{vector[0], vector[1], vector[2]};
22 }

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