sc::BatchElectronDensity Class Reference

This a more highly optimized than ElectronDensity since everything is precomputed. More...

#include <chemistry/qc/wfn/density.h>

Inheritance diagram for sc::BatchElectronDensity:

Inheritance graph
[legend]

List of all members.

Public Types

enum  { X = 0, Y = 1, Z = 2 }
 This gives the elements of gradient arrays. More...
enum  {
  XX = 0, YX = 1, YY = 2, ZX = 3,
  ZY = 4, ZZ = 5
}
 This gives the elements of hessian arrays. More...

Public Member Functions

 BatchElectronDensity (const Ref< KeyVal > &)
 BatchElectronDensity (const Ref< GaussianBasisSet > &basis, const Ref< Integral > &integral, double accuracy=DBL_EPSILON)
 BatchElectronDensity (const Ref< Wavefunction > &wfn, double accuracy=DBL_EPSILON)
 BatchElectronDensity (const Ref< BatchElectronDensity > &d, bool reference_parent_data=false)
 This will construct copies of this.
virtual void boundingbox (double valuemin, double valuemax, SCVector3 &p1, SCVector3 &p2)
 Returns the bounding box.
void clear ()
 This will cause all stratch storage to be released.
void compute_density (const SCVector3 &r, double *alpha_density, double *alpha_density_grad, double *alpha_density_hessian, double *beta_density, double *beta_density_grad, double *beta_density_hessian)
 This is a alternate to the Volume interface that avoids some of the overhead of that interface.
virtual void init ()
 This is called to finish initialization of the object.
virtual void set_densities (const RefSymmSCMatrix &aden, const RefSymmSCMatrix &bden=0)
 This will fill in the internal copies of the density matrices with new values.
virtual void set_densities (const Ref< Wavefunction > &wfn)
 Use the given Wavefunction object to set the electron density matrices.
void set_linear_scaling (bool b)
 Turn linear scaling algorithm on/off.
void set_accuracy (double a)
 Sets the accuracy.
void set_use_dmat_bound (bool b)
 Turn use of density matrix bounds on/off.
bool spin_polarized () const
 Return true if the densities are spin polarized.
DFT Support Members.
These return some of the internal data, some of which is only value after a density has been computed.

This data is needed by the density functional theory code.

double * alpha_density_matrix ()
 Return the alpha density matrix.
double * beta_density_matrix ()
 Return the beta density matrix.
int ncontrib ()
int * contrib ()
int ncontrib_bf ()
int * contrib_bf ()
double * bs_values ()
double * bsg_values ()
double * bsh_values ()
void set_need_basis_gradient (bool b)
 To ensure that that the basis functions gradients are computed, use this.
void set_need_basis_hessian (bool b)

Protected Member Functions

virtual void init_common_data ()
virtual void init_scratch_data ()
void compute_basis_values (const SCVector3 &r)
void compute_spin_density (const double *restrictxx dmat, double *restrictxx rho, double *restrictxx grad, double *restrictxx hess)
virtual void compute ()
 Recompute at least the results that have compute true and are not already computed.

Protected Attributes

Ref< Wavefunctionwfn_
Ref< GaussianBasisSetbasis_
Ref< Integralintegral_
bool initialized_
double * alpha_dmat_
double * beta_dmat_
double * dmat_bound_
ShellExtent * extent_
GaussianBasisSet::ValueDatavaldat_
int ncontrib_
int * contrib_
int ncontrib_bf_
int * contrib_bf_
double * bs_values_
double * bsg_values_
double * bsh_values_
int nshell_
int nbasis_
bool spin_polarized_
int linear_scaling_
int use_dmat_bound_
bool need_hessian_
bool need_gradient_
bool need_basis_hessian_
bool need_basis_gradient_
bool using_shared_data_
double accuracy_


Detailed Description

This a more highly optimized than ElectronDensity since everything is precomputed.

However, it cannot be used if the density and/or geometry might change between computations of the density or bounding box, unless the obsolete member is called.


Member Enumeration Documentation

anonymous enum

This gives the elements of gradient arrays.

anonymous enum

This gives the elements of hessian arrays.


Constructor & Destructor Documentation

sc::BatchElectronDensity::BatchElectronDensity ( const Ref< BatchElectronDensity > &  d,
bool  reference_parent_data = false 
)

This will construct copies of this.

If reference_parent_data is true, then data that do not change, such as the density matrices and shell extent, are referenced rather than copied. In this case, the original object that allocated this items must be valid while copied objects are used to compute densities. Also d must have already been intialized and the resulting copy is already initialized (and cannot be reinitialized).

If reference_parent_data is false, then init must be called on this object before it is used.


Member Function Documentation

virtual void sc::BatchElectronDensity::compute (  )  [protected, virtual]

Recompute at least the results that have compute true and are not already computed.

This should only be called by Result's members.

Implements sc::Volume.

virtual void sc::BatchElectronDensity::boundingbox ( double  valuemin,
double  valuemax,
SCVector3 &  p1,
SCVector3 &  p2 
) [virtual]

Returns the bounding box.

Implements sc::Volume.

void sc::BatchElectronDensity::clear (  ) 

This will cause all stratch storage to be released.

void sc::BatchElectronDensity::compute_density ( const SCVector3 &  r,
double *  alpha_density,
double *  alpha_density_grad,
double *  alpha_density_hessian,
double *  beta_density,
double *  beta_density_grad,
double *  beta_density_hessian 
)

This is a alternate to the Volume interface that avoids some of the overhead of that interface.

virtual void sc::BatchElectronDensity::init (  )  [virtual]

This is called to finish initialization of the object.

It must not be called with objects created in a way that they share parent data; those objects are initialized when they are constructed. This member is usually called automatically; however, for objects which will be used to provide other BatchElectronDensity objects' data, this must member be called before the other BatchElectronDensity objects are constructed. If initialize_density_matrices is false, then the density matrices will be allocated, but not filled in. They must be later filled in with set_densities.

virtual void sc::BatchElectronDensity::set_densities ( const RefSymmSCMatrix aden,
const RefSymmSCMatrix bden = 0 
) [virtual]

This will fill in the internal copies of the density matrices with new values.

aden is the alpha density matrix and bden is the beta density matrix. If bden is not null and does not reference the same matrix that is referenced by bden, then a spin polarized computation of the density is performed.

virtual void sc::BatchElectronDensity::set_densities ( const Ref< Wavefunction > &  wfn  )  [virtual]

Use the given Wavefunction object to set the electron density matrices.

void sc::BatchElectronDensity::set_linear_scaling ( bool  b  )  [inline]

Turn linear scaling algorithm on/off.

The effect of this will be delayed until the next time init() is called.

void sc::BatchElectronDensity::set_accuracy ( double  a  )  [inline]

Sets the accuracy.

void sc::BatchElectronDensity::set_use_dmat_bound ( bool  b  )  [inline]

Turn use of density matrix bounds on/off.

bool sc::BatchElectronDensity::spin_polarized (  )  const [inline]

Return true if the densities are spin polarized.

Set_densities must have been called, at least implicitly.

double* sc::BatchElectronDensity::alpha_density_matrix (  )  [inline]

Return the alpha density matrix.

double* sc::BatchElectronDensity::beta_density_matrix (  )  [inline]

Return the beta density matrix.

void sc::BatchElectronDensity::set_need_basis_gradient ( bool  b  )  [inline]

To ensure that that the basis functions gradients are computed, use this.


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

Generated at Sun Feb 22 10:12:52 2009 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.5.6.
These pages are hosted on SourceForge.net