gaussbas.h
//
// gaussbas.h
//
// Copyright (C) 1996 Limit Point Systems, Inc.
//
// Author: Curtis Janssen <cljanss@limitpt.com>
// Maintainer: LPS
//
// This file is part of the SC Toolkit.
//
// The SC Toolkit is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as published by
// the Free Software Foundation; either version 2, or (at your option)
// any later version.
//
// The SC Toolkit is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public License
// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
//
// The U.S. Government is granted a limited license as per AL 91-7.
//
#ifndef _chemistry_qc_basis_gaussbas_h
#define _chemistry_qc_basis_gaussbas_h
#ifdef __GNUC__
#pragma interface
#endif
#include <vector>
#include <iostream>
#include <util/state/state.h>
#include <util/keyval/keyval.h>
#include <math/scmat/matrix.h>
#include <math/scmat/vector3.h>
#include <chemistry/molecule/molecule.h>
namespace sc {
class GaussianShell;
class BasisFileSet;
class Integral;
class CartesianIter;
class SphericalTransformIter;
class GaussianBasisSet: public SavableState
{
private:
// nonnull if keyword "name" was provided
char* name_;
// same as name_ if name_!=0, else something else
char* label_;
GaussianShell** shell_;
std::vector<int> shell_to_function_;
std::vector<int> function_to_shell_;
Ref<Molecule> molecule_;
Ref<SCMatrixKit> matrixkit_;
Ref<SCMatrixKit> so_matrixkit_;
RefSCDimension basisdim_;
int ncenter_;
std::vector<int> shell_to_center_;
std::vector<int> shell_to_primitive_;
std::vector<int> center_to_shell_;
std::vector<int> center_to_nshell_;
std::vector<int> center_to_nbasis_;
int nshell_;
int nbasis_;
int nprim_;
bool has_pure_;
GaussianBasisSet(const char* name, const char* label, const Ref<Molecule>& molecule,
const Ref<SCMatrixKit>& matrixkit,
const RefSCDimension& basisdim,
const int ncenter, const int nshell,
GaussianShell** shell,
const std::vector<int>& center_to_nshell);
// Counts shells in this basis for this chemical element
int count_shells_(Ref<KeyVal>& keyval, const char* elemname, const char* sbasisname, BasisFileSet& bases,
int havepure, int pure, bool missing_ok);
// Constructs this basis
void get_shells_(int& ishell, Ref<KeyVal>& keyval, const char* elemname, const char* sbasisname, BasisFileSet& bases,
int havepure, int pure, bool missing_ok);
// Counts shells in an even-tempered primitive basis
int count_even_temp_shells_(Ref<KeyVal>& keyval, const char* elemname, const char* sbasisname,
int havepure, int pure);
// Constructs an even-tempered primitive basis
void get_even_temp_shells_(int& ishell, Ref<KeyVal>& keyval, const char* elemname, const char* sbasisname,
int havepure, int pure);
// Constructs basis set specified as an array of shells
void recursively_get_shell(int&,Ref<KeyVal>&,
const char*,const char*,BasisFileSet&,
int,int,int,bool missing_ok);
void init(Ref<Molecule>&,Ref<KeyVal>&,
BasisFileSet&,
int have_userkeyval,
int pure);
void init2(int skip_ghosts=0,bool include_q=0);
protected:
GaussianBasisSet(const GaussianBasisSet&);
virtual void set_matrixkit(const Ref<SCMatrixKit>&);
public:
class ValueData {
protected:
CartesianIter **civec_;
SphericalTransformIter **sivec_;
int maxam_;
public:
ValueData(const Ref<GaussianBasisSet> &, const Ref<Integral> &);
~ValueData();
CartesianIter **civec() { return civec_; }
SphericalTransformIter **sivec() { return sivec_; }
};
enum UnitType {Unit};
GaussianBasisSet(const Ref<KeyVal>&);
GaussianBasisSet(UnitType);
GaussianBasisSet(StateIn&);
virtual ~GaussianBasisSet();
Ref<GaussianBasisSet> operator+(const Ref<GaussianBasisSet>& B);
void save_data_state(StateOut&);
const char* name() const { return name_; }
const char* label() const { if (name()) { return name(); } else { return label_; } }
Ref<Molecule> molecule() const { return molecule_; }
Ref<SCMatrixKit> matrixkit() { return matrixkit_; }
Ref<SCMatrixKit> so_matrixkit() { return so_matrixkit_; }
RefSCDimension basisdim() { return basisdim_; }
int ncenter() const;
int nshell() const { return nshell_; }
int nshell_on_center(int icenter) const;
int shell_on_center(int icenter, int shell) const;
int shell_to_center(int ishell) const { return shell_to_center_[ishell]; }
int shell_to_primitive(int ishell) const {return shell_to_primitive_[ishell]; }
int nbasis() const { return nbasis_; }
int nbasis_on_center(int icenter) const;
int nprimitive() const { return nprim_; }
int has_pure() const { return has_pure_; }
int max_nfunction_in_shell() const;
int max_ncartesian_in_shell(int aminc=0) const;
int max_nprimitive_in_shell() const;
int max_angular_momentum() const;
int max_ncontraction() const;
int max_am_for_contraction(int con) const;
int max_cartesian() const;
int shell_to_function(int i) const { return shell_to_function_[i]; }
int function_to_shell(int i) const;
const GaussianShell& operator()(int i) const { return *shell_[i]; }
GaussianShell& operator()(int i) { return *shell_[i]; }
const GaussianShell& operator[](int i) const { return *shell_[i]; }
GaussianShell& operator[](int i) { return *shell_[i]; }
const GaussianShell& shell(int i) const { return *shell_[i]; }
GaussianShell& shell(int i) { return *shell_[i]; }
const GaussianShell& operator()(int icenter,int ishell) const;
GaussianShell& operator()(int icenter,int ishell);
const GaussianShell& shell(int i,int j) const { return operator()(i,j); }
GaussianShell& shell(int i,int j) { return operator()(i,j); }
double r(int icenter,int xyz) const;
int values(const SCVector3& r, ValueData *, double* basis_values) const;
int grad_values(const SCVector3& r, ValueData *,
double*g_values,double* basis_values=0) const;
int hessian_values(const SCVector3& r, ValueData *, double *h_values,
double*g_values=0,double* basis_values=0) const;
int shell_values(const SCVector3& r, int sh,
ValueData *, double* basis_values) const;
int grad_shell_values(const SCVector3& r, int sh,
ValueData *,
double*g_values, double* basis_values=0) const;
int hessian_shell_values(const SCVector3& r, int sh,
ValueData *, double *h_values,
double*g_values=0,double* basis_values=0) const;
int equiv(const Ref<GaussianBasisSet> &b);
void print_brief(std::ostream& =ExEnv::out0()) const;
void print(std::ostream& =ExEnv::out0()) const;
};
}
#endif
// Local Variables:
// mode: c++
// c-file-style: "CLJ"
// End: