GCMC Simulation
A C++ and Python-based Monte Carlo simulation framework for interacting particles.
Loading...
Searching...
No Matches
potential.cpp File Reference
#include "potential.h"
#include <stdexcept>
#include <cmath>

Functions

double idealPotential ()
 Calculates the Ideal potential energy.
 
double idealForceDotR ()
 Calculates the force between two ideal particles.
 
double lennardJonesPotential (double r2)
 Calculates the Lennard-Jones potential energy.
 
double lennardJonesForceDotR (double r2)
 Calculates the force between two particles using Lennard-Jones potential.
 
double wcaPotential (double r2)
 Calculates the WCA potential energy.
 
double wcaForceDotR (double r2)
 Calculates the force between two particles using WCA potential.
 
double yukawaPotential (double r2)
 Calculates the Yukawa potential energy.
 
double yukawaForceDotR (double r2)
 Calculates the force between two particles using Yukawa potential.
 
double athermalStarPotential (double r2, float f_dependant)
 Calculates the logarithmic potential energy.
 
double athermalStarForceDotR (double r2, float f_Dependant)
 Calculates the force between two star polymer cores.
 
PotentialType selectPotentialType (const std::string &potentialName)
 Selects the potential type based on a string input.
 
double computePairPotential (double r2, PotentialType potentialType, float f_prime)
 Returns the pair potential betwen two particles.
 
double computePairForce (double r2, PotentialType potentialType, float f_prime)
 Returns the pair potential betwen two particles.
 

Function Documentation

◆ athermalStarForceDotR()

double athermalStarForceDotR ( double r2,
float f_Dependant )

Calculates the force between two star polymer cores.

Parameters
f_dependantstar polymer functtionality dependant part.
r2The squared distance between two particles.
Returns
The magnitude of the force between two star polymer.

◆ athermalStarPotential()

double athermalStarPotential ( double r2,
float f_dependant )

Calculates the logarithmic potential energy.

Parameters
f_dependantstar polymer functtionality dependant part.
r2The squared distance between two particles.
Returns
The potential energy between two star polymer.

◆ computePairForce()

double computePairForce ( double r2,
PotentialType potentialType,
float f_prime )

Returns the pair potential betwen two particles.

Parameters
r2the squared distance between the two particles
typeThe type of potential
f_primefor the case of the ultrasoft potential.
Returns
The amount of force dot r.

◆ computePairPotential()

double computePairPotential ( double r2,
PotentialType potentialType,
float f_prime )

Returns the pair potential betwen two particles.

Parameters
r2the squared distance between the two particles
typeThe type of potential
f_primefor the case of the ultrasoft potential.
Returns
The amount of potential.

◆ idealForceDotR()

double idealForceDotR ( )

Calculates the force between two ideal particles.

Returns
zero!

◆ idealPotential()

double idealPotential ( )

Calculates the Ideal potential energy.

Returns
zero!

◆ lennardJonesForceDotR()

double lennardJonesForceDotR ( double r2)

Calculates the force between two particles using Lennard-Jones potential.

Parameters
r2The squared distance between two particles.
Returns
The magnitude of the Lennard-Jones force between two particles.

◆ lennardJonesPotential()

double lennardJonesPotential ( double r2)

Calculates the Lennard-Jones potential energy.

Parameters
r2The squared distance between two particles.
Returns
The Lennard-Jones potential energy between two particles.

◆ selectPotentialType()

PotentialType selectPotentialType ( const std::string & potentialName)

Selects the potential type based on a string input.

Parameters
potentialNameThe name of the potential type as a string.
Returns
The corresponding PotentialType enum value.

◆ wcaForceDotR()

double wcaForceDotR ( double r2)

Calculates the force between two particles using WCA potential.

Parameters
r2The squared distance between two particles.
Returns
The magnitude of the WCA force between two particles.

◆ wcaPotential()

double wcaPotential ( double r2)

Calculates the WCA potential energy.

Calculates the Weeks-Chandler-Andersen (WCA) potential energy.

Parameters
r2The squared distance between two particles.
Returns
The WCA potential energy between two particles.

◆ yukawaForceDotR()

double yukawaForceDotR ( double r2)

Calculates the force between two particles using Yukawa potential.

Parameters
r2The squared distance between two particles.
Returns
The magnitude of the Yukawa force between two particles.

◆ yukawaPotential()

double yukawaPotential ( double r2)

Calculates the Yukawa potential energy.

Parameters
r2The squared distance between two particles.
Returns
The Yukawa potential energy between two particles.