Main Page   Modules   Compound List   File List   Compound Members   File Members  

energy class

Class for handling energy variables. More...


Files

file  energy.h
 Data members and function declarations for class energy.


Compounds

struct  energy
 Class, which unites various energy variables. More...


Defines

#define _ENERGY_H_   1
 Environment variable for 'energy.h'.


Functions

energy * energy_ctor ()
 Constructor for the energy object. More...

void energy_dtor (energy *thee)
 Destructor for the energy object. More...

void energy_all_interactions (energy *thee, ionlist *ions, int types)
 Calculate the total sum of pair interactions for all ions specified in an array of ionlists. More...

double energy_all_interactions2 (energy *thee, ionlist *ions, int types, double *siasnew[], double *eiasnew[], double *coordsnew[])
 Calculate the total sum of pair interactions for all ions specified in an array of ionlists working on temporary/VEXTERNCal arrays. More...

void energy_added_ion (energy *thee, ionlist *ions, int types, int type, double *xyz, double *siasnew[], double *eiasnew[])
 Calculate the energy for adding an ion with specified type and coordinates. More...

void energy_deleted_ion (energy *thee, ionlist *ions, int types, int type, int pos, double *xyz, double *siasnew[], double *eiasnew[])
 Calculate the energy change for deletion of an ion with specified type and former coordinates. More...

void energy_moved_ion (energy *thee, ionlist *ions, int types, double *oldxyz, int type, int pos, double *siasnew[], double *eiasnew[])
 Calculate the energy change for movement of an ion with specified type and old+new coordinates. More...

void energy_some_interactions (energy *thee, ionlist *ions, int types, int type, int first, int last, double *siasnew[], double *eiasnew[], double *coordsnew[])
 Calculate the change in the total sum of pair interactions due to the movement of some ions of one specified type. More...

double energy_get_pot (ionlist *ions, int types, double *xyz)
 Get value for electrostatic potential due to explicit ions at given point (takes no this/thee-pointer). More...

void energy_update (energy *thee)
 Update energy variables (simply adds value stored in change variables 'DW...' to absolute values). More...


Detailed Description

Class for handling energy variables.

The functions herein are partially redundant and look much too complicated for their purpose (i.e., they are not optimized in terms of code reduction and programming elegance)


Function Documentation

void energy_added_ion energy   thee,
ionlist   ions,
int    types,
int    type,
double *    xyz,
double *    siasnew[],
double *    eiasnew[]
 

Calculate the energy for adding an ion with specified type and coordinates.

Routine assigns the values in both temporary interaction arrays ('siasnew[]' and 'eiasnew[]') according to the addition of the specified ion and assuming that the interaction arrays within the ionlist objects represent the state prior to the addition

The energy change is assigned to 'thee->DWelec'

Author:
Andreas Vitalis
Parameters:
thee  Energy object
ions  Pointer to array of ionlist objects, indexing starts at '1'
types  Integer number specifiying the number of different ion types given by 'ions'
type  Integer number specifying the type of the ion to be added (in terms of 'ions'-indexing)
xyz  Pointer to double array that holds coordinates for the ion to be added (Cartesian in )
siasnew  Array of pointers, which represents a 2D-array; first index is for ion types (starting at '1'), second for number of ions (also starting at '1'); used to hold new values for total pair interactions for every single ion in J
eiasnew  Analagous array of pointers used to hold new values for electrostatic pair interactions for every single ion in J

void energy_all_interactions energy   thee,
ionlist   ions,
int    types
 

Calculate the total sum of pair interactions for all ions specified in an array of ionlists.

Routine deletes and re-assigns the values to both single interaction arrays hidden in the ionlists and writes final energy result directly to 'thee->Welec'

Author:
Andreas Vitalis
Parameters:
thee  Energy object
ions  Pointer to array of ionlist objects, indexing starts at '1'
types  Integer number specifiying the number of different ion types given by 'ions'

double energy_all_interactions2 energy   thee,
ionlist   ions,
int    types,
double *    siasnew[],
double *    eiasnew[],
double *    coordsnew[]
 

Calculate the total sum of pair interactions for all ions specified in an array of ionlists working on temporary/VEXTERNCal arrays.

Routine deletes and re-assigns the values to both temporary interaction arrays ('siasnew[]' and 'eiasnew[]') based on the general ion type information in 'ions' with the exception of the coordinates, which are provided by 'coordsnew'

The final energy result is returned to the user

Author:
Andreas Vitalis
Parameters:
thee  Energy object
ions  Pointer to array of ionlist objects, indexing starts at '1'
types  Integer number specifiying the number of different ion types given by 'ions'
siasnew  Array of pointers, which represents a 2D-array; first index is for ion types (starting at '1'), second for number of ions (also starting at '1'); used to hold new values for total pair interactions for every single ion in J
eiasnew  Analagous array of pointers used to hold new values for electrostatic pair interactions for every single ion in J
coordsnew  Similar array of pointers used to hold previously modified coordinates to recalculate energy (first index for ion types again, second one in form of {x1,y1,z1,x2,y2,z2,...,xn,yn,zn} (starting at '1') for explicit Cartesian coordinates in
Returns:
Total sum of pair interactions for explicit ions

energy* energy_ctor  
 

Constructor for the energy object.

Author:
Andreas Vitalis
Returns:
Energy object

void energy_deleted_ion energy   thee,
ionlist   ions,
int    types,
int    type,
int    pos,
double *    xyz,
double *    siasnew[],
double *    eiasnew[]
 

Calculate the energy change for deletion of an ion with specified type and former coordinates.

Routine assigns the values in both temporary interaction arrays ('siasnew[]' and 'eiasnew[]') according to the deletion of the specified ion and assuming that the interaction arrays within the ionlist objects represent the state prior to the deletion

The energy change is assigned to 'thee->DWelec'

Author:
Andreas Vitalis
Parameters:
thee  Energy object
ions  Pointer to array of ionlist objects, indexing starts at '1'
types  Integer number specifiying the number of different ion types given by 'ions'
type  Integer number specifying the type of the deleted ion (in terms of 'ions'-indexing)
pos  Integer number specifying the (former) position of the x-coordinate of the deleted ion within the 'ions'-coordinates array
xyz  Pointer to double array that holds former coordinates of the deleted ion (Cartesian in )
siasnew  Array of pointers, which represents a 2D-array; first index is for ion types (starting at '1'), second for number of ions (also starting at '1'); used to hold new values for total pair interactions for every single ion in J
eiasnew  Analagous array of pointers used to hold new values for electrostatic pair interactions for every single ion in J

void energy_dtor energy   thee
 

Destructor for the energy object.

Author:
Andreas Vitalis
Parameters:
thee  Energy object

double energy_get_pot ionlist   ions,
int    types,
double *    xyz
 

Get value for electrostatic potential due to explicit ions at given point (takes no this/thee-pointer).

Author:
Andreas Vitalis
Parameters:
ions  Pointer to array of ionlist objects, indexing starts at '1'
types  Integer number specifiying the number of different ion types given by 'ions'
xyz  pointer to coordinate array, which specifies the point of interest (Cartesian in )
Returns:
Value for the elelctrostatic potential in J/e

void energy_moved_ion energy   thee,
ionlist   ions,
int    types,
double *    oldxyz,
int    type,
int    pos,
double *    siasnew[],
double *    eiasnew[]
 

Calculate the energy change for movement of an ion with specified type and old+new coordinates.

Routine assigns the values in both temporary interaction arrays ('siasnew[]' and 'eiasnew[]') according to the movement of the specified ion and assuming that the interaction arrays within the ionlist objects represent the state prior to the movement

The energy change is assigned to 'thee->DWelec'

Author:
Andreas Vitalis
Parameters:
thee  Energy object
ions  Pointer to array of ionlist objects, indexing starts at '1'
types  Integer number specifiying the number of different ion types given by 'ions'
oldxyz  Pointer to double array that holds original coordinates of the moved ion (Cartesian in )
type  Integer number specifying the type of the moved ion (in terms of 'ions'-indexing)
pos  Integer number specifying the position of the x-coordinate of the moved ion within the 'ions'-coordinates array
siasnew  Array of pointers, which represents a 2D-array; first index is for ion types (starting at '1'), second for number of ions (also starting at '1'); used to hold new values for total pair interactions for every single ion in J
eiasnew  Analagous array of pointers used to hold new values for electrostatic pair interactions for every single ion in J

void energy_some_interactions energy   thee,
ionlist   ions,
int    types,
int    type,
int    first,
int    last,
double *    siasnew[],
double *    eiasnew[],
double *    coordsnew[]
 

Calculate the change in the total sum of pair interactions due to the movement of some ions of one specified type.

Routine assigns the values in both temporary interaction arrays ('siasnew[]' and 'eiasnew[]') according to the movement of the specified ions and assuming that the interaction arrays within the ionlist objects represent the state prior to the movement

The energy change is assigned to 'thee->DWelec'

Author:
Andreas Vitalis
Parameters:
thee  Energy object
ions  Pointer to array of ionlist objects, indexing starts at '1'
types  Integer number specifiying the number of different ion types given by 'ions'
type  Integer number specifying the type of the moved ions (in terms of 'ions'-indexing)
first  Integer number specifying the first ion to be moved in terms of direct numbering (starting with '1')
last  Integer number specifying the last ion to be moved in terms of direct numbering (starting with '1')
siasnew  Array of pointers, which represents a 2D-array; first index is for ion types (starting at '1'), second for number of ions (also starting at '1'); used to hold new values for total pair interactions for every single ion in J
eiasnew  Analagous array of pointers used to hold new values for electrostatic pair interactions for every single ion in J
coordsnew  Similar array of pointers used to hold previously modified coordinates to recalculate energy (first index for ion types again, second one in form of {x1,y1,z1,x2,y2,z2,...,xn,yn,zn} (starting at '1') for explicit Cartesian coordinates in

void energy_update energy   thee
 

Update energy variables (simply adds value stored in change variables 'DW...' to absolute values).

Author:
Andreas Vitalis
Parameters:
thee  Energy object


Generated on Tue Jun 18 16:58:36 2002 for ISIM by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002