# NonbondedForceImpl Class Reference

This is the internal implementation of NonbondedForce. More...

`#include <NonbondedForceImpl.h>`

Inheritance diagram for NonbondedForceImpl:

List of all members.

## Public Member Functions

| NonbondedForceImpl (const NonbondedForce &owner)
| ~NonbondedForceImpl ()
void | initialize (ContextImpl &context)
| This is called after the ForceImpl is created and before updateContextState(), calcForces(), or calcEnergy() is called on it.
const NonbondedForce & | getOwner () const
| Get the Force object from which this ForceImpl was created.
void | updateContextState (ContextImpl &context)
| This method is called at the beginning of each time step.
double | calcForcesAndEnergy (ContextImpl &context, bool includeForces, bool includeEnergy, int groups)
| Calculate the force on each particle generated by this ForceImpl and/or this ForceImpl's contribution to the potential energy of the system.
std::map< std::string, double > | getDefaultParameters ()
| Get a map containing the default values for all adjustable parameters defined by this ForceImpl.
std::vector< std::string > | getKernelNames ()
| Get the names of all Kernels used by this Force.
void | updateParametersInContext (ContextImpl &context)

## Static Public Member Functions

static void | calcEwaldParameters (const System &system, const NonbondedForce &force, double &alpha, int &kmaxx, int &kmaxy, int &kmaxz)
| This is a utility routine that calculates the values to use for alpha and kmax when using Ewald summation.
static void | calcPMEParameters (const System &system, const NonbondedForce &force, double &alpha, int &xsize, int &ysize, int &zsize)
| This is a utility routine that calculates the values to use for alpha and grid size when using Particle Mesh Ewald.
static double | calcDispersionCorrection (const System &system, const NonbondedForce &force)
| Compute the coefficient which, when divided by the periodic box volume, gives the long range dispersion correction to the energy.

## Detailed Description

This is the internal implementation of NonbondedForce.

## Constructor & Destructor Documentation

NonbondedForceImpl | ( | const NonbondedForce & | owner | ) |

~NonbondedForceImpl | ( |  | ) |

## Member Function Documentation

static double calcDispersionCorrection | ( | const System & | system,
|  | const NonbondedForce & | force |
| ) |  |  | `[static]`

Compute the coefficient which, when divided by the periodic box volume, gives the long range dispersion correction to the energy.

static void calcEwaldParameters | ( | const System & | system,
|  | const NonbondedForce & | force,
|  | double & | alpha,
|  | int & | kmaxx,
|  | int & | kmaxy,
|  | int & | kmaxz |
| ) |  |  | `[static]`

This is a utility routine that calculates the values to use for alpha and kmax when using Ewald summation.

double calcForcesAndEnergy | ( | ContextImpl & | context,
|  | bool | includeForces,
|  | bool | includeEnergy,
|  | int | groups |
| ) |  |  | `[virtual]`

Calculate the force on each particle generated by this ForceImpl and/or this ForceImpl's contribution to the potential energy of the system.

Parameters:

  | context | the context in which the system is being simulated
  | includeForces | true if forces should be calculated
  | includeEnergy | true if the energy should be calculated
  | groups | a set of bit flags for which force groups to include. Group i should be included if (groups&(1<<i)) != 0.

Returns:
  this force's contribution to the potential energy of the system, or 0 if this force does not contribute to potential energy (or if includeEnergy is false)

Implements ForceImpl.

static void calcPMEParameters | ( | const System & | system,
|  | const NonbondedForce & | force,
|  | double & | alpha,
|  | int & | xsize,
|  | int & | ysize,
|  | int & | zsize |
| ) |  |  | `[static]`

This is a utility routine that calculates the values to use for alpha and grid size when using Particle Mesh Ewald.

std::map<std::string, double> getDefaultParameters | ( |  | ) | `[inline, virtual]`

Get a map containing the default values for all adjustable parameters defined by this ForceImpl.

These parameters and their default values will automatically be added to the Context.

Implements ForceImpl.

std::vector<std::string> getKernelNames | ( |  | ) | `[virtual]`

Get the names of all Kernels used by this Force.

Implements ForceImpl.

const NonbondedForce& getOwner | ( |  | ) | const`[inline, virtual]`

Get the Force object from which this ForceImpl was created.

Implements ForceImpl.

void initialize | ( | ContextImpl & | context | ) | `[virtual]`

This is called after the ForceImpl is created and before updateContextState(), calcForces(), or calcEnergy() is called on it.

This allows it to do any necessary initialization.

Implements ForceImpl.

void updateContextState | ( | ContextImpl & | context | ) | `[inline, virtual]`

This method is called at the beginning of each time step.

It give the ForceImpl a chance to modify the state variables (positions, velocities, and parameters) stored in the Context in arbitrary ways before integration is performed.

Parameters:

  | context | the context in which the system is being simulated

Implements ForceImpl.

void updateParametersInContext | ( | ContextImpl & | context | ) |

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

- NonbondedForceImpl.h