ProtoMol - an object-oriented component based framework for Molecular Dynamics simulations.

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ > Class Template Reference

#include <MultiGrid.h>

List of all members.

Public Member Functions

 MultiGrid ()
void anterpolateCharge (Real q, const Vector3D &coord, unsigned int index)
void fineToCoarse (int level, unsigned int block, unsigned int nBlocks)
void fineToCoarse (int level)
void direct (unsigned int block, unsigned int nBlocks)
void direct ()
void coarseToFine (int level, unsigned int block, unsigned int nBlocks)
void coarseToFine (int level)
void correction (int level, unsigned int block, unsigned int nBlocks)
void correction (int level)
Real energy (int level, unsigned int block, unsigned int nBlocks)
Real energy (int level)
void interpolateForce (Real q, unsigned int index, Vector3D &force)
void initialize (unsigned int n, Real s, int levels, int nx, int ny, int nz, int interOrder, int ratio, Vector3D min, Vector3D max, Vector3D h, Vector3D origin)
void updateSize (Vector3D min, Vector3D max)
void getV (int level, Real *&begin, Real *&end)
void getQ (int level, Real *&begin, Real *&end)
void clear ()
Real sumV (int level)
Real sumQ (int level)
void print (int level)
void printV (int level)
void printQ (int level)
void printConst ()

Private Member Functions

void precomputeG ()
void blocksCorrection (unsigned int nBlocks)

Private Attributes

std::vector< Array< Real, 3 > > myQ
std::vector< Array< Real, 3 > > myV
Array< Real, 3 > myGDirect
Array< Real, 3 > myGCorrection
int myGCorrDimX
int myGCorrDimY
int myGCorrDimZ
Vector3D myMin
Vector3D myMax
Vector3D myCMin
Vector3D myCMax
Vector3D myH
Vector3D myOrigin
int myNX
int myNY
int myNZ
int myNXOffset
int myNYOffset
int myNZOffset
Real myHX
Real myHY
Real myHZ
Real myHXr
Real myHYr
Real myHZr
std::vector< Int3DmyScaledParticleIntPositions
std::vector< Interpolation3DmyInterpolations
std::vector< TInterpolation > myGridInterpolation
Real myS
Real myRS
int myInterOrder
int myRatio
int myLevels
int mySigma
std::vector< Int3DmyDim
std::vector< RealmyScale
std::vector< std::vector<
int > > 
myBlocksCorrection


Detailed Description

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
class ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >

Multi grid algorithm based on TInterpolation scheme using TKernel handling non-periodic and periodic boundary conditions.


Constructor & Destructor Documentation

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::MultiGrid  ) 
 


Member Function Documentation

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::anterpolateCharge Real  q,
const Vector3D coord,
unsigned int  index
[inline]
 

Interpolation weights for the position and anterpolate the charge q onto grid level 0, q -> Q(0).

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::blocksCorrection unsigned int  nBlocks  )  [inline, private]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::clear  )  [inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::coarseToFine int  level  )  [inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::coarseToFine int  level,
unsigned int  block,
unsigned int  nBlocks
[inline]
 

Interpolates Q from level to level-1, Q(level) -> Q(level-1).

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::correction int  level  )  [inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::correction int  level,
unsigned int  block,
unsigned int  nBlocks
[inline]
 

Adds the correction term Q(level) -> V(level).

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::direct  )  [inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::direct unsigned int  block,
unsigned int  nBlocks
[inline]
 

Computes the potential for the top level, Q(maxLevels-1) -> V(maxLevels-1).

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::energy int  level  )  [inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::energy int  level,
unsigned int  block,
unsigned int  nBlocks
[inline]
 

Computes the energy of a given level, V(level) -> energy.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::fineToCoarse int  level  )  [inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::fineToCoarse int  level,
unsigned int  block,
unsigned int  nBlocks
[inline]
 

Anterpolates Q from level to level+1, Q(level) -> Q(level+1).

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::getQ int  level,
Real *&  begin,
Real *&  end
[inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::getV int  level,
Real *&  begin,
Real *&  end
[inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::initialize unsigned int  n,
Real  s,
int  levels,
int  nx,
int  ny,
int  nz,
int  interOrder,
int  ratio,
Vector3D  min,
Vector3D  max,
Vector3D  h,
Vector3D  origin
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::interpolateForce Real  q,
unsigned int  index,
Vector3D force
[inline]
 

Interpolates the force from grid, level 0, Q(0) -> force.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::precomputeG  )  [inline, private]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::print int  level  )  [inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::printConst  ) 
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::printQ int  level  ) 
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::printV int  level  ) 
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::sumQ int  level  )  [inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::sumV int  level  )  [inline]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
void ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::updateSize Vector3D  min,
Vector3D  max
 

Update the length, width and height of the grid according min and max such that anter-/interpolated works regardless order and boundary conditions. In case of non-PBC it adds a border such that all points inside [min,max] are correctly anter-/interpolated.


Member Data Documentation

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
std::vector<std::vector<int> > ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myBlocksCorrection [private]
 

List of blocks for the correction.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Vector3D ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myCMax [private]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Vector3D ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myCMin [private]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
std::vector<Int3D> ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myDim [private]
 

Dimension of the grids.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myGCorrDimX [private]
 

Dimensions of G_correction.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myGCorrDimY [private]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myGCorrDimZ [private]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Array<Real,3> ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myGCorrection [private]
 

G_Correction for other levels, G->V.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Array<Real,3> ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myGDirect [private]
 

G_direct for top level, G->V.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
std::vector<TInterpolation> ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myGridInterpolation [private]
 

Interpolation between grids.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Vector3D ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myH [private]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myHX [private]
 

h_x at level 0

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myHXr [private]
 

1/h_x at level 0

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myHY [private]
 

h_y at level 0

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myHYr [private]
 

1/h_y at level 0

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myHZ [private]
 

h_z at level 0

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myHZr [private]
 

1/h_z at level 0

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myInterOrder [private]
 

Interpolation order.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
std::vector<Interpolation3D> ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myInterpolations [private]
 

Interpolation weights for each particle.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myLevels [private]
 

Number of levels, 0,1,2,...,myLevels-1.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Vector3D ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myMax [private]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Vector3D ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myMin [private]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myNX [private]
 

x dimension of the grid level 0

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myNXOffset [private]
 

x index offset between to grid levels

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myNY [private]
 

y dimension of the grid level 0

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myNYOffset [private]
 

y index offset between to grid levels

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myNZ [private]
 

z dimension of the grid level 0

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myNZOffset [private]
 

z index offset between to grid levels

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Vector3D ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myOrigin [private]
 

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
std::vector<Array<Real,3> > ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myQ [private]
 

Arrays of charges.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myRatio [private]
 

Ratio between to levels, usually 2.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myRS [private]
 

1 / Softening distance

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
Real ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myS [private]
 

Softening distance.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
std::vector<Real> ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myScale [private]
 

Scaling factor for each level.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
std::vector<Int3D> ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myScaledParticleIntPositions [private]
 

Starting index for anter/-interpolation.

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
int ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::mySigma [private]
 

1 if interpolation weights ...,0 for w=0, 0 else

template<class TInterpolation, class TKernel, bool pbcX, bool pbcY, bool pbcZ>
std::vector<Array<Real,3> > ProtoMol::MultiGrid< TInterpolation, TKernel, pbcX, pbcY, pbcZ >::myV [private]
 

Arrays of potentials.


The documentation for this class was generated from the following file: Last update: . GNU GENERAL PUBLIC LICENSE, copyrighted by the University of Notre Dame and the University of Bergen, Norway.