LJTable Class Reference

#include <LJTable.h>

List of all members.

Public Member Functions

 LJTable (void)
 ~LJTable (void)
const TableEntrytable_row (unsigned int i) const
const TableEntrytable_val (unsigned int i, unsigned int j) const
const TableEntrytable_val_scale14 (unsigned int i, unsigned int j) const
const TableEntryget_table () const
int get_table_dim () const

Classes

struct  TableEntry


Detailed Description

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 13 of file LJTable.h.


Constructor & Destructor Documentation

LJTable::LJTable ( void   ) 

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 16 of file LJTable.C.

References Parameters::get_num_vdw_params(), j, Node::molecule, Node::Object(), Node::parameters, Node::simParameters, SimParameters::soluteScalingOn, and Molecule::ss_num_vdw_params.

00017 {
00018   Bool soluteScalingOn = Node::Object()->simParameters->soluteScalingOn;
00019 
00020   if (!soluteScalingOn) {
00021   table_dim = Node::Object()->parameters->get_num_vdw_params();
00022   } else {
00023   int ss_dim = Node::Object()->molecule->ss_num_vdw_params;
00024   table_dim = ss_dim + Node::Object()->parameters->get_num_vdw_params();
00025   }
00026   table_alloc = new char[2*table_dim*table_dim*sizeof(TableEntry) + 31];
00027   char *table_align = table_alloc;
00028   while ( (long)table_align % 32 ) table_align++;
00029   table = (TableEntry *) table_align;
00030 
00031   for (register int i=0; i < table_dim; i++)
00032     for (register int j=i; j < table_dim; j++)
00033     {
00034       TableEntry *curij = &(table[2*(i*table_dim+j)]);
00035       TableEntry *curji = &(table[2*(j*table_dim+i)]);
00036       compute_vdw_params(i,j,curij,curij+1);
00037 
00038       // Copy to transpose entry
00039       *curji = *curij;
00040       *(curji + 1) = *(curij + 1);
00041     }
00042 
00043 }

LJTable::~LJTable ( void   ) 

Definition at line 46 of file LJTable.C.

00047 {
00048   delete [] table_alloc;
00049 }


Member Function Documentation

const TableEntry* LJTable::get_table (  )  const [inline]

Definition at line 43 of file LJTable.h.

Referenced by dumpbench().

00043 { return table; }

int LJTable::get_table_dim (  )  const [inline]

Definition at line 44 of file LJTable.h.

Referenced by ComputeNonbondedCUDA::build_lj_table(), and dumpbench().

00044 { return table_dim; }

const TableEntry* LJTable::table_row ( unsigned int  i  )  const [inline]

Definition at line 31 of file LJTable.h.

Referenced by ExclElem::computeForce(), and SELF().

00031                                                     {
00032     return table + 2 * (i * table_dim);
00033   }

const TableEntry* LJTable::table_val ( unsigned int  i,
unsigned int  j 
) const [inline]

Definition at line 35 of file LJTable.h.

Referenced by ComputeNonbondedCUDA::build_lj_table().

00035                                                                     {
00036     return table + 2 * (i * table_dim + j);
00037   }

const TableEntry* LJTable::table_val_scale14 ( unsigned int  i,
unsigned int  j 
) const [inline]

Definition at line 39 of file LJTable.h.

00039                                                                             {
00040     return table + 2 * (i * table_dim + j) + 1;
00041   }


The documentation for this class was generated from the following files:
Generated on Fri Jun 22 01:17:20 2018 for NAMD by  doxygen 1.4.7