Main Page | Class List | File List | Class Members | File Members

fresult.h File Reference

Force result container class. More...

#include "force/fparam.h"

Go to the source code of this file.

Classes

struct  ForceResult_t
 Holds the arrays for computed forces and energies. More...

Typedefs

typedef ForceResult_t ForceResult
 Holds the arrays for computed forces and energies.

Enumerations

enum  ForceResultFlags_t {
  FORCE_RESULT_F_BOND = 0x0001, FORCE_RESULT_F_ANGLE = 0x0002, FORCE_RESULT_F_DIHED = 0x0004, FORCE_RESULT_F_IMPR = 0x0008,
  FORCE_RESULT_F_ELEC = 0x0010, FORCE_RESULT_F_VDW = 0x0020, FORCE_RESULT_F_BRES = 0x0040, FORCE_RESULT_E_BOND = 0x0100,
  FORCE_RESULT_E_ANGLE = 0x0200, FORCE_RESULT_E_DIHED = 0x0400, FORCE_RESULT_E_IMPR = 0x0800, FORCE_RESULT_E_ELEC = 0x1000,
  FORCE_RESULT_E_VDW = 0x2000, FORCE_RESULT_E_BRES = 0x4000, FORCE_RESULT_E_EPOT = 0x8000, FORCE_RESULT_ALL_F = 0x007f,
  FORCE_RESULT_ALL_E = 0xff00, FORCE_RESULT_ALL = FORCE_RESULT_ALL_F | FORCE_RESULT_ALL_E
}

Functions

ForceResultforce_result_create (const ForceParam *fprm, int32 alloc_flags)
 Constructor.
void force_result_destroy (ForceResult *)
 Destructor.
int force_result_initialize (ForceResult *, const ForceParam *fprm, int32 alloc_flags)
 Alternative constructor.
void force_result_cleanup (ForceResult *)
 Alternative destructor.


Detailed Description

Force result container class.

Author:
David J. Hardy
Date:
2005-2006
The ForceResult_t container class holds the arrays for the computed forces and energies.

Typedef Documentation

typedef struct ForceResult_t ForceResult
 

Holds the arrays for computed forces and energies.

The memory buffer space is allocated by the constructor based on the bitwise ORing of ForceResultFlags_t, with the array lengths determined by topology data in ForceParam_t object. The arrays are intended to be read after each force_compute(). The memory buffer space is freed by the destructor.

The computation of the potential energy reductions (ForceResult_t::u_total and other potential energies) and the total atomic forces ForceResult_t::f_total are determined by the value of ForceParam_t::forcetypes. The separated force arrays and interaction energy arrays are filled during computation of ForceResult_t::f_total.


Enumeration Type Documentation

enum ForceResultFlags_t
 

Enumeration values:
FORCE_RESULT_F_BOND  Flag for bond forces array.
FORCE_RESULT_F_ANGLE  Flag for angle forces array.
FORCE_RESULT_F_DIHED  Flag for dihedral forces array.
FORCE_RESULT_F_IMPR  Flag for improper forces array.
FORCE_RESULT_F_ELEC  Flag for electrostatic forces array.
FORCE_RESULT_F_VDW  Flag for van der Waals forces array.
FORCE_RESULT_F_BRES  Flag for boundary restraint forces array.
FORCE_RESULT_E_BOND  Flag for bond interaction energies array.
FORCE_RESULT_E_ANGLE  Flag for angle interaction energies array.
FORCE_RESULT_E_DIHED  Flag for dihedral interaction energies array.
FORCE_RESULT_E_IMPR  Flag for improper interaction energies array.
FORCE_RESULT_E_ELEC  Flag for electrostatic interaction energies array.
FORCE_RESULT_E_VDW  Flag for van der Waals interaction energies array.
FORCE_RESULT_E_BRES  Flag for boundary restraint interaction energies array.
FORCE_RESULT_E_EPOT  Flag for electrostatic potentials array.


Function Documentation

void force_result_cleanup ForceResult  ) 
 

Alternative destructor.

Use this to destroy a preallocated ForceResult_t object. Frees internal memory buffer arrays.

ForceResult* force_result_create const ForceParam fprm,
int32  alloc_flags
 

Constructor.

Parameters:
[in] fprm Array lengths provided by topology data.
[in] alloc_flags Flags tell which arrays to allocate.
Creates dynamically allocated ForceResult_t container object that holds the arrays for the computed forces and energies. The memory buffer space is allocated based on the value of alloc_flags, set by bitwise ORing of ForceResultFlags_t, with the array lengths determined by topology data in ForceParam_t object.

Returns:
Pointer to ForceResult_t object or NULL if memory allocation fails.

void force_result_destroy ForceResult  ) 
 

Destructor.

Frees memory buffer arrays and destroys the dynamically allocated ForceResult_t object. Call when finished using object.

int force_result_initialize ForceResult ,
const ForceParam fprm,
int32  alloc_flags
 

Alternative constructor.

Parameters:
[in] fprm Array lengths provided by topology data.
[in] alloc_flags Flags tell which arrays to allocate.
Use this to construct a preallocated ForceResult_t object. The internal memory buffer space is allocated based on the value of alloc_flags, set by bitwise ORing of ForceResultFlags_t, with the array lengths determined by topology data in ForceParam_t object.

Returns:
0 for success or FORCE_FAIL on failure.


Generated on Thu Feb 7 18:11:41 2008 for MDX by  doxygen 1.3.9.1