Molecular Dynamics Simulation  1.0
Public Member Functions | Protected Attributes | List of all members
TargettedForceSource Class Referenceabstract

Interface for targetted force source classes. More...

#include <TargettedForceSource.h>

Inheritance diagram for TargettedForceSource:
Inheritance graph
Collaboration diagram for TargettedForceSource:
Collaboration graph

Public Member Functions

 TargettedForceSource (const std::vector< size_t > &target_indices)
 
virtual ~TargettedForceSource ()=default
 Virtual destructor for correct cleanup of derived classes. More...
 
virtual void applyForce (std::vector< Particle > &particle_vector, double curr_simulation_time) const =0
 Applies the force directly to the particles with the specified indices within the vector. More...
 
virtual operator std::string () const =0
 Conversion from a force source object to a string containing its name. More...
 

Protected Attributes

std::vector< size_t > target_indices
 Indices of the particles on which the force is applied. More...
 

Detailed Description

Interface for targetted force source classes.

Definition of an interface for targetted force source classes. This is used to ensure inheriting classes implement the method applyForce(std::vector<Particle>& particles) according to our definition.

A TargettedForceSource specifies the force exerted on a specific particles within a vector, using the index within that vector.

Definition at line 17 of file TargettedForceSource.h.

Constructor & Destructor Documentation

◆ TargettedForceSource()

TargettedForceSource::TargettedForceSource ( const std::vector< size_t > &  target_indices)
inline

Definition at line 28 of file TargettedForceSource.h.

std::vector< size_t > target_indices
Indices of the particles on which the force is applied.

◆ ~TargettedForceSource()

virtual TargettedForceSource::~TargettedForceSource ( )
virtualdefault

Virtual destructor for correct cleanup of derived classes.

Virtual destructor to ensure correct deletion of inheriting classes.

Member Function Documentation

◆ applyForce()

virtual void TargettedForceSource::applyForce ( std::vector< Particle > &  particle_vector,
double  curr_simulation_time 
) const
pure virtual

Applies the force directly to the particles with the specified indices within the vector.

Parameters
particle_vectorParticle vector on which the force is applied
curr_simulation_timeCurrent simulation time

Calculates and the force exerted on the particles identified by index within the given particle vector.

Implemented in TargettedTemporaryConstantForce.

◆ operator std::string()

virtual TargettedForceSource::operator std::string ( ) const
explicitpure virtual

Conversion from a force source object to a string containing its name.

Implemented in TargettedTemporaryConstantForce.

Member Data Documentation

◆ target_indices

std::vector<size_t> TargettedForceSource::target_indices
protected

Indices of the particles on which the force is applied.

Definition at line 22 of file TargettedForceSource.h.


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