Molecular Dynamics Simulation
1.0
src
physics
simpleforces
GlobalDownwardsGravity.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
physics/simpleforces/SimpleForceSource.h
"
4
8
class
GlobalDownwardsGravity
:
public
SimpleForceSource
{
9
private
:
10
double
g
;
11
12
public
:
17
explicit
GlobalDownwardsGravity
(
double
g
);
18
24
std::array<double, 3UL>
calculateForce
(
Particle
& p)
const override
;
25
29
explicit
operator
std::string()
const override
;
30
36
void
setGravitationalAcceleration
(
double
g
);
37
};
SimpleForceSource.h
GlobalDownwardsGravity
Class to calculate the global downwards gravity force.
Definition:
GlobalDownwardsGravity.h:8
GlobalDownwardsGravity::g
double g
Definition:
GlobalDownwardsGravity.h:10
GlobalDownwardsGravity::setGravitationalAcceleration
void setGravitationalAcceleration(double g)
Sets the gravitational acceleration.
Definition:
GlobalDownwardsGravity.cpp:9
GlobalDownwardsGravity::calculateForce
std::array< double, 3UL > calculateForce(Particle &p) const override
Calculates the downwards gravity force on a particle using the given gravitational acceleration.
Definition:
GlobalDownwardsGravity.cpp:5
GlobalDownwardsGravity::GlobalDownwardsGravity
GlobalDownwardsGravity(double g)
Constructor for the GlobalDownwardsGravity class.
Definition:
GlobalDownwardsGravity.cpp:3
Particle
Class to represent a particle.
Definition:
Particle.h:26
SimpleForceSource
Interface for simple force source classes.
Definition:
SimpleForceSource.h:16
Generated by
1.9.1